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.
Record a payment.
Goal
Track payments.
Context
Billing.
Source Definition
import { defineCommand } from '@lssm-tech/lib.contracts-spec';
import { PaymentModel, RecordPaymentInputModel } from './payment.schema';
export const RecordPaymentContract = defineCommand({
meta: {
key: 'service.payment.record',
version: '1.0.0',
stability: 'stable',
owners: ['@examples.service-business-os'],
tags: ['service-business-os', 'payment', 'record'],
description: 'Record a payment.',
goal: 'Track payments.',
context: 'Billing.',
},
io: {
input: RecordPaymentInputModel,
output: PaymentModel,
},
policy: { auth: 'user' },
acceptance: {
scenarios: [
{
key: 'record-payment-happy-path',
given: ['Invoice exists'],
when: ['User records payment'],
then: ['Payment is recorded'],
},
],
examples: [
{
key: 'record-check',
input: { invoiceId: 'inv-456', amount: 100, method: 'check' },
output: { id: 'pay-123', status: 'completed' },
},
],
},
});