feat: implement delivery CRUD and driver assignment APIs#73
Open
Hahfyeex wants to merge 1 commit into
Open
Conversation
- Add Delivery Mongoose schema with sender, recipient, status, and tracking fields - POST /api/v1/deliveries — stores off-chain delivery metadata with auto-generated trackingId - GET /api/v1/deliveries — paginated list with status filter and date sort - GET /api/v1/deliveries/:id — fetch single delivery, returns 404 if not found - PUT /api/v1/deliveries/:id/assign — assigns a driver to a pending delivery Closes SwiftChainn#15, Closes SwiftChainn#16, Closes SwiftChainn#17, Closes SwiftChainn#18
|
@Hahfyeex Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/models/Delivery.ts) — Mongoose schema with sender/recipient sub-documents, status enum, auto-indexedtrackingIdanddriverIdfieldsPOST /api/v1/deliveriesstores off-chain delivery metadata and returns a generatedtrackingId(SWIFT-XXXXXXXXXX)GET /api/v1/deliverieswith pagination (page,limit),statusfilter, and date sort (order=asc|desc)GET /api/v1/deliveries/:idreturns full sender/recipient data; 404 if not foundPUT /api/v1/deliveries/:id/assignvalidates the delivery ispendingbefore linking a driver and transitioning status toassignedTest plan
POST /api/v1/deliverieswith valid body returns 201 withtrackingIdPOST /api/v1/deliveriesmissing required fields returns 400GET /api/v1/deliveries?status=pending&page=1&limit=5returns paginated resultsGET /api/v1/deliveries/:idreturns 200 with sender and recipient dataGET /api/v1/deliveries/:invalidIdreturns 404PUT /api/v1/deliveries/:id/assignwith validdriverIdsets status toassignedPUT /api/v1/deliveries/:id/assignon a non-pending delivery returns 409pnpm lint,tsc --noEmit)pnpm test)Closes #15, Closes #16, Closes #17, Closes #18