This commit is contained in:
@@ -696,6 +696,56 @@ model HttpWebhookAttempt {
|
||||
@@unique([deliveryId, attemptNo])
|
||||
}
|
||||
|
||||
model ReportReadinessState {
|
||||
objectKey String @id
|
||||
mask Int
|
||||
armed Boolean
|
||||
cycle Int @default(0)
|
||||
updatedAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
}
|
||||
|
||||
model ReportNotificationHour {
|
||||
id String @id
|
||||
tenantId String
|
||||
tenantName String
|
||||
hour DateTime
|
||||
revision Int @default(1)
|
||||
signatureCount Int @default(0)
|
||||
drainageCount Int @default(0)
|
||||
updatedAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
events ReportReadinessEvent[]
|
||||
reads ReportNotificationRead[]
|
||||
@@unique([tenantId, hour])
|
||||
@@index([hour(sort: Desc)], map: "ReportNotificationHour_hour_idx")
|
||||
}
|
||||
|
||||
model ReportReadinessEvent {
|
||||
id String @id
|
||||
hourId String
|
||||
objectKey String
|
||||
cycle Int
|
||||
tenantId String
|
||||
reportType String
|
||||
signatureId String
|
||||
drainageItemId String?
|
||||
applicationId String?
|
||||
applicationName String?
|
||||
signatureName String
|
||||
targetName String
|
||||
createdAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
hour ReportNotificationHour @relation(fields: [hourId], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
@@unique([objectKey, cycle])
|
||||
@@index([hourId, createdAt, id], map: "ReportReadinessEvent_hour_idx")
|
||||
}
|
||||
|
||||
model ReportNotificationRead {
|
||||
userId String
|
||||
hourId String
|
||||
revision Int
|
||||
hour ReportNotificationHour @relation(fields: [hourId], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
||||
@@id([userId, hourId])
|
||||
}
|
||||
|
||||
model SmsSignature {
|
||||
id String @id @default(cuid())
|
||||
tenantId String
|
||||
@@ -1705,6 +1755,7 @@ model SmsApiRequest {
|
||||
}
|
||||
|
||||
model SmsMessageRecord {
|
||||
monitorFacts SendingMonitorFact[]
|
||||
id String @id @default(cuid())
|
||||
tenantId String?
|
||||
batchTaskId String?
|
||||
@@ -1813,6 +1864,9 @@ model SmsSubmitRecord {
|
||||
errorCode String?
|
||||
errorMessage String?
|
||||
submittedAt DateTime?
|
||||
firstWireSubmitAt DateTime?
|
||||
wireTimeSource String?
|
||||
receiptRequested Boolean?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@ -1832,6 +1886,8 @@ model SmsSubmitRecord {
|
||||
@@index([gatewayMessageId])
|
||||
@@index([channelId, gatewayMessageId])
|
||||
@@index([channelGroupId])
|
||||
@@index([updatedAt,id], map: "SmsSubmitRecord_monitor_updated_idx")
|
||||
@@index([createdAt,id], map: "SmsSubmitRecord_monitor_created_idx")
|
||||
}
|
||||
|
||||
model GatewaySubmitOutbox {
|
||||
@@ -1958,6 +2014,9 @@ model SmsMessageSegmentAudit {
|
||||
errorCode String?
|
||||
errorMessage String?
|
||||
submittedAt DateTime?
|
||||
firstWireSubmitAt DateTime?
|
||||
wireTimeSource String?
|
||||
receiptRequested Boolean?
|
||||
deliveredAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -2339,6 +2398,7 @@ model UpstreamReceiptInbox {
|
||||
errorCode String?
|
||||
errorMessage String?
|
||||
deliveredAt DateTime
|
||||
gatewayReceivedAt DateTime?
|
||||
receivedAt DateTime @default(now())
|
||||
status String @default("pending")
|
||||
matchedMessageRecordId String?
|
||||
@@ -2355,6 +2415,8 @@ model UpstreamReceiptInbox {
|
||||
@@index([gatewayMessageId, phoneNumber])
|
||||
@@index([incomingChannelId, receivedAt])
|
||||
@@index([matchedMessageRecordId])
|
||||
@@index([updatedAt,id], map: "UpstreamReceiptInbox_monitor_updated_idx")
|
||||
@@index([matchedMessageRecordId,gatewayMessageId], map: "UpstreamReceiptInbox_monitor_message_idx")
|
||||
}
|
||||
|
||||
model GatewaySubmitDeadLetter {
|
||||
@@ -2563,3 +2625,127 @@ model InfrastructureAlertRead {
|
||||
@@unique([fingerprint, userId])
|
||||
@@index([userId, readAt])
|
||||
}
|
||||
|
||||
model SendingMonitorTarget {
|
||||
channelId String @id
|
||||
enabled Boolean
|
||||
version Int
|
||||
effectiveFrom DateTime
|
||||
updatedAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
updatedBy String
|
||||
}
|
||||
|
||||
model SendingMonitorRule {
|
||||
id String @id
|
||||
type String
|
||||
scopeKey String
|
||||
scope Json
|
||||
config Json
|
||||
version Int
|
||||
effectiveAt DateTime
|
||||
updatedAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
updatedBy String
|
||||
@@unique([type,scopeKey])
|
||||
}
|
||||
|
||||
model SendingMonitorRuleVersion {
|
||||
ruleId String
|
||||
version Int
|
||||
type String
|
||||
scope Json
|
||||
config Json
|
||||
effectiveAt DateTime
|
||||
createdAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
createdBy String
|
||||
@@id([ruleId,version])
|
||||
@@index([type,effectiveAt], map: "SendingMonitorRuleVersion_effective_idx")
|
||||
}
|
||||
|
||||
model SendingMonitorFact {
|
||||
id String @id
|
||||
kind String
|
||||
sourceId String
|
||||
messageRecordId String?
|
||||
messageRecord SmsMessageRecord? @relation(fields: [messageRecordId], references: [id], onDelete: SetNull)
|
||||
dimensionKey String
|
||||
dimensions Json
|
||||
submittedAt DateTime
|
||||
successAt DateTime?
|
||||
verification Boolean
|
||||
reason String?
|
||||
updatedAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
@@unique([kind,sourceId])
|
||||
@@index([messageRecordId], map: "SendingMonitorFact_message_idx")
|
||||
@@index([kind,submittedAt,dimensionKey], map: "SendingMonitorFact_window_idx")
|
||||
}
|
||||
|
||||
model SendingMonitorMinute {
|
||||
kind String
|
||||
dimensionKey String
|
||||
minute DateTime
|
||||
verification Boolean
|
||||
dimensions Json
|
||||
metrics Json
|
||||
updatedAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
@@id([kind,dimensionKey,minute,verification])
|
||||
@@index([kind,minute], map: "SendingMonitorMinute_window_idx")
|
||||
}
|
||||
|
||||
model SendingMonitorSnapshot {
|
||||
id String @id
|
||||
type String
|
||||
dimensionKey String
|
||||
dimensions Json
|
||||
evaluationAt DateTime
|
||||
windowFrom DateTime
|
||||
observedUntil DateTime
|
||||
stage String
|
||||
revision Int @default(1)
|
||||
metrics Json
|
||||
rule Json?
|
||||
status String
|
||||
completeness Json
|
||||
computedAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
@@unique([type,dimensionKey,evaluationAt])
|
||||
@@index([type,evaluationAt(sort: Desc),status], map: "SendingMonitorSnapshot_latest_idx")
|
||||
@@index([type,dimensionKey,evaluationAt], map: "SendingMonitorSnapshot_history_idx")
|
||||
}
|
||||
|
||||
model SendingMonitorAlert {
|
||||
id String @id
|
||||
type String
|
||||
dimensionKey String
|
||||
dimensions Json
|
||||
state String
|
||||
openedAt DateTime
|
||||
lastEvaluatedAt DateTime
|
||||
closedAt DateTime?
|
||||
closeReason String?
|
||||
ruleKey String
|
||||
latest Json
|
||||
worst Json
|
||||
updatedAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
@@index([state,openedAt(sort: Desc)], map: "SendingMonitorAlert_state_idx")
|
||||
}
|
||||
|
||||
model SendingMonitorAlertRead {
|
||||
alertId String
|
||||
userId String
|
||||
readAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
@@id([alertId,userId])
|
||||
}
|
||||
|
||||
model SendingMonitorCheckpoint {
|
||||
id String @id
|
||||
data Json
|
||||
updatedAt DateTime @default(dbgenerated("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"))
|
||||
}
|
||||
|
||||
model SendingMonitorTargetVersion {
|
||||
channelId String
|
||||
version Int
|
||||
enabled Boolean
|
||||
effectiveFrom DateTime @db.Timestamp(3)
|
||||
updatedBy String
|
||||
@@id([channelId,version])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user