Skip to content

Add invoice bulk recipient management #143

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Adding many recipients one by one via add_recipient() is inefficient for large team invoices. This issue adds add_recipients_batch() allowing the creator to append up to 50 recipients with amounts in a single transaction before any payment is received.

Technical Context

Involves lib.rs — new add_recipients_batch(env, invoice_id: u64, new_recipients: Vec<Address>, new_amounts: Vec<i128>). Requires creator auth. Assert invoice.funded == 0. Assert new_recipients.len() == new_amounts.len(). Assert new_recipients.len() <= 50. Extend both Vecs and save.

Acceptance Criteria

  • Requires creator auth
  • Panics with "payments already received" if invoice.funded > 0
  • Panics with "batch too large" if more than 50 recipients provided
  • All new recipients and amounts appended correctly
  • Test adds 5 recipients in batch, pays full new total, verifies all receive funds
  • All existing cargo tests pass
  • cargo clippy passes with zero warnings

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 pts

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions