business-as-code 2.1.3 → 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 (260) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +2 -0
  3. package/package.json +16 -13
  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/LICENSE +0 -21
  38. package/dist/business.d.ts +0 -62
  39. package/dist/business.d.ts.map +0 -1
  40. package/dist/business.js +0 -109
  41. package/dist/business.js.map +0 -1
  42. package/dist/canvas/activities.d.ts +0 -19
  43. package/dist/canvas/activities.d.ts.map +0 -1
  44. package/dist/canvas/activities.js +0 -20
  45. package/dist/canvas/activities.js.map +0 -1
  46. package/dist/canvas/channels.d.ts +0 -20
  47. package/dist/canvas/channels.d.ts.map +0 -1
  48. package/dist/canvas/channels.js +0 -21
  49. package/dist/canvas/channels.js.map +0 -1
  50. package/dist/canvas/relationships.d.ts +0 -20
  51. package/dist/canvas/relationships.d.ts.map +0 -1
  52. package/dist/canvas/relationships.js +0 -21
  53. package/dist/canvas/relationships.js.map +0 -1
  54. package/dist/canvas/resources.d.ts +0 -20
  55. package/dist/canvas/resources.d.ts.map +0 -1
  56. package/dist/canvas/resources.js +0 -30
  57. package/dist/canvas/resources.js.map +0 -1
  58. package/dist/canvas/revenue.d.ts +0 -22
  59. package/dist/canvas/revenue.d.ts.map +0 -1
  60. package/dist/canvas/revenue.js +0 -30
  61. package/dist/canvas/revenue.js.map +0 -1
  62. package/dist/canvas/segments.d.ts +0 -20
  63. package/dist/canvas/segments.d.ts.map +0 -1
  64. package/dist/canvas/segments.js +0 -28
  65. package/dist/canvas/segments.js.map +0 -1
  66. package/dist/canvas/types.d.ts +0 -232
  67. package/dist/canvas/types.d.ts.map +0 -1
  68. package/dist/canvas/types.js +0 -8
  69. package/dist/canvas/types.js.map +0 -1
  70. package/dist/canvas/value.d.ts +0 -20
  71. package/dist/canvas/value.d.ts.map +0 -1
  72. package/dist/canvas/value.js +0 -21
  73. package/dist/canvas/value.js.map +0 -1
  74. package/dist/dollar.d.ts +0 -60
  75. package/dist/dollar.d.ts.map +0 -1
  76. package/dist/dollar.js +0 -107
  77. package/dist/dollar.js.map +0 -1
  78. package/dist/entities/assets.d.ts +0 -21
  79. package/dist/entities/assets.d.ts.map +0 -1
  80. package/dist/entities/assets.js +0 -323
  81. package/dist/entities/assets.js.map +0 -1
  82. package/dist/entities/business.d.ts +0 -36
  83. package/dist/entities/business.d.ts.map +0 -1
  84. package/dist/entities/business.js +0 -370
  85. package/dist/entities/business.js.map +0 -1
  86. package/dist/entities/communication.d.ts +0 -21
  87. package/dist/entities/communication.d.ts.map +0 -1
  88. package/dist/entities/communication.js +0 -255
  89. package/dist/entities/communication.js.map +0 -1
  90. package/dist/entities/customers.d.ts +0 -58
  91. package/dist/entities/customers.d.ts.map +0 -1
  92. package/dist/entities/customers.js +0 -989
  93. package/dist/entities/customers.js.map +0 -1
  94. package/dist/entities/financials.d.ts +0 -59
  95. package/dist/entities/financials.d.ts.map +0 -1
  96. package/dist/entities/financials.js +0 -932
  97. package/dist/entities/financials.js.map +0 -1
  98. package/dist/entities/goals.d.ts +0 -58
  99. package/dist/entities/goals.d.ts.map +0 -1
  100. package/dist/entities/goals.js +0 -800
  101. package/dist/entities/goals.js.map +0 -1
  102. package/dist/entities/index.d.ts +0 -299
  103. package/dist/entities/index.d.ts.map +0 -1
  104. package/dist/entities/index.js +0 -198
  105. package/dist/entities/index.js.map +0 -1
  106. package/dist/entities/legal.d.ts +0 -21
  107. package/dist/entities/legal.d.ts.map +0 -1
  108. package/dist/entities/legal.js +0 -301
  109. package/dist/entities/legal.js.map +0 -1
  110. package/dist/entities/market.d.ts +0 -21
  111. package/dist/entities/market.d.ts.map +0 -1
  112. package/dist/entities/market.js +0 -301
  113. package/dist/entities/market.js.map +0 -1
  114. package/dist/entities/marketing.d.ts +0 -67
  115. package/dist/entities/marketing.d.ts.map +0 -1
  116. package/dist/entities/marketing.js +0 -1157
  117. package/dist/entities/marketing.js.map +0 -1
  118. package/dist/entities/offerings.d.ts +0 -51
  119. package/dist/entities/offerings.d.ts.map +0 -1
  120. package/dist/entities/offerings.js +0 -727
  121. package/dist/entities/offerings.js.map +0 -1
  122. package/dist/entities/operations.d.ts +0 -58
  123. package/dist/entities/operations.d.ts.map +0 -1
  124. package/dist/entities/operations.js +0 -787
  125. package/dist/entities/operations.js.map +0 -1
  126. package/dist/entities/organization.d.ts +0 -57
  127. package/dist/entities/organization.d.ts.map +0 -1
  128. package/dist/entities/organization.js +0 -807
  129. package/dist/entities/organization.js.map +0 -1
  130. package/dist/entities/partnerships.d.ts +0 -21
  131. package/dist/entities/partnerships.d.ts.map +0 -1
  132. package/dist/entities/partnerships.js +0 -300
  133. package/dist/entities/partnerships.js.map +0 -1
  134. package/dist/entities/planning.d.ts +0 -0
  135. package/dist/entities/planning.d.ts.map +0 -1
  136. package/dist/entities/planning.js +0 -271
  137. package/dist/entities/planning.js.map +0 -1
  138. package/dist/entities/projects.d.ts +0 -25
  139. package/dist/entities/projects.d.ts.map +0 -1
  140. package/dist/entities/projects.js +0 -349
  141. package/dist/entities/projects.js.map +0 -1
  142. package/dist/entities/risk.d.ts +0 -21
  143. package/dist/entities/risk.d.ts.map +0 -1
  144. package/dist/entities/risk.js +0 -293
  145. package/dist/entities/risk.js.map +0 -1
  146. package/dist/entities/sales.d.ts +0 -72
  147. package/dist/entities/sales.d.ts.map +0 -1
  148. package/dist/entities/sales.js +0 -1248
  149. package/dist/entities/sales.js.map +0 -1
  150. package/dist/financials.d.ts +0 -130
  151. package/dist/financials.d.ts.map +0 -1
  152. package/dist/financials.js +0 -297
  153. package/dist/financials.js.map +0 -1
  154. package/dist/goals.d.ts +0 -87
  155. package/dist/goals.d.ts.map +0 -1
  156. package/dist/goals.js +0 -215
  157. package/dist/goals.js.map +0 -1
  158. package/dist/index.d.ts +0 -97
  159. package/dist/index.d.ts.map +0 -1
  160. package/dist/index.js +0 -132
  161. package/dist/index.js.map +0 -1
  162. package/dist/kpis.d.ts +0 -118
  163. package/dist/kpis.d.ts.map +0 -1
  164. package/dist/kpis.js +0 -232
  165. package/dist/kpis.js.map +0 -1
  166. package/dist/metrics.d.ts +0 -448
  167. package/dist/metrics.d.ts.map +0 -1
  168. package/dist/metrics.js +0 -325
  169. package/dist/metrics.js.map +0 -1
  170. package/dist/okrs.d.ts +0 -123
  171. package/dist/okrs.d.ts.map +0 -1
  172. package/dist/okrs.js +0 -269
  173. package/dist/okrs.js.map +0 -1
  174. package/dist/organization.d.ts +0 -585
  175. package/dist/organization.d.ts.map +0 -1
  176. package/dist/organization.js +0 -173
  177. package/dist/organization.js.map +0 -1
  178. package/dist/process.d.ts +0 -112
  179. package/dist/process.d.ts.map +0 -1
  180. package/dist/process.js +0 -241
  181. package/dist/process.js.map +0 -1
  182. package/dist/product.d.ts +0 -85
  183. package/dist/product.d.ts.map +0 -1
  184. package/dist/product.js +0 -145
  185. package/dist/product.js.map +0 -1
  186. package/dist/queries.d.ts +0 -304
  187. package/dist/queries.d.ts.map +0 -1
  188. package/dist/queries.js +0 -415
  189. package/dist/queries.js.map +0 -1
  190. package/dist/roles.d.ts +0 -340
  191. package/dist/roles.d.ts.map +0 -1
  192. package/dist/roles.js +0 -255
  193. package/dist/roles.js.map +0 -1
  194. package/dist/service.d.ts +0 -61
  195. package/dist/service.d.ts.map +0 -1
  196. package/dist/service.js +0 -140
  197. package/dist/service.js.map +0 -1
  198. package/dist/types.d.ts +0 -459
  199. package/dist/types.d.ts.map +0 -1
  200. package/dist/types.js +0 -5
  201. package/dist/types.js.map +0 -1
  202. package/dist/vision.d.ts +0 -38
  203. package/dist/vision.d.ts.map +0 -1
  204. package/dist/vision.js +0 -68
  205. package/dist/vision.js.map +0 -1
  206. package/dist/workflow.d.ts +0 -115
  207. package/dist/workflow.d.ts.map +0 -1
  208. package/dist/workflow.js +0 -247
  209. package/dist/workflow.js.map +0 -1
  210. package/src/business.js +0 -108
  211. package/src/canvas/activities.ts +0 -32
  212. package/src/canvas/canvas.ts +0 -482
  213. package/src/canvas/channels.ts +0 -34
  214. package/src/canvas/costs.ts +0 -43
  215. package/src/canvas/economics.ts +0 -99
  216. package/src/canvas/index.ts +0 -206
  217. package/src/canvas/partnerships.ts +0 -34
  218. package/src/canvas/projections.ts +0 -141
  219. package/src/canvas/relationships.ts +0 -34
  220. package/src/canvas/resources.ts +0 -43
  221. package/src/canvas/revenue.ts +0 -56
  222. package/src/canvas/segments.ts +0 -42
  223. package/src/canvas/types.ts +0 -363
  224. package/src/canvas/value.ts +0 -34
  225. package/src/dollar.js +0 -106
  226. package/src/entities/assets.js +0 -322
  227. package/src/entities/business.js +0 -369
  228. package/src/entities/communication.js +0 -254
  229. package/src/entities/customers.js +0 -988
  230. package/src/entities/financials.js +0 -931
  231. package/src/entities/goals.js +0 -799
  232. package/src/entities/index.js +0 -197
  233. package/src/entities/legal.js +0 -300
  234. package/src/entities/market.js +0 -300
  235. package/src/entities/marketing.js +0 -1156
  236. package/src/entities/offerings.js +0 -726
  237. package/src/entities/operations.js +0 -786
  238. package/src/entities/organization.js +0 -806
  239. package/src/entities/partnerships.js +0 -299
  240. package/src/entities/planning.js +0 -270
  241. package/src/entities/projects.js +0 -348
  242. package/src/entities/risk.js +0 -292
  243. package/src/entities/sales.js +0 -1247
  244. package/src/financials.js +0 -296
  245. package/src/goals.js +0 -214
  246. package/src/index.js +0 -131
  247. package/src/index.test.js +0 -274
  248. package/src/kpis.js +0 -231
  249. package/src/metrics.js +0 -324
  250. package/src/okrs.js +0 -268
  251. package/src/organization.js +0 -172
  252. package/src/process.js +0 -240
  253. package/src/product.js +0 -144
  254. package/src/queries.js +0 -414
  255. package/src/roles.js +0 -254
  256. package/src/service.js +0 -139
  257. package/src/types.js +0 -4
  258. package/src/vision.js +0 -67
  259. package/src/workflow.js +0 -246
  260. package/tests/canvas.test.ts +0 -842
@@ -1,806 +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
- };