fix: close receipt delivery workflows

This commit is contained in:
hectorzhao
2026-07-24 14:40:57 +08:00
parent 2ee39056eb
commit 91f04f5288
22 changed files with 829 additions and 48 deletions
@@ -455,6 +455,37 @@ describe('SmsConfigService', () => {
}));
});
it('derives both downstream delivery modes when CMPP is enabled alongside HTTP', async () => {
const prisma = createPrismaMock();
prisma.smsApplication.findUnique.mockResolvedValue({
id: 'app-1',
tenantId: 'tenant-1',
cmppAccount: '100001',
interfaceEnabled: false,
httpConfig: { enabled: true },
});
const tx = {
smsApplication: {
update: jest.fn().mockResolvedValue({ id: 'app-1', interfaceEnabled: true }),
},
smsApplicationHttpConfig: {
update: jest.fn().mockResolvedValue({}),
},
};
prisma.$transaction.mockImplementationOnce((callback: (client: typeof tx) => unknown) => callback(tx));
const service = new SmsConfigService(prisma as never);
await service.updateApplication('app-1', { interfaceEnabled: true });
expect(tx.smsApplicationHttpConfig.update).toHaveBeenCalledWith({
where: { applicationId: 'app-1' },
data: {
receiptDeliveryMode: 'both',
uplinkDeliveryMode: 'both',
},
});
});
it('replaces application carrier channel-group routes with carrier validation', async () => {
const prisma = createPrismaMock();
const tx = {