Summary
The settlement endpoint should calculate each investor's pro-rata return, transfer the amounts via Soroban, and transition the invoice status to settled. An integration test should fund an invoice with multiple investors and verify all returns are distributed and the final status is correct.
Scope
- Seed a funded invoice (face value 9000) with three equal investors (3000 each)
- Call the settlement endpoint as the seller
- Assert each investor's return record shows 3000 (equal split, no remainder)
- Assert the invoice status is
settled after the call
- Assert calling settlement a second time returns 409 with
invoice_already_settled
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
The settlement endpoint should calculate each investor's pro-rata return, transfer the amounts via Soroban, and transition the invoice status to
settled. An integration test should fund an invoice with multiple investors and verify all returns are distributed and the final status is correct.Scope
settledafter the callinvoice_already_settledAcceptance Criteria
settledinvoice_already_settledETA: 12 hours
Coordinate on Telegram