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 an approval request with details.
Goal
View approval request details.
Context
Approval detail view.
Source Definition
import {
defineCommand,
defineQuery,
} from '@lssm-tech/lib.contracts-spec/operations';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
import { ApprovalDecisionEnum, ApprovalStatusEnum } from './approval.enum';
import { ApprovalCommentModel, ApprovalRequestModel } from './approval.schema';
export const GetApprovalContract = defineQuery({
meta: {
key: 'workflow.approval.get',
version: '1.0.0',
stability: 'stable',
owners: ['@example.workflow-system'],
tags: ['workflow', 'approval', 'get'],
description: 'Get an approval request with details.',
goal: 'View approval request details.',
context: 'Approval detail view.',
},
io: {
input: defineSchemaModel({
name: 'GetApprovalInput',
fields: {
requestId: {
type: ScalarTypeEnum.String_unsecure(),
isOptional: false,
},
},
}),
output: ApprovalRequestModel,
},
policy: { auth: 'user' },
acceptance: {
scenarios: [
{
key: 'get-approval-happy-path',
given: ['Approval request exists'],
when: ['User requests approval details'],
then: ['Approval details are returned'],
},
],
examples: [
{
key: 'get-basic',
input: { requestId: 'req-123' },
output: { id: 'req-123', status: 'pending' },
},
],
},
});