business-as-code 2.1.1 → 2.3.0

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.
Files changed (212) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +2 -0
  3. package/package.json +7 -4
  4. package/src/dollar.ts +5 -2
  5. package/src/entities/organization.ts +31 -18
  6. package/src/goals.ts +78 -12
  7. package/src/index.ts +48 -18
  8. package/src/kpis.ts +62 -8
  9. package/src/metrics.ts +92 -79
  10. package/src/okrs.ts +120 -20
  11. package/src/organization.ts +12 -15
  12. package/src/process.ts +11 -12
  13. package/src/product.ts +8 -9
  14. package/src/queries.ts +238 -75
  15. package/src/roles.ts +62 -61
  16. package/src/workflow.ts +22 -15
  17. package/test/business.test.ts +282 -0
  18. package/test/dollar.test.ts +270 -0
  19. package/test/entities.test.ts +628 -0
  20. package/test/financials.test.ts +539 -0
  21. package/test/goals.test.ts +451 -0
  22. package/{src → test}/index.test.ts +1 -1
  23. package/test/kpis.test.ts +440 -0
  24. package/test/metrics.test.ts +744 -0
  25. package/test/okrs.test.ts +741 -0
  26. package/test/organization.test.ts +548 -0
  27. package/test/process.test.ts +503 -0
  28. package/test/product.test.ts +430 -0
  29. package/test/queries.test.ts +556 -0
  30. package/test/roles.test.ts +546 -0
  31. package/test/service.test.ts +450 -0
  32. package/test/types.test.ts +1141 -0
  33. package/test/vision.test.ts +214 -0
  34. package/test/workflow.test.ts +501 -0
  35. package/vitest.config.ts +47 -0
  36. package/.turbo/turbo-build.log +0 -5
  37. package/dist/business.d.ts +0 -62
  38. package/dist/business.d.ts.map +0 -1
  39. package/dist/business.js +0 -109
  40. package/dist/business.js.map +0 -1
  41. package/dist/dollar.d.ts +0 -60
  42. package/dist/dollar.d.ts.map +0 -1
  43. package/dist/dollar.js +0 -107
  44. package/dist/dollar.js.map +0 -1
  45. package/dist/entities/assets.d.ts +0 -21
  46. package/dist/entities/assets.d.ts.map +0 -1
  47. package/dist/entities/assets.js +0 -323
  48. package/dist/entities/assets.js.map +0 -1
  49. package/dist/entities/business.d.ts +0 -36
  50. package/dist/entities/business.d.ts.map +0 -1
  51. package/dist/entities/business.js +0 -370
  52. package/dist/entities/business.js.map +0 -1
  53. package/dist/entities/communication.d.ts +0 -21
  54. package/dist/entities/communication.d.ts.map +0 -1
  55. package/dist/entities/communication.js +0 -255
  56. package/dist/entities/communication.js.map +0 -1
  57. package/dist/entities/customers.d.ts +0 -58
  58. package/dist/entities/customers.d.ts.map +0 -1
  59. package/dist/entities/customers.js +0 -989
  60. package/dist/entities/customers.js.map +0 -1
  61. package/dist/entities/financials.d.ts +0 -59
  62. package/dist/entities/financials.d.ts.map +0 -1
  63. package/dist/entities/financials.js +0 -932
  64. package/dist/entities/financials.js.map +0 -1
  65. package/dist/entities/goals.d.ts +0 -58
  66. package/dist/entities/goals.d.ts.map +0 -1
  67. package/dist/entities/goals.js +0 -800
  68. package/dist/entities/goals.js.map +0 -1
  69. package/dist/entities/index.d.ts +0 -299
  70. package/dist/entities/index.d.ts.map +0 -1
  71. package/dist/entities/index.js +0 -198
  72. package/dist/entities/index.js.map +0 -1
  73. package/dist/entities/legal.d.ts +0 -21
  74. package/dist/entities/legal.d.ts.map +0 -1
  75. package/dist/entities/legal.js +0 -301
  76. package/dist/entities/legal.js.map +0 -1
  77. package/dist/entities/market.d.ts +0 -21
  78. package/dist/entities/market.d.ts.map +0 -1
  79. package/dist/entities/market.js +0 -301
  80. package/dist/entities/market.js.map +0 -1
  81. package/dist/entities/marketing.d.ts +0 -67
  82. package/dist/entities/marketing.d.ts.map +0 -1
  83. package/dist/entities/marketing.js +0 -1157
  84. package/dist/entities/marketing.js.map +0 -1
  85. package/dist/entities/offerings.d.ts +0 -51
  86. package/dist/entities/offerings.d.ts.map +0 -1
  87. package/dist/entities/offerings.js +0 -727
  88. package/dist/entities/offerings.js.map +0 -1
  89. package/dist/entities/operations.d.ts +0 -58
  90. package/dist/entities/operations.d.ts.map +0 -1
  91. package/dist/entities/operations.js +0 -787
  92. package/dist/entities/operations.js.map +0 -1
  93. package/dist/entities/organization.d.ts +0 -57
  94. package/dist/entities/organization.d.ts.map +0 -1
  95. package/dist/entities/organization.js +0 -807
  96. package/dist/entities/organization.js.map +0 -1
  97. package/dist/entities/partnerships.d.ts +0 -21
  98. package/dist/entities/partnerships.d.ts.map +0 -1
  99. package/dist/entities/partnerships.js +0 -300
  100. package/dist/entities/partnerships.js.map +0 -1
  101. package/dist/entities/planning.d.ts +0 -87
  102. package/dist/entities/planning.d.ts.map +0 -1
  103. package/dist/entities/planning.js +0 -271
  104. package/dist/entities/planning.js.map +0 -1
  105. package/dist/entities/projects.d.ts +0 -25
  106. package/dist/entities/projects.d.ts.map +0 -1
  107. package/dist/entities/projects.js +0 -349
  108. package/dist/entities/projects.js.map +0 -1
  109. package/dist/entities/risk.d.ts +0 -21
  110. package/dist/entities/risk.d.ts.map +0 -1
  111. package/dist/entities/risk.js +0 -293
  112. package/dist/entities/risk.js.map +0 -1
  113. package/dist/entities/sales.d.ts +0 -72
  114. package/dist/entities/sales.d.ts.map +0 -1
  115. package/dist/entities/sales.js +0 -1248
  116. package/dist/entities/sales.js.map +0 -1
  117. package/dist/financials.d.ts +0 -130
  118. package/dist/financials.d.ts.map +0 -1
  119. package/dist/financials.js +0 -297
  120. package/dist/financials.js.map +0 -1
  121. package/dist/goals.d.ts +0 -87
  122. package/dist/goals.d.ts.map +0 -1
  123. package/dist/goals.js +0 -215
  124. package/dist/goals.js.map +0 -1
  125. package/dist/index.d.ts +0 -97
  126. package/dist/index.d.ts.map +0 -1
  127. package/dist/index.js +0 -132
  128. package/dist/index.js.map +0 -1
  129. package/dist/kpis.d.ts +0 -118
  130. package/dist/kpis.d.ts.map +0 -1
  131. package/dist/kpis.js +0 -232
  132. package/dist/kpis.js.map +0 -1
  133. package/dist/metrics.d.ts +0 -448
  134. package/dist/metrics.d.ts.map +0 -1
  135. package/dist/metrics.js +0 -325
  136. package/dist/metrics.js.map +0 -1
  137. package/dist/okrs.d.ts +0 -123
  138. package/dist/okrs.d.ts.map +0 -1
  139. package/dist/okrs.js +0 -269
  140. package/dist/okrs.js.map +0 -1
  141. package/dist/organization.d.ts +0 -585
  142. package/dist/organization.d.ts.map +0 -1
  143. package/dist/organization.js +0 -173
  144. package/dist/organization.js.map +0 -1
  145. package/dist/process.d.ts +0 -112
  146. package/dist/process.d.ts.map +0 -1
  147. package/dist/process.js +0 -241
  148. package/dist/process.js.map +0 -1
  149. package/dist/product.d.ts +0 -85
  150. package/dist/product.d.ts.map +0 -1
  151. package/dist/product.js +0 -145
  152. package/dist/product.js.map +0 -1
  153. package/dist/queries.d.ts +0 -304
  154. package/dist/queries.d.ts.map +0 -1
  155. package/dist/queries.js +0 -415
  156. package/dist/queries.js.map +0 -1
  157. package/dist/roles.d.ts +0 -340
  158. package/dist/roles.d.ts.map +0 -1
  159. package/dist/roles.js +0 -255
  160. package/dist/roles.js.map +0 -1
  161. package/dist/service.d.ts +0 -61
  162. package/dist/service.d.ts.map +0 -1
  163. package/dist/service.js +0 -140
  164. package/dist/service.js.map +0 -1
  165. package/dist/types.d.ts +0 -459
  166. package/dist/types.d.ts.map +0 -1
  167. package/dist/types.js +0 -5
  168. package/dist/types.js.map +0 -1
  169. package/dist/vision.d.ts +0 -38
  170. package/dist/vision.d.ts.map +0 -1
  171. package/dist/vision.js +0 -68
  172. package/dist/vision.js.map +0 -1
  173. package/dist/workflow.d.ts +0 -115
  174. package/dist/workflow.d.ts.map +0 -1
  175. package/dist/workflow.js +0 -247
  176. package/dist/workflow.js.map +0 -1
  177. package/src/business.js +0 -108
  178. package/src/dollar.js +0 -106
  179. package/src/entities/assets.js +0 -322
  180. package/src/entities/business.js +0 -369
  181. package/src/entities/communication.js +0 -254
  182. package/src/entities/customers.js +0 -988
  183. package/src/entities/financials.js +0 -931
  184. package/src/entities/goals.js +0 -799
  185. package/src/entities/index.js +0 -197
  186. package/src/entities/legal.js +0 -300
  187. package/src/entities/market.js +0 -300
  188. package/src/entities/marketing.js +0 -1156
  189. package/src/entities/offerings.js +0 -726
  190. package/src/entities/operations.js +0 -786
  191. package/src/entities/organization.js +0 -806
  192. package/src/entities/partnerships.js +0 -299
  193. package/src/entities/planning.js +0 -270
  194. package/src/entities/projects.js +0 -348
  195. package/src/entities/risk.js +0 -292
  196. package/src/entities/sales.js +0 -1247
  197. package/src/financials.js +0 -296
  198. package/src/goals.js +0 -214
  199. package/src/index.js +0 -131
  200. package/src/index.test.js +0 -274
  201. package/src/kpis.js +0 -231
  202. package/src/metrics.js +0 -324
  203. package/src/okrs.js +0 -268
  204. package/src/organization.js +0 -172
  205. package/src/process.js +0 -240
  206. package/src/product.js +0 -144
  207. package/src/queries.js +0 -414
  208. package/src/roles.js +0 -254
  209. package/src/service.js +0 -139
  210. package/src/types.js +0 -4
  211. package/src/vision.js +0 -67
  212. package/src/workflow.js +0 -246
