feat(P19ERP3-1,P19ERP3-2): 实现资产ERP摘要服务与建卡/流转出站联动
这个提交包含在:
@@ -177,6 +177,38 @@ describe('dispatchOutboxEvent', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('records asset binding for asset export', async () => {
|
||||
const prisma = {
|
||||
integrationBinding: {
|
||||
upsert: vi.fn().mockResolvedValue({ id: 'binding-asset-1' }),
|
||||
},
|
||||
};
|
||||
|
||||
await dispatchOutboxEvent({
|
||||
prisma,
|
||||
config: { erpSyncEnabled: true, erpSyncProvider: 'mock' },
|
||||
eventType: 'erp.asset.export',
|
||||
payload: {
|
||||
exportType: 'asset_ledger_summary',
|
||||
entityType: 'asset_card',
|
||||
entityId: 'asset-1',
|
||||
assetNo: 'ZC-001',
|
||||
},
|
||||
});
|
||||
|
||||
expect(prisma.integrationBinding.upsert).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
where: {
|
||||
provider_entity_type_local_id: {
|
||||
provider: 'erp',
|
||||
entity_type: 'asset_erp_card',
|
||||
local_id: 'asset-1',
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('loads IM channel and dispatches mock wecom message', async () => {
|
||||
const prisma = {
|
||||
notificationChannel: {
|
||||
|
||||
在新工单中引用
屏蔽一个用户