吸收数字员工审批时间线
This commit is contained in:
@@ -342,6 +342,39 @@ describe("digital employee state service", () => {
|
||||
entity_id: "approval-1",
|
||||
status: "pending",
|
||||
});
|
||||
const decisionEvents = Array.from(mockState.db?.events.values() ?? []).filter((event) => event.kind === "approval_decision");
|
||||
expect(decisionEvents).toHaveLength(1);
|
||||
expect(decisionEvents[0]).toMatchObject({
|
||||
id: "approval-1:decision:approved:2026-06-07T08-00-00-000Z",
|
||||
plan_id: "plan-1",
|
||||
task_id: "task-1",
|
||||
run_id: "run-1",
|
||||
message: "审批处理:确认发送日报给管理端 -> approved",
|
||||
sync_status: "pending",
|
||||
occurred_at: "2026-06-07T08:00:00.000Z",
|
||||
});
|
||||
expect(JSON.parse(decisionEvents[0]?.payload ?? "{}")).toMatchObject({
|
||||
source: "qimingclaw-approval-decision",
|
||||
approvalId: "approval-1",
|
||||
decision: "approved",
|
||||
previousStatus: "pending",
|
||||
nextStatus: "approved",
|
||||
title: "确认发送日报给管理端",
|
||||
planId: "plan-1",
|
||||
taskId: "task-1",
|
||||
runId: "run-1",
|
||||
decidedAt: "2026-06-07T08:00:00.000Z",
|
||||
acpPermission: {
|
||||
permission_id: "permission-1",
|
||||
session_id: "session-1",
|
||||
},
|
||||
});
|
||||
expect(mockState.db?.outbox.get("event:insert:approval-1:decision:approved:2026-06-07T08-00-00-000Z")).toMatchObject({
|
||||
entity_type: "event",
|
||||
entity_id: "approval-1:decision:approved:2026-06-07T08-00-00-000Z",
|
||||
operation: "insert",
|
||||
status: "pending",
|
||||
});
|
||||
expect(mockState.ensureSchemaCalls).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user