@@ -1,800 +0,0 @@
1
- /**
2
- * Goal Entity Types (Nouns)
3
- *
4
- * Goal tracking entities: Goal, OKR, KPI, Metric.
5
- *
6
- * @packageDocumentation
7
- */
8
- // =============================================================================
9
- // Goal
10
- // =============================================================================
11
- /**
12
- * Goal entity
13
- *
14
- * Represents a strategic or operational goal.
15
- */
16
- export const Goal = {
17
- singular: 'goal',
18
- plural: 'goals',
19
- description: 'A strategic or operational goal',
20
- properties: {
21
- // Identity
22
- name: {
23
- type: 'string',
24
- description: 'Goal name/title',
25
- },
26
- description: {
27
- type: 'string',
28
- optional: true,
29
- description: 'Goal description',
30
- },
31
- // Classification
32
- type: {
33
- type: 'string',
34
- optional: true,
35
- description: 'Goal type',
36
- examples: ['strategic', 'operational', 'tactical'],
37
- },
38
- category: {
39
- type: 'string',
40
- optional: true,
41
- description: 'Goal category',
42
- examples: ['growth', 'revenue', 'customer', 'product', 'operations', 'people', 'financial'],
43
- },
44
- priority: {
45
- type: 'string',
46
- optional: true,
47
- description: 'Priority level',
48
- examples: ['critical', 'high', 'medium', 'low'],
49
- },
50
- // Timeline
51
- startDate: {
52
- type: 'date',
53
- optional: true,
54
- description: 'Start date',
55
- },
56
- targetDate: {
57
- type: 'date',
58
- optional: true,
59
- description: 'Target completion date',
60
- },
61
- completedAt: {
62
- type: 'datetime',
63
- optional: true,
64
- description: 'Actual completion time',
65
- },
66
- // Progress
67
- progress: {
68
- type: 'number',
69
- optional: true,
70
- description: 'Progress percentage (0-100)',
71
- },
72
- confidence: {
73
- type: 'number',
74
- optional: true,
75
- description: 'Confidence level (0-100)',
76
- },
77
- // Success Criteria
78
- successMetrics: {
79
- type: 'string',
80
- array: true,
81
- optional: true,
82
- description: 'Success metrics',
83
- },
84
- targetValue: {
85
- type: 'number',
86
- optional: true,
87
- description: 'Target value for primary metric',
88
- },
89
- currentValue: {
90
- type: 'number',
91
- optional: true,
92
- description: 'Current value for primary metric',
93
- },
94
- unit: {
95
- type: 'string',
96
- optional: true,
97
- description: 'Metric unit',
98
- },
99
- // Status
100
- status: {
101
- type: 'string',
102
- description: 'Goal status',
103
- examples: ['draft', 'active', 'on-track', 'at-risk', 'behind', 'completed', 'cancelled'],
104
- },
105
- },
106
- relationships: {
107
- owner: {
108
- type: 'Worker',
109
- required: false,
110
- description: 'Goal owner',
111
- },
112
- team: {
113
- type: 'Team',
114
- required: false,
115
- description: 'Responsible team',
116
- },
117
- department: {
118
- type: 'Department',
119
- required: false,
120
- description: 'Responsible department',
121
- },
122
- parent: {
123
- type: 'Goal',
124
- required: false,
125
- description: 'Parent goal',
126
- },
127
- children: {
128
- type: 'Goal[]',
129
- description: 'Sub-goals',
130
- },
131
- dependencies: {
132
- type: 'Goal[]',
133
- description: 'Goals this depends on',
134
- },
135
- kpis: {
136
- type: 'KPI[]',
137
- description: 'Related KPIs',
138
- },
139
- },
140
- actions: [
141
- 'create',
142
- 'update',
143
- 'activate',
144
- 'updateProgress',
145
- 'markAtRisk',
146
- 'complete',
147
- 'cancel',
148
- 'extend',
149
- 'archive',
150
- ],
151
- events: [
152
- 'created',
153
- 'updated',
154
- 'activated',
155
- 'progressUpdated',
156
- 'markedAtRisk',
157
- 'completed',
158
- 'cancelled',
159
- 'extended',
160
- 'overdue',
161
- 'archived',
162
- ],
163
- };
164
- // =============================================================================
165
- // OKR (Objective and Key Results)
166
- // =============================================================================
167
- /**
168
- * OKR entity
169
- *
170
- * Represents an objective with measurable key results.
171
- */
172
- export const OKR = {
173
- singular: 'okr',
174
- plural: 'okrs',
175
- description: 'An objective with measurable key results',
176
- properties: {
177
- // Objective
178
- objective: {
179
- type: 'string',
180
- description: 'Objective statement',
181
- },
182
- description: {
183
- type: 'string',
184
- optional: true,
185
- description: 'Objective description',
186
- },
187
- // Classification
188
- type: {
189
- type: 'string',
190
- optional: true,
191
- description: 'OKR type',
192
- examples: ['company', 'department', 'team', 'individual'],
193
- },
194
- category: {
195
- type: 'string',
196
- optional: true,
197
- description: 'OKR category',
198
- examples: ['growth', 'product', 'customer', 'operations', 'people'],
199
- },
200
- // Period
201
- period: {
202
- type: 'string',
203
- optional: true,
204
- description: 'OKR period (e.g., "Q1 2025", "H1 2025")',
205
- },
206
- startDate: {
207
- type: 'date',
208
- optional: true,
209
- description: 'Period start date',
210
- },
211
- endDate: {
212
- type: 'date',
213
- optional: true,
214
- description: 'Period end date',
215
- },
216
- // Progress
217
- progress: {
218
- type: 'number',
219
- optional: true,
220
- description: 'Overall progress (0-100)',
221
- },
222
- confidence: {
223
- type: 'number',
224
- optional: true,
225
- description: 'Confidence level (0-1)',
226
- },
227
- grade: {
228
- type: 'number',
229
- optional: true,
230
- description: 'Final grade (0-1)',
231
- },
232
- // Key Results count
233
- keyResultCount: {
234
- type: 'number',
235
- optional: true,
236
- description: 'Number of key results',
237
- },
238
- completedKeyResultCount: {
239
- type: 'number',
240
- optional: true,
241
- description: 'Completed key results',
242
- },
243
- // Status
244
- status: {
245
- type: 'string',
246
- description: 'OKR status',
247
- examples: ['draft', 'active', 'on-track', 'at-risk', 'behind', 'completed', 'cancelled'],
248
- },
249
- },
250
- relationships: {
251
- owner: {
252
- type: 'Worker',
253
- required: false,
254
- description: 'OKR owner',
255
- },
256
- team: {
257
- type: 'Team',
258
- required: false,
259
- description: 'Responsible team',
260
- },
261
- department: {
262
- type: 'Department',
263
- required: false,
264
- description: 'Responsible department',
265
- },
266
- parent: {
267
- type: 'OKR',
268
- required: false,
269
- description: 'Parent OKR (alignment)',
270
- },
271
- children: {
272
- type: 'OKR[]',
273
- description: 'Aligned child OKRs',
274
- },
275
- keyResults: {
276
- type: 'KeyResult[]',
277
- description: 'Key results',
278
- },
279
- },
280
- actions: [
281
- 'create',
282
- 'update',
283
- 'activate',
284
- 'addKeyResult',
285
- 'removeKeyResult',
286
- 'updateProgress',
287
- 'updateConfidence',
288
- 'grade',
289
- 'complete',
290
- 'cancel',
291
- 'archive',
292
- ],
293
- events: [
294
- 'created',
295
- 'updated',
296
- 'activated',
297
- 'keyResultAdded',
298
- 'keyResultRemoved',
299
- 'progressUpdated',
300
- 'confidenceUpdated',
301
- 'graded',
302
- 'completed',
303
- 'cancelled',
304
- 'archived',
305
- ],
306
- };
307
- // =============================================================================
308
- // KeyResult
309
- // =============================================================================
310
- /**
311
- * KeyResult entity
312
- *
313
- * Represents a measurable key result within an OKR.
314
- */
315
- export const KeyResult = {
316
- singular: 'key-result',
317
- plural: 'key-results',
318
- description: 'A measurable key result within an OKR',
319
- properties: {
320
- // Description
321
- description: {
322
- type: 'string',
323
- description: 'Key result description',
324
- },
325
- // Metric
326
- metric: {
327
- type: 'string',
328
- description: 'Metric being measured',
329
- },
330
- unit: {
331
- type: 'string',
332
- optional: true,
333
- description: 'Unit of measurement',
334
- },
335
- // Values
336
- startValue: {
337
- type: 'number',
338
- optional: true,
339
- description: 'Starting value',
340
- },
341
- targetValue: {
342
- type: 'number',
343
- description: 'Target value',
344
- },
345
- currentValue: {
346
- type: 'number',
347
- optional: true,
348
- description: 'Current value',
349
- },
350
- // Progress
351
- progress: {
352
- type: 'number',
353
- optional: true,
354
- description: 'Progress percentage (0-100)',
355
- },
356
- confidence: {
357
- type: 'number',
358
- optional: true,
359
- description: 'Confidence level (0-1)',
360
- },
361
- // Type
362
- direction: {
363
- type: 'string',
364
- optional: true,
365
- description: 'Direction of improvement',
366
- examples: ['increase', 'decrease', 'maintain'],
367
- },
368
- measurementType: {
369
- type: 'string',
370
- optional: true,
371
- description: 'How progress is measured',
372
- examples: ['percentage', 'absolute', 'binary', 'milestone'],
373
- },
374
- // Status
375
- status: {
376
- type: 'string',
377
- description: 'Key result status',
378
- examples: ['not-started', 'on-track', 'at-risk', 'behind', 'completed'],
379
- },
380
- },
381
- relationships: {
382
- okr: {
383
- type: 'OKR',
384
- description: 'Parent OKR',
385
- },
386
- owner: {
387
- type: 'Worker',
388
- required: false,
389
- description: 'Key result owner',
390
- },
391
- initiatives: {
392
- type: 'Initiative[]',
393
- description: 'Supporting initiatives',
394
- },
395
- },
396
- actions: [
397
- 'create',
398
- 'update',
399
- 'updateValue',
400
- 'updateConfidence',
401
- 'complete',
402
- 'delete',
403
- ],
404
- events: [
405
- 'created',
406
- 'updated',
407
- 'valueUpdated',
408
- 'confidenceUpdated',
409
- 'completed',
410
- 'deleted',
411
- ],
412
- };
413
- // =============================================================================
414
- // KPI (Key Performance Indicator)
415
- // =============================================================================
416
- /**
417
- * KPI entity
418
- *
419
- * Represents a key performance indicator.
420
- */
421
- export const KPI = {
422
- singular: 'kpi',
423
- plural: 'kpis',
424
- description: 'A key performance indicator',
425
- properties: {
426
- // Identity
427
- name: {
428
- type: 'string',
429
- description: 'KPI name',
430
- },
431
- description: {
432
- type: 'string',
433
- optional: true,
434
- description: 'KPI description',
435
- },
436
- code: {
437
- type: 'string',
438
- optional: true,
439
- description: 'KPI code (e.g., "MRR", "NPS")',
440
- },
441
- // Classification
442
- category: {
443
- type: 'string',
444
- optional: true,
445
- description: 'KPI category',
446
- examples: ['financial', 'customer', 'operations', 'people', 'product', 'growth'],
447
- },
448
- type: {
449
- type: 'string',
450
- optional: true,
451
- description: 'KPI type',
452
- examples: ['leading', 'lagging'],
453
- },
454
- // Measurement
455
- unit: {
456
- type: 'string',
457
- optional: true,
458
- description: 'Unit of measurement',
459
- },
460
- format: {
461
- type: 'string',
462
- optional: true,
463
- description: 'Display format',
464
- examples: ['number', 'currency', 'percentage', 'duration'],
465
- },
466
- precision: {
467
- type: 'number',
468
- optional: true,
469
- description: 'Decimal precision',
470
- },
471
- // Values
472
- targetValue: {
473
- type: 'number',
474
- optional: true,
475
- description: 'Target value',
476
- },
477
- currentValue: {
478
- type: 'number',
479
- optional: true,
480
- description: 'Current value',
481
- },
482
- previousValue: {
483
- type: 'number',
484
- optional: true,
485
- description: 'Previous period value',
486
- },
487
- baselineValue: {
488
- type: 'number',
489
- optional: true,
490
- description: 'Baseline value',
491
- },
492
- // Thresholds
493
- warningThreshold: {
494
- type: 'number',
495
- optional: true,
496
- description: 'Warning threshold',
497
- },
498
- criticalThreshold: {
499
- type: 'number',
500
- optional: true,
501
- description: 'Critical threshold',
502
- },
503
- direction: {
504
- type: 'string',
505
- optional: true,
506
- description: 'Good direction',
507
- examples: ['higher-is-better', 'lower-is-better', 'target'],
508
- },
509
- // Tracking
510
- frequency: {
511
- type: 'string',
512
- optional: true,
513
- description: 'Measurement frequency',
514
- examples: ['realtime', 'hourly', 'daily', 'weekly', 'monthly', 'quarterly'],
515
- },
516
- lastMeasuredAt: {
517
- type: 'datetime',
518
- optional: true,
519
- description: 'Last measurement time',
520
- },
521
- // Calculation
522
- formula: {
523
- type: 'string',
524
- optional: true,
525
- description: 'Calculation formula',
526
- },
527
- dataSource: {
528
- type: 'string',
529
- optional: true,
530
- description: 'Data source',
531
- },
532
- // Status
533
- status: {
534
- type: 'string',
535
- optional: true,
536
- description: 'KPI status',
537
- examples: ['on-target', 'warning', 'critical', 'no-data'],
538
- },
539
- },
540
- relationships: {
541
- owner: {
542
- type: 'Worker',
543
- required: false,
544
- description: 'KPI owner',
545
- },
546
- department: {
547
- type: 'Department',
548
- required: false,
549
- description: 'Responsible department',
550
- },
551
- goals: {
552
- type: 'Goal[]',
553
- description: 'Related goals',
554
- },
555
- dashboard: {
556
- type: 'Dashboard',
557
- required: false,
558
- description: 'Display dashboard',
559
- },
560
- history: {
561
- type: 'KPIValue[]',
562
- description: 'Historical values',
563
- },
564
- },
565
- actions: [
566
- 'create',
567
- 'update',
568
- 'measure',
569
- 'setTarget',
570
- 'setThresholds',
571
- 'alert',
572
- 'archive',
573
- ],
574
- events: [
575
- 'created',
576
- 'updated',
577
- 'measured',
578
- 'targetSet',
579
- 'thresholdBreached',
580
- 'targetMet',
581
- 'alerted',
582
- 'archived',
583
- ],
584
- };
585
- // =============================================================================
586
- // Metric
587
- // =============================================================================
588
- /**
589
- * Metric entity
590
- *
591
- * Represents a general business metric or measurement.
592
- */
593
- export const Metric = {
594
- singular: 'metric',
595
- plural: 'metrics',
596
- description: 'A general business metric or measurement',
597
- properties: {
598
- // Identity
599
- name: {
600
- type: 'string',
601
- description: 'Metric name',
602
- },
603
- description: {
604
- type: 'string',
605
- optional: true,
606
- description: 'Metric description',
607
- },
608
- // Classification
609
- category: {
610
- type: 'string',
611
- optional: true,
612
- description: 'Metric category',
613
- },
614
- tags: {
615
- type: 'string',
616
- array: true,
617
- optional: true,
618
- description: 'Tags',
619
- },
620
- // Value
621
- value: {
622
- type: 'number',
623
- description: 'Current value',
624
- },
625
- unit: {
626
- type: 'string',
627
- optional: true,
628
- description: 'Unit of measurement',
629
- },
630
- // Timestamp
631
- timestamp: {
632
- type: 'datetime',
633
- description: 'Measurement timestamp',
634
- },
635
- period: {
636
- type: 'string',
637
- optional: true,
638
- description: 'Measurement period',
639
- },
640
- // Source
641
- source: {
642
- type: 'string',
643
- optional: true,
644
- description: 'Data source',
645
- },
646
- },
647
- relationships: {
648
- kpi: {
649
- type: 'KPI',
650
- required: false,
651
- description: 'Related KPI',
652
- },
653
- },
654
- actions: [
655
- 'record',
656
- 'update',
657
- 'delete',
658
- ],
659
- events: [
660
- 'recorded',
661
- 'updated',
662
- 'deleted',
663
- ],
664
- };
665
- // =============================================================================
666
- // Initiative
667
- // =============================================================================
668
- /**
669
- * Initiative entity
670
- *
671
- * Represents a strategic initiative or project supporting goals.
672
- */
673
- export const Initiative = {
674
- singular: 'initiative',
675
- plural: 'initiatives',
676
- description: 'A strategic initiative or project supporting goals',
677
- properties: {
678
- // Identity
679
- name: {
680
- type: 'string',
681
- description: 'Initiative name',
682
- },
683
- description: {
684
- type: 'string',
685
- optional: true,
686
- description: 'Initiative description',
687
- },
688
- // Classification
689
- type: {
690
- type: 'string',
691
- optional: true,
692
- description: 'Initiative type',
693
- examples: ['project', 'program', 'experiment', 'improvement'],
694
- },
695
- priority: {
696
- type: 'string',
697
- optional: true,
698
- description: 'Priority level',
699
- examples: ['critical', 'high', 'medium', 'low'],
700
- },
701
- // Timeline
702
- startDate: {
703
- type: 'date',
704
- optional: true,
705
- description: 'Start date',
706
- },
707
- endDate: {
708
- type: 'date',
709
- optional: true,
710
- description: 'End date',
711
- },
712
- // Progress
713
- progress: {
714
- type: 'number',
715
- optional: true,
716
- description: 'Progress percentage (0-100)',
717
- },
718
- // Resources
719
- budget: {
720
- type: 'number',
721
- optional: true,
722
- description: 'Allocated budget',
723
- },
724
- budgetCurrency: {
725
- type: 'string',
726
- optional: true,
727
- description: 'Budget currency',
728
- },
729
- spent: {
730
- type: 'number',
731
- optional: true,
732
- description: 'Amount spent',
733
- },
734
- // Status
735
- status: {
736
- type: 'string',
737
- description: 'Initiative status',
738
- examples: ['proposed', 'approved', 'in-progress', 'on-hold', 'completed', 'cancelled'],
739
- },
740
- },
741
- relationships: {
742
- owner: {
743
- type: 'Worker',
744
- required: false,
745
- description: 'Initiative owner',
746
- },
747
- team: {
748
- type: 'Team',
749
- required: false,
750
- description: 'Responsible team',
751
- },
752
- goals: {
753
- type: 'Goal[]',
754
- description: 'Supported goals',
755
- },
756
- keyResults: {
757
- type: 'KeyResult[]',
758
- description: 'Supported key results',
759
- },
760
- },
761
- actions: [
762
- 'create',
763
- 'update',
764
- 'approve',
765
- 'start',
766
- 'pause',
767
- 'resume',
768
- 'complete',
769
- 'cancel',
770
- 'archive',
771
- ],
772
- events: [
773
- 'created',
774
- 'updated',
775
- 'approved',
776
- 'started',
777
- 'paused',
778
- 'resumed',
779
- 'completed',
780
- 'cancelled',
781
- 'archived',
782
- ],
783
- };
784
- // =============================================================================
785
- // Exports
786
- // =============================================================================
787
- export const GoalEntities = {
788
- Goal,
789
- OKR,
790
- KeyResult,
791
- KPI,
792
- Metric,
793
- Initiative,
794
- };
795
- export const GoalCategories = {
796
- objectives: ['Goal', 'OKR', 'KeyResult'],
797
- measurement: ['KPI', 'Metric'],
798
- execution: ['Initiative'],
799
- };
800
- //# sourceMappingURL=goals.js.map