Description
Some business workflows require that payout from Invoice B is triggered only after Invoice A is fully funded and released. A parent-child linkage between invoices should block child invoice release until the parent is finalised.
Technical Context
Add parent_invoice_id: Option<u64> to the Invoice struct in types.rs. In release_payment inside contracts/split/src/lib.rs, if parent_invoice_id is Some, look up the parent's status and return ParentInvoiceNotFinalised if it is not Finalised. Emit ChildInvoiceUnblocked(child_id, parent_id) from events.rs when the child is released.
Acceptance Criteria
Description
Some business workflows require that payout from Invoice B is triggered only after Invoice A is fully funded and released. A parent-child linkage between invoices should block child invoice release until the parent is finalised.
Technical Context
Add
parent_invoice_id: Option<u64>to theInvoicestruct intypes.rs. Inrelease_paymentinsidecontracts/split/src/lib.rs, ifparent_invoice_idisSome, look up the parent's status and returnParentInvoiceNotFinalisedif it is notFinalised. EmitChildInvoiceUnblocked(child_id, parent_id)fromevents.rswhen the child is released.Acceptance Criteria
release_paymentis blocked until the parent isFinalisedChildInvoiceUnblockedevent is emitted on the first successful child release