汇总已落盘的借款本金与还款、兼容历史编号的周期化编号、付款责任与回单核验、报销进度和排序、PWA/采购事务、错误原因与日期校验及ERP退役。 统一共享预算池锁序和锁后判断,恢复差旅原预算选择,补原因码固定夹具及反向完整性检查。 纳入配套迁移、测试、受管QA、分层验收合同、规约及任务记录;原始证据留在ignored artifacts。 关联任务:09-17-company-loan-principal-repayment、09-17-erp-exclusive-retirement、09-18-reimbursement-periodic-numbering、09-08-reimbursement-payment-closeout、09-18-local-concurrency-product-fixes、09-19-budget-pool-concurrency、09-05-error-explainability-payment-readiness。 预算补审由Claude定向验证2文件928项通过,原4446/28及r6结果仍仅对应各自历史输入;本轮未重跑测试。 完整新候选门禁、R1真实入口接入与12项公网义务仍开放。生产编号未启用、差旅仍冻结;不推送、不部署,不宣称发布资格。
44 行
2.8 KiB
JavaScript
44 行
2.8 KiB
JavaScript
const { personalNotificationText, loadPendingPaymentResponsibility } = require("../../../src/services/paymentResponsibility");
|
|
|
|
describe("payment responsibility and personal notification facts", () => {
|
|
it.each([
|
|
["wecom_app_sent", "success", "企微个人消息已发送(不代表已读)"],
|
|
["wecom_app_no_bound_recipients", "success", "企微个人消息未发送:接收人未绑定企微"],
|
|
["wecom_sent", "success", "仅有企微群通知记录,未确认个人消息送达"],
|
|
["mock_sent", "success", "仅有模拟通知记录,未发送企微个人消息"],
|
|
["wecom_app_invaliduser", "failed", "企微通知发送失败,请核对通知记录"],
|
|
])("projects %s without converting generic success into personal delivery", (result_code, status, message) => {
|
|
expect(personalNotificationText([{ deliveries: [{ result_code, status }] }])).toBe(message);
|
|
});
|
|
|
|
it("does not attribute one anchor delivery to every intended recipient", () => {
|
|
expect(personalNotificationText([
|
|
{ recipient_employee_id: "first", deliveries: [{ status: "success", result_code: "wecom_app_sent" }] },
|
|
{ recipient_employee_id: "second", deliveries: [] },
|
|
])).toBe("存在企微个人消息发送成功记录,接收范围需核对(不代表已读)");
|
|
});
|
|
|
|
it("does not infer delivery from a notification record alone", () => {
|
|
expect(personalNotificationText([{ deliveries: [] }])).toBe("暂无企微个人消息发送成功记录");
|
|
});
|
|
|
|
it("separates eligible people from the selected notification recipient and omits disabled/self/admin", async () => {
|
|
const person = (id, role, extra = {}) => ({ id, name: id, status: "active", archived_at: null, roles: [{ role_code: role }], ...extra });
|
|
const tx = { employee: { findMany: vi.fn(async () => [
|
|
person("maker", "ceo"), person("ceo", "ceo"), person("manager", "manager"),
|
|
person("disabled", "manager", { status: "inactive" }), person("archived", "manager", { archived_at: new Date() }),
|
|
person("admin", "admin"),
|
|
]) }, notification: { findMany: vi.fn(async () => [{ recipient: { name: "ceo" }, deliveries: [] }]) } };
|
|
const projection = await loadPendingPaymentResponsibility(tx, { id: "batch", status: "draft", created_by: "maker" });
|
|
expect(projection.actorName).toBe("可复核:ceo、manager");
|
|
expect(projection.detail).toBe("站内提醒对象:ceo;暂无企微个人消息发送成功记录");
|
|
expect(tx.notification.findMany.mock.calls[0][0].select).not.toHaveProperty("response_body");
|
|
});
|
|
|
|
it("does not replace actual completed reviewers with current role holders", async () => {
|
|
const tx = { employee: { findMany: vi.fn() } };
|
|
expect(await loadPendingPaymentResponsibility(tx, { status: "executed" })).toBeNull();
|
|
expect(tx.employee.findMany).not.toHaveBeenCalled();
|
|
});
|
|
});
|