Implement Routes for Appointments #185

Closed
opened 2026-01-19 20:42:56 +00:00 by duarteneves5 · 0 comments
duarteneves5 commented 2026-01-19 20:42:56 +00:00 (Migrated from github.com)

Implement the REST endpoints for the Appointment entity, connecting the API layer to the existing AppointmentRepo.

The router must handle standard CRUD operations. The repository currently handles validation for the client_id during creation.

Technical Requirements:

  • File: src/routers/appointments.py
  • Prefix: /appointments
  • Tags: ["Appointments"]
  • Dependency: Inject AppointmentRepo using Depends().
  • Testing: Use AsyncMock to mock the repository layer.

Exception Mapping Strategy:

  • HTTPException(404) -> Raised by Repo when Client not found.
  • AppointmentDatabaseError -> 500 Internal Server Error (Handled by decorator).

TDD Checklist:

Implement the REST endpoints for the **Appointment** entity, connecting the API layer to the existing `AppointmentRepo`. The router must handle standard CRUD operations. The repository currently handles validation for the `client_id` during creation. **Technical Requirements:** - **File:** `src/routers/appointments.py` - **Prefix:** `/appointments` - **Tags:** `["Appointments"]` - **Dependency:** Inject `AppointmentRepo` using `Depends()`. - **Testing:** Use `AsyncMock` to mock the repository layer. **Exception Mapping Strategy:** - `HTTPException(404)` -> Raised by Repo when Client not found. - `AppointmentDatabaseError` -> **500 Internal Server Error** (Handled by decorator). **TDD Checklist:** - [x] #186 - [x] #187 - [x] #188
Sign in to join this conversation.
No description provided.