Repository navigation
Fix invoice lifecycle and pagination issues - #989
Open
Joel234-png wants to merge 1 commit into
Open
Joel234-png wants to merge 1 commit into
Joel234-png wants to merge 1 commit into
Conversation
Addresses four invoice management bugs: - Invoice list ordering inconsistency between paginated requests (WHEELBACK#876) Add _id field as stable tiebreaker in sort order to ensure consistent pagination across multiple requests. Sort by created_at, invoice_id, _id. - Invoice status does not update after successful settlement (WHEELBACK#874) Add syncInvoiceStatus function that queries contract status on GET /:id and updates MongoDB with the current state from Soroban smart contract. Ensures invoice detail response always reflects settlement changes. - Repeated invoice creation produces conflicting invoice identifier (WHEELBACK#877) Add duplicate invoice ID check before insertion. If ID already exists, return 409 Conflict error and ask client to retry to generate new ID. - Invoice creation accepts due date outside supported range (WHEELBACK#879) Add upper bound validation to futureTimestamp schema. Due date must be within 10 years from now (315,360,000 seconds). Prevents invalid dates. All invoice operations now maintain data consistency and proper constraints. Closes WHEELBACK#874, WHEELBACK#876, WHEELBACK#877, WHEELBACK#879
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.
Addresses four invoice management bugs:
Invoice list ordering inconsistency between paginated requests (SAMPLE 030: Invoice list ordering changes between paginated requests #876) Add _id field as stable tiebreaker in sort order to ensure consistent pagination across multiple requests. Sort by created_at, invoice_id, _id.
Invoice status does not update after successful settlement (SAMPLE 028: Invoice status does not update after successful settlement #874) Add syncInvoiceStatus function that queries contract status on GET /:id and updates MongoDB with the current state from Soroban smart contract. Ensures invoice detail response always reflects settlement changes.
Repeated invoice creation produces conflicting invoice identifier (SAMPLE 031: Repeated invoice creation produces a conflicting invoice identifier #877) Add duplicate invoice ID check before insertion. If ID already exists, return 409 Conflict error and ask client to retry to generate new ID.
Invoice creation accepts due date outside supported range (SAMPLE 033: Invoice creation accepts a due date outside the supported range #879) Add upper bound validation to futureTimestamp schema. Due date must be within 10 years from now (315,360,000 seconds). Prevents invalid dates.
All invoice operations now maintain data consistency and proper constraints.
Closes #874
Closes #876
Closes #877
Closes #879
Pull Request
Summary
Checklist
abis/andCOMEBACKHERE-contracts/)Notes
make check-abi-snapshots.