Skip to content

feat: implement #522 #523 #524 #525 invoice enhancements - #567

Merged
Kingsman-99 merged 3 commits into
Stellar-split:mainfrom
obedebuka41-dotcom:feature/522-523-524-525-invoice-enhancements
Jul 30, 2026
Merged

feat: implement #522 #523 #524 #525 invoice enhancements#567
Kingsman-99 merged 3 commits into
Stellar-split:mainfrom
obedebuka41-dotcom:feature/522-523-524-525-invoice-enhancements

Conversation

@obedebuka41-dotcom

Copy link
Copy Markdown
Contributor

#522 — Cross-Invoice Split Linkage

  • Add parent_invoice_id: Option to Invoice struct
  • Block _release if parent is not Released/Finalised
  • Detect invalid/too-deep parent chains at creation time (MAX_PARENT_DEPTH=10)
  • Emit ChildInvoiceUnblocked(child_id, parent_id) on successful child release
  • Add ParentInvoiceNotFinalised, CircularParentReference, ParentChainTooDeep errors

#523 — Late Payment Penalty Fee

  • Add late_penalty_bps: u32 to Invoice struct
  • Accept contributions within GRACE_WINDOW (86400s) after deadline
  • Charge ceil(amount * bps / 10000) penalty and transfer to treasury
  • Emit LatePaymentPenaltyCharged(invoice_id, payer, penalty_amount)
  • Zero bps disables penalty; on-time payments unaffected

#524 — Invoice Batch Creation

  • Add InvoiceParams struct mirroring create_invoice params
  • Add batch_create_invoices(invoices: Vec) -> Vec
  • Enforce MAX_BATCH_SIZE=50; return BatchTooLarge error if exceeded
  • Emit individual InvoiceCreated per entry + one BatchInvoiceCreated
  • Atomic: all succeed or transaction aborts

#525 — Recipient Share Precision Rounding

  • Add calc.rs module with distribute_with_remainder (largest-remainder method)
  • Guarantees sum(shares) == total for any input (no stroop lost)
  • Largest fractional remainder recipients receive the extra stroop
  • Fully unit-tested in calc.rs including property-based test
  • _release uses distribute_with_remainder for all payouts

chore: update .gitignore with test snapshots, IDE, OS, and stellar-cli artifacts
close #522
close #523
close #524
close #525

…tellar-split#525 invoice enhancements

Stellar-split#522 — Cross-Invoice Split Linkage
- Add parent_invoice_id: Option<u64> to Invoice struct
- Block _release if parent is not Released/Finalised
- Detect invalid/too-deep parent chains at creation time (MAX_PARENT_DEPTH=10)
- Emit ChildInvoiceUnblocked(child_id, parent_id) on successful child release
- Add ParentInvoiceNotFinalised, CircularParentReference, ParentChainTooDeep errors

Stellar-split#523 — Late Payment Penalty Fee
- Add late_penalty_bps: u32 to Invoice struct
- Accept contributions within GRACE_WINDOW (86400s) after deadline
- Charge ceil(amount * bps / 10000) penalty and transfer to treasury
- Emit LatePaymentPenaltyCharged(invoice_id, payer, penalty_amount)
- Zero bps disables penalty; on-time payments unaffected

Stellar-split#524 — Invoice Batch Creation
- Add InvoiceParams struct mirroring create_invoice params
- Add batch_create_invoices(invoices: Vec<InvoiceParams>) -> Vec<u64>
- Enforce MAX_BATCH_SIZE=50; return BatchTooLarge error if exceeded
- Emit individual InvoiceCreated per entry + one BatchInvoiceCreated
- Atomic: all succeed or transaction aborts

Stellar-split#525 — Recipient Share Precision Rounding
- Add calc.rs module with distribute_with_remainder (largest-remainder method)
- Guarantees sum(shares) == total for any input (no stroop lost)
- Largest fractional remainder recipients receive the extra stroop
- Fully unit-tested in calc.rs including property-based test
- _release uses distribute_with_remainder for all payouts

chore: update .gitignore with test snapshots, IDE, OS, and stellar-cli artifacts
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@obedebuka41-dotcom Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Kingsman-99
Kingsman-99 merged commit 66397fc into Stellar-split:main Jul 30, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants