[SupplierOrders] - Create Database Interface File and Structure #154
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#154
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 supplierOrders collection. This isolates our database logic from the API endpoints.
Tasks:
Create a new file: src/repositories/supplier_order_repo.py.
Define the class: SupplierOrderRepo.
Add placeholder/empty async methods for CRUD operations (raising NotImplementedError):
create_supplier_order(order_data: SupplierOrderCreate, created_by_id: UUID) -> SupplierOrder
get_by_id(order_id: ObjectId) -> SupplierOrder | None
get_by_work_order_id(work_order_id: ObjectId) -> list[SupplierOrder] (To see parts ordered for a specific job)
get_by_status(status: SupplierOrderStatus) -> list[SupplierOrder] (For dashboard filtering)
get_by_supplier_name(supplier_name: str) -> list[SupplierOrder]
update(order_id: ObjectId, update_data: SupplierOrderUpdate) -> SupplierOrder | None
delete(order_id: ObjectId) -> bool