35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
from fastapi import APIRouter, Depends, status
|
|
from common.deps import verify_api_key
|
|
from models.api.clinic import ClinicCreate, ClinicCreateResponse, ClinicHistoryResponse, RunSummary
|
|
|
|
router = APIRouter(prefix="/api/clinics", tags=["clinics"], dependencies=[Depends(verify_api_key)])
|
|
|
|
|
|
@router.post("", status_code=status.HTTP_201_CREATED, response_model=ClinicCreateResponse)
|
|
async def create_clinic(body: ClinicCreate):
|
|
return ClinicCreateResponse(
|
|
id="11111111-1111-1111-1111-111111111111",
|
|
url=body.url,
|
|
name=body.name,
|
|
created_at="2026-04-20T09:00:00Z",
|
|
)
|
|
|
|
|
|
@router.get("/{id}/history", response_model=ClinicHistoryResponse)
|
|
async def get_clinic_history(id: str):
|
|
return ClinicHistoryResponse(
|
|
clinic_id=id,
|
|
runs=[
|
|
RunSummary(
|
|
run_id="22222222-2222-2222-2222-222222222222",
|
|
status="complete",
|
|
started_at="2026-04-20T09:00:00Z",
|
|
completed_at="2026-04-20T09:01:30Z",
|
|
overall_score=82,
|
|
)
|
|
],
|
|
metrics_timeseries={
|
|
"youtube_subscribers": [{"date": "2026-04-20", "value": 12345}]
|
|
},
|
|
)
|