init
This commit is contained in:
13
src/lib/phaseAggregate.ts
Normal file
13
src/lib/phaseAggregate.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import type { PhaseId, StoryGroup } from '../types/jira'
|
||||
import { statusToPhase } from './statusPhase'
|
||||
|
||||
export function countSubtasksByPhase(groups: StoryGroup[]): Record<PhaseId, number> {
|
||||
const acc: Record<PhaseId, number> = { analyse: 0, design: 0, integration: 0, done: 0 }
|
||||
for (const g of groups) {
|
||||
for (const s of g.subtasks) {
|
||||
const p = statusToPhase(s.fields.status.name)
|
||||
acc[p] += 1
|
||||
}
|
||||
}
|
||||
return acc
|
||||
}
|
||||
Reference in New Issue
Block a user