feat: add ownership-costs feature capsule (refs #15)

- Create ownership_costs table for recurring vehicle costs
- Add backend feature capsule with types, repository, service, routes
- Update TCO calculation to use ownership_costs (with fallback to legacy vehicle fields)
- Add taxCosts and otherCosts to TCO response
- Create frontend ownership-costs feature with form, list, API, hooks
- Update TCODisplay to show all cost types

This implements a more flexible approach to tracking recurring ownership costs
(insurance, registration, tax, other) with explicit date ranges and optional
document association.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Eric Gullickson
2026-01-12 21:28:25 -06:00
parent 5c93150a58
commit a8c4eba8d1
19 changed files with 1644 additions and 15 deletions

View File

@@ -121,6 +121,12 @@ export const TCODisplay: React.FC<TCODisplayProps> = ({ vehicleId, tcoEnabled })
{tco.registrationCosts > 0 && (
<div>Registration: {currencySymbol}{formatCurrency(tco.registrationCosts)}</div>
)}
{tco.taxCosts > 0 && (
<div>Tax: {currencySymbol}{formatCurrency(tco.taxCosts)}</div>
)}
{tco.otherCosts > 0 && (
<div>Other: {currencySymbol}{formatCurrency(tco.otherCosts)}</div>
)}
{tco.fuelCosts > 0 && (
<div>Fuel: {currencySymbol}{formatCurrency(tco.fuelCosts)}</div>
)}