Skip to content

Fix invoice lifecycle and pagination issues - #988

Closed
Joel234-png wants to merge 1 commit into
WHEELBACK:mainfrom
Joel234-png:batch-138-features
Closed

Joel234-png wants to merge 1 commit into
WHEELBACK:mainfrom
Joel234-png:batch-138-features

Conversation

@Joel234-png

Copy link
Copy Markdown

Addresses four invoice management bugs:

All invoice operations now maintain data consistency and proper constraints.

Closes #874
Closes #876
Closes #877
Closes #879

Pull Request

Summary

  • Describe the purpose of this PR in one or two sentences.

Checklist

  • PR description includes: Closes #[issue_id]
  • Tests added or updated
  • ABI snapshot updated if contract sources changed (abis/ and COMEBACKHERE-contracts/)
  • Screenshots attached if UI changed
  • Documentation updated if needed

Notes

  • For contract changes, verify ABI snapshot hygiene with make check-abi-snapshots.
  • For UI changes, include screenshots or screen recordings to help reviewers.

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
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@Joel234-png 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! 🚀

Learn more about application limits

@Joel234-png
Joel234-png deleted the batch-138-features branch October 18, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants