business-as-code 0.2.1 → 2.0.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.
Files changed (190) hide show
  1. package/.turbo/turbo-build.log +5 -0
  2. package/CHANGELOG.md +17 -0
  3. package/IMPLEMENTATION.md +226 -0
  4. package/README.md +1133 -193
  5. package/dist/business.d.ts +62 -0
  6. package/dist/business.d.ts.map +1 -0
  7. package/dist/business.js +109 -0
  8. package/dist/business.js.map +1 -0
  9. package/dist/dollar.d.ts +60 -0
  10. package/dist/dollar.d.ts.map +1 -0
  11. package/dist/dollar.js +107 -0
  12. package/dist/dollar.js.map +1 -0
  13. package/dist/entities/assets.d.ts +21 -0
  14. package/dist/entities/assets.d.ts.map +1 -0
  15. package/dist/entities/assets.js +323 -0
  16. package/dist/entities/assets.js.map +1 -0
  17. package/dist/entities/business.d.ts +36 -0
  18. package/dist/entities/business.d.ts.map +1 -0
  19. package/dist/entities/business.js +370 -0
  20. package/dist/entities/business.js.map +1 -0
  21. package/dist/entities/communication.d.ts +21 -0
  22. package/dist/entities/communication.d.ts.map +1 -0
  23. package/dist/entities/communication.js +255 -0
  24. package/dist/entities/communication.js.map +1 -0
  25. package/dist/entities/customers.d.ts +58 -0
  26. package/dist/entities/customers.d.ts.map +1 -0
  27. package/dist/entities/customers.js +989 -0
  28. package/dist/entities/customers.js.map +1 -0
  29. package/dist/entities/financials.d.ts +59 -0
  30. package/dist/entities/financials.d.ts.map +1 -0
  31. package/dist/entities/financials.js +932 -0
  32. package/dist/entities/financials.js.map +1 -0
  33. package/dist/entities/goals.d.ts +58 -0
  34. package/dist/entities/goals.d.ts.map +1 -0
  35. package/dist/entities/goals.js +800 -0
  36. package/dist/entities/goals.js.map +1 -0
  37. package/dist/entities/index.d.ts +299 -0
  38. package/dist/entities/index.d.ts.map +1 -0
  39. package/dist/entities/index.js +198 -0
  40. package/dist/entities/index.js.map +1 -0
  41. package/dist/entities/legal.d.ts +21 -0
  42. package/dist/entities/legal.d.ts.map +1 -0
  43. package/dist/entities/legal.js +301 -0
  44. package/dist/entities/legal.js.map +1 -0
  45. package/dist/entities/market.d.ts +21 -0
  46. package/dist/entities/market.d.ts.map +1 -0
  47. package/dist/entities/market.js +301 -0
  48. package/dist/entities/market.js.map +1 -0
  49. package/dist/entities/marketing.d.ts +67 -0
  50. package/dist/entities/marketing.d.ts.map +1 -0
  51. package/dist/entities/marketing.js +1157 -0
  52. package/dist/entities/marketing.js.map +1 -0
  53. package/dist/entities/offerings.d.ts +51 -0
  54. package/dist/entities/offerings.d.ts.map +1 -0
  55. package/dist/entities/offerings.js +727 -0
  56. package/dist/entities/offerings.js.map +1 -0
  57. package/dist/entities/operations.d.ts +58 -0
  58. package/dist/entities/operations.d.ts.map +1 -0
  59. package/dist/entities/operations.js +787 -0
  60. package/dist/entities/operations.js.map +1 -0
  61. package/dist/entities/organization.d.ts +57 -0
  62. package/dist/entities/organization.d.ts.map +1 -0
  63. package/dist/entities/organization.js +807 -0
  64. package/dist/entities/organization.js.map +1 -0
  65. package/dist/entities/partnerships.d.ts +21 -0
  66. package/dist/entities/partnerships.d.ts.map +1 -0
  67. package/dist/entities/partnerships.js +300 -0
  68. package/dist/entities/partnerships.js.map +1 -0
  69. package/dist/entities/planning.d.ts +87 -0
  70. package/dist/entities/planning.d.ts.map +1 -0
  71. package/dist/entities/planning.js +271 -0
  72. package/dist/entities/planning.js.map +1 -0
  73. package/dist/entities/projects.d.ts +25 -0
  74. package/dist/entities/projects.d.ts.map +1 -0
  75. package/dist/entities/projects.js +349 -0
  76. package/dist/entities/projects.js.map +1 -0
  77. package/dist/entities/risk.d.ts +21 -0
  78. package/dist/entities/risk.d.ts.map +1 -0
  79. package/dist/entities/risk.js +293 -0
  80. package/dist/entities/risk.js.map +1 -0
  81. package/dist/entities/sales.d.ts +72 -0
  82. package/dist/entities/sales.d.ts.map +1 -0
  83. package/dist/entities/sales.js +1248 -0
  84. package/dist/entities/sales.js.map +1 -0
  85. package/dist/financials.d.ts +130 -0
  86. package/dist/financials.d.ts.map +1 -0
  87. package/dist/financials.js +297 -0
  88. package/dist/financials.js.map +1 -0
  89. package/dist/goals.d.ts +87 -0
  90. package/dist/goals.d.ts.map +1 -0
  91. package/dist/goals.js +215 -0
  92. package/dist/goals.js.map +1 -0
  93. package/dist/index.d.ts +97 -4
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/index.js +131 -1079
  96. package/dist/index.js.map +1 -1
  97. package/dist/kpis.d.ts +118 -0
  98. package/dist/kpis.d.ts.map +1 -0
  99. package/dist/kpis.js +232 -0
  100. package/dist/kpis.js.map +1 -0
  101. package/dist/metrics.d.ts +448 -0
  102. package/dist/metrics.d.ts.map +1 -0
  103. package/dist/metrics.js +325 -0
  104. package/dist/metrics.js.map +1 -0
  105. package/dist/okrs.d.ts +123 -0
  106. package/dist/okrs.d.ts.map +1 -0
  107. package/dist/okrs.js +269 -0
  108. package/dist/okrs.js.map +1 -0
  109. package/dist/organization.d.ts +585 -0
  110. package/dist/organization.d.ts.map +1 -0
  111. package/dist/organization.js +173 -0
  112. package/dist/organization.js.map +1 -0
  113. package/dist/process.d.ts +112 -0
  114. package/dist/process.d.ts.map +1 -0
  115. package/dist/process.js +241 -0
  116. package/dist/process.js.map +1 -0
  117. package/dist/product.d.ts +85 -0
  118. package/dist/product.d.ts.map +1 -0
  119. package/dist/product.js +145 -0
  120. package/dist/product.js.map +1 -0
  121. package/dist/queries.d.ts +304 -0
  122. package/dist/queries.d.ts.map +1 -0
  123. package/dist/queries.js +415 -0
  124. package/dist/queries.js.map +1 -0
  125. package/dist/roles.d.ts +340 -0
  126. package/dist/roles.d.ts.map +1 -0
  127. package/dist/roles.js +255 -0
  128. package/dist/roles.js.map +1 -0
  129. package/dist/service.d.ts +61 -0
  130. package/dist/service.d.ts.map +1 -0
  131. package/dist/service.js +140 -0
  132. package/dist/service.js.map +1 -0
  133. package/dist/types.d.ts +459 -0
  134. package/dist/types.d.ts.map +1 -0
  135. package/dist/types.js +5 -0
  136. package/dist/types.js.map +1 -0
  137. package/dist/vision.d.ts +38 -0
  138. package/dist/vision.d.ts.map +1 -0
  139. package/dist/vision.js +68 -0
  140. package/dist/vision.js.map +1 -0
  141. package/dist/workflow.d.ts +115 -0
  142. package/dist/workflow.d.ts.map +1 -0
  143. package/dist/workflow.js +247 -0
  144. package/dist/workflow.js.map +1 -0
  145. package/examples/basic-usage.ts +307 -0
  146. package/package.json +19 -60
  147. package/src/business.ts +121 -0
  148. package/src/dollar.ts +132 -0
  149. package/src/entities/assets.ts +332 -0
  150. package/src/entities/business.ts +406 -0
  151. package/src/entities/communication.ts +264 -0
  152. package/src/entities/customers.ts +1072 -0
  153. package/src/entities/financials.ts +1011 -0
  154. package/src/entities/goals.ts +871 -0
  155. package/src/entities/index.ts +383 -0
  156. package/src/entities/legal.ts +310 -0
  157. package/src/entities/market.ts +310 -0
  158. package/src/entities/marketing.ts +1249 -0
  159. package/src/entities/offerings.ts +789 -0
  160. package/src/entities/operations.ts +861 -0
  161. package/src/entities/organization.ts +876 -0
  162. package/src/entities/partnerships.ts +309 -0
  163. package/src/entities/planning.ts +307 -0
  164. package/src/entities/projects.ts +360 -0
  165. package/src/entities/risk.ts +302 -0
  166. package/src/entities/sales.ts +1352 -0
  167. package/src/financials.ts +352 -0
  168. package/src/goals.ts +250 -0
  169. package/src/index.test.ts +336 -0
  170. package/src/index.ts +530 -0
  171. package/src/kpis.ts +275 -0
  172. package/src/metrics.ts +825 -0
  173. package/src/okrs.ts +325 -0
  174. package/src/organization.ts +909 -0
  175. package/src/process.ts +272 -0
  176. package/src/product.ts +178 -0
  177. package/src/queries.ts +767 -0
  178. package/src/roles.ts +686 -0
  179. package/src/service.ts +164 -0
  180. package/src/types.ts +493 -0
  181. package/src/vision.ts +88 -0
  182. package/src/workflow.ts +280 -0
  183. package/tsconfig.json +9 -0
  184. package/dist/loaders/index.d.ts +0 -174
  185. package/dist/loaders/index.js +0 -366
  186. package/dist/loaders/index.js.map +0 -1
  187. package/dist/schema/index.d.ts +0 -146
  188. package/dist/schema/index.js +0 -716
  189. package/dist/schema/index.js.map +0 -1
  190. package/dist/types-CJ9eGS_C.d.ts +0 -86
