Skip to content

fix: return InvalidAmount on unpaid total overflow#1063

Open
brentthomas248 wants to merge 2 commits into
Remitwise-Org:mainfrom
brentthomas248:codex/grantfox-1018
Open

fix: return InvalidAmount on unpaid total overflow#1063
brentthomas248 wants to merge 2 commits into
Remitwise-Org:mainfrom
brentthomas248:codex/grantfox-1018

Conversation

@brentthomas248

@brentthomas248 brentthomas248 commented Jul 3, 2026

Copy link
Copy Markdown

Closes #1018

Summary:

  • replace saturating unpaid-total cache updates with checked arithmetic that returns InvalidAmount on overflow or underflow
  • propagate checked unpaid-total failures through create_bill, pay_bill, batch_pay_bills, cancel_bill, and schedule execution
  • add regression coverage for overflow/underflow state preservation and update stale large-amount/pagination baseline tests

Tests:

  • PATH="$HOME/.cargo/bin:$PATH" cargo test -p bill_payments
  • PATH="$HOME/.cargo/bin:$PATH" cargo clippy -p bill_payments --all-targets -- -D warnings

CI note:

  • Public workspace CI is currently failing in unrelated reporting crate checks before this bill_payments patch is implicated. The focused bill_payments test/clippy commands above pass locally.

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.

Convert the adjust_unpaid_total overflow panic to a checked BillPaymentsError return

1 participant