Add recurring expenses with active nav tab highlighting

- 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>
This commit is contained in:
2026-03-23 21:08:38 -04:00
parent 3e6231b654
commit 5f2111ea66
16 changed files with 604 additions and 44 deletions

View File

@@ -0,0 +1,11 @@
-- CreateTable
CREATE TABLE "RecurringExpense" (
"id" TEXT NOT NULL PRIMARY KEY,
"title" TEXT NOT NULL,
"amountCents" INTEGER NOT NULL,
"category" TEXT NOT NULL,
"dayOfMonth" INTEGER NOT NULL,
"active" BOOLEAN NOT NULL DEFAULT true,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL
);

View File

@@ -50,6 +50,17 @@ model MerchantCorrection {
updatedAt DateTime @updatedAt
}
model RecurringExpense {
id String @id @default(cuid())
title String
amountCents Int
category Category
dayOfMonth Int // 128, 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