Skip to content

feat: Implement Draft Invoice Sta#153

Open
Anuoluwapo25 wants to merge 1 commit intoShadeProtocol:mainfrom
Anuoluwapo25:Implement-Draft-Invoice-State
Open

feat: Implement Draft Invoice Sta#153
Anuoluwapo25 wants to merge 1 commit intoShadeProtocol:mainfrom
Anuoluwapo25:Implement-Draft-Invoice-State

Conversation

@Anuoluwapo25
Copy link

@Anuoluwapo25 Anuoluwapo25 commented Feb 26, 2026

Description

This PR introduces a Draft status for invoices. Draft invoices are stored on-chain but are not visible in public invoice queries and cannot be paid until explicitly finalized by the merchant.

This enables merchants to prepare invoices privately before making them

Type of Change

##Description

  • Bug fix (non-breaking change which fixes an issue)
  • [ x] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Test improvements
  • Other (please describe):

Related Issues

Fixes #

Changes Made

Added Draft variant to InvoiceStatus

Implemented finalize_invoice(env, merchant, id) function

Updated invoice query logic to exclude Draft invoices from standard get_invoices results

Prevented payment of invoices in Draft status

Added tests validating Draft behavior and finalization flow

Updated inline documentation and comments

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • All existing tests pass locally
  • I have tested this manually

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

closes #138

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Draft Invoice State

1 participant