Track SMS sent counts by type (mass, singular, auth, auto, admin).

Charge/refund bump the matching counter plus total; expose smsSentByType on business APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-09-09 11:31:17 +03:30
co-authored by Cursor
parent 717a203d48
commit a2dacfdc97
9 changed files with 156 additions and 22 deletions
+5
View File
@@ -114,6 +114,11 @@ model Business {
annualRenewalAt DateTime? @map("annual_renewal_at") @db.Timestamptz(6)
smsBalance Int @default(0) @map("sms_balance")
smsSentCount Int @default(0) @map("sms_sent_count")
smsSentMass Int @default(0) @map("sms_sent_mass")
smsSentSingular Int @default(0) @map("sms_sent_singular")
smsSentAuth Int @default(0) @map("sms_sent_auth")
smsSentAutoCustomer Int @default(0) @map("sms_sent_auto_customer")
smsSentAdmin Int @default(0) @map("sms_sent_admin")
addresses Address[]
blogs blogs[]
brands Brand[]