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.
- package/CHANGELOG.md +10 -0
- package/README.md +2 -0
- package/package.json +16 -13
- package/src/dollar.ts +5 -2
- package/src/entities/organization.ts +31 -18
- package/src/goals.ts +78 -12
- package/src/index.ts +48 -18
- package/src/kpis.ts +62 -8
- package/src/metrics.ts +92 -79
- package/src/okrs.ts +120 -20
- package/src/organization.ts +12 -15
- package/src/process.ts +11 -12
- package/src/product.ts +8 -9
- package/src/queries.ts +238 -75
- package/src/roles.ts +62 -61
- package/src/workflow.ts +22 -15
- package/test/business.test.ts +282 -0
- package/test/dollar.test.ts +270 -0
- package/test/entities.test.ts +628 -0
- package/test/financials.test.ts +539 -0
- package/test/goals.test.ts +451 -0
- package/{src → test}/index.test.ts +1 -1
- package/test/kpis.test.ts +440 -0
- package/test/metrics.test.ts +744 -0
- package/test/okrs.test.ts +741 -0
- package/test/organization.test.ts +548 -0
- package/test/process.test.ts +503 -0
- package/test/product.test.ts +430 -0
- package/test/queries.test.ts +556 -0
- package/test/roles.test.ts +546 -0
- package/test/service.test.ts +450 -0
- package/test/types.test.ts +1141 -0
- package/test/vision.test.ts +214 -0
- package/test/workflow.test.ts +501 -0
- package/vitest.config.ts +47 -0
- package/.turbo/turbo-build.log +0 -5
- package/LICENSE +0 -21
- package/dist/business.d.ts +0 -62
- package/dist/business.d.ts.map +0 -1
- package/dist/business.js +0 -109
- package/dist/business.js.map +0 -1
- package/dist/canvas/activities.d.ts +0 -19
- package/dist/canvas/activities.d.ts.map +0 -1
- package/dist/canvas/activities.js +0 -20
- package/dist/canvas/activities.js.map +0 -1
- package/dist/canvas/channels.d.ts +0 -20
- package/dist/canvas/channels.d.ts.map +0 -1
- package/dist/canvas/channels.js +0 -21
- package/dist/canvas/channels.js.map +0 -1
- package/dist/canvas/relationships.d.ts +0 -20
- package/dist/canvas/relationships.d.ts.map +0 -1
- package/dist/canvas/relationships.js +0 -21
- package/dist/canvas/relationships.js.map +0 -1
- package/dist/canvas/resources.d.ts +0 -20
- package/dist/canvas/resources.d.ts.map +0 -1
- package/dist/canvas/resources.js +0 -30
- package/dist/canvas/resources.js.map +0 -1
- package/dist/canvas/revenue.d.ts +0 -22
- package/dist/canvas/revenue.d.ts.map +0 -1
- package/dist/canvas/revenue.js +0 -30
- package/dist/canvas/revenue.js.map +0 -1
- package/dist/canvas/segments.d.ts +0 -20
- package/dist/canvas/segments.d.ts.map +0 -1
- package/dist/canvas/segments.js +0 -28
- package/dist/canvas/segments.js.map +0 -1
- package/dist/canvas/types.d.ts +0 -232
- package/dist/canvas/types.d.ts.map +0 -1
- package/dist/canvas/types.js +0 -8
- package/dist/canvas/types.js.map +0 -1
- package/dist/canvas/value.d.ts +0 -20
- package/dist/canvas/value.d.ts.map +0 -1
- package/dist/canvas/value.js +0 -21
- package/dist/canvas/value.js.map +0 -1
- package/dist/dollar.d.ts +0 -60
- package/dist/dollar.d.ts.map +0 -1
- package/dist/dollar.js +0 -107
- package/dist/dollar.js.map +0 -1
- package/dist/entities/assets.d.ts +0 -21
- package/dist/entities/assets.d.ts.map +0 -1
- package/dist/entities/assets.js +0 -323
- package/dist/entities/assets.js.map +0 -1
- package/dist/entities/business.d.ts +0 -36
- package/dist/entities/business.d.ts.map +0 -1
- package/dist/entities/business.js +0 -370
- package/dist/entities/business.js.map +0 -1
- package/dist/entities/communication.d.ts +0 -21
- package/dist/entities/communication.d.ts.map +0 -1
- package/dist/entities/communication.js +0 -255
- package/dist/entities/communication.js.map +0 -1
- package/dist/entities/customers.d.ts +0 -58
- package/dist/entities/customers.d.ts.map +0 -1
- package/dist/entities/customers.js +0 -989
- package/dist/entities/customers.js.map +0 -1
- package/dist/entities/financials.d.ts +0 -59
- package/dist/entities/financials.d.ts.map +0 -1
- package/dist/entities/financials.js +0 -932
- package/dist/entities/financials.js.map +0 -1
- package/dist/entities/goals.d.ts +0 -58
- package/dist/entities/goals.d.ts.map +0 -1
- package/dist/entities/goals.js +0 -800
- package/dist/entities/goals.js.map +0 -1
- package/dist/entities/index.d.ts +0 -299
- package/dist/entities/index.d.ts.map +0 -1
- package/dist/entities/index.js +0 -198
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/legal.d.ts +0 -21
- package/dist/entities/legal.d.ts.map +0 -1
- package/dist/entities/legal.js +0 -301
- package/dist/entities/legal.js.map +0 -1
- package/dist/entities/market.d.ts +0 -21
- package/dist/entities/market.d.ts.map +0 -1
- package/dist/entities/market.js +0 -301
- package/dist/entities/market.js.map +0 -1
- package/dist/entities/marketing.d.ts +0 -67
- package/dist/entities/marketing.d.ts.map +0 -1
- package/dist/entities/marketing.js +0 -1157
- package/dist/entities/marketing.js.map +0 -1
- package/dist/entities/offerings.d.ts +0 -51
- package/dist/entities/offerings.d.ts.map +0 -1
- package/dist/entities/offerings.js +0 -727
- package/dist/entities/offerings.js.map +0 -1
- package/dist/entities/operations.d.ts +0 -58
- package/dist/entities/operations.d.ts.map +0 -1
- package/dist/entities/operations.js +0 -787
- package/dist/entities/operations.js.map +0 -1
- package/dist/entities/organization.d.ts +0 -57
- package/dist/entities/organization.d.ts.map +0 -1
- package/dist/entities/organization.js +0 -807
- package/dist/entities/organization.js.map +0 -1
- package/dist/entities/partnerships.d.ts +0 -21
- package/dist/entities/partnerships.d.ts.map +0 -1
- package/dist/entities/partnerships.js +0 -300
- package/dist/entities/partnerships.js.map +0 -1
- package/dist/entities/planning.d.ts +0 -0
- package/dist/entities/planning.d.ts.map +0 -1
- package/dist/entities/planning.js +0 -271
- package/dist/entities/planning.js.map +0 -1
- package/dist/entities/projects.d.ts +0 -25
- package/dist/entities/projects.d.ts.map +0 -1
- package/dist/entities/projects.js +0 -349
- package/dist/entities/projects.js.map +0 -1
- package/dist/entities/risk.d.ts +0 -21
- package/dist/entities/risk.d.ts.map +0 -1
- package/dist/entities/risk.js +0 -293
- package/dist/entities/risk.js.map +0 -1
- package/dist/entities/sales.d.ts +0 -72
- package/dist/entities/sales.d.ts.map +0 -1
- package/dist/entities/sales.js +0 -1248
- package/dist/entities/sales.js.map +0 -1
- package/dist/financials.d.ts +0 -130
- package/dist/financials.d.ts.map +0 -1
- package/dist/financials.js +0 -297
- package/dist/financials.js.map +0 -1
- package/dist/goals.d.ts +0 -87
- package/dist/goals.d.ts.map +0 -1
- package/dist/goals.js +0 -215
- package/dist/goals.js.map +0 -1
- package/dist/index.d.ts +0 -97
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -132
- package/dist/index.js.map +0 -1
- package/dist/kpis.d.ts +0 -118
- package/dist/kpis.d.ts.map +0 -1
- package/dist/kpis.js +0 -232
- package/dist/kpis.js.map +0 -1
- package/dist/metrics.d.ts +0 -448
- package/dist/metrics.d.ts.map +0 -1
- package/dist/metrics.js +0 -325
- package/dist/metrics.js.map +0 -1
- package/dist/okrs.d.ts +0 -123
- package/dist/okrs.d.ts.map +0 -1
- package/dist/okrs.js +0 -269
- package/dist/okrs.js.map +0 -1
- package/dist/organization.d.ts +0 -585
- package/dist/organization.d.ts.map +0 -1
- package/dist/organization.js +0 -173
- package/dist/organization.js.map +0 -1
- package/dist/process.d.ts +0 -112
- package/dist/process.d.ts.map +0 -1
- package/dist/process.js +0 -241
- package/dist/process.js.map +0 -1
- package/dist/product.d.ts +0 -85
- package/dist/product.d.ts.map +0 -1
- package/dist/product.js +0 -145
- package/dist/product.js.map +0 -1
- package/dist/queries.d.ts +0 -304
- package/dist/queries.d.ts.map +0 -1
- package/dist/queries.js +0 -415
- package/dist/queries.js.map +0 -1
- package/dist/roles.d.ts +0 -340
- package/dist/roles.d.ts.map +0 -1
- package/dist/roles.js +0 -255
- package/dist/roles.js.map +0 -1
- package/dist/service.d.ts +0 -61
- package/dist/service.d.ts.map +0 -1
- package/dist/service.js +0 -140
- package/dist/service.js.map +0 -1
- package/dist/types.d.ts +0 -459
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -5
- package/dist/types.js.map +0 -1
- package/dist/vision.d.ts +0 -38
- package/dist/vision.d.ts.map +0 -1
- package/dist/vision.js +0 -68
- package/dist/vision.js.map +0 -1
- package/dist/workflow.d.ts +0 -115
- package/dist/workflow.d.ts.map +0 -1
- package/dist/workflow.js +0 -247
- package/dist/workflow.js.map +0 -1
- package/src/business.js +0 -108
- package/src/canvas/activities.ts +0 -32
- package/src/canvas/canvas.ts +0 -482
- package/src/canvas/channels.ts +0 -34
- package/src/canvas/costs.ts +0 -43
- package/src/canvas/economics.ts +0 -99
- package/src/canvas/index.ts +0 -206
- package/src/canvas/partnerships.ts +0 -34
- package/src/canvas/projections.ts +0 -141
- package/src/canvas/relationships.ts +0 -34
- package/src/canvas/resources.ts +0 -43
- package/src/canvas/revenue.ts +0 -56
- package/src/canvas/segments.ts +0 -42
- package/src/canvas/types.ts +0 -363
- package/src/canvas/value.ts +0 -34
- package/src/dollar.js +0 -106
- package/src/entities/assets.js +0 -322
- package/src/entities/business.js +0 -369
- package/src/entities/communication.js +0 -254
- package/src/entities/customers.js +0 -988
- package/src/entities/financials.js +0 -931
- package/src/entities/goals.js +0 -799
- package/src/entities/index.js +0 -197
- package/src/entities/legal.js +0 -300
- package/src/entities/market.js +0 -300
- package/src/entities/marketing.js +0 -1156
- package/src/entities/offerings.js +0 -726
- package/src/entities/operations.js +0 -786
- package/src/entities/organization.js +0 -806
- package/src/entities/partnerships.js +0 -299
- package/src/entities/planning.js +0 -270
- package/src/entities/projects.js +0 -348
- package/src/entities/risk.js +0 -292
- package/src/entities/sales.js +0 -1247
- package/src/financials.js +0 -296
- package/src/goals.js +0 -214
- package/src/index.js +0 -131
- package/src/index.test.js +0 -274
- package/src/kpis.js +0 -231
- package/src/metrics.js +0 -324
- package/src/okrs.js +0 -268
- package/src/organization.js +0 -172
- package/src/process.js +0 -240
- package/src/product.js +0 -144
- package/src/queries.js +0 -414
- package/src/roles.js +0 -254
- package/src/service.js +0 -139
- package/src/types.js +0 -4
- package/src/vision.js +0 -67
- package/src/workflow.js +0 -246
- package/tests/canvas.test.ts +0 -842
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for entities/index.ts - Business Entity Type Definitions
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { describe, it, expect } from 'vitest'
|
|
6
|
+
import {
|
|
7
|
+
// Business entities
|
|
8
|
+
Business,
|
|
9
|
+
Vision,
|
|
10
|
+
Value,
|
|
11
|
+
BusinessEntities,
|
|
12
|
+
BusinessCategories,
|
|
13
|
+
|
|
14
|
+
// Organization entities
|
|
15
|
+
Organization,
|
|
16
|
+
Department,
|
|
17
|
+
Team,
|
|
18
|
+
Position,
|
|
19
|
+
Role,
|
|
20
|
+
Worker,
|
|
21
|
+
OrganizationEntities,
|
|
22
|
+
OrganizationCategories,
|
|
23
|
+
|
|
24
|
+
// Goal entities
|
|
25
|
+
Goal,
|
|
26
|
+
OKR,
|
|
27
|
+
KeyResult,
|
|
28
|
+
KPI,
|
|
29
|
+
Metric,
|
|
30
|
+
Initiative,
|
|
31
|
+
GoalEntities,
|
|
32
|
+
GoalCategories,
|
|
33
|
+
|
|
34
|
+
// Offering entities
|
|
35
|
+
Product,
|
|
36
|
+
Service,
|
|
37
|
+
Feature,
|
|
38
|
+
PricingPlan,
|
|
39
|
+
RoadmapItem,
|
|
40
|
+
OfferingEntities,
|
|
41
|
+
OfferingCategories,
|
|
42
|
+
|
|
43
|
+
// Operations entities
|
|
44
|
+
Process,
|
|
45
|
+
ProcessStep,
|
|
46
|
+
Workflow,
|
|
47
|
+
WorkflowAction,
|
|
48
|
+
WorkflowRun,
|
|
49
|
+
Policy,
|
|
50
|
+
OperationsEntities,
|
|
51
|
+
OperationsCategories,
|
|
52
|
+
|
|
53
|
+
// Financial entities
|
|
54
|
+
Budget,
|
|
55
|
+
Revenue,
|
|
56
|
+
Expense,
|
|
57
|
+
Investment,
|
|
58
|
+
FinancialPeriod,
|
|
59
|
+
Forecast,
|
|
60
|
+
FinancialEntities,
|
|
61
|
+
FinancialCategories,
|
|
62
|
+
|
|
63
|
+
// All entities
|
|
64
|
+
AllBusinessEntities,
|
|
65
|
+
BusinessEntityCategories,
|
|
66
|
+
Entities,
|
|
67
|
+
} from '../src/entities/index.js'
|
|
68
|
+
|
|
69
|
+
// Helper to validate Noun structure
|
|
70
|
+
function isValidNoun(entity: unknown): boolean {
|
|
71
|
+
if (typeof entity !== 'object' || entity === null) return false
|
|
72
|
+
const e = entity as Record<string, unknown>
|
|
73
|
+
return (
|
|
74
|
+
typeof e.singular === 'string' &&
|
|
75
|
+
typeof e.plural === 'string' &&
|
|
76
|
+
typeof e.description === 'string' &&
|
|
77
|
+
typeof e.properties === 'object' &&
|
|
78
|
+
Array.isArray(e.actions) &&
|
|
79
|
+
Array.isArray(e.events)
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
describe('Business Entities', () => {
|
|
84
|
+
describe('Business', () => {
|
|
85
|
+
it('should be a valid Noun definition', () => {
|
|
86
|
+
expect(isValidNoun(Business)).toBe(true)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('should have correct singular/plural', () => {
|
|
90
|
+
expect(Business.singular).toBe('business')
|
|
91
|
+
expect(Business.plural).toBe('businesses')
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
it('should have identity properties', () => {
|
|
95
|
+
expect(Business.properties.name).toBeDefined()
|
|
96
|
+
expect(Business.properties.legalName).toBeDefined()
|
|
97
|
+
expect(Business.properties.slug).toBeDefined()
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it('should have purpose properties', () => {
|
|
101
|
+
expect(Business.properties.mission).toBeDefined()
|
|
102
|
+
expect(Business.properties.vision).toBeDefined()
|
|
103
|
+
expect(Business.properties.values).toBeDefined()
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
it('should have relationships', () => {
|
|
107
|
+
expect(Business.relationships).toBeDefined()
|
|
108
|
+
expect(Business.relationships?.organization).toBeDefined()
|
|
109
|
+
expect(Business.relationships?.products).toBeDefined()
|
|
110
|
+
expect(Business.relationships?.services).toBeDefined()
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('should have actions and events', () => {
|
|
114
|
+
expect(Business.actions).toContain('create')
|
|
115
|
+
expect(Business.actions).toContain('update')
|
|
116
|
+
expect(Business.actions).toContain('launch')
|
|
117
|
+
expect(Business.events).toContain('created')
|
|
118
|
+
expect(Business.events).toContain('updated')
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
describe('Vision', () => {
|
|
123
|
+
it('should be a valid Noun definition', () => {
|
|
124
|
+
expect(isValidNoun(Vision)).toBe(true)
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('should have correct singular/plural', () => {
|
|
128
|
+
expect(Vision.singular).toBe('vision')
|
|
129
|
+
expect(Vision.plural).toBe('visions')
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it('should have statement property', () => {
|
|
133
|
+
expect(Vision.properties.statement).toBeDefined()
|
|
134
|
+
expect(Vision.properties.statement.type).toBe('string')
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it('should have success indicators', () => {
|
|
138
|
+
expect(Vision.properties.successIndicators).toBeDefined()
|
|
139
|
+
expect(Vision.properties.successIndicators.array).toBe(true)
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
describe('Value', () => {
|
|
144
|
+
it('should be a valid Noun definition', () => {
|
|
145
|
+
expect(isValidNoun(Value)).toBe(true)
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
it('should have correct singular/plural', () => {
|
|
149
|
+
expect(Value.singular).toBe('value')
|
|
150
|
+
expect(Value.plural).toBe('values')
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('should have behaviors property', () => {
|
|
154
|
+
expect(Value.properties.behaviors).toBeDefined()
|
|
155
|
+
expect(Value.properties.antiPatterns).toBeDefined()
|
|
156
|
+
})
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
describe('BusinessEntities', () => {
|
|
160
|
+
it('should contain all business entities', () => {
|
|
161
|
+
expect(BusinessEntities.Business).toBe(Business)
|
|
162
|
+
expect(BusinessEntities.Vision).toBe(Vision)
|
|
163
|
+
expect(BusinessEntities.Value).toBe(Value)
|
|
164
|
+
})
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
describe('BusinessCategories', () => {
|
|
168
|
+
it('should categorize entities', () => {
|
|
169
|
+
expect(BusinessCategories.core).toContain('Business')
|
|
170
|
+
expect(BusinessCategories.purpose).toContain('Vision')
|
|
171
|
+
expect(BusinessCategories.purpose).toContain('Value')
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
describe('Organization Entities', () => {
|
|
177
|
+
describe('Organization', () => {
|
|
178
|
+
it('should be a valid Noun definition', () => {
|
|
179
|
+
expect(isValidNoun(Organization)).toBe(true)
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
it('should have correct singular/plural', () => {
|
|
183
|
+
expect(Organization.singular).toBe('organization')
|
|
184
|
+
expect(Organization.plural).toBe('organizations')
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
describe('Department', () => {
|
|
189
|
+
it('should be a valid Noun definition', () => {
|
|
190
|
+
expect(isValidNoun(Department)).toBe(true)
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
it('should have correct singular/plural', () => {
|
|
194
|
+
expect(Department.singular).toBe('department')
|
|
195
|
+
expect(Department.plural).toBe('departments')
|
|
196
|
+
})
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
describe('Team', () => {
|
|
200
|
+
it('should be a valid Noun definition', () => {
|
|
201
|
+
expect(isValidNoun(Team)).toBe(true)
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
it('should have correct singular/plural', () => {
|
|
205
|
+
expect(Team.singular).toBe('team')
|
|
206
|
+
expect(Team.plural).toBe('teams')
|
|
207
|
+
})
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
describe('Position', () => {
|
|
211
|
+
it('should be a valid Noun definition', () => {
|
|
212
|
+
expect(isValidNoun(Position)).toBe(true)
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
it('should have correct singular/plural', () => {
|
|
216
|
+
expect(Position.singular).toBe('position')
|
|
217
|
+
expect(Position.plural).toBe('positions')
|
|
218
|
+
})
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
describe('Role', () => {
|
|
222
|
+
it('should be a valid Noun definition', () => {
|
|
223
|
+
expect(isValidNoun(Role)).toBe(true)
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
it('should have correct singular/plural', () => {
|
|
227
|
+
expect(Role.singular).toBe('role')
|
|
228
|
+
expect(Role.plural).toBe('roles')
|
|
229
|
+
})
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
describe('Worker', () => {
|
|
233
|
+
it('should be a valid Noun definition', () => {
|
|
234
|
+
expect(isValidNoun(Worker)).toBe(true)
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
it('should have correct singular/plural', () => {
|
|
238
|
+
expect(Worker.singular).toBe('worker')
|
|
239
|
+
expect(Worker.plural).toBe('workers')
|
|
240
|
+
})
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
describe('OrganizationEntities', () => {
|
|
244
|
+
it('should contain all organization entities', () => {
|
|
245
|
+
expect(OrganizationEntities.Organization).toBe(Organization)
|
|
246
|
+
expect(OrganizationEntities.Department).toBe(Department)
|
|
247
|
+
expect(OrganizationEntities.Team).toBe(Team)
|
|
248
|
+
expect(OrganizationEntities.Position).toBe(Position)
|
|
249
|
+
expect(OrganizationEntities.Role).toBe(Role)
|
|
250
|
+
expect(OrganizationEntities.Worker).toBe(Worker)
|
|
251
|
+
})
|
|
252
|
+
})
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
describe('Goal Entities', () => {
|
|
256
|
+
describe('Goal', () => {
|
|
257
|
+
it('should be a valid Noun definition', () => {
|
|
258
|
+
expect(isValidNoun(Goal)).toBe(true)
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
it('should have correct singular/plural', () => {
|
|
262
|
+
expect(Goal.singular).toBe('goal')
|
|
263
|
+
expect(Goal.plural).toBe('goals')
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
it('should have progress properties', () => {
|
|
267
|
+
expect(Goal.properties.progress).toBeDefined()
|
|
268
|
+
expect(Goal.properties.status).toBeDefined()
|
|
269
|
+
})
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
describe('OKR', () => {
|
|
273
|
+
it('should be a valid Noun definition', () => {
|
|
274
|
+
expect(isValidNoun(OKR)).toBe(true)
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
it('should have correct singular/plural', () => {
|
|
278
|
+
expect(OKR.singular).toBe('okr')
|
|
279
|
+
expect(OKR.plural).toBe('okrs')
|
|
280
|
+
})
|
|
281
|
+
})
|
|
282
|
+
|
|
283
|
+
describe('KeyResult', () => {
|
|
284
|
+
it('should be a valid Noun definition', () => {
|
|
285
|
+
expect(isValidNoun(KeyResult)).toBe(true)
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
it('should have correct singular/plural', () => {
|
|
289
|
+
expect(KeyResult.singular).toBe('key-result')
|
|
290
|
+
expect(KeyResult.plural).toBe('key-results')
|
|
291
|
+
})
|
|
292
|
+
})
|
|
293
|
+
|
|
294
|
+
describe('KPI', () => {
|
|
295
|
+
it('should be a valid Noun definition', () => {
|
|
296
|
+
expect(isValidNoun(KPI)).toBe(true)
|
|
297
|
+
})
|
|
298
|
+
|
|
299
|
+
it('should have correct singular/plural', () => {
|
|
300
|
+
expect(KPI.singular).toBe('kpi')
|
|
301
|
+
expect(KPI.plural).toBe('kpis')
|
|
302
|
+
})
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
describe('Metric', () => {
|
|
306
|
+
it('should be a valid Noun definition', () => {
|
|
307
|
+
expect(isValidNoun(Metric)).toBe(true)
|
|
308
|
+
})
|
|
309
|
+
|
|
310
|
+
it('should have correct singular/plural', () => {
|
|
311
|
+
expect(Metric.singular).toBe('metric')
|
|
312
|
+
expect(Metric.plural).toBe('metrics')
|
|
313
|
+
})
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
describe('Initiative', () => {
|
|
317
|
+
it('should be a valid Noun definition', () => {
|
|
318
|
+
expect(isValidNoun(Initiative)).toBe(true)
|
|
319
|
+
})
|
|
320
|
+
|
|
321
|
+
it('should have correct singular/plural', () => {
|
|
322
|
+
expect(Initiative.singular).toBe('initiative')
|
|
323
|
+
expect(Initiative.plural).toBe('initiatives')
|
|
324
|
+
})
|
|
325
|
+
})
|
|
326
|
+
|
|
327
|
+
describe('GoalEntities', () => {
|
|
328
|
+
it('should contain all goal entities', () => {
|
|
329
|
+
expect(GoalEntities.Goal).toBe(Goal)
|
|
330
|
+
expect(GoalEntities.OKR).toBe(OKR)
|
|
331
|
+
expect(GoalEntities.KeyResult).toBe(KeyResult)
|
|
332
|
+
expect(GoalEntities.KPI).toBe(KPI)
|
|
333
|
+
expect(GoalEntities.Metric).toBe(Metric)
|
|
334
|
+
expect(GoalEntities.Initiative).toBe(Initiative)
|
|
335
|
+
})
|
|
336
|
+
})
|
|
337
|
+
})
|
|
338
|
+
|
|
339
|
+
describe('Offering Entities', () => {
|
|
340
|
+
describe('Product', () => {
|
|
341
|
+
it('should be a valid Noun definition', () => {
|
|
342
|
+
expect(isValidNoun(Product)).toBe(true)
|
|
343
|
+
})
|
|
344
|
+
|
|
345
|
+
it('should have correct singular/plural', () => {
|
|
346
|
+
expect(Product.singular).toBe('product')
|
|
347
|
+
expect(Product.plural).toBe('products')
|
|
348
|
+
})
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
describe('Service', () => {
|
|
352
|
+
it('should be a valid Noun definition', () => {
|
|
353
|
+
expect(isValidNoun(Service)).toBe(true)
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
it('should have correct singular/plural', () => {
|
|
357
|
+
expect(Service.singular).toBe('service')
|
|
358
|
+
expect(Service.plural).toBe('services')
|
|
359
|
+
})
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
describe('Feature', () => {
|
|
363
|
+
it('should be a valid Noun definition', () => {
|
|
364
|
+
expect(isValidNoun(Feature)).toBe(true)
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
it('should have correct singular/plural', () => {
|
|
368
|
+
expect(Feature.singular).toBe('feature')
|
|
369
|
+
expect(Feature.plural).toBe('features')
|
|
370
|
+
})
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
describe('PricingPlan', () => {
|
|
374
|
+
it('should be a valid Noun definition', () => {
|
|
375
|
+
expect(isValidNoun(PricingPlan)).toBe(true)
|
|
376
|
+
})
|
|
377
|
+
|
|
378
|
+
it('should have correct singular/plural', () => {
|
|
379
|
+
expect(PricingPlan.singular).toBe('pricing-plan')
|
|
380
|
+
expect(PricingPlan.plural).toBe('pricing-plans')
|
|
381
|
+
})
|
|
382
|
+
})
|
|
383
|
+
|
|
384
|
+
describe('RoadmapItem', () => {
|
|
385
|
+
it('should be a valid Noun definition', () => {
|
|
386
|
+
expect(isValidNoun(RoadmapItem)).toBe(true)
|
|
387
|
+
})
|
|
388
|
+
|
|
389
|
+
it('should have correct singular/plural', () => {
|
|
390
|
+
expect(RoadmapItem.singular).toBe('roadmap-item')
|
|
391
|
+
expect(RoadmapItem.plural).toBe('roadmap-items')
|
|
392
|
+
})
|
|
393
|
+
})
|
|
394
|
+
|
|
395
|
+
describe('OfferingEntities', () => {
|
|
396
|
+
it('should contain all offering entities', () => {
|
|
397
|
+
expect(OfferingEntities.Product).toBe(Product)
|
|
398
|
+
expect(OfferingEntities.Service).toBe(Service)
|
|
399
|
+
expect(OfferingEntities.Feature).toBe(Feature)
|
|
400
|
+
expect(OfferingEntities.PricingPlan).toBe(PricingPlan)
|
|
401
|
+
expect(OfferingEntities.RoadmapItem).toBe(RoadmapItem)
|
|
402
|
+
})
|
|
403
|
+
})
|
|
404
|
+
})
|
|
405
|
+
|
|
406
|
+
describe('Operations Entities', () => {
|
|
407
|
+
describe('Process', () => {
|
|
408
|
+
it('should be a valid Noun definition', () => {
|
|
409
|
+
expect(isValidNoun(Process)).toBe(true)
|
|
410
|
+
})
|
|
411
|
+
|
|
412
|
+
it('should have correct singular/plural', () => {
|
|
413
|
+
expect(Process.singular).toBe('process')
|
|
414
|
+
expect(Process.plural).toBe('processes')
|
|
415
|
+
})
|
|
416
|
+
})
|
|
417
|
+
|
|
418
|
+
describe('ProcessStep', () => {
|
|
419
|
+
it('should be a valid Noun definition', () => {
|
|
420
|
+
expect(isValidNoun(ProcessStep)).toBe(true)
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
it('should have correct singular/plural', () => {
|
|
424
|
+
expect(ProcessStep.singular).toBe('process-step')
|
|
425
|
+
expect(ProcessStep.plural).toBe('process-steps')
|
|
426
|
+
})
|
|
427
|
+
})
|
|
428
|
+
|
|
429
|
+
describe('Workflow', () => {
|
|
430
|
+
it('should be a valid Noun definition', () => {
|
|
431
|
+
expect(isValidNoun(Workflow)).toBe(true)
|
|
432
|
+
})
|
|
433
|
+
|
|
434
|
+
it('should have correct singular/plural', () => {
|
|
435
|
+
expect(Workflow.singular).toBe('workflow')
|
|
436
|
+
expect(Workflow.plural).toBe('workflows')
|
|
437
|
+
})
|
|
438
|
+
})
|
|
439
|
+
|
|
440
|
+
describe('WorkflowAction', () => {
|
|
441
|
+
it('should be a valid Noun definition', () => {
|
|
442
|
+
expect(isValidNoun(WorkflowAction)).toBe(true)
|
|
443
|
+
})
|
|
444
|
+
|
|
445
|
+
it('should have correct singular/plural', () => {
|
|
446
|
+
expect(WorkflowAction.singular).toBe('workflow-action')
|
|
447
|
+
expect(WorkflowAction.plural).toBe('workflow-actions')
|
|
448
|
+
})
|
|
449
|
+
})
|
|
450
|
+
|
|
451
|
+
describe('WorkflowRun', () => {
|
|
452
|
+
it('should be a valid Noun definition', () => {
|
|
453
|
+
expect(isValidNoun(WorkflowRun)).toBe(true)
|
|
454
|
+
})
|
|
455
|
+
|
|
456
|
+
it('should have correct singular/plural', () => {
|
|
457
|
+
expect(WorkflowRun.singular).toBe('workflow-run')
|
|
458
|
+
expect(WorkflowRun.plural).toBe('workflow-runs')
|
|
459
|
+
})
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
describe('Policy', () => {
|
|
463
|
+
it('should be a valid Noun definition', () => {
|
|
464
|
+
expect(isValidNoun(Policy)).toBe(true)
|
|
465
|
+
})
|
|
466
|
+
|
|
467
|
+
it('should have correct singular/plural', () => {
|
|
468
|
+
expect(Policy.singular).toBe('policy')
|
|
469
|
+
expect(Policy.plural).toBe('policies')
|
|
470
|
+
})
|
|
471
|
+
})
|
|
472
|
+
|
|
473
|
+
describe('OperationsEntities', () => {
|
|
474
|
+
it('should contain all operations entities', () => {
|
|
475
|
+
expect(OperationsEntities.Process).toBe(Process)
|
|
476
|
+
expect(OperationsEntities.ProcessStep).toBe(ProcessStep)
|
|
477
|
+
expect(OperationsEntities.Workflow).toBe(Workflow)
|
|
478
|
+
expect(OperationsEntities.WorkflowAction).toBe(WorkflowAction)
|
|
479
|
+
expect(OperationsEntities.WorkflowRun).toBe(WorkflowRun)
|
|
480
|
+
expect(OperationsEntities.Policy).toBe(Policy)
|
|
481
|
+
})
|
|
482
|
+
})
|
|
483
|
+
})
|
|
484
|
+
|
|
485
|
+
describe('Financial Entities', () => {
|
|
486
|
+
describe('Budget', () => {
|
|
487
|
+
it('should be a valid Noun definition', () => {
|
|
488
|
+
expect(isValidNoun(Budget)).toBe(true)
|
|
489
|
+
})
|
|
490
|
+
|
|
491
|
+
it('should have correct singular/plural', () => {
|
|
492
|
+
expect(Budget.singular).toBe('budget')
|
|
493
|
+
expect(Budget.plural).toBe('budgets')
|
|
494
|
+
})
|
|
495
|
+
})
|
|
496
|
+
|
|
497
|
+
describe('Revenue', () => {
|
|
498
|
+
it('should be a valid Noun definition', () => {
|
|
499
|
+
expect(isValidNoun(Revenue)).toBe(true)
|
|
500
|
+
})
|
|
501
|
+
|
|
502
|
+
it('should have correct singular/plural', () => {
|
|
503
|
+
expect(Revenue.singular).toBe('revenue')
|
|
504
|
+
expect(Revenue.plural).toBe('revenues')
|
|
505
|
+
})
|
|
506
|
+
})
|
|
507
|
+
|
|
508
|
+
describe('Expense', () => {
|
|
509
|
+
it('should be a valid Noun definition', () => {
|
|
510
|
+
expect(isValidNoun(Expense)).toBe(true)
|
|
511
|
+
})
|
|
512
|
+
|
|
513
|
+
it('should have correct singular/plural', () => {
|
|
514
|
+
expect(Expense.singular).toBe('expense')
|
|
515
|
+
expect(Expense.plural).toBe('expenses')
|
|
516
|
+
})
|
|
517
|
+
})
|
|
518
|
+
|
|
519
|
+
describe('Investment', () => {
|
|
520
|
+
it('should be a valid Noun definition', () => {
|
|
521
|
+
expect(isValidNoun(Investment)).toBe(true)
|
|
522
|
+
})
|
|
523
|
+
|
|
524
|
+
it('should have correct singular/plural', () => {
|
|
525
|
+
expect(Investment.singular).toBe('investment')
|
|
526
|
+
expect(Investment.plural).toBe('investments')
|
|
527
|
+
})
|
|
528
|
+
})
|
|
529
|
+
|
|
530
|
+
describe('FinancialPeriod', () => {
|
|
531
|
+
it('should be a valid Noun definition', () => {
|
|
532
|
+
expect(isValidNoun(FinancialPeriod)).toBe(true)
|
|
533
|
+
})
|
|
534
|
+
|
|
535
|
+
it('should have correct singular/plural', () => {
|
|
536
|
+
expect(FinancialPeriod.singular).toBe('financial-period')
|
|
537
|
+
expect(FinancialPeriod.plural).toBe('financial-periods')
|
|
538
|
+
})
|
|
539
|
+
})
|
|
540
|
+
|
|
541
|
+
describe('Forecast', () => {
|
|
542
|
+
it('should be a valid Noun definition', () => {
|
|
543
|
+
expect(isValidNoun(Forecast)).toBe(true)
|
|
544
|
+
})
|
|
545
|
+
|
|
546
|
+
it('should have correct singular/plural', () => {
|
|
547
|
+
expect(Forecast.singular).toBe('forecast')
|
|
548
|
+
expect(Forecast.plural).toBe('forecasts')
|
|
549
|
+
})
|
|
550
|
+
})
|
|
551
|
+
|
|
552
|
+
describe('FinancialEntities', () => {
|
|
553
|
+
it('should contain all financial entities', () => {
|
|
554
|
+
expect(FinancialEntities.Budget).toBe(Budget)
|
|
555
|
+
expect(FinancialEntities.Revenue).toBe(Revenue)
|
|
556
|
+
expect(FinancialEntities.Expense).toBe(Expense)
|
|
557
|
+
expect(FinancialEntities.Investment).toBe(Investment)
|
|
558
|
+
expect(FinancialEntities.FinancialPeriod).toBe(FinancialPeriod)
|
|
559
|
+
expect(FinancialEntities.Forecast).toBe(Forecast)
|
|
560
|
+
})
|
|
561
|
+
})
|
|
562
|
+
})
|
|
563
|
+
|
|
564
|
+
describe('AllBusinessEntities', () => {
|
|
565
|
+
it('should contain all entity categories', () => {
|
|
566
|
+
expect(AllBusinessEntities.business).toBeDefined()
|
|
567
|
+
expect(AllBusinessEntities.organization).toBeDefined()
|
|
568
|
+
expect(AllBusinessEntities.goals).toBeDefined()
|
|
569
|
+
expect(AllBusinessEntities.offerings).toBeDefined()
|
|
570
|
+
expect(AllBusinessEntities.operations).toBeDefined()
|
|
571
|
+
expect(AllBusinessEntities.financials).toBeDefined()
|
|
572
|
+
expect(AllBusinessEntities.customers).toBeDefined()
|
|
573
|
+
expect(AllBusinessEntities.sales).toBeDefined()
|
|
574
|
+
expect(AllBusinessEntities.marketing).toBeDefined()
|
|
575
|
+
expect(AllBusinessEntities.partnerships).toBeDefined()
|
|
576
|
+
expect(AllBusinessEntities.legal).toBeDefined()
|
|
577
|
+
expect(AllBusinessEntities.risk).toBeDefined()
|
|
578
|
+
expect(AllBusinessEntities.projects).toBeDefined()
|
|
579
|
+
expect(AllBusinessEntities.planning).toBeDefined()
|
|
580
|
+
expect(AllBusinessEntities.communication).toBeDefined()
|
|
581
|
+
expect(AllBusinessEntities.assets).toBeDefined()
|
|
582
|
+
expect(AllBusinessEntities.market).toBeDefined()
|
|
583
|
+
})
|
|
584
|
+
})
|
|
585
|
+
|
|
586
|
+
describe('BusinessEntityCategories', () => {
|
|
587
|
+
it('should contain all category names', () => {
|
|
588
|
+
expect(BusinessEntityCategories).toContain('business')
|
|
589
|
+
expect(BusinessEntityCategories).toContain('organization')
|
|
590
|
+
expect(BusinessEntityCategories).toContain('goals')
|
|
591
|
+
expect(BusinessEntityCategories).toContain('offerings')
|
|
592
|
+
expect(BusinessEntityCategories).toContain('operations')
|
|
593
|
+
expect(BusinessEntityCategories).toContain('financials')
|
|
594
|
+
expect(BusinessEntityCategories).toContain('customers')
|
|
595
|
+
expect(BusinessEntityCategories).toContain('sales')
|
|
596
|
+
expect(BusinessEntityCategories).toContain('marketing')
|
|
597
|
+
expect(BusinessEntityCategories).toContain('partnerships')
|
|
598
|
+
expect(BusinessEntityCategories).toContain('legal')
|
|
599
|
+
expect(BusinessEntityCategories).toContain('risk')
|
|
600
|
+
expect(BusinessEntityCategories).toContain('projects')
|
|
601
|
+
expect(BusinessEntityCategories).toContain('planning')
|
|
602
|
+
expect(BusinessEntityCategories).toContain('communication')
|
|
603
|
+
expect(BusinessEntityCategories).toContain('assets')
|
|
604
|
+
expect(BusinessEntityCategories).toContain('market')
|
|
605
|
+
})
|
|
606
|
+
|
|
607
|
+
it('should have 17 categories', () => {
|
|
608
|
+
expect(BusinessEntityCategories).toHaveLength(17)
|
|
609
|
+
})
|
|
610
|
+
})
|
|
611
|
+
|
|
612
|
+
describe('Entities', () => {
|
|
613
|
+
it('should be a flat object containing all entities', () => {
|
|
614
|
+
// Verify some entities from different categories exist
|
|
615
|
+
expect(Entities.Business).toBeDefined()
|
|
616
|
+
expect(Entities.Organization).toBeDefined()
|
|
617
|
+
expect(Entities.Goal).toBeDefined()
|
|
618
|
+
expect(Entities.Product).toBeDefined()
|
|
619
|
+
expect(Entities.Process).toBeDefined()
|
|
620
|
+
expect(Entities.Budget).toBeDefined()
|
|
621
|
+
})
|
|
622
|
+
|
|
623
|
+
it('should have valid Noun structure for all entities', () => {
|
|
624
|
+
for (const [name, entity] of Object.entries(Entities)) {
|
|
625
|
+
expect(isValidNoun(entity)).toBe(true)
|
|
626
|
+
}
|
|
627
|
+
})
|
|
628
|
+
})
|