@@ -0,0 +1,932 @@
1
+ /**
2
+ * Financial Entity Types (Nouns)
3
+ *
4
+ * Financial entities: Budget, Revenue, Expense, Investment, FinancialPeriod.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ // =============================================================================
9
+ // Budget
10
+ // =============================================================================
11
+ /**
12
+ * Budget entity
13
+ *
14
+ * Represents a budget allocation.
15
+ */
16
+ export const Budget = {
17
+ singular: 'budget',
18
+ plural: 'budgets',
19
+ description: 'A budget allocation',
20
+ properties: {
21
+ // Identity
22
+ name: {
23
+ type: 'string',
24
+ description: 'Budget name',
25
+ },
26
+ description: {
27
+ type: 'string',
28
+ optional: true,
29
+ description: 'Budget description',
30
+ },
31
+ // Classification
32
+ type: {
33
+ type: 'string',
34
+ optional: true,
35
+ description: 'Budget type',
36
+ examples: ['operating', 'capital', 'project', 'marketing', 'hiring', 'r&d'],
37
+ },
38
+ category: {
39
+ type: 'string',
40
+ optional: true,
41
+ description: 'Budget category',
42
+ },
43
+ // Period
44
+ period: {
45
+ type: 'string',
46
+ optional: true,
47
+ description: 'Budget period (e.g., "Q1 2025", "FY2025")',
48
+ },
49
+ startDate: {
50
+ type: 'date',
51
+ optional: true,
52
+ description: 'Period start date',
53
+ },
54
+ endDate: {
55
+ type: 'date',
56
+ optional: true,
57
+ description: 'Period end date',
58
+ },
59
+ // Amounts
60
+ amount: {
61
+ type: 'number',
62
+ description: 'Budgeted amount',
63
+ },
64
+ currency: {
65
+ type: 'string',
66
+ optional: true,
67
+ description: 'Currency code',
68
+ },
69
+ spent: {
70
+ type: 'number',
71
+ optional: true,
72
+ description: 'Amount spent',
73
+ },
74
+ committed: {
75
+ type: 'number',
76
+ optional: true,
77
+ description: 'Amount committed',
78
+ },
79
+ available: {
80
+ type: 'number',
81
+ optional: true,
82
+ description: 'Available amount',
83
+ },
84
+ // Utilization
85
+ utilization: {
86
+ type: 'number',
87
+ optional: true,
88
+ description: 'Utilization percentage',
89
+ },
90
+ // Status
91
+ status: {
92
+ type: 'string',
93
+ description: 'Budget status',
94
+ examples: ['draft', 'approved', 'active', 'frozen', 'closed'],
95
+ },
96
+ },
97
+ relationships: {
98
+ owner: {
99
+ type: 'Worker',
100
+ required: false,
101
+ description: 'Budget owner',
102
+ },
103
+ department: {
104
+ type: 'Department',
105
+ required: false,
106
+ description: 'Owning department',
107
+ },
108
+ team: {
109
+ type: 'Team',
110
+ required: false,
111
+ description: 'Owning team',
112
+ },
113
+ expenses: {
114
+ type: 'Expense[]',
115
+ description: 'Budget expenses',
116
+ },
117
+ parent: {
118
+ type: 'Budget',
119
+ required: false,
120
+ description: 'Parent budget',
121
+ },
122
+ children: {
123
+ type: 'Budget[]',
124
+ description: 'Sub-budgets',
125
+ },
126
+ },
127
+ actions: [
128
+ 'create',
129
+ 'update',
130
+ 'submit',
131
+ 'approve',
132
+ 'allocate',
133
+ 'reallocate',
134
+ 'freeze',
135
+ 'unfreeze',
136
+ 'close',
137
+ 'archive',
138
+ ],
139
+ events: [
140
+ 'created',
141
+ 'updated',
142
+ 'submitted',
143
+ 'approved',
144
+ 'allocated',
145
+ 'reallocated',
146
+ 'frozen',
147
+ 'unfrozen',
148
+ 'thresholdWarning',
149
+ 'overBudget',
150
+ 'closed',
151
+ 'archived',
152
+ ],
153
+ };
154
+ // =============================================================================
155
+ // Revenue
156
+ // =============================================================================
157
+ /**
158
+ * Revenue entity
159
+ *
160
+ * Represents a revenue record.
161
+ */
162
+ export const Revenue = {
163
+ singular: 'revenue',
164
+ plural: 'revenues',
165
+ description: 'A revenue record',
166
+ properties: {
167
+ // Classification
168
+ type: {
169
+ type: 'string',
170
+ optional: true,
171
+ description: 'Revenue type',
172
+ examples: ['subscription', 'one-time', 'usage', 'professional-services', 'licensing', 'other'],
173
+ },
174
+ category: {
175
+ type: 'string',
176
+ optional: true,
177
+ description: 'Revenue category',
178
+ },
179
+ source: {
180
+ type: 'string',
181
+ optional: true,
182
+ description: 'Revenue source',
183
+ },
184
+ // Amount
185
+ amount: {
186
+ type: 'number',
187
+ description: 'Revenue amount',
188
+ },
189
+ currency: {
190
+ type: 'string',
191
+ optional: true,
192
+ description: 'Currency code',
193
+ },
194
+ // Period
195
+ period: {
196
+ type: 'string',
197
+ optional: true,
198
+ description: 'Revenue period',
199
+ },
200
+ date: {
201
+ type: 'date',
202
+ optional: true,
203
+ description: 'Revenue date',
204
+ },
205
+ // Recurring
206
+ isRecurring: {
207
+ type: 'boolean',
208
+ optional: true,
209
+ description: 'Is recurring revenue',
210
+ },
211
+ recurringPeriod: {
212
+ type: 'string',
213
+ optional: true,
214
+ description: 'Recurring period',
215
+ examples: ['monthly', 'quarterly', 'yearly'],
216
+ },
217
+ // Recognition
218
+ recognized: {
219
+ type: 'boolean',
220
+ optional: true,
221
+ description: 'Revenue recognized',
222
+ },
223
+ recognizedAt: {
224
+ type: 'date',
225
+ optional: true,
226
+ description: 'Recognition date',
227
+ },
228
+ deferredAmount: {
229
+ type: 'number',
230
+ optional: true,
231
+ description: 'Deferred revenue amount',
232
+ },
233
+ // Attribution
234
+ segment: {
235
+ type: 'string',
236
+ optional: true,
237
+ description: 'Business segment',
238
+ },
239
+ region: {
240
+ type: 'string',
241
+ optional: true,
242
+ description: 'Geographic region',
243
+ },
244
+ },
245
+ relationships: {
246
+ product: {
247
+ type: 'Product',
248
+ required: false,
249
+ description: 'Revenue product',
250
+ },
251
+ service: {
252
+ type: 'Service',
253
+ required: false,
254
+ description: 'Revenue service',
255
+ },
256
+ customer: {
257
+ type: 'Customer',
258
+ required: false,
259
+ description: 'Customer',
260
+ },
261
+ period: {
262
+ type: 'FinancialPeriod',
263
+ required: false,
264
+ description: 'Financial period',
265
+ },
266
+ },
267
+ actions: [
268
+ 'record',
269
+ 'update',
270
+ 'recognize',
271
+ 'defer',
272
+ 'void',
273
+ ],
274
+ events: [
275
+ 'recorded',
276
+ 'updated',
277
+ 'recognized',
278
+ 'deferred',
279
+ 'voided',
280
+ ],
281
+ };
282
+ // =============================================================================
283
+ // Expense
284
+ // =============================================================================
285
+ /**
286
+ * Expense entity
287
+ *
288
+ * Represents an expense record.
289
+ */
290
+ export const Expense = {
291
+ singular: 'expense',
292
+ plural: 'expenses',
293
+ description: 'An expense record',
294
+ properties: {
295
+ // Identity
296
+ description: {
297
+ type: 'string',
298
+ description: 'Expense description',
299
+ },
300
+ // Classification
301
+ type: {
302
+ type: 'string',
303
+ optional: true,
304
+ description: 'Expense type',
305
+ examples: ['payroll', 'cogs', 'marketing', 'sales', 'r&d', 'g&a', 'facilities', 'travel', 'software', 'services'],
306
+ },
307
+ category: {
308
+ type: 'string',
309
+ optional: true,
310
+ description: 'Expense category',
311
+ },
312
+ subcategory: {
313
+ type: 'string',
314
+ optional: true,
315
+ description: 'Expense subcategory',
316
+ },
317
+ // Amount
318
+ amount: {
319
+ type: 'number',
320
+ description: 'Expense amount',
321
+ },
322
+ currency: {
323
+ type: 'string',
324
+ optional: true,
325
+ description: 'Currency code',
326
+ },
327
+ // Date
328
+ date: {
329
+ type: 'date',
330
+ description: 'Expense date',
331
+ },
332
+ period: {
333
+ type: 'string',
334
+ optional: true,
335
+ description: 'Expense period',
336
+ },
337
+ // Recurring
338
+ isRecurring: {
339
+ type: 'boolean',
340
+ optional: true,
341
+ description: 'Is recurring expense',
342
+ },
343
+ recurringPeriod: {
344
+ type: 'string',
345
+ optional: true,
346
+ description: 'Recurring period',
347
+ },
348
+ // Classification
349
+ isCapex: {
350
+ type: 'boolean',
351
+ optional: true,
352
+ description: 'Is capital expenditure',
353
+ },
354
+ isDeductible: {
355
+ type: 'boolean',
356
+ optional: true,
357
+ description: 'Is tax deductible',
358
+ },
359
+ // Vendor
360
+ vendor: {
361
+ type: 'string',
362
+ optional: true,
363
+ description: 'Vendor name',
364
+ },
365
+ invoiceNumber: {
366
+ type: 'string',
367
+ optional: true,
368
+ description: 'Invoice number',
369
+ },
370
+ // Status
371
+ status: {
372
+ type: 'string',
373
+ description: 'Expense status',
374
+ examples: ['draft', 'submitted', 'approved', 'rejected', 'paid', 'voided'],
375
+ },
376
+ },
377
+ relationships: {
378
+ submitter: {
379
+ type: 'Worker',
380
+ required: false,
381
+ description: 'Who submitted',
382
+ },
383
+ approver: {
384
+ type: 'Worker',
385
+ required: false,
386
+ description: 'Who approved',
387
+ },
388
+ budget: {
389
+ type: 'Budget',
390
+ required: false,
391
+ description: 'Budget charged',
392
+ },
393
+ department: {
394
+ type: 'Department',
395
+ required: false,
396
+ description: 'Department',
397
+ },
398
+ period: {
399
+ type: 'FinancialPeriod',
400
+ required: false,
401
+ description: 'Financial period',
402
+ },
403
+ },
404
+ actions: [
405
+ 'create',
406
+ 'update',
407
+ 'submit',
408
+ 'approve',
409
+ 'reject',
410
+ 'pay',
411
+ 'void',
412
+ ],
413
+ events: [
414
+ 'created',
415
+ 'updated',
416
+ 'submitted',
417
+ 'approved',
418
+ 'rejected',
419
+ 'paid',
420
+ 'voided',
421
+ ],
422
+ };
423
+ // =============================================================================
424
+ // Investment
425
+ // =============================================================================
426
+ /**
427
+ * Investment entity
428
+ *
429
+ * Represents a funding or investment round.
430
+ */
431
+ export const Investment = {
432
+ singular: 'investment',
433
+ plural: 'investments',
434
+ description: 'A funding or investment round',
435
+ properties: {
436
+ // Identity
437
+ name: {
438
+ type: 'string',
439
+ description: 'Investment name/round',
440
+ },
441
+ description: {
442
+ type: 'string',
443
+ optional: true,
444
+ description: 'Investment description',
445
+ },
446
+ // Type
447
+ type: {
448
+ type: 'string',
449
+ optional: true,
450
+ description: 'Investment type',
451
+ examples: ['pre-seed', 'seed', 'series-a', 'series-b', 'series-c', 'series-d', 'growth', 'debt', 'grant'],
452
+ },
453
+ instrumentType: {
454
+ type: 'string',
455
+ optional: true,
456
+ description: 'Instrument type',
457
+ examples: ['equity', 'safe', 'convertible-note', 'debt', 'revenue-based'],
458
+ },
459
+ // Amount
460
+ amount: {
461
+ type: 'number',
462
+ description: 'Investment amount',
463
+ },
464
+ currency: {
465
+ type: 'string',
466
+ optional: true,
467
+ description: 'Currency code',
468
+ },
469
+ // Valuation
470
+ preMoneyValuation: {
471
+ type: 'number',
472
+ optional: true,
473
+ description: 'Pre-money valuation',
474
+ },
475
+ postMoneyValuation: {
476
+ type: 'number',
477
+ optional: true,
478
+ description: 'Post-money valuation',
479
+ },
480
+ valuationCap: {
481
+ type: 'number',
482
+ optional: true,
483
+ description: 'Valuation cap (for SAFEs/convertibles)',
484
+ },
485
+ discount: {
486
+ type: 'number',
487
+ optional: true,
488
+ description: 'Discount percentage',
489
+ },
490
+ // Equity
491
+ equityPercentage: {
492
+ type: 'number',
493
+ optional: true,
494
+ description: 'Equity percentage sold',
495
+ },
496
+ sharesIssued: {
497
+ type: 'number',
498
+ optional: true,
499
+ description: 'Shares issued',
500
+ },
501
+ pricePerShare: {
502
+ type: 'number',
503
+ optional: true,
504
+ description: 'Price per share',
505
+ },
506
+ // Timeline
507
+ announcedAt: {
508
+ type: 'date',
509
+ optional: true,
510
+ description: 'Announcement date',
511
+ },
512
+ closedAt: {
513
+ type: 'date',
514
+ optional: true,
515
+ description: 'Closing date',
516
+ },
517
+ // Terms
518
+ interestRate: {
519
+ type: 'number',
520
+ optional: true,
521
+ description: 'Interest rate (for debt)',
522
+ },
523
+ maturityDate: {
524
+ type: 'date',
525
+ optional: true,
526
+ description: 'Maturity date (for debt)',
527
+ },
528
+ // Lead
529
+ leadInvestor: {
530
+ type: 'string',
531
+ optional: true,
532
+ description: 'Lead investor',
533
+ },
534
+ investors: {
535
+ type: 'string',
536
+ array: true,
537
+ optional: true,
538
+ description: 'All investors',
539
+ },
540
+ // Status
541
+ status: {
542
+ type: 'string',
543
+ description: 'Investment status',
544
+ examples: ['prospecting', 'negotiating', 'term-sheet', 'due-diligence', 'closing', 'closed', 'cancelled'],
545
+ },
546
+ },
547
+ relationships: {
548
+ business: {
549
+ type: 'Business',
550
+ description: 'Business receiving investment',
551
+ },
552
+ },
553
+ actions: [
554
+ 'create',
555
+ 'update',
556
+ 'negotiate',
557
+ 'signTermSheet',
558
+ 'close',
559
+ 'announce',
560
+ 'cancel',
561
+ ],
562
+ events: [
563
+ 'created',
564
+ 'updated',
565
+ 'negotiated',
566
+ 'termSheetSigned',
567
+ 'closed',
568
+ 'announced',
569
+ 'cancelled',
570
+ ],
571
+ };
572
+ // =============================================================================
573
+ // FinancialPeriod
574
+ // =============================================================================
575
+ /**
576
+ * FinancialPeriod entity
577
+ *
578
+ * Represents a financial reporting period.
579
+ */
580
+ export const FinancialPeriod = {
581
+ singular: 'financial-period',
582
+ plural: 'financial-periods',
583
+ description: 'A financial reporting period',
584
+ properties: {
585
+ // Identity
586
+ name: {
587
+ type: 'string',
588
+ description: 'Period name (e.g., "Q1 2025", "FY2025")',
589
+ },
590
+ // Type
591
+ type: {
592
+ type: 'string',
593
+ description: 'Period type',
594
+ examples: ['month', 'quarter', 'half-year', 'year'],
595
+ },
596
+ // Dates
597
+ startDate: {
598
+ type: 'date',
599
+ description: 'Period start date',
600
+ },
601
+ endDate: {
602
+ type: 'date',
603
+ description: 'Period end date',
604
+ },
605
+ // Financials
606
+ revenue: {
607
+ type: 'number',
608
+ optional: true,
609
+ description: 'Total revenue',
610
+ },
611
+ cogs: {
612
+ type: 'number',
613
+ optional: true,
614
+ description: 'Cost of goods sold',
615
+ },
616
+ grossProfit: {
617
+ type: 'number',
618
+ optional: true,
619
+ description: 'Gross profit',
620
+ },
621
+ grossMargin: {
622
+ type: 'number',
623
+ optional: true,
624
+ description: 'Gross margin percentage',
625
+ },
626
+ operatingExpenses: {
627
+ type: 'number',
628
+ optional: true,
629
+ description: 'Operating expenses',
630
+ },
631
+ operatingIncome: {
632
+ type: 'number',
633
+ optional: true,
634
+ description: 'Operating income (EBIT)',
635
+ },
636
+ operatingMargin: {
637
+ type: 'number',
638
+ optional: true,
639
+ description: 'Operating margin percentage',
640
+ },
641
+ netIncome: {
642
+ type: 'number',
643
+ optional: true,
644
+ description: 'Net income',
645
+ },
646
+ netMargin: {
647
+ type: 'number',
648
+ optional: true,
649
+ description: 'Net margin percentage',
650
+ },
651
+ ebitda: {
652
+ type: 'number',
653
+ optional: true,
654
+ description: 'EBITDA',
655
+ },
656
+ ebitdaMargin: {
657
+ type: 'number',
658
+ optional: true,
659
+ description: 'EBITDA margin percentage',
660
+ },
661
+ // Cash
662
+ cashStart: {
663
+ type: 'number',
664
+ optional: true,
665
+ description: 'Cash at start',
666
+ },
667
+ cashEnd: {
668
+ type: 'number',
669
+ optional: true,
670
+ description: 'Cash at end',
671
+ },
672
+ cashFlow: {
673
+ type: 'number',
674
+ optional: true,
675
+ description: 'Net cash flow',
676
+ },
677
+ burnRate: {
678
+ type: 'number',
679
+ optional: true,
680
+ description: 'Monthly burn rate',
681
+ },
682
+ runway: {
683
+ type: 'number',
684
+ optional: true,
685
+ description: 'Runway in months',
686
+ },
687
+ // SaaS Metrics
688
+ mrr: {
689
+ type: 'number',
690
+ optional: true,
691
+ description: 'Monthly recurring revenue',
692
+ },
693
+ arr: {
694
+ type: 'number',
695
+ optional: true,
696
+ description: 'Annual recurring revenue',
697
+ },
698
+ nrr: {
699
+ type: 'number',
700
+ optional: true,
701
+ description: 'Net revenue retention',
702
+ },
703
+ grr: {
704
+ type: 'number',
705
+ optional: true,
706
+ description: 'Gross revenue retention',
707
+ },
708
+ customers: {
709
+ type: 'number',
710
+ optional: true,
711
+ description: 'Customer count',
712
+ },
713
+ arpu: {
714
+ type: 'number',
715
+ optional: true,
716
+ description: 'Average revenue per user',
717
+ },
718
+ cac: {
719
+ type: 'number',
720
+ optional: true,
721
+ description: 'Customer acquisition cost',
722
+ },
723
+ ltv: {
724
+ type: 'number',
725
+ optional: true,
726
+ description: 'Lifetime value',
727
+ },
728
+ ltvCacRatio: {
729
+ type: 'number',
730
+ optional: true,
731
+ description: 'LTV:CAC ratio',
732
+ },
733
+ churnRate: {
734
+ type: 'number',
735
+ optional: true,
736
+ description: 'Churn rate',
737
+ },
738
+ // Currency
739
+ currency: {
740
+ type: 'string',
741
+ optional: true,
742
+ description: 'Reporting currency',
743
+ },
744
+ // Status
745
+ status: {
746
+ type: 'string',
747
+ description: 'Period status',
748
+ examples: ['open', 'closed', 'audited'],
749
+ },
750
+ },
751
+ relationships: {
752
+ business: {
753
+ type: 'Business',
754
+ description: 'Business',
755
+ },
756
+ revenues: {
757
+ type: 'Revenue[]',
758
+ description: 'Period revenues',
759
+ },
760
+ expenses: {
761
+ type: 'Expense[]',
762
+ description: 'Period expenses',
763
+ },
764
+ budgets: {
765
+ type: 'Budget[]',
766
+ description: 'Period budgets',
767
+ },
768
+ previous: {
769
+ type: 'FinancialPeriod',
770
+ required: false,
771
+ description: 'Previous period',
772
+ },
773
+ },
774
+ actions: [
775
+ 'create',
776
+ 'update',
777
+ 'close',
778
+ 'reopen',
779
+ 'audit',
780
+ ],
781
+ events: [
782
+ 'created',
783
+ 'updated',
784
+ 'closed',
785
+ 'reopened',
786
+ 'audited',
787
+ ],
788
+ };
789
+ // =============================================================================
790
+ // Forecast
791
+ // =============================================================================
792
+ /**
793
+ * Forecast entity
794
+ *
795
+ * Represents a financial forecast.
796
+ */
797
+ export const Forecast = {
798
+ singular: 'forecast',
799
+ plural: 'forecasts',
800
+ description: 'A financial forecast',
801
+ properties: {
802
+ // Identity
803
+ name: {
804
+ type: 'string',
805
+ description: 'Forecast name',
806
+ },
807
+ description: {
808
+ type: 'string',
809
+ optional: true,
810
+ description: 'Forecast description',
811
+ },
812
+ // Type
813
+ type: {
814
+ type: 'string',
815
+ optional: true,
816
+ description: 'Forecast type',
817
+ examples: ['revenue', 'expense', 'cash', 'headcount', 'arr'],
818
+ },
819
+ scenario: {
820
+ type: 'string',
821
+ optional: true,
822
+ description: 'Scenario',
823
+ examples: ['base', 'optimistic', 'pessimistic', 'stretch'],
824
+ },
825
+ // Period
826
+ startDate: {
827
+ type: 'date',
828
+ description: 'Forecast start date',
829
+ },
830
+ endDate: {
831
+ type: 'date',
832
+ description: 'Forecast end date',
833
+ },
834
+ granularity: {
835
+ type: 'string',
836
+ optional: true,
837
+ description: 'Forecast granularity',
838
+ examples: ['monthly', 'quarterly', 'yearly'],
839
+ },
840
+ // Values
841
+ values: {
842
+ type: 'json',
843
+ optional: true,
844
+ description: 'Forecast values by period',
845
+ },
846
+ total: {
847
+ type: 'number',
848
+ optional: true,
849
+ description: 'Total forecasted amount',
850
+ },
851
+ currency: {
852
+ type: 'string',
853
+ optional: true,
854
+ description: 'Currency code',
855
+ },
856
+ // Assumptions
857
+ assumptions: {
858
+ type: 'string',
859
+ array: true,
860
+ optional: true,
861
+ description: 'Forecast assumptions',
862
+ },
863
+ growthRate: {
864
+ type: 'number',
865
+ optional: true,
866
+ description: 'Assumed growth rate',
867
+ },
868
+ // Accuracy
869
+ confidenceLevel: {
870
+ type: 'number',
871
+ optional: true,
872
+ description: 'Confidence level (0-100)',
873
+ },
874
+ // Versioning
875
+ version: {
876
+ type: 'number',
877
+ optional: true,
878
+ description: 'Forecast version',
879
+ },
880
+ // Status
881
+ status: {
882
+ type: 'string',
883
+ description: 'Forecast status',
884
+ examples: ['draft', 'review', 'approved', 'superseded'],
885
+ },
886
+ },
887
+ relationships: {
888
+ owner: {
889
+ type: 'Worker',
890
+ required: false,
891
+ description: 'Forecast owner',
892
+ },
893
+ basedOn: {
894
+ type: 'FinancialPeriod[]',
895
+ description: 'Historical periods used',
896
+ },
897
+ },
898
+ actions: [
899
+ 'create',
900
+ 'update',
901
+ 'submit',
902
+ 'approve',
903
+ 'supersede',
904
+ 'archive',
905
+ ],
906
+ events: [
907
+ 'created',
908
+ 'updated',
909
+ 'submitted',
910
+ 'approved',
911
+ 'superseded',
912
+ 'archived',
913
+ ],
914
+ };
915
+ // =============================================================================
916
+ // Exports
917
+ // =============================================================================
918
+ export const FinancialEntities = {
919
+ Budget,
920
+ Revenue,
921
+ Expense,
922
+ Investment,
923
+ FinancialPeriod,
924
+ Forecast,
925
+ };
926
+ export const FinancialCategories = {
927
+ planning: ['Budget', 'Forecast'],
928
+ transactions: ['Revenue', 'Expense'],
929
+ funding: ['Investment'],
930
+ reporting: ['FinancialPeriod'],
931
+ };
932
+ //# sourceMappingURL=financials.js.map