Problem
lib.rs defines Subscription, SubscriptionPlan, and SubscriptionStatus as #[contracttype] structs, and EVENTS.md documents a SUBSCRIPTION/CREATED event — but there are zero callable entry points for subscriptions anywhere in the codebase. This is dead code that will trigger Clippy warnings and confuse integrators.
Required Entry Points
create_plan(merchant, plan_id, name, description, amount, currency, interval_secs) — merchant creates a billing plan
subscribe(payer, subscription_id, plan_id) — payer subscribes to a plan
process_subscription(operator, subscription_id) — operator triggers a recurring charge
cancel_subscription(payer_or_merchant, subscription_id) — cancel an active subscription
get_subscription(subscription_id) → Subscription
get_plan(plan_id) → SubscriptionPlan
Acceptance Criteria
Branch & Commit Examples
branch: feat/subscription-manager
commit: feat(subscriptions): implement create_plan, subscribe, process_subscription, cancel_subscription
Problem
lib.rsdefinesSubscription,SubscriptionPlan, andSubscriptionStatusas#[contracttype]structs, andEVENTS.mddocuments aSUBSCRIPTION/CREATEDevent — but there are zero callable entry points for subscriptions anywhere in the codebase. This is dead code that will trigger Clippy warnings and confuse integrators.Required Entry Points
create_plan(merchant, plan_id, name, description, amount, currency, interval_secs)— merchant creates a billing plansubscribe(payer, subscription_id, plan_id)— payer subscribes to a planprocess_subscription(operator, subscription_id)— operator triggers a recurring chargecancel_subscription(payer_or_merchant, subscription_id)— cancel an active subscriptionget_subscription(subscription_id)→Subscriptionget_plan(plan_id)→SubscriptionPlanAcceptance Criteria
PaymentProcessoror dedicatedSubscriptionManager)process_subscriptionenforcesnext_payment_at— rejects if called before due datemax_paymentsis respected; subscription auto-cancels when limit is reachedSUBSCRIPTION/CREATED,SUBSCRIPTION/CHARGED,SUBSCRIPTION/CANCELLEDevents are emittedEVENTS.mdandCHANGELOG.mdare updatedcargo test --all-featurespassesBranch & Commit Examples