Skip to content

Add an invoice extension function allowing admins to push back the funding deadline for an open invoice #412

Description

@Chucks1093

Summary

Some invoices may need more time to reach their funding target. An extend_deadline function that updates the deadline_ledger for an open invoice would allow admins to give struggling invoices additional time without cancelling and re-registering them.

Scope

  • Add extend_deadline(invoice_id: BytesN<32>, new_deadline_ledger: u32) callable only by the protocol admin
  • Validate the invoice status is Open and new_deadline_ledger is greater than the current deadline_ledger
  • Update deadline_ledger in persistent storage with a TTL bump
  • Panic with DeadlineNotExtended if new_deadline_ledger is not greater than the current value
  • Emit a deadline_extended event with invoice_id, old_deadline_ledger, and new_deadline_ledger

Acceptance Criteria

  • deadline_ledger updated correctly for valid input
  • Extension on a non-Open invoice panics with InvalidInvoiceStatus
  • new_deadline_ledger not greater than current panics with DeadlineNotExtended
  • Non-admin caller panics with Unauthorized
  • deadline_extended event emitted with old and new values

ETA: 24 hours


Coordinate on Telegram

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions