feat: refine template deletion and channel group filters

This commit is contained in:
hectorzhao
2026-08-09 20:54:52 +08:00
parent 482d332f49
commit 78b839f468
11 changed files with 210 additions and 49 deletions
@@ -87,7 +87,12 @@ async dispatchDueScheduledTasks(now = new Date()) {
let reservationEstablished = false;
let dispatchPrepared = false;
try {
await this.facade.validateSendResources(task.tenantId, task.applicationId ?? undefined, task.templateId ?? undefined);
await this.facade.validateSendResources(
task.tenantId,
task.applicationId ?? undefined,
task.templateId ?? undefined,
{ usePersistedTemplateSnapshot: true },
);
const messages = await this.prisma.smsMessageRecord.findMany({
where: { batchTaskId: task.id, status: { in: ['scheduled', 'queued'] } },
select: { id: true, amountCents: true, billingUnits: true },