修正CEO报销财务兜底与部署护栏(07-28-ceo-finance-fallback)
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-07-28 13:42:48 +08:00
父节点 37b625c5dc
当前提交 35948729cf
共修改 31 个文件,包含 980 行新增和 74 行删除
+25 -3
查看文件
@@ -164,6 +164,28 @@ describe("workflow assignee resolution", () => {
expect(resolved.actionable.assigneeRole).toBe("finance_mgr");
});
it.each([
["small", { level1_role: "manager", level2_role: "finance", level3_role: null }],
["medium", { level1_role: "manager", level2_role: "finance", level3_role: null }],
["large", { level1_role: "manager", level2_role: "ceo", level3_role: "finance" }],
])("uses one finance fallback node for CEO owner %s rules", async (_name, rule) => {
const tx = buildTx({ ownerRoles: ["ceo"], managerId: null });
const steps = await workflowUtils.buildApprovalWorkflowSnapshot({
tx,
ownerId: OWNER_ID,
approvalRule: {
...rule,
owner_self_fallback_role: "finance",
},
});
expect(steps.map((step) => step.assignee_rule)).toEqual([
{ type: "role", value: "finance" },
]);
expect(steps[0].id).toContain("owner_self_fallback");
});
it("removes CEO self node and duplicate fallback role for large CEO owner applications", async () => {
const tx = buildTx({ ownerRoles: ["ceo"], managerId: null });
@@ -225,7 +247,7 @@ describe("workflow assignee resolution", () => {
ownerId: OWNER_ID,
approvalRule: {
level1_role: "manager",
owner_self_fallback_role: "finance_mgr",
owner_self_fallback_role: "finance",
},
}),
).rejects.toMatchObject({
@@ -238,7 +260,7 @@ describe("workflow assignee resolution", () => {
it("blocks fallback when the owner also holds the fallback role", async () => {
const tx = buildTx({
ownerRoles: ["ceo", "finance_mgr"],
ownerRoles: ["ceo", "finance"],
managerId: null,
});
@@ -248,7 +270,7 @@ describe("workflow assignee resolution", () => {
ownerId: OWNER_ID,
approvalRule: {
level1_role: "manager",
owner_self_fallback_role: "finance_mgr",
owner_self_fallback_role: "finance",
},
}),
).rejects.toMatchObject({