[Appointments] - Create Database Interface File and Structure #121

Closed
opened 2025-11-05 20:48:22 +00:00 by duarteneves5 · 0 comments
duarteneves5 commented 2025-11-05 20:48:22 +00:00 (Migrated from github.com)

Create the file that will hold all database interactions for the appointments collection. This isolates our database logic from the API endpoints.

Tasks:

  • Create a new file (e.g., repositories/appointment_repo.py or services/appointment_service.py).
  • Define the class (e.g., AppointmentRepository).
  • Add placeholder/empty async methods for CRUD operations:
    • create_appointment(appointment_data: AppointmentCreate) -> Appointment
    • get_appointment_by_id(appointment_id: ObjectId) -> Appointment | None
    • get_appointments_by_vehicle_id(vehicle_id: ObjectId) -> list[Appointment]
    • get_appointments_by_client_id(client_id: ObjectId) -> list[Appointment]
    • update_appointment(appointment_id: ObjectId, update_data: AppointmentUpdate) -> Appointment | None
    • delete_appointment(appointment_id: ObjectId) -> bool
Create the file that will hold all database interactions for the `appointments` collection. This isolates our database logic from the API endpoints. **Tasks:** - [ ] Create a new file (e.g., `repositories/appointment_repo.py` or `services/appointment_service.py`). - [ ] Define the class (e.g., `AppointmentRepository`). - [ ] Add placeholder/empty `async` methods for CRUD operations: - `create_appointment(appointment_data: AppointmentCreate) -> Appointment` - `get_appointment_by_id(appointment_id: ObjectId) -> Appointment | None` - `get_appointments_by_vehicle_id(vehicle_id: ObjectId) -> list[Appointment]` - `get_appointments_by_client_id(client_id: ObjectId) -> list[Appointment]` - `update_appointment(appointment_id: ObjectId, update_data: AppointmentUpdate) -> Appointment | None` - `delete_appointment(appointment_id: ObjectId) -> bool`
Sign in to join this conversation.
No description provided.