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.
Issue an invoice for a job.
Goal
Bill clients.
Context
Billing.
Source Definition
import { defineCommand } from '@lssm-tech/lib.contracts-spec';
import { InvoiceModel, IssueInvoiceInputModel } from './invoice.schema';
export const IssueInvoiceContract = defineCommand({
meta: {
key: 'service.invoice.issue',
version: '1.0.0',
stability: 'stable',
owners: ['@examples.service-business-os'],
tags: ['service-business-os', 'invoice', 'issue'],
description: 'Issue an invoice for a job.',
goal: 'Bill clients.',
context: 'Billing.',
},
io: {
input: IssueInvoiceInputModel,
output: InvoiceModel,
},
policy: { auth: 'user' },
acceptance: {
scenarios: [
{
key: 'issue-invoice-happy-path',
given: ['Job is complete'],
when: ['User issues invoice'],
then: ['Invoice is created and sent'],
},
],
examples: [
{
key: 'issue-standard',
input: {
jobId: 'job-123',
dueDate: '2025-02-01',
items: [{ description: 'Service', amount: 100 }],
},
output: { id: 'inv-456', status: 'issued', total: 100 },
},
],
},
});