fix: reassemble inbound CMPP long messages

This commit is contained in:
hectorzhao
2026-07-23 21:04:35 +08:00
parent f186aee00b
commit b29576fcd1
9 changed files with 1102 additions and 22 deletions
+45
View File
@@ -47,6 +47,7 @@ model Tenant {
gatewaySubmitDeadLetters GatewaySubmitDeadLetter[]
openApiRequests OpenApiRequest[]
httpWebhookEvents HttpWebhookEvent[]
cmppInboundLongMessages CmppInboundLongMessage[]
}
model EnterpriseCertification {
@@ -400,6 +401,7 @@ model SmsApplication {
httpWebhookEndpoints HttpWebhookEndpoint[]
httpWebhookEvents HttpWebhookEvent[]
dailyUsages SmsApplicationDailyUsage[]
inboundLongMessages CmppInboundLongMessage[]
@@index([tenantId, status])
}
@@ -1541,6 +1543,49 @@ model SmsMessageSegmentAudit {
@@index([submitStatus, receiptStatus])
}
model CmppInboundLongMessage {
id String @id @default(cuid())
tenantId String
applicationId String
groupKey String
account String
srcId String?
phoneNumbers Json
concatReference Int
segmentTotal Int
msgFmt Int
messageId String @unique
status String @default("collecting")
response Json?
expiresAt DateTime
completedAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
tenant Tenant @relation(fields: [tenantId], references: [id])
application SmsApplication @relation(fields: [applicationId], references: [id], onDelete: Cascade)
segments CmppInboundLongMessageSegment[]
@@index([groupKey, status, createdAt])
@@index([applicationId, status, expiresAt])
}
model CmppInboundLongMessageSegment {
id String @id @default(cuid())
groupId String
segmentIndex Int
sequenceId String?
content String
contentHash String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
group CmppInboundLongMessage @relation(fields: [groupId], references: [id], onDelete: Cascade)
@@unique([groupId, segmentIndex])
@@index([sequenceId])
}
model SmsReceiptRecord {
id String @id @default(cuid())
tenantId String?