Carry partial refunds across settlement days
A 100.00 charge receives refunds of 20.00 on Monday and 15.00 on Thursday. The report subtracts only the latest refund, overstating net revenue by 20.00.
- Focused work estimate
- 3h 30m + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Temporal data · Ledger invariants · Regression analysis
Estimated field mix
- Backend100%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A fictional subscription service invoices in USD and EUR. Finance currently compares a payment-provider CSV with database exports; late refunds and retried imports make the monthly close unreliable. Work on synthetic ledger entries only.
Setup prerequisites
- REST APIs
- SQL transactions
- Integer money representation
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
Acceptance criteria
- Net the charge against all distinct posted refunds in the selected cutoff.
- Keep pending refunds visible but outside settled totals.
- Flag cumulative refunds above the captured amount without silently clipping them.
Implementation constraints
- Preserve each provider refund identity and posting timestamp; never overwrite the original charge.
Verification to include
- Assert net 65.00 after both refunds and 80.00 at Monday cutoff.
- Replay a refund and inject an excess refund; check deduplication and conflict.
Deliverables
- Append-only refund matching change and cutoff examples
Rollout and recovery
Recompute a shadow report for one month; retain the previous report revision for comparison.
Value of the work
For the engineer: Practice monetary invariants, concurrent writes, reconciliation, and operational recovery across one service boundary.
For the team: Review how an engineer makes discrepancies explainable and recoverable before a financial workflow is trusted.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.