Skip to content

feat(backend): add pending invoice stats helper (#278) - #353

Draft
s6pa1rta3n-lab wants to merge 1 commit into
Quittance-Labs:mainfrom
s6pa1rta3n-lab:fix-issue-278
Draft

feat(backend): add pending invoice stats helper (#278)#353
s6pa1rta3n-lab wants to merge 1 commit into
Quittance-Labs:mainfrom
s6pa1rta3n-lab:fix-issue-278

Conversation

@s6pa1rta3n-lab

Copy link
Copy Markdown

Summary

Implements isPendingInvoice(invoice) in backend/src/utils/stats-pending-filter.ts to ensure consistent pending invoice classification across dashboard stats and storage aggregators, and wires it into calculateInvoiceStats in backend/src/storage/invoice-stats.ts.

Changes

  • backend/src/utils/stats-pending-filter.ts: Implemented isPendingInvoice() predicate and PENDING_STATUS constant.
  • backend/tests/fixtures/stats-pending-filter.fixture.ts: Added fixture cases covering valid pending invoices, non-pending statuses, and malformed inputs.
  • backend/tests/stats-pending-filter.test.ts: Added unit test suite covering constants, valid fixtures, non-pending fixtures, malformed inputs, and array filtering operations.
  • backend/src/storage/invoice-stats.ts: Imported isPendingInvoice and replaced inline status check with the shared predicate.

Verification

  • npm test: All backend unit & isolated tests pass cleanly (187 passing tests).
  • npm run typecheck: TypeScript verification passes with 0 errors.
  • PR touches exactly 4 paths per issue specification.

Closes #278

Payout Routing

  • EVM (Base/Arbitrum/Polygon/ETH): 0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89
  • Stellar: GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(backend): add pending invoice stats helper

1 participant