- Add RecurringExpense model to Prisma schema with migration - Add lib/recurring-expenses.ts: CRUD + virtual projection per month - Add /recurring-expenses API routes (GET, POST, PATCH, DELETE) - Merge projected recurring expenses into dashboard totals and expense list - Add RecurringExpenseManager component to /add-expense page - Show amber "Recurring" badge on projected items; hide edit/delete for them - Highlight active nav tab using usePathname() with hover state - Fix Turbopack/Prisma stub issue by adding serverExternalPackages to next.config.ts - Clear stale Turbopack stub in Dockerfile before each build Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
73 lines
1.5 KiB
Plaintext
73 lines
1.5 KiB
Plaintext
generator client {
|
||
provider = "prisma-client-js"
|
||
}
|
||
|
||
datasource db {
|
||
provider = "sqlite"
|
||
url = env("DATABASE_URL")
|
||
}
|
||
|
||
enum Category {
|
||
RENT
|
||
FOOD
|
||
TRANSPORT
|
||
BILLS
|
||
SHOPPING
|
||
HEALTH
|
||
ENTERTAINMENT
|
||
MISC
|
||
}
|
||
|
||
model Expense {
|
||
id String @id @default(cuid())
|
||
date String
|
||
title String
|
||
amountCents Int
|
||
category Category
|
||
createdAt DateTime @default(now())
|
||
}
|
||
|
||
model Paycheck {
|
||
id String @id @default(cuid())
|
||
payDate String
|
||
amountCents Int
|
||
createdAt DateTime @default(now())
|
||
}
|
||
|
||
model PaySchedule {
|
||
id String @id @default(cuid())
|
||
amountCents Int
|
||
anchorDate String
|
||
active Boolean @default(true)
|
||
createdAt DateTime @default(now())
|
||
}
|
||
|
||
model MerchantCorrection {
|
||
id String @id @default(cuid())
|
||
merchantName String @unique
|
||
category Category
|
||
createdAt DateTime @default(now())
|
||
updatedAt DateTime @updatedAt
|
||
}
|
||
|
||
model RecurringExpense {
|
||
id String @id @default(cuid())
|
||
title String
|
||
amountCents Int
|
||
category Category
|
||
dayOfMonth Int // 1–28, capped so it is valid in every month including February
|
||
active Boolean @default(true)
|
||
createdAt DateTime @default(now())
|
||
updatedAt DateTime @updatedAt
|
||
}
|
||
|
||
model MonthlyInsight {
|
||
id String @id @default(cuid())
|
||
month String @unique
|
||
year Int
|
||
generatedAt DateTime @default(now())
|
||
summary String
|
||
recommendations String
|
||
inputSnapshot String
|
||
}
|