feat(P19ERP1-3,P19ERP1-4): 实现ERP凭证导出与管理入口
这个提交包含在:
@@ -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: {
|
||||
|
||||
在新工单中引用
屏蔽一个用户