Overview
Add a dispute function that allows a payer to flag an invoice as disputed within 48 hours of funding. Disputed invoices cannot release funds until the dispute is resolved by the admin or the window expires.
Acceptance Criteria
raise_dispute(invoice_id: u64, reason_hash: BytesN<32>) callable by any payer within 48 ledgers of full funding
- Disputed invoices enter
Disputed status; release_funds is blocked with InvoiceDisputed error
resolve_dispute(invoice_id, outcome: DisputeOutcome) callable only by admin
DisputeOutcome: Approved (release funds to recipients) or Refunded (return funds to payers)
- If dispute is not resolved within 72 ledgers, it auto-expires and funds are released to recipients
- Emits
DisputeRaised, DisputeResolved, DisputeExpired events
get_invoice adds dispute: Option<DisputeStatus> to the invoice struct
- Integration tests: dispute → resolve approve, dispute → resolve refund, dispute → auto-expire
Overview
Add a dispute function that allows a payer to flag an invoice as disputed within 48 hours of funding. Disputed invoices cannot release funds until the dispute is resolved by the admin or the window expires.
Acceptance Criteria
raise_dispute(invoice_id: u64, reason_hash: BytesN<32>)callable by any payer within 48 ledgers of full fundingDisputedstatus;release_fundsis blocked withInvoiceDisputederrorresolve_dispute(invoice_id, outcome: DisputeOutcome)callable only by adminDisputeOutcome:Approved(release funds to recipients) orRefunded(return funds to payers)DisputeRaised,DisputeResolved,DisputeExpiredeventsget_invoiceaddsdispute: Option<DisputeStatus>to the invoice struct