Description
An invoice with a single recipient is effectively a direct payment and does not benefit from the splitting infrastructure. The contract should enforce a configurable minimum number of recipients per invoice to ensure the feature is used appropriately.
Technical Context
Store MinRecipientsPerInvoice: u32 in storage::instance in contracts/split/src/lib.rs. In create_invoice, count the entries in the recipients vector and compare against the minimum. Return TooFewRecipients { found: u32, min: u32 } (new error in types.rs) when below threshold. Admin method set_min_recipients allows updating the floor.
Acceptance Criteria
Description
An invoice with a single recipient is effectively a direct payment and does not benefit from the splitting infrastructure. The contract should enforce a configurable minimum number of recipients per invoice to ensure the feature is used appropriately.
Technical Context
Store
MinRecipientsPerInvoice: u32instorage::instanceincontracts/split/src/lib.rs. Increate_invoice, count the entries in therecipientsvector and compare against the minimum. ReturnTooFewRecipients { found: u32, min: u32 }(new error intypes.rs) when below threshold. Admin methodset_min_recipientsallows updating the floor.Acceptance Criteria
TooFewRecipientsMinRecipientsPerInvoicedefaults to2at deployment1for single-recipient use casesTooFewRecipientserror carries bothfoundandminvalues for client displayMinRecipientsUpdated(new_min)event is emitted fromevents.rson admin change