Add owner reminders for recurring treasury patterns with once-or-daily cadence.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-25 16:35:45 +03:30
co-authored by Cursor
parent c5ff3597db
commit f3f043d4e8
7 changed files with 666 additions and 101 deletions
@@ -0,0 +1,6 @@
-- AlterTable
ALTER TABLE "FinancialRecurringItem" ADD COLUMN "reminderDaysBefore" INTEGER;
ALTER TABLE "FinancialRecurringItem" ADD COLUMN "reminderNotifyApp" BOOLEAN NOT NULL DEFAULT true;
ALTER TABLE "FinancialRecurringItem" ADD COLUMN "reminderNotifySms" BOOLEAN NOT NULL DEFAULT true;
ALTER TABLE "FinancialRecurringItem" ADD COLUMN "reminderLastSentDay" TEXT;
ALTER TABLE "FinancialRecurringItem" ADD COLUMN "reminderLastSentDue" TIMESTAMP(3);
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "FinancialRecurringItem" ADD COLUMN "reminderRepeatDaily" BOOLEAN NOT NULL DEFAULT true;
+9
View File
@@ -2520,6 +2520,15 @@ model FinancialRecurringItem {
categoryId String?
isActive Boolean @default(true)
createdById String?
/// null = بدون یادآور؛ ۰ = روز سررسید؛ N = N روز قبل از سررسید
reminderDaysBefore Int?
/// true = هر روز از N تا سررسید؛ false = فقط همان روز مشخص‌شده یک‌بار
reminderRepeatDaily Boolean @default(true)
reminderNotifyApp Boolean @default(true)
reminderNotifySms Boolean @default(true)
/// آخرین روزی که برای nextDue فعلی یادآور ارسال شد (YYYY-MM-DD تهران)
reminderLastSentDay String?
reminderLastSentDue DateTime?
occurrences FinancialRecurringOccurrence[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt