Skip to content

Subscription ​

Subscription owns persistent shared offerings, organization agreements, immutable plan snapshots, feature overrides, invoices, and manually recorded payments. Admin owns platform HTTP orchestration; Organization owns tenant billing views and relationship usage. Consumers receive narrow public capabilities.

Manual billing workflows documents authorization, lifecycle transitions, nullable PATCH semantics, retries, retained corrections, read-only enforcement, operation coverage, migrations, rollout, and reconciliation. Payments affect invoice balances; access changes require a separate administrative action. There is no billing automation.

The PostgreSQL adapter commits business writes, retry results, and audit entries together. Capacity changes share Organization's lock. Request-time eligibility uses the injected clock through SubscriptionService.IsActiveSubscription, called only by use cases. Runtime organization projections use persisted data and never select mock agreements. Legacy memory adapters are unmounted and remain only as quarantined compatibility code.

Apply migrations before serving the new reads. Enforcement defaults to shadow until actual customer agreements and permissions have been reviewed; enable it with SUBSCRIPTION_ENFORCEMENT=enforce. Backend unit and PostgreSQL HTTP tests cover the manual workflow and concurrency. Frontend integration and production agreement backfill are deployment work outside this API repository.

See public contracts, module facades, and use cases.

Documentation follows the source. Planned contracts are marked explicitly.