fix: harden real backend workflows and channel connections

This commit is contained in:
hectorzhao
2026-07-06 17:54:53 +08:00
parent 8cca361441
commit b5132d7f4e
47 changed files with 2530 additions and 314 deletions
+7 -3
View File
@@ -352,6 +352,7 @@ model SmsApplication {
sendTasks SmsSendTask[]
batchTasks SmsBatchTask[]
messageRecords SmsMessageRecord[]
connectionStates CmppConnectionState[]
@@index([tenantId, status])
}
@@ -502,6 +503,7 @@ model SmsChannel {
model CmppConnectionState {
id String @id @default(cuid())
tenantId String?
applicationId String?
channelId String
connectionId String
status String @default("disconnected")
@@ -515,11 +517,13 @@ model CmppConnectionState {
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
tenant Tenant? @relation(fields: [tenantId], references: [id])
channel SmsChannel @relation(fields: [channelId], references: [id])
tenant Tenant? @relation(fields: [tenantId], references: [id])
application SmsApplication? @relation(fields: [applicationId], references: [id])
channel SmsChannel @relation(fields: [channelId], references: [id])
@@unique([channelId, connectionId])
@@unique([applicationId, channelId, connectionId])
@@index([tenantId, status])
@@index([applicationId, status])
@@index([channelId, status])
}