OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Get organization subscription status.
Goal
Show current plan and billing status.
Context
Billing page, plan upgrade prompts.
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import {
CheckFeatureAccessInputModel,
CheckFeatureAccessOutputModel,
GetUsageSummaryInputModel,
GetUsageSummaryOutputModel,
RecordUsageInputModel,
RecordUsageOutputModel,
SubscriptionModel,
UsageRecordedPayloadModel,
} from './billing.schema';
export const GetSubscriptionContract = defineQuery({
meta: {
key: 'saas.billing.subscription.get',
version: '1.0.0',
stability: 'stable',
owners: ['@example.saas-boilerplate'],
tags: ['saas', 'billing', 'subscription'],
description: 'Get organization subscription status.',
goal: 'Show current plan and billing status.',
context: 'Billing page, plan upgrade prompts.',
},
io: {
input: null,
output: SubscriptionModel,
},
policy: {
auth: 'user',
},
acceptance: {
scenarios: [
{
key: 'get-subscription-happy-path',
given: ['Organization has active subscription'],
when: ['User requests subscription status'],
then: ['Subscription details are returned'],
},
],
examples: [
{
key: 'get-basic',
input: null,
output: {
plan: 'pro',
status: 'active',
currentPeriodEnd: '2025-02-01T00:00:00Z',
},
},
],
},
});