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.

saas.billing.usage.summary

Get usage summary for the current billing period.

  • Type: operation (query)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.saas-boilerplate
  • Tags: saas, billing, usage
  • File: packages/examples/saas-boilerplate/src/billing/billing.operations.ts
  • field.key.label
    saas.billing.usage.summary
    field.version.label
    1.0.0
    field.type.label
    operation (query)
    field.title.label
    saas.billing.usage.summary
    field.description.label

    Get usage summary for the current billing period.

  • Type: operation (query)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.saas-boilerplate
  • Tags: saas, billing, usage
  • File: packages/examples/saas-boilerplate/src/billing/billing.operations.ts
  • field.tags.label
    saas,billing,usage
    field.owners.label
    @example.saas-boilerplate
    field.stability.label
    stable

    Get usage summary for the current billing period.

    Goal

    Show usage vs limits.

    Context

    Billing page, usage dashboards.

    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 GetUsageSummaryContract = defineQuery({
    	meta: {
    		key: 'saas.billing.usage.summary',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@example.saas-boilerplate'],
    		tags: ['saas', 'billing', 'usage'],
    		description: 'Get usage summary for the current billing period.',
    		goal: 'Show usage vs limits.',
    		context: 'Billing page, usage dashboards.',
    	},
    	io: {
    		input: GetUsageSummaryInputModel,
    		output: GetUsageSummaryOutputModel,
    	},
    	policy: {
    		auth: 'user',
    	},
    	acceptance: {
    		scenarios: [
    			{
    				key: 'get-usage-happy-path',
    				given: ['Organization has usage history'],
    				when: ['User requests usage summary'],
    				then: ['Usage metrics are returned'],
    			},
    		],
    		examples: [
    			{
    				key: 'get-current-usage',
    				input: { period: 'current' },
    				output: { features: [{ name: 'api_calls', used: 100, limit: 1000 }] },
    			},
    		],
    	},
    });