perf(cmpp): add durable inbound fast path
This commit is contained in:
@@ -52,6 +52,9 @@ model Tenant {
|
||||
openApiRequests OpenApiRequest[]
|
||||
httpWebhookEvents HttpWebhookEvent[]
|
||||
cmppInboundLongMessages CmppInboundLongMessage[]
|
||||
cmppInboundSubmissionInboxes CmppInboundSubmissionInbox[]
|
||||
smsApplicationDailyReservations SmsApplicationDailyReservation[]
|
||||
phoneFrequencyReservations PhoneFrequencyReservation[]
|
||||
}
|
||||
|
||||
model EnterpriseCertification {
|
||||
@@ -467,10 +470,13 @@ model SmsApplication {
|
||||
httpWebhookEndpoints HttpWebhookEndpoint[]
|
||||
httpWebhookEvents HttpWebhookEvent[]
|
||||
dailyUsages SmsApplicationDailyUsage[]
|
||||
dailyReservations SmsApplicationDailyReservation[]
|
||||
inboundLongMessages CmppInboundLongMessage[]
|
||||
inboundSubmissionInboxes CmppInboundSubmissionInbox[]
|
||||
riskRules RiskRule[]
|
||||
phoneFrequencyStates PhoneFrequencyState[]
|
||||
phoneFrequencyHits PhoneFrequencyHit[]
|
||||
phoneFrequencyReservations PhoneFrequencyReservation[]
|
||||
|
||||
@@index([tenantId, status])
|
||||
@@index([status, createdAt])
|
||||
@@ -533,6 +539,25 @@ model SmsApplicationDailyUsage {
|
||||
@@index([usageDate])
|
||||
}
|
||||
|
||||
model SmsApplicationDailyReservation {
|
||||
id String @id @default(cuid())
|
||||
reservationKey String @unique
|
||||
tenantId String
|
||||
applicationId String
|
||||
usageDate DateTime @db.Date
|
||||
requestedCount Int
|
||||
dailyLimit Int
|
||||
usedCount Int?
|
||||
reserved Boolean
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
application SmsApplication @relation(fields: [applicationId], references: [id], onDelete: Restrict)
|
||||
|
||||
@@index([applicationId, usageDate])
|
||||
@@index([tenantId, createdAt])
|
||||
}
|
||||
|
||||
model SmsApplicationHttpIpAllowlist {
|
||||
id String @id @default(cuid())
|
||||
applicationId String
|
||||
@@ -1578,6 +1603,21 @@ model PhoneFrequencyHit {
|
||||
@@index([releasedById])
|
||||
}
|
||||
|
||||
model PhoneFrequencyReservation {
|
||||
id String @id @default(cuid())
|
||||
reservationKey String @unique
|
||||
tenantId String
|
||||
applicationId String
|
||||
result Json
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
application SmsApplication @relation(fields: [applicationId], references: [id], onDelete: Restrict)
|
||||
|
||||
@@index([applicationId, createdAt])
|
||||
@@index([tenantId, createdAt])
|
||||
}
|
||||
|
||||
model PhoneFrequencyWhitelist {
|
||||
id String @id @default(cuid())
|
||||
phoneNumber String @unique
|
||||
@@ -1952,6 +1992,35 @@ model CmppInboundLongMessageSegment {
|
||||
@@index([sequenceId])
|
||||
}
|
||||
|
||||
model CmppInboundSubmissionInbox {
|
||||
id String @id @default(cuid())
|
||||
requestKey String @unique
|
||||
payloadHash String
|
||||
tenantId String
|
||||
applicationId String
|
||||
queuePriority String @default("normal")
|
||||
payload Json
|
||||
response Json
|
||||
status String @default("pending")
|
||||
attempts Int @default(0)
|
||||
nextAttemptAt DateTime @default(now())
|
||||
lockedAt DateTime?
|
||||
lockedBy String?
|
||||
lastError String?
|
||||
result Json?
|
||||
completedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
application SmsApplication @relation(fields: [applicationId], references: [id])
|
||||
|
||||
@@index([status, nextAttemptAt, createdAt])
|
||||
@@index([status, lockedAt])
|
||||
@@index([applicationId, createdAt])
|
||||
@@index([queuePriority, status, createdAt])
|
||||
}
|
||||
|
||||
model SmsReceiptRecord {
|
||||
id String @id @default(cuid())
|
||||
tenantId String?
|
||||
|
||||
Reference in New Issue
Block a user