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.list.mine

List approval requests assigned to current user.

  • Type: operation (query)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.workflow-system
  • Tags: workflow, approval, list, inbox
  • field.key.label
    workflow.approval.list.mine
    field.version.label
    1.0.0
    field.type.label
    operation (query)
    field.title.label
    workflow.approval.list.mine
    field.description.label

    List approval requests assigned to current user.

  • Type: operation (query)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.workflow-system
  • Tags: workflow, approval, list, inbox
  • field.tags.label
    workflow,approval,list,inbox
    field.owners.label
    @example.workflow-system
    field.stability.label
    stable

    List approval requests assigned to current user.

    Goal

    Show pending approvals in user inbox.

    Context

    Approval inbox, dashboard widget.

    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 ListMyApprovalsContract = defineQuery({
    	meta: {
    		key: 'workflow.approval.list.mine',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@example.workflow-system'],
    		tags: ['workflow', 'approval', 'list', 'inbox'],
    		description: 'List approval requests assigned to current user.',
    		goal: 'Show pending approvals in user inbox.',
    		context: 'Approval inbox, dashboard widget.',
    	},
    	io: {
    		input: defineSchemaModel({
    			name: 'ListMyApprovalsInput',
    			fields: {
    				status: { type: ApprovalStatusEnum, isOptional: true },
    				limit: {
    					type: ScalarTypeEnum.Int_unsecure(),
    					isOptional: true,
    					defaultValue: 20,
    				},
    				offset: {
    					type: ScalarTypeEnum.Int_unsecure(),
    					isOptional: true,
    					defaultValue: 0,
    				},
    			},
    		}),
    		output: defineSchemaModel({
    			name: 'ListMyApprovalsOutput',
    			fields: {
    				requests: {
    					type: ApprovalRequestModel,
    					isArray: true,
    					isOptional: false,
    				},
    				total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
    				pendingCount: {
    					type: ScalarTypeEnum.Int_unsecure(),
    					isOptional: false,
    				},
    			},
    		}),
    	},
    	policy: { auth: 'user' },
    	acceptance: {
    		scenarios: [
    			{
    				key: 'list-approvals-happy-path',
    				given: ['User has assigned approvals'],
    				when: ['User lists approvals'],
    				then: ['List of requests is returned'],
    			},
    		],
    		examples: [
    			{
    				key: 'list-pending',
    				input: { status: 'pending', limit: 10 },
    				output: { requests: [], total: 2, pendingCount: 2 },
    			},
    		],
    	},
    });