feat(admin): implement approval separation and verifiable completion policy

- Separate B2B_SUPPLIER_STRATEGY strategic manager actions from digital tasks
- Ensure strategic proposals do not create/requeue digital tasks or set executedAt
- Ensure SEO and digital approvals transition actionable tasks to TODO
- Strengthen task completion policy: require independently verifiable HTTP(S) deliverables, reject canina://, git://stage, and post-tsk missing article placeholders
- Reject completion when QA verification evidence reports 404 or missing article errors
- Add unit test coverage for ApprovalsController, DepartmentTasksController and completion policy
This commit is contained in:
devops committed 2026-10-20 19:41:39 +00:00
1 parent ee90284129
commit 02fe634944
7 files changed
+605 -24

No files matched your search

@@ -130,7 +130,6 @@ export class DepartmentTasksController {
},
});
// ثبت در تاریخچه لاگ‌ها
await (this.prisma as any).auditLog.create({
data: {
entity: "task",
@@ -169,6 +168,8 @@ export class DepartmentTasksController {
const candidateDeliverableUrl = body.deliverableUrl || existing.deliverableUrl;
if (body.status === "DONE") {
assertTaskCanComplete({
code: existing.code,
title: existing.title,
deliverableUrl: candidateDeliverableUrl,
acceptanceCriteria: existing.acceptanceCriteria,
executionLogs: logs,
@@ -182,7 +183,6 @@ 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 || "") + "\n\n[اصلاحات و تضمین کیفیت QA]: " + body.logNote;
}
@@ -192,7 +192,6 @@ export class DepartmentTasksController {
data: updateData,
});
// ثبت در تاریخچه
await (this.prisma as any).auditLog.create({
data: {
entity: "task",