Repository navigation
feat(dashboard): add a latest proof of delivery photos widget - #388
Merged
Merged
Conversation
Adds a Proof of Delivery dashboard tile showing the latest delivery photos in a grid, each linking to its order, with loading and empty states. Backed by GET /int/v1/fleet-ops/proofs/recent, which returns the session company's latest photo proofs (file type 'photo') on orders, newest first, with order public_id, customer name, capture time and a signed photo url. The limit defaults to 12 and is capped between 1 and 24.
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.
Adds a dashboard tile showing the latest proof of delivery photos.
Endpoint
GET /int/v1/fleet-ops/proofs/recent?limit=12(ProofController@recent). It returns the session company's proofs that:photo, so signatures and QR scans are excludedResults are newest first, with
order.customerandfileeager-loaded.limitdefaults to 12 and is clamped to 1–24.Each item has
id,order_id,customer_name,remarks,url(the file's signed URL) andcaptured_at. The route is registered in theproofsgroup callback, whichfleetbaseRoutesadds before the REST routes, sorecentisn't taken as an id.Widget
widget/proof-of-delivery, registered asfleet-ops-proof-of-delivery-widget(Operations, 4×9). It shows:It's not added to the default dashboard layout.
Tests
ProofControllerRecentTest(5 tests) covers company scoping, photo-only filtering, ordering, the payload, limit bounds and sessions with no company. Every new controller line is covered. It andProofControllerContractsTestexit 0.