Skip to content

refactor(db): rename Refuel → Expense throughout#23

Open
andp97 wants to merge 1 commit into
db/indexesfrom
db/rename-refuel-expense
Open

refactor(db): rename Refuel → Expense throughout#23
andp97 wants to merge 1 commit into
db/indexesfrom
db/rename-refuel-expense

Conversation

@andp97

@andp97 andp97 commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • The Refuel table/model tracked all vehicle expenses (fuel, maintenance, other), not just refueling — the name was misleading
  • Renamed everything consistently to Expense

Changes

Layer Before After
DB table "Refuel" "Expense" (ALTER TABLE RENAME — zero data loss)
Prisma model Refuel Expense
Vehicle relation .refuels .expenses
API route /api/refuels /api/expenses
TS interface Refuel Expense
Dashboard key lastRefuel lastExpense
Seed IDs seed-refuel-{1-5} seed-expense-{1-5}

Depends on #22 (indexes must be applied before the rename migration, since it renames those index names too)

Test plan

  • pnpm typecheck — clean
  • pnpm test — 33/36 pass (3 pre-existing getDaysUntil timezone failures, unrelated)
  • prisma migrate deploy applied cleanly — 0 rows dropped

🤖 Generated with Claude Code

The Refuel table tracked all vehicle expenses (fuel, maintenance, other),
not just refueling events. Rename for accuracy:
- DB table: ALTER TABLE "Refuel" RENAME TO "Expense" (zero data loss)
- Prisma model: Refuel → Expense, Vehicle.refuels → Vehicle.expenses
- API route: /api/refuels → /api/expenses
- lib/types.ts: Refuel interface → Expense, lastRefuel → lastExpense
- All API routes, components, seed, and e2e tests updated accordingly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant