You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(payments): subscription lifecycle, renewal invoices and plan-based write access #908
Is your feature request related to a problem? Please describe.
With the subscription data model in place, nothing creates or extends a subscription, issues renewal invoices, or ends access when a period lapses. Write access still depends only on the permanent is_admitted flag.
Describe the solution you'd like
A SubscriptionService for subscribe, renew and status transitions (active → renewal_pending → past_due → expired).
PaymentsService.confirmInvoice extends the subscription period (same transaction as the invoice confirmation). All five confirmation paths (maintenance poll and the Zebedee/LNbits/OpenNode/Nodeless callbacks) already go through it, so the invoice carries its plan_id instead of each callback learning about plans.
POST /invoices accepts a plan id; existing admission behaviour is unchanged when no plans are configured.
A periodic sweep (maintenance worker) that issues renewal invoices before period end and moves overdue subscriptions through grace to expired.
isUserAdmitted checks for an active subscription, reusing the existing admission cache so there is no extra database read per event.
Tests for each transition, the confirm path, and the cache behaviour.
Activity