35a5be97b0
Next.js 16 personal finance dashboard connected to postgres-personal. Phase 1 (Foundation): - API routes: GET /api/transactions (paginated, filterable, sortable), GET /api/statements, GET /api/merchants - Transactions data table with date/category/bank/search filters, pagination, sort - Statements card grid with period, due date, amount, transaction count - Sidebar layout with nav for all planned sections Phase 2 (Normalisation): - PATCH /api/transactions/[id] — upsert transaction_overrides - POST /api/transactions/bulk — bulk categorize/normalize - Inline click-to-edit category (22 options) and merchant name - Blue dot override indicator, bulk action bar - Effective values via COALESCE(override, llm_value) pattern Stack: Next.js 16 (App Router, standalone), Prisma 7.x + @prisma/adapter-pg, TanStack Query, Tailwind CSS. Auth via Traefik chain-oauth@file.
15 lines
557 B
SQL
15 lines
557 B
SQL
-- Add merchant_normalized column to existing transactions table
|
|
ALTER TABLE transactions ADD COLUMN IF NOT EXISTS merchant_normalized TEXT;
|
|
|
|
-- Create transaction_overrides table
|
|
CREATE TABLE IF NOT EXISTS transaction_overrides (
|
|
id SERIAL PRIMARY KEY,
|
|
transaction_id INTEGER NOT NULL UNIQUE REFERENCES transactions(id) ON DELETE CASCADE,
|
|
merchant_normalized TEXT,
|
|
category_override TEXT,
|
|
notes TEXT,
|
|
updated_at TIMESTAMPTZ DEFAULT NOW()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_overrides_txn_id ON transaction_overrides(transaction_id);
|