docs(release): seal and deliver task agreement 1.25 with retained production state
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
export function summarize(tasks) {
|
||||
const counts = { todo: 0, doing: 0, done: 0, blocked: 0 };
|
||||
let remainingMinutes = 0;
|
||||
for (const task of tasks) {
|
||||
counts[task.status] += 1;
|
||||
if (task.status !== 'done') remainingMinutes += task.minutes;
|
||||
}
|
||||
|
||||
const total = tasks.length;
|
||||
return {
|
||||
total,
|
||||
counts,
|
||||
completedPercent: total === 0 ? 0 : Math.round(counts.done / total * 100),
|
||||
remainingMinutes,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user