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.
- package/.turbo/turbo-build.log +5 -0
- package/CHANGELOG.md +17 -0
- package/IMPLEMENTATION.md +226 -0
- package/README.md +1133 -193
- package/dist/business.d.ts +62 -0
- package/dist/business.d.ts.map +1 -0
- package/dist/business.js +109 -0
- package/dist/business.js.map +1 -0
- package/dist/dollar.d.ts +60 -0
- package/dist/dollar.d.ts.map +1 -0
- package/dist/dollar.js +107 -0
- package/dist/dollar.js.map +1 -0
- package/dist/entities/assets.d.ts +21 -0
- package/dist/entities/assets.d.ts.map +1 -0
- package/dist/entities/assets.js +323 -0
- package/dist/entities/assets.js.map +1 -0
- package/dist/entities/business.d.ts +36 -0
- package/dist/entities/business.d.ts.map +1 -0
- package/dist/entities/business.js +370 -0
- package/dist/entities/business.js.map +1 -0
- package/dist/entities/communication.d.ts +21 -0
- package/dist/entities/communication.d.ts.map +1 -0
- package/dist/entities/communication.js +255 -0
- package/dist/entities/communication.js.map +1 -0
- package/dist/entities/customers.d.ts +58 -0
- package/dist/entities/customers.d.ts.map +1 -0
- package/dist/entities/customers.js +989 -0
- package/dist/entities/customers.js.map +1 -0
- package/dist/entities/financials.d.ts +59 -0
- package/dist/entities/financials.d.ts.map +1 -0
- package/dist/entities/financials.js +932 -0
- package/dist/entities/financials.js.map +1 -0
- package/dist/entities/goals.d.ts +58 -0
- package/dist/entities/goals.d.ts.map +1 -0
- package/dist/entities/goals.js +800 -0
- package/dist/entities/goals.js.map +1 -0
- package/dist/entities/index.d.ts +299 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +198 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/legal.d.ts +21 -0
- package/dist/entities/legal.d.ts.map +1 -0
- package/dist/entities/legal.js +301 -0
- package/dist/entities/legal.js.map +1 -0
- package/dist/entities/market.d.ts +21 -0
- package/dist/entities/market.d.ts.map +1 -0
- package/dist/entities/market.js +301 -0
- package/dist/entities/market.js.map +1 -0
- package/dist/entities/marketing.d.ts +67 -0
- package/dist/entities/marketing.d.ts.map +1 -0
- package/dist/entities/marketing.js +1157 -0
- package/dist/entities/marketing.js.map +1 -0
- package/dist/entities/offerings.d.ts +51 -0
- package/dist/entities/offerings.d.ts.map +1 -0
- package/dist/entities/offerings.js +727 -0
- package/dist/entities/offerings.js.map +1 -0
- package/dist/entities/operations.d.ts +58 -0
- package/dist/entities/operations.d.ts.map +1 -0
- package/dist/entities/operations.js +787 -0
- package/dist/entities/operations.js.map +1 -0
- package/dist/entities/organization.d.ts +57 -0
- package/dist/entities/organization.d.ts.map +1 -0
- package/dist/entities/organization.js +807 -0
- package/dist/entities/organization.js.map +1 -0
- package/dist/entities/partnerships.d.ts +21 -0
- package/dist/entities/partnerships.d.ts.map +1 -0
- package/dist/entities/partnerships.js +300 -0
- package/dist/entities/partnerships.js.map +1 -0
- package/dist/entities/planning.d.ts +87 -0
- package/dist/entities/planning.d.ts.map +1 -0
- package/dist/entities/planning.js +271 -0
- package/dist/entities/planning.js.map +1 -0
- package/dist/entities/projects.d.ts +25 -0
- package/dist/entities/projects.d.ts.map +1 -0
- package/dist/entities/projects.js +349 -0
- package/dist/entities/projects.js.map +1 -0
- package/dist/entities/risk.d.ts +21 -0
- package/dist/entities/risk.d.ts.map +1 -0
- package/dist/entities/risk.js +293 -0
- package/dist/entities/risk.js.map +1 -0
- package/dist/entities/sales.d.ts +72 -0
- package/dist/entities/sales.d.ts.map +1 -0
- package/dist/entities/sales.js +1248 -0
- package/dist/entities/sales.js.map +1 -0
- package/dist/financials.d.ts +130 -0
- package/dist/financials.d.ts.map +1 -0
- package/dist/financials.js +297 -0
- package/dist/financials.js.map +1 -0
- package/dist/goals.d.ts +87 -0
- package/dist/goals.d.ts.map +1 -0
- package/dist/goals.js +215 -0
- package/dist/goals.js.map +1 -0
- package/dist/index.d.ts +97 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +131 -1079
- package/dist/index.js.map +1 -1
- package/dist/kpis.d.ts +118 -0
- package/dist/kpis.d.ts.map +1 -0
- package/dist/kpis.js +232 -0
- package/dist/kpis.js.map +1 -0
- package/dist/metrics.d.ts +448 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +325 -0
- package/dist/metrics.js.map +1 -0
- package/dist/okrs.d.ts +123 -0
- package/dist/okrs.d.ts.map +1 -0
- package/dist/okrs.js +269 -0
- package/dist/okrs.js.map +1 -0
- package/dist/organization.d.ts +585 -0
- package/dist/organization.d.ts.map +1 -0
- package/dist/organization.js +173 -0
- package/dist/organization.js.map +1 -0
- package/dist/process.d.ts +112 -0
- package/dist/process.d.ts.map +1 -0
- package/dist/process.js +241 -0
- package/dist/process.js.map +1 -0
- package/dist/product.d.ts +85 -0
- package/dist/product.d.ts.map +1 -0
- package/dist/product.js +145 -0
- package/dist/product.js.map +1 -0
- package/dist/queries.d.ts +304 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +415 -0
- package/dist/queries.js.map +1 -0
- package/dist/roles.d.ts +340 -0
- package/dist/roles.d.ts.map +1 -0
- package/dist/roles.js +255 -0
- package/dist/roles.js.map +1 -0
- package/dist/service.d.ts +61 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +140 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +459 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/vision.d.ts +38 -0
- package/dist/vision.d.ts.map +1 -0
- package/dist/vision.js +68 -0
- package/dist/vision.js.map +1 -0
- package/dist/workflow.d.ts +115 -0
- package/dist/workflow.d.ts.map +1 -0
- package/dist/workflow.js +247 -0
- package/dist/workflow.js.map +1 -0
- package/examples/basic-usage.ts +307 -0
- package/package.json +19 -60
- package/src/business.ts +121 -0
- package/src/dollar.ts +132 -0
- package/src/entities/assets.ts +332 -0
- package/src/entities/business.ts +406 -0
- package/src/entities/communication.ts +264 -0
- package/src/entities/customers.ts +1072 -0
- package/src/entities/financials.ts +1011 -0
- package/src/entities/goals.ts +871 -0
- package/src/entities/index.ts +383 -0
- package/src/entities/legal.ts +310 -0
- package/src/entities/market.ts +310 -0
- package/src/entities/marketing.ts +1249 -0
- package/src/entities/offerings.ts +789 -0
- package/src/entities/operations.ts +861 -0
- package/src/entities/organization.ts +876 -0
- package/src/entities/partnerships.ts +309 -0
- package/src/entities/planning.ts +307 -0
- package/src/entities/projects.ts +360 -0
- package/src/entities/risk.ts +302 -0
- package/src/entities/sales.ts +1352 -0
- package/src/financials.ts +352 -0
- package/src/goals.ts +250 -0
- package/src/index.test.ts +336 -0
- package/src/index.ts +530 -0
- package/src/kpis.ts +275 -0
- package/src/metrics.ts +825 -0
- package/src/okrs.ts +325 -0
- package/src/organization.ts +909 -0
- package/src/process.ts +272 -0
- package/src/product.ts +178 -0
- package/src/queries.ts +767 -0
- package/src/roles.ts +686 -0
- package/src/service.ts +164 -0
- package/src/types.ts +493 -0
- package/src/vision.ts +88 -0
- package/src/workflow.ts +280 -0
- package/tsconfig.json +9 -0
- package/dist/loaders/index.d.ts +0 -174
- package/dist/loaders/index.js +0 -366
- package/dist/loaders/index.js.map +0 -1
- package/dist/schema/index.d.ts +0 -146
- package/dist/schema/index.js +0 -716
- package/dist/schema/index.js.map +0 -1
- package/dist/types-CJ9eGS_C.d.ts +0 -86
package/src/okrs.ts
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Objectives and Key Results (OKRs) management
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { OKRDefinition, KeyResult } from './types.js'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Define Objectives and Key Results for goal tracking
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const quarterlyOKRs = okrs([
|
|
13
|
+
* {
|
|
14
|
+
* objective: 'Achieve Product-Market Fit',
|
|
15
|
+
* description: 'Validate that our product solves a real problem for customers',
|
|
16
|
+
* period: 'Q2 2024',
|
|
17
|
+
* owner: 'CEO',
|
|
18
|
+
* keyResults: [
|
|
19
|
+
* {
|
|
20
|
+
* description: 'Increase Net Promoter Score',
|
|
21
|
+
* metric: 'NPS',
|
|
22
|
+
* startValue: 40,
|
|
23
|
+
* targetValue: 60,
|
|
24
|
+
* currentValue: 52,
|
|
25
|
+
* unit: 'score',
|
|
26
|
+
* progress: 60,
|
|
27
|
+
* },
|
|
28
|
+
* {
|
|
29
|
+
* description: 'Reduce monthly churn rate',
|
|
30
|
+
* metric: 'Churn Rate',
|
|
31
|
+
* startValue: 8,
|
|
32
|
+
* targetValue: 4,
|
|
33
|
+
* currentValue: 5.5,
|
|
34
|
+
* unit: 'percent',
|
|
35
|
+
* progress: 62.5,
|
|
36
|
+
* },
|
|
37
|
+
* {
|
|
38
|
+
* description: 'Achieve customer retention',
|
|
39
|
+
* metric: 'Customers with 3+ months',
|
|
40
|
+
* startValue: 50,
|
|
41
|
+
* targetValue: 200,
|
|
42
|
+
* currentValue: 125,
|
|
43
|
+
* unit: 'customers',
|
|
44
|
+
* progress: 50,
|
|
45
|
+
* },
|
|
46
|
+
* ],
|
|
47
|
+
* status: 'on-track',
|
|
48
|
+
* confidence: 75,
|
|
49
|
+
* },
|
|
50
|
+
* ])
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export function okrs(definitions: OKRDefinition[]): OKRDefinition[] {
|
|
54
|
+
return definitions.map(okr => validateAndNormalizeOKR(okr))
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Define a single OKR
|
|
59
|
+
*/
|
|
60
|
+
export function okr(definition: OKRDefinition): OKRDefinition {
|
|
61
|
+
return validateAndNormalizeOKR(definition)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Validate and normalize an OKR definition
|
|
66
|
+
*/
|
|
67
|
+
function validateAndNormalizeOKR(okr: OKRDefinition): OKRDefinition {
|
|
68
|
+
if (!okr.objective) {
|
|
69
|
+
throw new Error('OKR objective is required')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Calculate progress for key results if not set
|
|
73
|
+
const keyResults = okr.keyResults?.map(kr => ({
|
|
74
|
+
...kr,
|
|
75
|
+
progress: kr.progress ?? calculateKeyResultProgress(kr),
|
|
76
|
+
}))
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
...okr,
|
|
80
|
+
keyResults,
|
|
81
|
+
status: okr.status || 'not-started',
|
|
82
|
+
confidence: okr.confidence ?? calculateConfidence(keyResults || []),
|
|
83
|
+
metadata: okr.metadata || {},
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Calculate key result progress
|
|
89
|
+
*/
|
|
90
|
+
export function calculateKeyResultProgress(kr: KeyResult): number {
|
|
91
|
+
if (kr.currentValue === undefined || kr.startValue === undefined) return 0
|
|
92
|
+
|
|
93
|
+
const total = kr.targetValue - kr.startValue
|
|
94
|
+
if (total === 0) return 100
|
|
95
|
+
|
|
96
|
+
const current = kr.currentValue - kr.startValue
|
|
97
|
+
const progress = (current / total) * 100
|
|
98
|
+
|
|
99
|
+
return Math.max(0, Math.min(100, progress))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Calculate overall OKR progress
|
|
104
|
+
*/
|
|
105
|
+
export function calculateOKRProgress(okr: OKRDefinition): number {
|
|
106
|
+
if (!okr.keyResults || okr.keyResults.length === 0) return 0
|
|
107
|
+
|
|
108
|
+
const totalProgress = okr.keyResults.reduce((sum, kr) => {
|
|
109
|
+
return sum + (kr.progress ?? calculateKeyResultProgress(kr))
|
|
110
|
+
}, 0)
|
|
111
|
+
|
|
112
|
+
return totalProgress / okr.keyResults.length
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Calculate confidence score based on key results
|
|
117
|
+
*/
|
|
118
|
+
export function calculateConfidence(keyResults: KeyResult[]): number {
|
|
119
|
+
if (keyResults.length === 0) return 0
|
|
120
|
+
|
|
121
|
+
const totalProgress = keyResults.reduce((sum, kr) => {
|
|
122
|
+
return sum + (kr.progress ?? calculateKeyResultProgress(kr))
|
|
123
|
+
}, 0)
|
|
124
|
+
|
|
125
|
+
const avgProgress = totalProgress / keyResults.length
|
|
126
|
+
|
|
127
|
+
// Confidence tends to be slightly lower than actual progress
|
|
128
|
+
return Math.max(0, Math.min(100, avgProgress - 10))
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Update key result current value
|
|
133
|
+
*/
|
|
134
|
+
export function updateKeyResult(
|
|
135
|
+
okr: OKRDefinition,
|
|
136
|
+
krDescription: string,
|
|
137
|
+
currentValue: number
|
|
138
|
+
): OKRDefinition {
|
|
139
|
+
const keyResults = okr.keyResults?.map(kr => {
|
|
140
|
+
if (kr.description === krDescription) {
|
|
141
|
+
const updatedKR = { ...kr, currentValue }
|
|
142
|
+
return {
|
|
143
|
+
...updatedKR,
|
|
144
|
+
progress: calculateKeyResultProgress(updatedKR),
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return kr
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
// Recalculate overall status and confidence
|
|
151
|
+
const progress = calculateOKRProgress({ ...okr, keyResults })
|
|
152
|
+
const status = determineOKRStatus(progress, okr.confidence || 0)
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
...okr,
|
|
156
|
+
keyResults,
|
|
157
|
+
status,
|
|
158
|
+
confidence: calculateConfidence(keyResults || []),
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Determine OKR status based on progress and confidence
|
|
164
|
+
*/
|
|
165
|
+
function determineOKRStatus(
|
|
166
|
+
progress: number,
|
|
167
|
+
confidence: number
|
|
168
|
+
): OKRDefinition['status'] {
|
|
169
|
+
if (progress === 0) return 'not-started'
|
|
170
|
+
if (progress === 100) return 'completed'
|
|
171
|
+
if (confidence < 50 || progress < 30) return 'at-risk'
|
|
172
|
+
return 'on-track'
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Check if key result is on track
|
|
177
|
+
*/
|
|
178
|
+
export function isKeyResultOnTrack(kr: KeyResult): boolean {
|
|
179
|
+
const progress = kr.progress ?? calculateKeyResultProgress(kr)
|
|
180
|
+
return progress >= 70
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Check if OKR is on track
|
|
185
|
+
*/
|
|
186
|
+
export function isOKROnTrack(okr: OKRDefinition): boolean {
|
|
187
|
+
const progress = calculateOKRProgress(okr)
|
|
188
|
+
return progress >= 70 && (okr.confidence ?? 0) >= 60
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Get key results that are on track
|
|
193
|
+
*/
|
|
194
|
+
export function getKeyResultsOnTrack(okr: OKRDefinition): KeyResult[] {
|
|
195
|
+
return okr.keyResults?.filter(isKeyResultOnTrack) || []
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Get key results that are at risk
|
|
200
|
+
*/
|
|
201
|
+
export function getKeyResultsAtRisk(okr: OKRDefinition): KeyResult[] {
|
|
202
|
+
return okr.keyResults?.filter(kr => !isKeyResultOnTrack(kr)) || []
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Get OKRs by owner
|
|
207
|
+
*/
|
|
208
|
+
export function getOKRsByOwner(okrs: OKRDefinition[], owner: string): OKRDefinition[] {
|
|
209
|
+
return okrs.filter(okr => okr.owner === owner)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Get OKRs by period
|
|
214
|
+
*/
|
|
215
|
+
export function getOKRsByPeriod(okrs: OKRDefinition[], period: string): OKRDefinition[] {
|
|
216
|
+
return okrs.filter(okr => okr.period === period)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Get OKRs by status
|
|
221
|
+
*/
|
|
222
|
+
export function getOKRsByStatus(
|
|
223
|
+
okrs: OKRDefinition[],
|
|
224
|
+
status: OKRDefinition['status']
|
|
225
|
+
): OKRDefinition[] {
|
|
226
|
+
return okrs.filter(okr => okr.status === status)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Calculate success rate across all OKRs
|
|
231
|
+
*/
|
|
232
|
+
export function calculateSuccessRate(okrs: OKRDefinition[]): number {
|
|
233
|
+
if (okrs.length === 0) return 0
|
|
234
|
+
|
|
235
|
+
const avgProgress = okrs.reduce((sum, okr) => {
|
|
236
|
+
return sum + calculateOKRProgress(okr)
|
|
237
|
+
}, 0) / okrs.length
|
|
238
|
+
|
|
239
|
+
return avgProgress
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Format key result for display
|
|
244
|
+
*/
|
|
245
|
+
export function formatKeyResult(kr: KeyResult): string {
|
|
246
|
+
const progress = kr.progress ?? calculateKeyResultProgress(kr)
|
|
247
|
+
const current = kr.currentValue ?? kr.startValue ?? 0
|
|
248
|
+
const target = kr.targetValue
|
|
249
|
+
|
|
250
|
+
return `${kr.description}: ${current}/${target} ${kr.unit || ''} (${progress.toFixed(0)}%)`
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Compare OKR performance between periods
|
|
255
|
+
*/
|
|
256
|
+
export function compareOKRPerformance(
|
|
257
|
+
current: OKRDefinition,
|
|
258
|
+
previous: OKRDefinition
|
|
259
|
+
): {
|
|
260
|
+
progressDelta: number
|
|
261
|
+
confidenceDelta: number
|
|
262
|
+
improved: boolean
|
|
263
|
+
} {
|
|
264
|
+
const currentProgress = calculateOKRProgress(current)
|
|
265
|
+
const previousProgress = calculateOKRProgress(previous)
|
|
266
|
+
const progressDelta = currentProgress - previousProgress
|
|
267
|
+
|
|
268
|
+
const currentConfidence = current.confidence ?? 0
|
|
269
|
+
const previousConfidence = previous.confidence ?? 0
|
|
270
|
+
const confidenceDelta = currentConfidence - previousConfidence
|
|
271
|
+
|
|
272
|
+
const improved = progressDelta > 0 && confidenceDelta >= 0
|
|
273
|
+
|
|
274
|
+
return { progressDelta, confidenceDelta, improved }
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Validate OKR definitions
|
|
279
|
+
*/
|
|
280
|
+
export function validateOKRs(okrs: OKRDefinition[]): { valid: boolean; errors: string[] } {
|
|
281
|
+
const errors: string[] = []
|
|
282
|
+
|
|
283
|
+
for (const okr of okrs) {
|
|
284
|
+
if (!okr.objective) {
|
|
285
|
+
errors.push('OKR objective is required')
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (okr.objective && okr.objective.length < 10) {
|
|
289
|
+
errors.push(`OKR objective "${okr.objective}" should be at least 10 characters`)
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (okr.confidence !== undefined && (okr.confidence < 0 || okr.confidence > 100)) {
|
|
293
|
+
errors.push(`OKR "${okr.objective}" confidence must be between 0 and 100`)
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (okr.keyResults) {
|
|
297
|
+
if (okr.keyResults.length === 0) {
|
|
298
|
+
errors.push(`OKR "${okr.objective}" must have at least one key result`)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (okr.keyResults.length > 5) {
|
|
302
|
+
errors.push(`OKR "${okr.objective}" should have no more than 5 key results`)
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
for (const kr of okr.keyResults) {
|
|
306
|
+
if (!kr.description) {
|
|
307
|
+
errors.push(`Key result in OKR "${okr.objective}" must have a description`)
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (!kr.metric) {
|
|
311
|
+
errors.push(`Key result "${kr.description}" must have a metric`)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (kr.progress !== undefined && (kr.progress < 0 || kr.progress > 100)) {
|
|
315
|
+
errors.push(`Key result "${kr.description}" progress must be between 0 and 100`)
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
return {
|
|
322
|
+
valid: errors.length === 0,
|
|
323
|
+
errors,
|
|
324
|
+
}
|
|
325
|
+
}
|