Skip to content

Multi-issue PR: stats, inactive plans, plan description, token in events - #141

Open
m1s0g1 wants to merge 4 commits into
stellar-sub:mainfrom
m1s0g1:combo-issues-67-66-65-56
Open

m1s0g1 wants to merge 4 commits into
stellar-sub:mainfrom
m1s0g1:combo-issues-67-66-65-56

Conversation

@m1s0g1

@m1s0g1 m1s0g1 commented Oct 21, 2026

Copy link
Copy Markdown

Summary

Addresses four issues with comprehensive implementations:

Changes by Issue

Issue #67: Per-Merchant Stats Registry

  • Added MerchantStats type tracking subscriptions, active subscriptions, and total charged volume per merchant
  • Updated register_subscription to initialize merchant stats
  • Updated update_subscription to maintain merchant stats alongside global stats
  • Added get_merchant_stats(merchant) public function
  • Comprehensive tests covering registration, updates, active/inactive transitions, and independent merchant tracking

Issue #66: Inactive Plans View

  • Added get_inactive_plans_by_merchant() returning inactive plans oldest first
  • Added get_inactive_plans_by_merchant_count() helper function
  • Comprehensive tests covering no inactive plans, some inactive, all inactive, and merchant separation

Issue #65: Plan Description Design

Design Decision: Option 1 - New field plus mirror update (chosen for coherence and simplicity)

  • Added description: Option<String> to Plan in both plan and subscription contracts
  • Updated plan creation to accept optional description
  • Maintained backward compatibility: existing plans default to None
  • Added tests verifying existing plans decode correctly with None
  • Added mirror-sync test confirming subscription contract can decode plans with description
  • No changes required to subscription logic - option field handled automatically

Issue #56: Token in Charged Event

  • Added token: Address field to Charged event
  • Updated event emission in charge() to include token from subscription
  • Updated event tests to verify token field
  • Updated documentation reflecting new charged event schema

Testing

All changes include comprehensive test coverage:

  • Unit tests for each new feature
  • Integration tests verifying merchant stats consistency
  • Mirror-sync tests for plan description backward compatibility
  • Existing tests remain passing (no regressions)

Closes

Closes #67
Closes #66
Closes #65
Closes #56

@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@m1s0g1 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

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

Labels

None yet

Projects

None yet

1 participant