Enforce subscription period end and lifecycle transitions #3

Closed
opened 2026-03-10 14:40:53 +03:00 by sirily · 0 comments
Owner

Problem
Generation eligibility currently checks subscription.status === "active" in packages/db/src/generation-store.ts, but does not enforce currentPeriodEnd or move subscriptions through past_due / expired states.

Why this matters
After a user pays once, unused quota can remain available beyond the paid period because there is no runtime enforcement that the billing window actually ended.

Acceptance criteria

  • Active subscription checks enforce the current billing window.
  • At or after currentPeriodEnd, access is terminated immediately with no grace period.
  • Warning/reminder flows, if implemented, happen before expiry and do not extend access.
  • Expired periods transition subscriptions out of active.
  • Billing and account views reflect pending_activation, active, past_due, expired, and canceled consistently.
  • Add tests for post-expiry request rejection.
Problem Generation eligibility currently checks `subscription.status === "active"` in `packages/db/src/generation-store.ts`, but does not enforce `currentPeriodEnd` or move subscriptions through `past_due` / `expired` states. Why this matters After a user pays once, unused quota can remain available beyond the paid period because there is no runtime enforcement that the billing window actually ended. Acceptance criteria - Active subscription checks enforce the current billing window. - At or after `currentPeriodEnd`, access is terminated immediately with no grace period. - Warning/reminder flows, if implemented, happen before expiry and do not extend access. - Expired periods transition subscriptions out of `active`. - Billing and account views reflect `pending_activation`, `active`, `past_due`, `expired`, and `canceled` consistently. - Add tests for post-expiry request rejection.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sirily/nroxy#3