feat: implement initial structure for activities, analytics, auth, contacts, deals, organizations, tasks, and users APIs with placeholder endpoints
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
"""Contacts API package."""
|
||||
from .views import router
|
||||
|
||||
__all__ = ["router"]
|
||||
@@ -0,0 +1 @@
|
||||
"""Contacts CRUD placeholder."""
|
||||
@@ -0,0 +1,10 @@
|
||||
"""Contact API schemas."""
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import BaseModel, EmailStr
|
||||
|
||||
|
||||
class ContactCreatePayload(BaseModel):
|
||||
name: str
|
||||
email: EmailStr | None = None
|
||||
phone: str | None = None
|
||||
@@ -0,0 +1,30 @@
|
||||
"""Contact API stubs required by the spec."""
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Query, status
|
||||
|
||||
from .models import ContactCreatePayload
|
||||
|
||||
router = APIRouter(prefix="/contacts", tags=["contacts"])
|
||||
|
||||
|
||||
def _stub(endpoint: str) -> dict[str, str]:
|
||||
return {"detail": f"{endpoint} is not implemented yet"}
|
||||
|
||||
|
||||
@router.get("/", status_code=status.HTTP_501_NOT_IMPLEMENTED)
|
||||
async def list_contacts(
|
||||
page: int = Query(1, ge=1),
|
||||
page_size: int = Query(20, ge=1, le=100),
|
||||
search: str | None = None,
|
||||
owner_id: int | None = None,
|
||||
) -> dict[str, str]:
|
||||
"""Placeholder list endpoint supporting the required filters."""
|
||||
return _stub("GET /contacts")
|
||||
|
||||
|
||||
@router.post("/", status_code=status.HTTP_501_NOT_IMPLEMENTED)
|
||||
async def create_contact(payload: ContactCreatePayload) -> dict[str, str]:
|
||||
"""Placeholder for creating a contact within the current organization."""
|
||||
_ = payload
|
||||
return _stub("POST /contacts")
|
||||
Reference in New Issue
Block a user