@nahisaho/musubix-workflow-engine 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application/PhaseController.d.ts +110 -0
- package/dist/application/PhaseController.d.ts.map +1 -0
- package/dist/application/PhaseController.js +272 -0
- package/dist/application/PhaseController.js.map +1 -0
- package/dist/application/QualityGateRunner.d.ts +97 -0
- package/dist/application/QualityGateRunner.d.ts.map +1 -0
- package/dist/application/QualityGateRunner.js +234 -0
- package/dist/application/QualityGateRunner.js.map +1 -0
- package/dist/application/StateTracker.d.ts +119 -0
- package/dist/application/StateTracker.d.ts.map +1 -0
- package/dist/application/StateTracker.js +192 -0
- package/dist/application/StateTracker.js.map +1 -0
- package/dist/application/index.d.ts +11 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/index.js +11 -0
- package/dist/application/index.js.map +1 -0
- package/dist/domain/entities/Phase.d.ts +125 -0
- package/dist/domain/entities/Phase.d.ts.map +1 -0
- package/dist/domain/entities/Phase.js +146 -0
- package/dist/domain/entities/Phase.js.map +1 -0
- package/dist/domain/entities/QualityGate.d.ts +85 -0
- package/dist/domain/entities/QualityGate.d.ts.map +1 -0
- package/dist/domain/entities/QualityGate.js +117 -0
- package/dist/domain/entities/QualityGate.js.map +1 -0
- package/dist/domain/entities/Workflow.d.ts +90 -0
- package/dist/domain/entities/Workflow.d.ts.map +1 -0
- package/dist/domain/entities/Workflow.js +174 -0
- package/dist/domain/entities/Workflow.js.map +1 -0
- package/dist/domain/entities/index.d.ts +11 -0
- package/dist/domain/entities/index.d.ts.map +1 -0
- package/dist/domain/entities/index.js +11 -0
- package/dist/domain/entities/index.js.map +1 -0
- package/dist/domain/events/PhaseTransitioned.d.ts +37 -0
- package/dist/domain/events/PhaseTransitioned.d.ts.map +1 -0
- package/dist/domain/events/PhaseTransitioned.js +38 -0
- package/dist/domain/events/PhaseTransitioned.js.map +1 -0
- package/dist/domain/events/QualityGatePassed.d.ts +63 -0
- package/dist/domain/events/QualityGatePassed.d.ts.map +1 -0
- package/dist/domain/events/QualityGatePassed.js +68 -0
- package/dist/domain/events/QualityGatePassed.js.map +1 -0
- package/dist/domain/events/index.d.ts +13 -0
- package/dist/domain/events/index.d.ts.map +1 -0
- package/dist/domain/events/index.js +9 -0
- package/dist/domain/events/index.js.map +1 -0
- package/dist/domain/index.d.ts +11 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +14 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/value-objects/ApprovalStatus.d.ts +69 -0
- package/dist/domain/value-objects/ApprovalStatus.d.ts.map +1 -0
- package/dist/domain/value-objects/ApprovalStatus.js +105 -0
- package/dist/domain/value-objects/ApprovalStatus.js.map +1 -0
- package/dist/domain/value-objects/PhaseType.d.ts +66 -0
- package/dist/domain/value-objects/PhaseType.d.ts.map +1 -0
- package/dist/domain/value-objects/PhaseType.js +105 -0
- package/dist/domain/value-objects/PhaseType.js.map +1 -0
- package/dist/domain/value-objects/TaskStatus.d.ts +59 -0
- package/dist/domain/value-objects/TaskStatus.d.ts.map +1 -0
- package/dist/domain/value-objects/TaskStatus.js +90 -0
- package/dist/domain/value-objects/TaskStatus.js.map +1 -0
- package/dist/domain/value-objects/index.d.ts +11 -0
- package/dist/domain/value-objects/index.d.ts.map +1 -0
- package/dist/domain/value-objects/index.js +11 -0
- package/dist/domain/value-objects/index.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Entity
|
|
3
|
+
*
|
|
4
|
+
* Represents the complete workflow state
|
|
5
|
+
*
|
|
6
|
+
* @see REQ-ORCH-001 - Phase Transition
|
|
7
|
+
* @see REQ-ORCH-002 - State Tracking
|
|
8
|
+
*/
|
|
9
|
+
import { createPhase, startPhase, canTransitionTo, } from './Phase.js';
|
|
10
|
+
import { getAllPhases } from '../value-objects/PhaseType.js';
|
|
11
|
+
/**
|
|
12
|
+
* Create a new workflow
|
|
13
|
+
*
|
|
14
|
+
* @param id - Workflow ID
|
|
15
|
+
* @param name - Workflow name
|
|
16
|
+
* @param description - Optional description
|
|
17
|
+
* @returns New workflow
|
|
18
|
+
*/
|
|
19
|
+
export function createWorkflow(id, name, description) {
|
|
20
|
+
const phases = new Map();
|
|
21
|
+
// Initialize all phases
|
|
22
|
+
for (const phaseType of getAllPhases()) {
|
|
23
|
+
phases.set(phaseType, createPhase(phaseType));
|
|
24
|
+
}
|
|
25
|
+
const now = new Date();
|
|
26
|
+
return Object.freeze({
|
|
27
|
+
id,
|
|
28
|
+
name,
|
|
29
|
+
description,
|
|
30
|
+
status: 'not-started',
|
|
31
|
+
currentPhase: null,
|
|
32
|
+
phases,
|
|
33
|
+
createdAt: now,
|
|
34
|
+
updatedAt: now,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Start workflow (begins with requirements phase)
|
|
39
|
+
*
|
|
40
|
+
* @param workflow - Workflow to start
|
|
41
|
+
* @returns Updated workflow
|
|
42
|
+
*/
|
|
43
|
+
export function startWorkflow(workflow) {
|
|
44
|
+
if (workflow.status !== 'not-started') {
|
|
45
|
+
throw new Error(`Cannot start workflow in status: ${workflow.status}`);
|
|
46
|
+
}
|
|
47
|
+
const firstPhase = 'requirements';
|
|
48
|
+
const phases = new Map(workflow.phases);
|
|
49
|
+
const phase = phases.get(firstPhase);
|
|
50
|
+
if (!phase) {
|
|
51
|
+
throw new Error(`Phase not found: ${firstPhase}`);
|
|
52
|
+
}
|
|
53
|
+
phases.set(firstPhase, startPhase(phase));
|
|
54
|
+
return Object.freeze({
|
|
55
|
+
...workflow,
|
|
56
|
+
status: 'in-progress',
|
|
57
|
+
currentPhase: firstPhase,
|
|
58
|
+
phases,
|
|
59
|
+
updatedAt: new Date(),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Update phase in workflow
|
|
64
|
+
*
|
|
65
|
+
* @param workflow - Workflow to update
|
|
66
|
+
* @param phase - Updated phase
|
|
67
|
+
* @returns Updated workflow
|
|
68
|
+
*/
|
|
69
|
+
export function updatePhase(workflow, phase) {
|
|
70
|
+
const phases = new Map(workflow.phases);
|
|
71
|
+
phases.set(phase.type, phase);
|
|
72
|
+
return Object.freeze({
|
|
73
|
+
...workflow,
|
|
74
|
+
phases,
|
|
75
|
+
updatedAt: new Date(),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Transition to next phase
|
|
80
|
+
*
|
|
81
|
+
* @param workflow - Current workflow
|
|
82
|
+
* @param targetPhase - Target phase
|
|
83
|
+
* @returns Updated workflow
|
|
84
|
+
* @throws Error if transition is invalid
|
|
85
|
+
*/
|
|
86
|
+
export function transitionToPhase(workflow, targetPhase) {
|
|
87
|
+
if (!workflow.currentPhase) {
|
|
88
|
+
throw new Error('Workflow has not been started');
|
|
89
|
+
}
|
|
90
|
+
const currentPhaseEntity = workflow.phases.get(workflow.currentPhase);
|
|
91
|
+
if (!currentPhaseEntity) {
|
|
92
|
+
throw new Error(`Current phase not found: ${workflow.currentPhase}`);
|
|
93
|
+
}
|
|
94
|
+
// Check if transition is valid
|
|
95
|
+
if (!canTransitionTo(currentPhaseEntity, targetPhase)) {
|
|
96
|
+
// Special error for design → implementation (forbidden direct transition)
|
|
97
|
+
if (workflow.currentPhase === 'design' && targetPhase === 'implementation') {
|
|
98
|
+
throw new Error('⚠️ 設計から実装への直接遷移は禁止されています。' +
|
|
99
|
+
'必ずPhase 3(タスク分解)を経てください。');
|
|
100
|
+
}
|
|
101
|
+
throw new Error(`Invalid transition from ${workflow.currentPhase} to ${targetPhase}. ` +
|
|
102
|
+
`Current phase must be approved first.`);
|
|
103
|
+
}
|
|
104
|
+
// Start target phase
|
|
105
|
+
const phases = new Map(workflow.phases);
|
|
106
|
+
const targetPhaseEntity = phases.get(targetPhase);
|
|
107
|
+
if (!targetPhaseEntity) {
|
|
108
|
+
throw new Error(`Target phase not found: ${targetPhase}`);
|
|
109
|
+
}
|
|
110
|
+
phases.set(targetPhase, startPhase(targetPhaseEntity));
|
|
111
|
+
// Check if completing
|
|
112
|
+
const isCompleting = targetPhase === 'completion';
|
|
113
|
+
return Object.freeze({
|
|
114
|
+
...workflow,
|
|
115
|
+
currentPhase: targetPhase,
|
|
116
|
+
phases,
|
|
117
|
+
updatedAt: new Date(),
|
|
118
|
+
status: isCompleting ? 'completed' : 'in-progress',
|
|
119
|
+
completedAt: isCompleting ? new Date() : undefined,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get current phase entity
|
|
124
|
+
*
|
|
125
|
+
* @param workflow - Workflow
|
|
126
|
+
* @returns Current phase or null
|
|
127
|
+
*/
|
|
128
|
+
export function getCurrentPhase(workflow) {
|
|
129
|
+
if (!workflow.currentPhase) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
return workflow.phases.get(workflow.currentPhase) ?? null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Get workflow progress percentage
|
|
136
|
+
*
|
|
137
|
+
* @param workflow - Workflow
|
|
138
|
+
* @returns Progress 0-100
|
|
139
|
+
*/
|
|
140
|
+
export function getWorkflowProgress(workflow) {
|
|
141
|
+
const allPhases = getAllPhases();
|
|
142
|
+
let completedCount = 0;
|
|
143
|
+
for (const phase of workflow.phases.values()) {
|
|
144
|
+
if (phase.status === 'approved' || phase.status === 'completed') {
|
|
145
|
+
completedCount++;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return Math.round((completedCount / allPhases.length) * 100);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Generate workflow ID
|
|
152
|
+
*
|
|
153
|
+
* @param name - Workflow name (optional)
|
|
154
|
+
* @returns Workflow ID
|
|
155
|
+
*/
|
|
156
|
+
export function generateWorkflowId(name) {
|
|
157
|
+
const timestamp = Date.now().toString(36);
|
|
158
|
+
const prefix = name
|
|
159
|
+
? name.substring(0, 3).toUpperCase().replace(/[^A-Z]/g, 'X')
|
|
160
|
+
: 'WFL';
|
|
161
|
+
return `${prefix}-${timestamp}`;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Check if workflow can proceed to implementation
|
|
165
|
+
*
|
|
166
|
+
* @param workflow - Workflow to check
|
|
167
|
+
* @returns true if can proceed
|
|
168
|
+
*/
|
|
169
|
+
export function canProceedToImplementation(workflow) {
|
|
170
|
+
// Must have completed task-breakdown phase
|
|
171
|
+
const taskBreakdownPhase = workflow.phases.get('task-breakdown');
|
|
172
|
+
return taskBreakdownPhase?.status === 'approved';
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=Workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Workflow.js","sourceRoot":"","sources":["../../../src/domain/entities/Workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAEL,WAAW,EACX,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAsB7D;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,EAAU,EACV,IAAY,EACZ,WAAoB;IAEpB,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;IAE3C,wBAAwB;IACxB,KAAK,MAAM,SAAS,IAAI,YAAY,EAAE,EAAE,CAAC;QACvC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,EAAE;QACF,IAAI;QACJ,WAAW;QACX,MAAM,EAAE,aAAa;QACrB,YAAY,EAAE,IAAI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K,CAAC;IACV,OAAO,GAAG,MAAM,IAAI,SAAS,EAAE,CAAC;AAClC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAkB;IAC3D,2CAA2C;IAC3C,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjE,OAAO,kBAAkB,EAAE,MAAM,KAAK,UAAU,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entities barrel export
|
|
3
|
+
*
|
|
4
|
+
* @see REQ-ORCH-001 - Phase Transition
|
|
5
|
+
* @see REQ-ORCH-002 - State Tracking
|
|
6
|
+
* @see REQ-ORCH-003 - Quality Gate Integration
|
|
7
|
+
*/
|
|
8
|
+
export { type ArtifactType, type PhaseArtifact, type ReviewResult, type ReviewCheckpoint, type Phase, createPhase, startPhase, addArtifact, setReview, approvePhase, canTransitionTo, getPhaseDisplayName, createArtifact, createReviewResult, } from './Phase.js';
|
|
9
|
+
export { type QualityCheckFn, type QualityCheckResult, type QualityGate, type QualityGateResult, createQualityGate, executeQualityGate, aggregateGateResults, PHASE_QUALITY_GATES, getPhaseGateChecks, } from './QualityGate.js';
|
|
10
|
+
export { type WorkflowStatus, type Workflow, createWorkflow, startWorkflow, updatePhase, transitionToPhase, getCurrentPhase, getWorkflowProgress, generateWorkflowId, canProceedToImplementation, } from './Workflow.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,cAAc,EACd,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entities barrel export
|
|
3
|
+
*
|
|
4
|
+
* @see REQ-ORCH-001 - Phase Transition
|
|
5
|
+
* @see REQ-ORCH-002 - State Tracking
|
|
6
|
+
* @see REQ-ORCH-003 - Quality Gate Integration
|
|
7
|
+
*/
|
|
8
|
+
export { createPhase, startPhase, addArtifact, setReview, approvePhase, canTransitionTo, getPhaseDisplayName, createArtifact, createReviewResult, } from './Phase.js';
|
|
9
|
+
export { createQualityGate, executeQualityGate, aggregateGateResults, PHASE_QUALITY_GATES, getPhaseGateChecks, } from './QualityGate.js';
|
|
10
|
+
export { createWorkflow, startWorkflow, updatePhase, transitionToPhase, getCurrentPhase, getWorkflowProgress, generateWorkflowId, canProceedToImplementation, } from './Workflow.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAML,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAKL,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAGL,cAAc,EACd,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PhaseTransitioned Event
|
|
3
|
+
*
|
|
4
|
+
* Domain event emitted when a phase transition occurs
|
|
5
|
+
*
|
|
6
|
+
* @see REQ-ORCH-001 - Phase Transition
|
|
7
|
+
*/
|
|
8
|
+
import type { PhaseType } from '../value-objects/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Phase transitioned event
|
|
11
|
+
*/
|
|
12
|
+
export interface PhaseTransitionedEvent {
|
|
13
|
+
readonly type: 'PhaseTransitioned';
|
|
14
|
+
readonly workflowId: string;
|
|
15
|
+
readonly fromPhase: PhaseType;
|
|
16
|
+
readonly toPhase: PhaseType;
|
|
17
|
+
readonly timestamp: Date;
|
|
18
|
+
readonly approvedBy?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a phase transitioned event
|
|
22
|
+
*
|
|
23
|
+
* @param workflowId - Workflow ID
|
|
24
|
+
* @param fromPhase - Source phase
|
|
25
|
+
* @param toPhase - Target phase
|
|
26
|
+
* @param approvedBy - Approver (optional)
|
|
27
|
+
* @returns PhaseTransitionedEvent
|
|
28
|
+
*/
|
|
29
|
+
export declare function createPhaseTransitionedEvent(workflowId: string, fromPhase: PhaseType, toPhase: PhaseType, approvedBy?: string): PhaseTransitionedEvent;
|
|
30
|
+
/**
|
|
31
|
+
* Format event for logging
|
|
32
|
+
*
|
|
33
|
+
* @param event - Event to format
|
|
34
|
+
* @returns Formatted string
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatPhaseTransitionedEvent(event: PhaseTransitionedEvent): string;
|
|
37
|
+
//# sourceMappingURL=PhaseTransitioned.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhaseTransitioned.d.ts","sourceRoot":"","sources":["../../../src/domain/events/PhaseTransitioned.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,SAAS,EAClB,UAAU,CAAC,EAAE,MAAM,GAClB,sBAAsB,CASxB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAIlF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PhaseTransitioned Event
|
|
3
|
+
*
|
|
4
|
+
* Domain event emitted when a phase transition occurs
|
|
5
|
+
*
|
|
6
|
+
* @see REQ-ORCH-001 - Phase Transition
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Create a phase transitioned event
|
|
10
|
+
*
|
|
11
|
+
* @param workflowId - Workflow ID
|
|
12
|
+
* @param fromPhase - Source phase
|
|
13
|
+
* @param toPhase - Target phase
|
|
14
|
+
* @param approvedBy - Approver (optional)
|
|
15
|
+
* @returns PhaseTransitionedEvent
|
|
16
|
+
*/
|
|
17
|
+
export function createPhaseTransitionedEvent(workflowId, fromPhase, toPhase, approvedBy) {
|
|
18
|
+
return Object.freeze({
|
|
19
|
+
type: 'PhaseTransitioned',
|
|
20
|
+
workflowId,
|
|
21
|
+
fromPhase,
|
|
22
|
+
toPhase,
|
|
23
|
+
timestamp: new Date(),
|
|
24
|
+
approvedBy,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Format event for logging
|
|
29
|
+
*
|
|
30
|
+
* @param event - Event to format
|
|
31
|
+
* @returns Formatted string
|
|
32
|
+
*/
|
|
33
|
+
export function formatPhaseTransitionedEvent(event) {
|
|
34
|
+
const approver = event.approvedBy ? ` (approved by ${event.approvedBy})` : '';
|
|
35
|
+
return `[${event.timestamp.toISOString()}] Workflow ${event.workflowId}: ` +
|
|
36
|
+
`${event.fromPhase} → ${event.toPhase}${approver}`;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=PhaseTransitioned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhaseTransitioned.js","sourceRoot":"","sources":["../../../src/domain/events/PhaseTransitioned.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAC1C,UAAkB,EAClB,SAAoB,EACpB,OAAkB,EAClB,UAAmB;IAEnB,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,mBAAmB;QACzB,UAAU;QACV,SAAS;QACT,OAAO;QACP,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,UAAU;KACX,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAA6B;IACxE,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9E,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,cAAc,KAAK,CAAC,UAAU,IAAI;QACxE,GAAG,KAAK,CAAC,SAAS,MAAM,KAAK,CAAC,OAAO,GAAG,QAAQ,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QualityGatePassed Event
|
|
3
|
+
*
|
|
4
|
+
* Domain event emitted when quality gate passes
|
|
5
|
+
*
|
|
6
|
+
* @see REQ-ORCH-003 - Quality Gate Integration
|
|
7
|
+
*/
|
|
8
|
+
import type { PhaseType } from '../value-objects/index.js';
|
|
9
|
+
import type { QualityGateResult } from '../entities/QualityGate.js';
|
|
10
|
+
/**
|
|
11
|
+
* Quality gate passed event
|
|
12
|
+
*/
|
|
13
|
+
export interface QualityGatePassedEvent {
|
|
14
|
+
readonly type: 'QualityGatePassed';
|
|
15
|
+
readonly workflowId: string;
|
|
16
|
+
readonly phase: PhaseType;
|
|
17
|
+
readonly gateResults: readonly QualityGateResult[];
|
|
18
|
+
readonly timestamp: Date;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Quality gate failed event
|
|
22
|
+
*/
|
|
23
|
+
export interface QualityGateFailedEvent {
|
|
24
|
+
readonly type: 'QualityGateFailed';
|
|
25
|
+
readonly workflowId: string;
|
|
26
|
+
readonly phase: PhaseType;
|
|
27
|
+
readonly gateResults: readonly QualityGateResult[];
|
|
28
|
+
readonly failedGates: readonly string[];
|
|
29
|
+
readonly timestamp: Date;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Create a quality gate passed event
|
|
33
|
+
*
|
|
34
|
+
* @param workflowId - Workflow ID
|
|
35
|
+
* @param phase - Phase type
|
|
36
|
+
* @param gateResults - Gate results
|
|
37
|
+
* @returns QualityGatePassedEvent
|
|
38
|
+
*/
|
|
39
|
+
export declare function createQualityGatePassedEvent(workflowId: string, phase: PhaseType, gateResults: readonly QualityGateResult[]): QualityGatePassedEvent;
|
|
40
|
+
/**
|
|
41
|
+
* Create a quality gate failed event
|
|
42
|
+
*
|
|
43
|
+
* @param workflowId - Workflow ID
|
|
44
|
+
* @param phase - Phase type
|
|
45
|
+
* @param gateResults - Gate results
|
|
46
|
+
* @returns QualityGateFailedEvent
|
|
47
|
+
*/
|
|
48
|
+
export declare function createQualityGateFailedEvent(workflowId: string, phase: PhaseType, gateResults: readonly QualityGateResult[]): QualityGateFailedEvent;
|
|
49
|
+
/**
|
|
50
|
+
* Format passed event for logging
|
|
51
|
+
*
|
|
52
|
+
* @param event - Event to format
|
|
53
|
+
* @returns Formatted string
|
|
54
|
+
*/
|
|
55
|
+
export declare function formatQualityGatePassedEvent(event: QualityGatePassedEvent): string;
|
|
56
|
+
/**
|
|
57
|
+
* Format failed event for logging
|
|
58
|
+
*
|
|
59
|
+
* @param event - Event to format
|
|
60
|
+
* @returns Formatted string
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatQualityGateFailedEvent(event: QualityGateFailedEvent): string;
|
|
63
|
+
//# sourceMappingURL=QualityGatePassed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QualityGatePassed.d.ts","sourceRoot":"","sources":["../../../src/domain/events/QualityGatePassed.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACnD,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACnD,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,SAAS,iBAAiB,EAAE,GACxC,sBAAsB,CAQxB;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,SAAS,iBAAiB,EAAE,GACxC,sBAAsB,CAaxB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAIlF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAIlF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QualityGatePassed Event
|
|
3
|
+
*
|
|
4
|
+
* Domain event emitted when quality gate passes
|
|
5
|
+
*
|
|
6
|
+
* @see REQ-ORCH-003 - Quality Gate Integration
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Create a quality gate passed event
|
|
10
|
+
*
|
|
11
|
+
* @param workflowId - Workflow ID
|
|
12
|
+
* @param phase - Phase type
|
|
13
|
+
* @param gateResults - Gate results
|
|
14
|
+
* @returns QualityGatePassedEvent
|
|
15
|
+
*/
|
|
16
|
+
export function createQualityGatePassedEvent(workflowId, phase, gateResults) {
|
|
17
|
+
return Object.freeze({
|
|
18
|
+
type: 'QualityGatePassed',
|
|
19
|
+
workflowId,
|
|
20
|
+
phase,
|
|
21
|
+
gateResults,
|
|
22
|
+
timestamp: new Date(),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a quality gate failed event
|
|
27
|
+
*
|
|
28
|
+
* @param workflowId - Workflow ID
|
|
29
|
+
* @param phase - Phase type
|
|
30
|
+
* @param gateResults - Gate results
|
|
31
|
+
* @returns QualityGateFailedEvent
|
|
32
|
+
*/
|
|
33
|
+
export function createQualityGateFailedEvent(workflowId, phase, gateResults) {
|
|
34
|
+
const failedGates = gateResults
|
|
35
|
+
.filter(r => !r.passed)
|
|
36
|
+
.map(r => r.gateName);
|
|
37
|
+
return Object.freeze({
|
|
38
|
+
type: 'QualityGateFailed',
|
|
39
|
+
workflowId,
|
|
40
|
+
phase,
|
|
41
|
+
gateResults,
|
|
42
|
+
failedGates,
|
|
43
|
+
timestamp: new Date(),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Format passed event for logging
|
|
48
|
+
*
|
|
49
|
+
* @param event - Event to format
|
|
50
|
+
* @returns Formatted string
|
|
51
|
+
*/
|
|
52
|
+
export function formatQualityGatePassedEvent(event) {
|
|
53
|
+
const gateCount = event.gateResults.length;
|
|
54
|
+
return `[${event.timestamp.toISOString()}] Workflow ${event.workflowId}: ` +
|
|
55
|
+
`All ${gateCount} quality gates passed for ${event.phase}`;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Format failed event for logging
|
|
59
|
+
*
|
|
60
|
+
* @param event - Event to format
|
|
61
|
+
* @returns Formatted string
|
|
62
|
+
*/
|
|
63
|
+
export function formatQualityGateFailedEvent(event) {
|
|
64
|
+
const failedList = event.failedGates.join(', ');
|
|
65
|
+
return `[${event.timestamp.toISOString()}] Workflow ${event.workflowId}: ` +
|
|
66
|
+
`Quality gates failed for ${event.phase}: ${failedList}`;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=QualityGatePassed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QualityGatePassed.js","sourceRoot":"","sources":["../../../src/domain/events/QualityGatePassed.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA4BH;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC1C,UAAkB,EAClB,KAAgB,EAChB,WAAyC;IAEzC,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,mBAAmB;QACzB,UAAU;QACV,KAAK;QACL,WAAW;QACX,SAAS,EAAE,IAAI,IAAI,EAAE;KACtB,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC1C,UAAkB,EAClB,KAAgB,EAChB,WAAyC;IAEzC,MAAM,WAAW,GAAG,WAAW;SAC5B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;SACtB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,mBAAmB;QACzB,UAAU;QACV,KAAK;QACL,WAAW;QACX,WAAW;QACX,SAAS,EAAE,IAAI,IAAI,EAAE;KACtB,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAA6B;IACxE,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;IAC3C,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,cAAc,KAAK,CAAC,UAAU,IAAI;QACxE,OAAO,SAAS,6BAA6B,KAAK,CAAC,KAAK,EAAE,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAA6B;IACxE,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,cAAc,KAAK,CAAC,UAAU,IAAI;QACxE,4BAA4B,KAAK,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Events barrel export
|
|
3
|
+
*
|
|
4
|
+
* @see REQ-ORCH-001 - Phase Transition
|
|
5
|
+
* @see REQ-ORCH-003 - Quality Gate Integration
|
|
6
|
+
*/
|
|
7
|
+
export { type PhaseTransitionedEvent, createPhaseTransitionedEvent, formatPhaseTransitionedEvent, } from './PhaseTransitioned.js';
|
|
8
|
+
export { type QualityGatePassedEvent, type QualityGateFailedEvent, createQualityGatePassedEvent, createQualityGateFailedEvent, formatQualityGatePassedEvent, formatQualityGateFailedEvent, } from './QualityGatePassed.js';
|
|
9
|
+
/**
|
|
10
|
+
* All workflow domain events
|
|
11
|
+
*/
|
|
12
|
+
export type WorkflowDomainEvent = import('./PhaseTransitioned.js').PhaseTransitionedEvent | import('./QualityGatePassed.js').QualityGatePassedEvent | import('./QualityGatePassed.js').QualityGateFailedEvent;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/events/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,sBAAsB,EAC3B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,OAAO,wBAAwB,EAAE,sBAAsB,GACvD,OAAO,wBAAwB,EAAE,sBAAsB,GACvD,OAAO,wBAAwB,EAAE,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Events barrel export
|
|
3
|
+
*
|
|
4
|
+
* @see REQ-ORCH-001 - Phase Transition
|
|
5
|
+
* @see REQ-ORCH-003 - Quality Gate Integration
|
|
6
|
+
*/
|
|
7
|
+
export { createPhaseTransitionedEvent, formatPhaseTransitionedEvent, } from './PhaseTransitioned.js';
|
|
8
|
+
export { createQualityGatePassedEvent, createQualityGateFailedEvent, formatQualityGatePassedEvent, formatQualityGateFailedEvent, } from './QualityGatePassed.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/events/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAGL,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Layer barrel export
|
|
3
|
+
*
|
|
4
|
+
* @see REQ-ORCH-001 - Phase Transition
|
|
5
|
+
* @see REQ-ORCH-002 - State Tracking
|
|
6
|
+
* @see REQ-ORCH-003 - Quality Gate Integration
|
|
7
|
+
*/
|
|
8
|
+
export * from './value-objects/index.js';
|
|
9
|
+
export * from './entities/index.js';
|
|
10
|
+
export * from './events/index.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,0BAA0B,CAAC;AAGzC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Layer barrel export
|
|
3
|
+
*
|
|
4
|
+
* @see REQ-ORCH-001 - Phase Transition
|
|
5
|
+
* @see REQ-ORCH-002 - State Tracking
|
|
6
|
+
* @see REQ-ORCH-003 - Quality Gate Integration
|
|
7
|
+
*/
|
|
8
|
+
// Value Objects
|
|
9
|
+
export * from './value-objects/index.js';
|
|
10
|
+
// Entities
|
|
11
|
+
export * from './entities/index.js';
|
|
12
|
+
// Events
|
|
13
|
+
export * from './events/index.js';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gBAAgB;AAChB,cAAc,0BAA0B,CAAC;AAEzC,WAAW;AACX,cAAc,qBAAqB,CAAC;AAEpC,SAAS;AACT,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ApprovalStatus Value Object
|
|
3
|
+
*
|
|
4
|
+
* Represents the approval status for phase transitions
|
|
5
|
+
*
|
|
6
|
+
* @see REQ-ORCH-003 - Quality Gate Integration
|
|
7
|
+
* @see DES-ORCH-003 - QualityGateRunner
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Approval status type
|
|
11
|
+
*/
|
|
12
|
+
export type ApprovalStatus = 'pending' | 'approved' | 'rejected';
|
|
13
|
+
/**
|
|
14
|
+
* Approval keywords that indicate user approval
|
|
15
|
+
*/
|
|
16
|
+
export declare const APPROVAL_KEYWORDS: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* Rejection keywords
|
|
19
|
+
*/
|
|
20
|
+
export declare const REJECTION_KEYWORDS: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* Approval entity
|
|
23
|
+
*/
|
|
24
|
+
export interface Approval {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly status: ApprovalStatus;
|
|
27
|
+
readonly approver: string;
|
|
28
|
+
readonly comment?: string;
|
|
29
|
+
readonly timestamp: Date;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Create an approval
|
|
33
|
+
*
|
|
34
|
+
* @param id - Approval ID
|
|
35
|
+
* @param status - Approval status
|
|
36
|
+
* @param approver - Approver identifier
|
|
37
|
+
* @param comment - Optional comment
|
|
38
|
+
* @returns Approval entity
|
|
39
|
+
*/
|
|
40
|
+
export declare function createApproval(id: string, status: ApprovalStatus, approver: string, comment?: string): Approval;
|
|
41
|
+
/**
|
|
42
|
+
* Parse user input for approval status
|
|
43
|
+
*
|
|
44
|
+
* @param input - User input text
|
|
45
|
+
* @returns Detected approval status
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseApprovalFromInput(input: string): ApprovalStatus;
|
|
48
|
+
/**
|
|
49
|
+
* Check if approval is granted
|
|
50
|
+
*
|
|
51
|
+
* @param approval - Approval to check
|
|
52
|
+
* @returns true if approved
|
|
53
|
+
*/
|
|
54
|
+
export declare function isApproved(approval: Approval): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Check if approval is rejected
|
|
57
|
+
*
|
|
58
|
+
* @param approval - Approval to check
|
|
59
|
+
* @returns true if rejected
|
|
60
|
+
*/
|
|
61
|
+
export declare function isRejected(approval: Approval): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Generate approval ID
|
|
64
|
+
*
|
|
65
|
+
* @param phaseType - Phase type
|
|
66
|
+
* @returns Approval ID
|
|
67
|
+
*/
|
|
68
|
+
export declare function generateApprovalId(phaseType: string): string;
|
|
69
|
+
//# sourceMappingURL=ApprovalStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApprovalStatus.d.ts","sourceRoot":"","sources":["../../../src/domain/value-objects/ApprovalStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAY9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAQ/C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,QAAQ,CAQV;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAkBpE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAG5D"}
|