fix: harden real backend admin workflows and ui

This commit is contained in:
hectorzhao
2026-07-03 19:29:56 +08:00
parent dd09d91c1e
commit 8cca361441
71 changed files with 5111 additions and 4439 deletions
+17 -1
View File
@@ -71,6 +71,7 @@ describe('OperationsService', () => {
applicationId: 'app-1',
channelId: 'channel-1',
taskId: 'task-1',
messageId: 'MSG-1',
phoneNumber: '13800000001',
status: 'delivered',
});
@@ -81,15 +82,30 @@ describe('OperationsService', () => {
applicationId: 'app-1',
channelId: 'channel-1',
batchTaskId: 'task-1',
messageId: 'MSG-1',
phoneNumber: '13800000001',
status: 'delivered',
},
include: { submitRecords: true, receiptRecords: true },
include: { tenant: true, application: true, channel: true, submitRecords: true, receiptRecords: true },
orderBy: { queuedAt: 'desc' },
take: 500,
});
});
it('returns uplink messages with tenant and channel display data', async () => {
const prisma = createPrismaMock();
const service = new OperationsService(prisma as never);
await service.listUplinkMessages({ tenantId: 'tenant-1', channelId: 'channel-1' });
expect(prisma.smsUplinkMessage.findMany).toHaveBeenCalledWith({
where: { tenantId: 'tenant-1', channelId: 'channel-1' },
include: { tenant: true, channel: true },
orderBy: { receivedAt: 'desc' },
take: 500,
});
});
it('builds dashboard and statistics aggregates', async () => {
const prisma = createPrismaMock();
const service = new OperationsService(prisma as never);