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,807 +0,0 @@
1
- /**
2
- * Organization Entity Types (Nouns)
3
- *
4
- * Organizational hierarchy: Organization, Department, Team, Position, Role.
5
- *
6
- * @packageDocumentation
7
- */
8
- // =============================================================================
9
- // Organization
10
- // =============================================================================
11
- /**
12
- * Organization entity
13
- *
14
- * Represents the top-level organizational structure.
15
- */
16
- export const Organization = {
17
- singular: 'organization',
18
- plural: 'organizations',
19
- description: 'The top-level organizational structure',
20
- properties: {
21
- // Identity
22
- name: {
23
- type: 'string',
24
- description: 'Organization name',
25
- },
26
- description: {
27
- type: 'string',
28
- optional: true,
29
- description: 'Organization description',
30
- },
31
- // Type
32
- type: {
33
- type: 'string',
34
- optional: true,
35
- description: 'Organization type',
36
- examples: ['functional', 'divisional', 'matrix', 'flat', 'holacracy'],
37
- },
38
- // Settings
39
- fiscalYearStart: {
40
- type: 'string',
41
- optional: true,
42
- description: 'Fiscal year start month (e.g., "January", "April")',
43
- },
44
- defaultCurrency: {
45
- type: 'string',
46
- optional: true,
47
- description: 'Default currency code',
48
- examples: ['USD', 'EUR', 'GBP'],
49
- },
50
- defaultTimezone: {
51
- type: 'string',
52
- optional: true,
53
- description: 'Default timezone',
54
- },
55
- // Size
56
- departmentCount: {
57
- type: 'number',
58
- optional: true,
59
- description: 'Number of departments',
60
- },
61
- teamCount: {
62
- type: 'number',
63
- optional: true,
64
- description: 'Number of teams',
65
- },
66
- positionCount: {
67
- type: 'number',
68
- optional: true,
69
- description: 'Number of positions',
70
- },
71
- // Status
72
- status: {
73
- type: 'string',
74
- optional: true,
75
- description: 'Organization status',
76
- examples: ['active', 'restructuring', 'archived'],
77
- },
78
- },
79
- relationships: {
80
- business: {
81
- type: 'Business',
82
- description: 'Parent business',
83
- },
84
- departments: {
85
- type: 'Department[]',
86
- description: 'Departments',
87
- },
88
- teams: {
89
- type: 'Team[]',
90
- description: 'All teams',
91
- },
92
- positions: {
93
- type: 'Position[]',
94
- description: 'All positions',
95
- },
96
- roles: {
97
- type: 'Role[]',
98
- description: 'Defined roles',
99
- },
100
- },
101
- actions: [
102
- 'create',
103
- 'update',
104
- 'restructure',
105
- 'merge',
106
- 'split',
107
- 'archive',
108
- ],
109
- events: [
110
- 'created',
111
- 'updated',
112
- 'restructured',
113
- 'merged',
114
- 'split',
115
- 'archived',
116
- ],
117
- };
118
- // =============================================================================
119
- // Department
120
- // =============================================================================
121
- /**
122
- * Department entity
123
- *
124
- * Represents a functional department or division.
125
- */
126
- export const Department = {
127
- singular: 'department',
128
- plural: 'departments',
129
- description: 'A functional department or division',
130
- properties: {
131
- // Identity
132
- name: {
133
- type: 'string',
134
- description: 'Department name',
135
- },
136
- code: {
137
- type: 'string',
138
- optional: true,
139
- description: 'Department code (e.g., "ENG", "MKT")',
140
- },
141
- description: {
142
- type: 'string',
143
- optional: true,
144
- description: 'Department description',
145
- },
146
- // Type
147
- type: {
148
- type: 'string',
149
- optional: true,
150
- description: 'Department type',
151
- examples: ['engineering', 'product', 'design', 'marketing', 'sales', 'operations', 'finance', 'hr', 'legal', 'support'],
152
- },
153
- // Budget
154
- budget: {
155
- type: 'number',
156
- optional: true,
157
- description: 'Annual budget',
158
- },
159
- budgetCurrency: {
160
- type: 'string',
161
- optional: true,
162
- description: 'Budget currency',
163
- },
164
- budgetPeriod: {
165
- type: 'string',
166
- optional: true,
167
- description: 'Budget period',
168
- examples: ['monthly', 'quarterly', 'yearly'],
169
- },
170
- // Size
171
- headcount: {
172
- type: 'number',
173
- optional: true,
174
- description: 'Number of employees',
175
- },
176
- teamCount: {
177
- type: 'number',
178
- optional: true,
179
- description: 'Number of teams',
180
- },
181
- // Hierarchy
182
- level: {
183
- type: 'number',
184
- optional: true,
185
- description: 'Organizational level (1 = top)',
186
- },
187
- // Status
188
- status: {
189
- type: 'string',
190
- optional: true,
191
- description: 'Department status',
192
- examples: ['active', 'forming', 'restructuring', 'dissolved'],
193
- },
194
- },
195
- relationships: {
196
- organization: {
197
- type: 'Organization',
198
- description: 'Parent organization',
199
- },
200
- parent: {
201
- type: 'Department',
202
- required: false,
203
- description: 'Parent department (for sub-departments)',
204
- },
205
- children: {
206
- type: 'Department[]',
207
- description: 'Sub-departments',
208
- },
209
- head: {
210
- type: 'Position',
211
- required: false,
212
- description: 'Department head position',
213
- },
214
- teams: {
215
- type: 'Team[]',
216
- description: 'Teams in this department',
217
- },
218
- goals: {
219
- type: 'Goal[]',
220
- description: 'Department goals',
221
- },
222
- budgets: {
223
- type: 'Budget[]',
224
- description: 'Budget allocations',
225
- },
226
- },
227
- actions: [
228
- 'create',
229
- 'update',
230
- 'rename',
231
- 'setBudget',
232
- 'addTeam',
233
- 'removeTeam',
234
- 'setHead',
235
- 'merge',
236
- 'split',
237
- 'dissolve',
238
- 'archive',
239
- ],
240
- events: [
241
- 'created',
242
- 'updated',
243
- 'renamed',
244
- 'budgetSet',
245
- 'teamAdded',
246
- 'teamRemoved',
247
- 'headChanged',
248
- 'merged',
249
- 'split',
250
- 'dissolved',
251
- 'archived',
252
- ],
253
- };
254
- // =============================================================================
255
- // Team
256
- // =============================================================================
257
- /**
258
- * Team entity
259
- *
260
- * Represents a working team within a department.
261
- */
262
- export const Team = {
263
- singular: 'team',
264
- plural: 'teams',
265
- description: 'A working team within a department',
266
- properties: {
267
- // Identity
268
- name: {
269
- type: 'string',
270
- description: 'Team name',
271
- },
272
- code: {
273
- type: 'string',
274
- optional: true,
275
- description: 'Team code',
276
- },
277
- description: {
278
- type: 'string',
279
- optional: true,
280
- description: 'Team description',
281
- },
282
- // Type
283
- type: {
284
- type: 'string',
285
- optional: true,
286
- description: 'Team type',
287
- examples: ['product', 'platform', 'growth', 'infrastructure', 'support', 'project', 'tiger'],
288
- },
289
- methodology: {
290
- type: 'string',
291
- optional: true,
292
- description: 'Working methodology',
293
- examples: ['scrum', 'kanban', 'scrumban', 'waterfall', 'hybrid'],
294
- },
295
- // Size
296
- capacity: {
297
- type: 'number',
298
- optional: true,
299
- description: 'Team capacity (FTE)',
300
- },
301
- headcount: {
302
- type: 'number',
303
- optional: true,
304
- description: 'Number of members',
305
- },
306
- // Communication
307
- slackChannel: {
308
- type: 'string',
309
- optional: true,
310
- description: 'Slack channel',
311
- },
312
- email: {
313
- type: 'string',
314
- optional: true,
315
- description: 'Team email',
316
- },
317
- // Status
318
- status: {
319
- type: 'string',
320
- optional: true,
321
- description: 'Team status',
322
- examples: ['active', 'forming', 'storming', 'norming', 'performing', 'adjourning'],
323
- },
324
- },
325
- relationships: {
326
- department: {
327
- type: 'Department',
328
- description: 'Parent department',
329
- },
330
- lead: {
331
- type: 'Position',
332
- required: false,
333
- description: 'Team lead position',
334
- },
335
- positions: {
336
- type: 'Position[]',
337
- description: 'Team positions',
338
- },
339
- projects: {
340
- type: 'Project[]',
341
- description: 'Active projects',
342
- },
343
- workflows: {
344
- type: 'Workflow[]',
345
- description: 'Team workflows',
346
- },
347
- },
348
- actions: [
349
- 'create',
350
- 'update',
351
- 'rename',
352
- 'setLead',
353
- 'addMember',
354
- 'removeMember',
355
- 'setCapacity',
356
- 'assignProject',
357
- 'unassignProject',
358
- 'archive',
359
- ],
360
- events: [
361
- 'created',
362
- 'updated',
363
- 'renamed',
364
- 'leadChanged',
365
- 'memberAdded',
366
- 'memberRemoved',
367
- 'capacityChanged',
368
- 'projectAssigned',
369
- 'projectUnassigned',
370
- 'archived',
371
- ],
372
- };
373
- // =============================================================================
374
- // Position
375
- // =============================================================================
376
- /**
377
- * Position entity
378
- *
379
- * Represents a position/job within the organization.
380
- */
381
- export const Position = {
382
- singular: 'position',
383
- plural: 'positions',
384
- description: 'A position or job within the organization',
385
- properties: {
386
- // Identity
387
- title: {
388
- type: 'string',
389
- description: 'Position title',
390
- },
391
- code: {
392
- type: 'string',
393
- optional: true,
394
- description: 'Position code',
395
- },
396
- description: {
397
- type: 'string',
398
- optional: true,
399
- description: 'Position description',
400
- },
401
- // Classification
402
- level: {
403
- type: 'string',
404
- optional: true,
405
- description: 'Job level',
406
- examples: ['intern', 'junior', 'mid', 'senior', 'staff', 'principal', 'director', 'vp', 'c-level'],
407
- },
408
- track: {
409
- type: 'string',
410
- optional: true,
411
- description: 'Career track',
412
- examples: ['individual-contributor', 'management', 'executive'],
413
- },
414
- grade: {
415
- type: 'string',
416
- optional: true,
417
- description: 'Pay grade',
418
- },
419
- // Type
420
- employmentType: {
421
- type: 'string',
422
- optional: true,
423
- description: 'Employment type',
424
- examples: ['full-time', 'part-time', 'contract', 'intern', 'advisor'],
425
- },
426
- workLocation: {
427
- type: 'string',
428
- optional: true,
429
- description: 'Work location type',
430
- examples: ['remote', 'office', 'hybrid'],
431
- },
432
- // Compensation
433
- salaryMin: {
434
- type: 'number',
435
- optional: true,
436
- description: 'Minimum salary',
437
- },
438
- salaryMax: {
439
- type: 'number',
440
- optional: true,
441
- description: 'Maximum salary',
442
- },
443
- salaryCurrency: {
444
- type: 'string',
445
- optional: true,
446
- description: 'Salary currency',
447
- },
448
- equityMin: {
449
- type: 'number',
450
- optional: true,
451
- description: 'Minimum equity percentage',
452
- },
453
- equityMax: {
454
- type: 'number',
455
- optional: true,
456
- description: 'Maximum equity percentage',
457
- },
458
- // Capacity
459
- fte: {
460
- type: 'number',
461
- optional: true,
462
- description: 'Full-time equivalent (0-1)',
463
- },
464
- // Requirements
465
- requirements: {
466
- type: 'string',
467
- array: true,
468
- optional: true,
469
- description: 'Position requirements',
470
- },
471
- skills: {
472
- type: 'string',
473
- array: true,
474
- optional: true,
475
- description: 'Required skills',
476
- },
477
- // Status
478
- status: {
479
- type: 'string',
480
- optional: true,
481
- description: 'Position status',
482
- examples: ['open', 'filled', 'frozen', 'eliminated'],
483
- },
484
- },
485
- relationships: {
486
- team: {
487
- type: 'Team',
488
- description: 'Parent team',
489
- },
490
- role: {
491
- type: 'Role',
492
- description: 'Assigned role',
493
- },
494
- reportsTo: {
495
- type: 'Position',
496
- required: false,
497
- description: 'Reports to position',
498
- },
499
- directReports: {
500
- type: 'Position[]',
501
- description: 'Direct reports',
502
- },
503
- holder: {
504
- type: 'Worker',
505
- required: false,
506
- description: 'Current position holder',
507
- },
508
- },
509
- actions: [
510
- 'create',
511
- 'update',
512
- 'open',
513
- 'fill',
514
- 'freeze',
515
- 'eliminate',
516
- 'transfer',
517
- 'promote',
518
- 'setCompensation',
519
- 'archive',
520
- ],
521
- events: [
522
- 'created',
523
- 'updated',
524
- 'opened',
525
- 'filled',
526
- 'frozen',
527
- 'eliminated',
528
- 'transferred',
529
- 'promoted',
530
- 'compensationChanged',
531
- 'archived',
532
- ],
533
- };
534
- // =============================================================================
535
- // Role
536
- // =============================================================================
537
- /**
538
- * Role entity
539
- *
540
- * Represents a role with permissions and capabilities.
541
- */
542
- export const Role = {
543
- singular: 'role',
544
- plural: 'roles',
545
- description: 'A role with permissions and capabilities',
546
- properties: {
547
- // Identity
548
- name: {
549
- type: 'string',
550
- description: 'Role name',
551
- },
552
- code: {
553
- type: 'string',
554
- optional: true,
555
- description: 'Role code',
556
- },
557
- description: {
558
- type: 'string',
559
- optional: true,
560
- description: 'Role description',
561
- },
562
- // Type
563
- type: {
564
- type: 'string',
565
- optional: true,
566
- description: 'Role type',
567
- examples: ['executive', 'manager', 'lead', 'contributor', 'specialist', 'support'],
568
- },
569
- // Permissions
570
- permissions: {
571
- type: 'string',
572
- array: true,
573
- optional: true,
574
- description: 'Granted permissions',
575
- },
576
- capabilities: {
577
- type: 'string',
578
- array: true,
579
- optional: true,
580
- description: 'Role capabilities',
581
- },
582
- // Approval
583
- approvalLevel: {
584
- type: 'number',
585
- optional: true,
586
- description: 'Approval authority level',
587
- },
588
- approvalLimit: {
589
- type: 'number',
590
- optional: true,
591
- description: 'Approval spending limit',
592
- },
593
- // Hierarchy
594
- level: {
595
- type: 'number',
596
- optional: true,
597
- description: 'Role hierarchy level',
598
- },
599
- // Status
600
- status: {
601
- type: 'string',
602
- optional: true,
603
- description: 'Role status',
604
- examples: ['active', 'deprecated'],
605
- },
606
- },
607
- relationships: {
608
- organization: {
609
- type: 'Organization',
610
- description: 'Parent organization',
611
- },
612
- parent: {
613
- type: 'Role',
614
- required: false,
615
- description: 'Parent role (inherits permissions)',
616
- },
617
- children: {
618
- type: 'Role[]',
619
- description: 'Child roles',
620
- },
621
- positions: {
622
- type: 'Position[]',
623
- description: 'Positions with this role',
624
- },
625
- },
626
- actions: [
627
- 'create',
628
- 'update',
629
- 'grantPermission',
630
- 'revokePermission',
631
- 'setApprovalLimit',
632
- 'deprecate',
633
- 'archive',
634
- ],
635
- events: [
636
- 'created',
637
- 'updated',
638
- 'permissionGranted',
639
- 'permissionRevoked',
640
- 'approvalLimitChanged',
641
- 'deprecated',
642
- 'archived',
643
- ],
644
- };
645
- // =============================================================================
646
- // Worker
647
- // =============================================================================
648
- /**
649
- * Worker entity
650
- *
651
- * Represents a human employee or AI agent that fills a position.
652
- */
653
- export const Worker = {
654
- singular: 'worker',
655
- plural: 'workers',
656
- description: 'A human employee or AI agent that fills a position',
657
- properties: {
658
- // Identity
659
- name: {
660
- type: 'string',
661
- description: 'Worker name',
662
- },
663
- email: {
664
- type: 'string',
665
- optional: true,
666
- description: 'Email address',
667
- },
668
- avatarUrl: {
669
- type: 'url',
670
- optional: true,
671
- description: 'Avatar URL',
672
- },
673
- // Type
674
- type: {
675
- type: 'string',
676
- description: 'Worker type',
677
- examples: ['human', 'agent'],
678
- },
679
- // Human-specific
680
- firstName: {
681
- type: 'string',
682
- optional: true,
683
- description: 'First name',
684
- },
685
- lastName: {
686
- type: 'string',
687
- optional: true,
688
- description: 'Last name',
689
- },
690
- phone: {
691
- type: 'string',
692
- optional: true,
693
- description: 'Phone number',
694
- },
695
- location: {
696
- type: 'string',
697
- optional: true,
698
- description: 'Work location',
699
- },
700
- timezone: {
701
- type: 'string',
702
- optional: true,
703
- description: 'Timezone',
704
- },
705
- startDate: {
706
- type: 'date',
707
- optional: true,
708
- description: 'Start date',
709
- },
710
- // Agent-specific
711
- agentId: {
712
- type: 'string',
713
- optional: true,
714
- description: 'AI agent identifier',
715
- },
716
- modelId: {
717
- type: 'string',
718
- optional: true,
719
- description: 'AI model identifier',
720
- },
721
- capabilities: {
722
- type: 'string',
723
- array: true,
724
- optional: true,
725
- description: 'Agent capabilities',
726
- },
727
- // Availability
728
- availability: {
729
- type: 'string',
730
- optional: true,
731
- description: 'Availability status',
732
- examples: ['available', 'busy', 'away', 'offline'],
733
- },
734
- capacity: {
735
- type: 'number',
736
- optional: true,
737
- description: 'Available capacity (0-1)',
738
- },
739
- // Status
740
- status: {
741
- type: 'string',
742
- optional: true,
743
- description: 'Worker status',
744
- examples: ['active', 'onboarding', 'on-leave', 'offboarding', 'inactive'],
745
- },
746
- },
747
- relationships: {
748
- position: {
749
- type: 'Position',
750
- required: false,
751
- description: 'Current position',
752
- },
753
- manager: {
754
- type: 'Worker',
755
- required: false,
756
- description: 'Direct manager',
757
- },
758
- directReports: {
759
- type: 'Worker[]',
760
- description: 'Direct reports',
761
- },
762
- tasks: {
763
- type: 'Task[]',
764
- description: 'Assigned tasks',
765
- },
766
- },
767
- actions: [
768
- 'create',
769
- 'update',
770
- 'onboard',
771
- 'assign',
772
- 'reassign',
773
- 'setAvailability',
774
- 'promote',
775
- 'transfer',
776
- 'offboard',
777
- 'archive',
778
- ],
779
- events: [
780
- 'created',
781
- 'updated',
782
- 'onboarded',
783
- 'assigned',
784
- 'reassigned',
785
- 'availabilityChanged',
786
- 'promoted',
787
- 'transferred',
788
- 'offboarded',
789
- 'archived',
790
- ],
791
- };
792
- // =============================================================================
793
- // Exports
794
- // =============================================================================
795
- export const OrganizationEntities = {
796
- Organization,
797
- Department,
798
- Team,
799
- Position,
800
- Role,
801
- Worker,
802
- };
803
- export const OrganizationCategories = {
804
- structure: ['Organization', 'Department', 'Team'],
805
- people: ['Position', 'Role', 'Worker'],
806
- };
807
- //# sourceMappingURL=organization.js.map