fix: close sms scheduling and billing gaps
This commit is contained in:
@@ -11,10 +11,12 @@ model Tenant {
|
||||
name String
|
||||
code String @unique
|
||||
status String @default("active")
|
||||
certificationStatus String @default("approved")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
users User[]
|
||||
enterpriseCertifications EnterpriseCertification[]
|
||||
operationLogs OperationLog[]
|
||||
fileObjects FileObject[]
|
||||
enterpriseBlacklists EnterpriseBlacklist[]
|
||||
@@ -35,6 +37,28 @@ model Tenant {
|
||||
smsSubmitRecords SmsSubmitRecord[]
|
||||
smsReceiptRecords SmsReceiptRecord[]
|
||||
smsUplinkMessages SmsUplinkMessage[]
|
||||
cmppConnectionStates CmppConnectionState[]
|
||||
}
|
||||
|
||||
model EnterpriseCertification {
|
||||
id String @id @default(cuid())
|
||||
tenantId String
|
||||
companyName String
|
||||
licenseNo String?
|
||||
contactName String?
|
||||
contactPhone String?
|
||||
materials Json?
|
||||
status String @default("pending")
|
||||
rejectReason String?
|
||||
reviewerId String?
|
||||
submittedAt DateTime @default(now())
|
||||
reviewedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
|
||||
@@index([tenantId, status, createdAt])
|
||||
}
|
||||
|
||||
model User {
|
||||
@@ -449,10 +473,35 @@ model SmsChannel {
|
||||
submitRecords SmsSubmitRecord[]
|
||||
receiptRecords SmsReceiptRecord[]
|
||||
uplinkMessages SmsUplinkMessage[]
|
||||
connectionStates CmppConnectionState[]
|
||||
|
||||
@@index([status])
|
||||
}
|
||||
|
||||
model CmppConnectionState {
|
||||
id String @id @default(cuid())
|
||||
tenantId String?
|
||||
channelId String
|
||||
connectionId String
|
||||
status String @default("disconnected")
|
||||
desiredConnections Int @default(1)
|
||||
currentConnections Int @default(0)
|
||||
lastConnectedAt DateTime?
|
||||
lastDisconnectedAt DateTime?
|
||||
lastHeartbeatAt DateTime?
|
||||
reconnectCount Int @default(0)
|
||||
lastError String?
|
||||
updatedAt DateTime @updatedAt
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
tenant Tenant? @relation(fields: [tenantId], references: [id])
|
||||
channel SmsChannel @relation(fields: [channelId], references: [id])
|
||||
|
||||
@@unique([channelId, connectionId])
|
||||
@@index([tenantId, status])
|
||||
@@index([channelId, status])
|
||||
}
|
||||
|
||||
model SmsChannelGroup {
|
||||
id String @id @default(cuid())
|
||||
code String @unique
|
||||
@@ -723,6 +772,8 @@ model SmsBatchTask {
|
||||
failedTotal Int @default(0)
|
||||
unknownTotal Int @default(0)
|
||||
timeoutTotal Int @default(0)
|
||||
scheduledAt DateTime?
|
||||
canceledAt DateTime?
|
||||
createdById String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -737,6 +788,7 @@ model SmsBatchTask {
|
||||
receiptRecords SmsReceiptRecord[]
|
||||
|
||||
@@index([tenantId, status, createdAt])
|
||||
@@index([status, scheduledAt])
|
||||
@@index([applicationId, createdAt])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user