[WorkOrders] - Create Database Interface File and Structure #111
Labels
No labels
CI/CD
MongoDB
PostgreSQL
api
authentication
bug
documentation
duplicate
enhancement
example issue
fix
good first issue
help wanted
high-level requirement
infrastructure
invalid
low-level requirement
medium-level requirement
question
security
test
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AndreFerreira5/starranja#111
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Create the file that will hold all database interactions for the
workOrderscollection. This isolates our database logic from the API endpoints.Tasks:
repositories/workOrders_repo.pyorservices/workOrder_service.py).WorkOrderRepository).asyncmethods for CRUD operations:create_workOrder(workOrder_data: WorkOrderCreate) -> WorkOrderget_workOrder_by_id(workOrder_id: ObjectId) -> WorkOrder | Noneget_workOrders_by_vehicle_id(vehicle_id: str) -> list[WorkOrder]get_workOrders_by_appointment_id(appointment_id: str) -> list[WorkOrder]get_workOrders_by_client_id(client_id: ObjectId) -> list[WorkOrder]update_workOrder(workOrder_id: ObjectId, update_data: WorkOrderUpdate) -> WorkOrder | Nonedelete_workOrder(workOrder_id: ObjectId) -> boolget_workOrders_by_appointment_id(appointment_id: str) -> list[WorkOrder] should be address in the routes files. Adding this here would break the Single Responsibility Principle and creates a complex dependency that makes the code hard to test and maintain.