Routes
openapi_first.templates.vet_app.routes
Veterinary Clinic route handlers bound via OpenAPI operationId.
Handlers explicitly control HTTP response status codes to ensure runtime behavior matches the OpenAPI contract. Domain models defined using Pydantic are used for request and response payloads.
No routing decorators, path definitions, or implicit framework behavior appear in this module. All routing, HTTP methods, and schemas are defined in the OpenAPI specification.
Functions
create_appointment
Create an appointment.
create_parent
Create a parent.
Parameters
payload : ParentCreate
Parent data excluding the id field.
response : Response
Response object used to set the HTTP status code.
Returns
Parent The newly created parent.
create_treatment
Add a treatment (admin only).
delete_parent
Delete an existing parent.
Parameters
id : int Identifier of the parent. response : Response Response object used to set the HTTP status code.
Raises
HTTPException 404 if the parent does not exist.
get_parent
Retrieve a single parent by ID.
Parameters
id : int Identifier of the parent.
Returns
Parent The requested parent.
Raises
HTTPException 404 if the parent does not exist.
list_appointments
List appointments (paginated, filterable).
list_parents
List parents (paginated).
Parameters
limit : int Maximum number of records to return. offset : int Number of records to skip.
Returns
dict
Paginated response with total and items.
list_treatments
List treatments (catalogue).
Returns
list[Treatment] A list of treatment domain objects.
stream_actions
async
Stream animal actions via SSE, scoped to a pet's species.
update_appointment
Update an existing appointment.
update_parent
Update an existing parent.
Parameters
id : int Identifier of the parent. payload : ParentCreate Updated parent data.
Returns
Parent The updated parent.
Raises
HTTPException 404 if the parent does not exist.
upload_pet_photo
Upload a pet photo.
Parameters
id : int Identifier of the pet. file : UploadFile Image file to upload.
Returns
dict A confirmation with the pet ID.