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.

workflow.approval.comment.add

Add a comment to an approval request.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.workflow-system
  • Tags: workflow, approval, comment
  • File: packages/examples/workflow-system/src/approval/approval.operations.ts
  • field.key.label
    workflow.approval.comment.add
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    workflow.approval.comment.add
    field.description.label

    Add a comment to an approval request.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.workflow-system
  • Tags: workflow, approval, comment
  • File: packages/examples/workflow-system/src/approval/approval.operations.ts
  • field.tags.label
    workflow,approval,comment
    field.owners.label
    @example.workflow-system
    field.stability.label
    stable

    Add a comment to an approval request.

    Goal

    Allow discussion on approval requests.

    Context

    Approval detail view.

    Emitted Events

    `workflow.approval.comment.added` (v1.0.0)

    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 AddApprovalCommentContract = defineCommand({
    	meta: {
    		key: 'workflow.approval.comment.add',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@example.workflow-system'],
    		tags: ['workflow', 'approval', 'comment'],
    		description: 'Add a comment to an approval request.',
    		goal: 'Allow discussion on approval requests.',
    		context: 'Approval detail view.',
    	},
    	io: {
    		input: defineSchemaModel({
    			name: 'AddCommentInput',
    			fields: {
    				requestId: {
    					type: ScalarTypeEnum.String_unsecure(),
    					isOptional: false,
    				},
    				content: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
    				isInternal: { type: ScalarTypeEnum.Boolean(), isOptional: true },
    			},
    		}),
    		output: ApprovalCommentModel,
    	},
    	policy: { auth: 'user' },
    	sideEffects: {
    		emits: [
    			{
    				key: 'workflow.approval.comment.added',
    				version: '1.0.0',
    				when: 'Comment is added',
    				payload: ApprovalCommentModel,
    			},
    		],
    	},
    	acceptance: {
    		scenarios: [
    			{
    				key: 'add-comment-happy-path',
    				given: ['Approval request exists'],
    				when: ['User adds a comment'],
    				then: ['Comment is added', 'CommentAdded event is emitted'],
    			},
    		],
    		examples: [
    			{
    				key: 'add-question',
    				input: {
    					requestId: 'req-123',
    					content: 'Can you clarify budget?',
    					isInternal: false,
    				},
    				output: { id: 'com-789', content: 'Can you clarify budget?' },
    			},
    		],
    	},
    });