feat(governance): implement 5-stage task lifecycle and CEO approval state machine
This commit is contained in:
1 parent
8bf1843b9b
commit
dd90ab0f4c
3 files changed
+73
-15
No files matched your search
@@ -73,6 +73,10 @@ export class DepartmentTasksController {
|
||||
});
|
||||
|
||||
const statusCounts: Record<string, number> = {
|
||||
TODO: 0,
|
||||
IN_PROGRESS: 0,
|
||||
TEST: 0,
|
||||
DONE: 0,
|
||||
BACKLOG: 0,
|
||||
IN_PROGRESS: 0,
|
||||
IN_REVIEW: 0,
|
||||
@@ -117,7 +121,7 @@ export class DepartmentTasksController {
|
||||
department: body.department,
|
||||
title: body.title,
|
||||
description: body.description || null,
|
||||
status: body.status || "BACKLOG",
|
||||
status: body.status || "TODO",
|
||||
priority: body.priority || "MEDIUM",
|
||||
assignee: body.assignee || "AI_AGENT",
|
||||
acceptanceCriteria: body.acceptanceCriteria || null,
|
||||
@@ -170,6 +174,12 @@ export class DepartmentTasksController {
|
||||
if (body.deliverableUrl) updateData.deliverableUrl = body.deliverableUrl;
|
||||
if (body.status === "IN_PROGRESS" && !existing.startedAt) updateData.startedAt = new Date();
|
||||
if (body.status === "DONE") updateData.completedAt = new Date();
|
||||
// اگر تست QA ناموفق بود و به TODO برگشت، لاگ اصلاح ضمیمه میشود
|
||||
if (body.status === "TODO" && body.logNote) {
|
||||
updateData.description = (existing.description || "") + "
|
||||
|
||||
[اصلاحات و تضمین کیفیت QA]: " + body.logNote;
|
||||
}
|
||||
|
||||
const updated = await (this.prisma as any).departmentTask.update({
|
||||
where: { id },
|
||||
|
||||
Reference in new issue
Block a user