fix: harden real backend admin workflows and ui
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user