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.

crm.deal.move

Move a deal to a different stage.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.crm-pipeline
  • Tags: crm, deal, move, kanban
  • File: packages/examples/crm-pipeline/src/deal/deal.operation.ts
  • field.key.label
    crm.deal.move
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    crm.deal.move
    field.description.label

    Move a deal to a different stage.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.crm-pipeline
  • Tags: crm, deal, move, kanban
  • File: packages/examples/crm-pipeline/src/deal/deal.operation.ts
  • field.tags.label
    crm,deal,move,kanban
    field.owners.label
    @example.crm-pipeline
    field.stability.label
    stable

    Move a deal to a different stage.

    Goal

    Allow drag-and-drop stage movement in Kanban.

    Context

    Pipeline Kanban view.

    Emitted Events

    `deal.moved` (v1.0.0)

    Source Definition

    import {
    	defineCommand,
    	defineQuery,
    } from '@lssm-tech/lib.contracts-spec/operations';
    import {
    	CreateDealInputModel,
    	DealLostPayloadModel,
    	DealModel,
    	DealMovedPayloadModel,
    	DealWonPayloadModel,
    	ListDealsInputModel,
    	ListDealsOutputModel,
    	LoseDealInputModel,
    	MoveDealInputModel,
    	WinDealInputModel,
    } from './deal.schema';
    
    export const MoveDealContract = defineCommand({
    	meta: {
    		key: 'crm.deal.move',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@example.crm-pipeline'],
    		tags: ['crm', 'deal', 'move', 'kanban'],
    		description: 'Move a deal to a different stage.',
    		goal: 'Allow drag-and-drop stage movement in Kanban.',
    		context: 'Pipeline Kanban view.',
    	},
    	io: {
    		input: MoveDealInputModel,
    		output: DealModel,
    	},
    	policy: {
    		auth: 'user',
    	},
    	sideEffects: {
    		emits: [
    			{
    				key: 'deal.moved',
    				version: '1.0.0',
    				when: 'Deal stage changed',
    				payload: DealMovedPayloadModel,
    			},
    		],
    		audit: ['deal.moved'],
    	},
    	acceptance: {
    		scenarios: [
    			{
    				key: 'move-deal-happy-path',
    				given: ['Deal exists in stage A'],
    				when: ['User moves deal to stage B'],
    				then: ['Deal stage is updated', 'DealMoved event is emitted'],
    			},
    		],
    		examples: [
    			{
    				key: 'move-to-negotiation',
    				input: { dealId: 'deal-789', targetStageId: 'stage-negotiation' },
    				output: {
    					id: 'deal-789',
    					stageId: 'stage-negotiation',
    					movedAt: '2025-01-15T10:00:00Z',
    				},
    			},
    		],
    	},
    });