Implement Routes for Invoices #189
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#189
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?
Implement the REST endpoints for the Invoice entity, connecting the API layer to the existing
InvoiceRepo.This module is responsible for the Snapshot Logic—locking in client, vehicle, and item details at the moment of emission. It must verify the existence of the source
WorkOrderand ensure business rules (like address presence) are met before generation.Technical Requirements:
src/routers/invoices.py/invoices["Invoices"]InvoiceRepousingDepends().AsyncMockto mock the repository layer. Do not connect to the real database.Exception Mapping Strategy:
InvoiceNotFoundError-> 404 Not FoundClientAddressMissingError-> 400 Bad Request (Cannot emit invoice without valid fiscal address)InvoiceNumberConflictError-> 500 Internal Server Error (Should not happen with atomic counter, but handle as safety)InvoiceDatabaseError-> 500 Internal Server ErrorTDD Checklist: