Add optional SMS auto-block threshold below balance.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-08 14:12:29 +03:30
co-authored by Cursor
parent f9b77ceaac
commit 8eba9a9b8f
4 changed files with 47 additions and 4 deletions
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE `sms_accounts` ADD COLUMN `auto_block_below_rials` INTEGER NULL;
+2
View File
@@ -89,6 +89,8 @@ model SmsAccount {
balanceRials Int @default(0) @map("balance_rials")
pricePerPartRials Int @default(2500) @map("price_per_part_rials")
isBlocked Boolean @default(false) @map("is_blocked")
/// If set: block non-alert SMS when balanceRials < this. Null = only manual isBlocked.
autoBlockBelowRials Int? @map("auto_block_below_rials")
/// below this => red/critical
alertCriticalRials Int @default(10000) @map("alert_critical_rials")
/// at/below this (and above critical) => yellow; above => green