41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""Task API stubs supporting list/create operations."""
|
|
from __future__ import annotations
|
|
|
|
from datetime import date
|
|
|
|
from fastapi import APIRouter, Depends, Query, status
|
|
|
|
from app.api.deps import get_organization_context
|
|
from app.services.organization_service import OrganizationContext
|
|
|
|
from .models import TaskCreatePayload
|
|
|
|
router = APIRouter(prefix="/tasks", tags=["tasks"])
|
|
|
|
|
|
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_tasks(
|
|
deal_id: int | None = None,
|
|
only_open: bool = False,
|
|
due_before: date | None = Query(default=None),
|
|
due_after: date | None = Query(default=None),
|
|
context: OrganizationContext = Depends(get_organization_context),
|
|
) -> dict[str, str]:
|
|
"""Placeholder for task filtering endpoint."""
|
|
_ = context
|
|
return _stub("GET /tasks")
|
|
|
|
|
|
@router.post("/", status_code=status.HTTP_501_NOT_IMPLEMENTED)
|
|
async def create_task(
|
|
payload: TaskCreatePayload,
|
|
context: OrganizationContext = Depends(get_organization_context),
|
|
) -> dict[str, str]:
|
|
"""Placeholder for creating a task linked to a deal."""
|
|
_ = (payload, context)
|
|
return _stub("POST /tasks")
|