feat(P19ERP1-3,P19ERP1-4): 实现ERP凭证导出与管理入口

这个提交包含在:
2026-03-08 16:29:05 +08:00
父节点 a1b1d7cfc9
当前提交 855bcdffeb
共修改 14 个文件,包含 1361 行新增和 145 行删除
@@ -29,6 +29,41 @@ describe("dispatchOutboxEvent", () => {
expect(result.response.externalId).toContain("BX-001");
});
it("records integration binding for standard journal export", async () => {
const prisma = {
integrationBinding: {
upsert: vi.fn().mockResolvedValue({ id: 'binding-1' }),
},
};
const result = await dispatchOutboxEvent({
prisma,
config: {
erpSyncEnabled: true,
erpSyncProvider: 'mock',
},
eventType: 'erp.journal.export',
payload: {
entityType: 'reimbursement_form',
entityId: 'rb-1',
documentNo: 'BX-20260308-0001',
},
});
expect(result.channel).toBe('erp');
expect(prisma.integrationBinding.upsert).toHaveBeenCalledWith(
expect.objectContaining({
where: {
provider_entity_type_local_id: {
provider: 'erp',
entity_type: 'reimbursement_journal',
local_id: 'rb-1',
},
},
}),
);
});
it("loads IM channel and dispatches mock wecom message", async () => {
const prisma = {
notificationChannel: {