feat: add carrier-aware signature retirement alerts
This commit is contained in:
@@ -806,6 +806,7 @@ model SmsChannel {
|
||||
code String @unique
|
||||
name String
|
||||
carrier String?
|
||||
carriers String[] @default([])
|
||||
sendRegion String @default("全国")
|
||||
protocol String @default("CMPP")
|
||||
gatewayHost String
|
||||
@@ -1059,6 +1060,9 @@ model ChannelSignatureReportTask {
|
||||
tenantId String
|
||||
signatureId String
|
||||
channelId String
|
||||
carrier String?
|
||||
approvedAt DateTime?
|
||||
approvalScope String @default("legacy_channel")
|
||||
reportType String @default("signature")
|
||||
drainageItemId String?
|
||||
status String @default("pending")
|
||||
@@ -1078,10 +1082,152 @@ model ChannelSignatureReportTask {
|
||||
@@index([tenantId, status])
|
||||
@@index([status, createdAt])
|
||||
@@index([signatureId, channelId])
|
||||
@@index([signatureId, channelId, carrier])
|
||||
@@index([signatureId, drainageItemId, channelId])
|
||||
@@index([reportType, status])
|
||||
}
|
||||
|
||||
model SignatureRetirementRule {
|
||||
id String @id @default(cuid())
|
||||
ruleType String
|
||||
targetId String?
|
||||
targetKey String @default("")
|
||||
enabled Boolean @default(true)
|
||||
mobileWindowDays Int @default(30)
|
||||
mobileThreshold Int @default(1)
|
||||
unicomWindowDays Int @default(30)
|
||||
unicomThreshold Int @default(1)
|
||||
telecomWindowDays Int @default(30)
|
||||
telecomThreshold Int @default(1)
|
||||
messageTemplate String?
|
||||
version Int @default(1)
|
||||
createdById String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([ruleType, targetKey])
|
||||
@@index([ruleType, enabled])
|
||||
}
|
||||
|
||||
model SignatureRetirementWebhook {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
platform String
|
||||
urlEncrypted String
|
||||
urlMasked String
|
||||
status String @default("active")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([status, createdAt])
|
||||
}
|
||||
|
||||
model SignatureRetirementCycle {
|
||||
id String @id @default(cuid())
|
||||
dimensionType String
|
||||
signatureId String
|
||||
channelId String?
|
||||
channelKey String @default("")
|
||||
carrier String
|
||||
status String @default("open")
|
||||
startedOn DateTime @db.Date
|
||||
lastDetectedOn DateTime @db.Date
|
||||
resolvedOn DateTime? @db.Date
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([dimensionType, signatureId, channelKey, carrier, status])
|
||||
@@index([status, lastDetectedOn])
|
||||
}
|
||||
|
||||
model SignatureRetirementDetection {
|
||||
id String @id @default(cuid())
|
||||
detectionDate DateTime @db.Date
|
||||
dimensionType String
|
||||
tenantId String
|
||||
applicationId String?
|
||||
signatureId String
|
||||
channelId String?
|
||||
channelKey String @default("")
|
||||
carrier String
|
||||
windowDays Int
|
||||
threshold Int
|
||||
submittedAttempts Int @default(0)
|
||||
acceptedBusinessCount Int @default(0)
|
||||
deliveredBusinessCount Int @default(0)
|
||||
approvedAt DateTime
|
||||
ruleId String?
|
||||
ruleVersion Int @default(1)
|
||||
status String
|
||||
cycleId String?
|
||||
suppressed Boolean @default(false)
|
||||
notificationTitle String?
|
||||
notificationContent String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([detectionDate, dimensionType, signatureId, channelKey, carrier])
|
||||
@@index([detectionDate, dimensionType, status])
|
||||
@@index([signatureId, carrier, detectionDate])
|
||||
@@index([channelId, carrier, detectionDate])
|
||||
}
|
||||
|
||||
model SignatureRetirementMessage {
|
||||
id String @id @default(cuid())
|
||||
detectionId String @unique
|
||||
cycleId String
|
||||
tenantId String
|
||||
title String
|
||||
content String
|
||||
isRead Boolean @default(false)
|
||||
suppressed Boolean @default(false)
|
||||
readAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([createdAt, isRead, suppressed])
|
||||
@@index([tenantId, createdAt])
|
||||
}
|
||||
|
||||
model SignatureRetirementSuppression {
|
||||
id String @id @default(cuid())
|
||||
dimensionType String
|
||||
signatureId String
|
||||
channelId String?
|
||||
channelKey String @default("")
|
||||
carrier String
|
||||
mode String
|
||||
muteUntil DateTime? @db.Date
|
||||
active Boolean @default(true)
|
||||
reason String?
|
||||
operatorId String?
|
||||
cancelledAt DateTime?
|
||||
cancelledById String?
|
||||
cancelReason String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([dimensionType, signatureId, channelKey, carrier])
|
||||
@@index([active, muteUntil])
|
||||
}
|
||||
|
||||
model SignatureRetirementWebhookDelivery {
|
||||
id String @id @default(cuid())
|
||||
detectionDate DateTime @db.Date
|
||||
webhookId String
|
||||
groupKey String
|
||||
payload Json
|
||||
status String @default("pending")
|
||||
attemptCount Int @default(0)
|
||||
nextRetryAt DateTime?
|
||||
lastHttpStatus Int?
|
||||
lastError String?
|
||||
deliveredAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([webhookId, detectionDate, groupKey])
|
||||
@@index([status, nextRetryAt])
|
||||
}
|
||||
|
||||
model ChannelSignatureReportRecord {
|
||||
id String @id @default(cuid())
|
||||
taskId String
|
||||
|
||||
Reference in New Issue
Block a user