feat: complete application updates

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-09-24 22:29:32 +03:30
co-authored by Copilot
parent 2198574e4d
commit b9ac917eb6
11 changed files with 462 additions and 7 deletions
@@ -0,0 +1,34 @@
CREATE TABLE "SmsWallet" (
"id" TEXT NOT NULL DEFAULT 'default',
"balanceToman" INTEGER NOT NULL DEFAULT 0,
"pricePerPart" INTEGER NOT NULL DEFAULT 250,
"blocked" BOOLEAN NOT NULL DEFAULT false,
"cardNumber" TEXT NOT NULL DEFAULT '6219861941033817',
"sheba" TEXT NOT NULL DEFAULT 'IR805606118280056043604401',
"accountName" TEXT NOT NULL DEFAULT 'حسین منتظر',
"yellowThreshold" INTEGER NOT NULL DEFAULT 10000,
"redThreshold" INTEGER NOT NULL DEFAULT 1000,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "SmsWallet_pkey" PRIMARY KEY ("id")
);
CREATE TABLE "SmsUsage" (
"id" TEXT NOT NULL,
"parts" INTEGER NOT NULL,
"costToman" INTEGER NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "SmsUsage_pkey" PRIMARY KEY ("id")
);
CREATE INDEX "SmsUsage_createdAt_idx" ON "SmsUsage"("createdAt");
CREATE TABLE "SmsTopUp" (
"id" TEXT NOT NULL,
"amountToman" INTEGER NOT NULL,
"note" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "SmsTopUp_pkey" PRIMARY KEY ("id")
);
INSERT INTO "SmsWallet" ("id", "updatedAt")
VALUES ('default', CURRENT_TIMESTAMP);
+30
View File
@@ -757,3 +757,33 @@ model ProductSuggestion {
@@index([customerId, isActive])
@@index([productId])
}
/// یک ردیف برای تعرفه، موجودی و اطلاعات واریز پیامک
model SmsWallet {
id String @id @default("default")
balanceToman Int @default(0)
pricePerPart Int @default(250)
blocked Boolean @default(false)
cardNumber String @default("6219861941033817")
sheba String @default("IR805606118280056043604401")
accountName String @default("حسین منتظر")
yellowThreshold Int @default(10000)
redThreshold Int @default(1000)
updatedAt DateTime @updatedAt
}
model SmsUsage {
id String @id @default(cuid())
parts Int
costToman Int
createdAt DateTime @default(now())
@@index([createdAt])
}
model SmsTopUp {
id String @id @default(cuid())
amountToman Int
note String?
createdAt DateTime @default(now())
}