Preserve strict flow sequence numbers when hoisting mid-flow modifications
This commit is contained in:
1 parent
a91f4b5f25
commit
e3c7f93dd9
2 files changed
+8
-6
No files matched your search
@@ -1168,7 +1168,7 @@ describe("Hose Flow Domain", () => {
|
||||
const r = aligned.get("run-2144")!;
|
||||
expect(r.eHumanAction).toBe("已支付 (中途修改)");
|
||||
expect(r.eHumanComment).toBe(
|
||||
"1. 财务助理(熊雪倩): 修改了单据\n2. 上级主管(孙麓): 同意\n3. 财务助理(熊雪倩): 同意\n4. 董事长(甘戈): 同意\n5. 财务经理(周晚容): 同意\n6. CFO(张舒): 同意\n7. 高思琦: 支付成功"
|
||||
"2. 财务助理(熊雪倩): 修改了单据\n1. 上级主管(孙麓): 同意\n3. 财务助理(熊雪倩): 同意\n4. 董事长(甘戈): 同意\n5. 财务经理(周晚容): 同意\n6. CFO(张舒): 同意\n7. 高思琦: 支付成功"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -930,11 +930,13 @@ export function formatNumberedHumanOpinions(
|
||||
}
|
||||
|
||||
if (mode === "forward") {
|
||||
// If any history line records document modification ("修改了单据"), place all modification lines at the top
|
||||
const modLines = historyLines.filter((l) => l.includes("修改了单据"));
|
||||
const normalHistory = historyLines.filter((l) => !l.includes("修改了单据"));
|
||||
const all = [...modLines, ...normalHistory, ...pendingLines];
|
||||
return all.map((line, idx) => `${idx + 1}. ${line}`).join("\n");
|
||||
const all = [...historyLines, ...pendingLines];
|
||||
const numbered = all.map((line, idx) => `${idx + 1}. ${line}`);
|
||||
// If any history line records document modification ("修改了单据"), hoist all modification lines to the top
|
||||
// while strictly preserving each item's true chronological sequence number from the flow
|
||||
const modLines = numbered.filter((l) => l.includes("修改了单据"));
|
||||
const normalLines = numbered.filter((l) => !l.includes("修改了单据"));
|
||||
return [...modLines, ...normalLines].join("\n");
|
||||
}
|
||||
|
||||
// Reverse chronological order for in-progress approvals:
|
||||
|
||||
Reference in new issue
Block a user