feat: aggregate cmpp template mismatch reviews
This commit is contained in:
@@ -166,6 +166,17 @@ function createPrismaMock() {
|
||||
}
|
||||
|
||||
describe('OperationsService', () => {
|
||||
it('keeps task progress limited to client-created batch tasks', async () => {
|
||||
const prisma = createPrismaMock();
|
||||
const service = new OperationsService(prisma as never);
|
||||
|
||||
await service.listBatchTasks({ tenantId: 'tenant-1', status: 'queued' });
|
||||
|
||||
expect(prisma.smsBatchTask.findMany).toHaveBeenCalledWith(expect.objectContaining({
|
||||
where: { tenantId: 'tenant-1', status: 'queued', sourceType: 'client' },
|
||||
}));
|
||||
});
|
||||
|
||||
it('filters send-chain messages by tenant, application, channel, content, date, task, phone, and status', async () => {
|
||||
const prisma = createPrismaMock();
|
||||
const service = new OperationsService(prisma as never);
|
||||
|
||||
@@ -78,7 +78,7 @@ export class OperationsService {
|
||||
|
||||
listBatchTasks(query: { tenantId?: string; status?: string }) {
|
||||
return this.prisma.smsBatchTask.findMany({
|
||||
where: { tenantId: query.tenantId, status: query.status },
|
||||
where: { tenantId: query.tenantId, status: query.status, sourceType: 'client' },
|
||||
include: { apiRequests: true },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user