Add invalidation for ['fuelLogs', 'all'] query key
Root Cause
PostgreSQL DECIMAL columns are returned as strings by the pg driver. The totalCost field was already converted with Number(), but fuelUnits and costPerUnit were not, causing frontend defensive checks to fail and display 0.000.
Test plan
Verify Summary card displays correct total fuel units
Verify log entries display correct gallons and price per gallon (e.g., 5.500 @ $3.459)
Verify adding a new fuel log immediately updates the Recent Fuel Logs list
## Summary
- Fix fuelUnits and costPerUnit displaying as 0.000 due to DECIMAL columns returning as strings from PostgreSQL
- Add `Number()` conversion in `toEnhancedResponse()` for `fuel_units` and `cost_per_unit`
- Fix dynamic updates by invalidating the 'all' query key in mutation handler
Fixes #49
## Changes
| File | Change |
|------|--------|
| `backend/src/features/fuel-logs/domain/fuel-logs.service.ts` | Add `Number()` conversion for fuelUnits and costPerUnit |
| `frontend/src/features/fuel-logs/hooks/useFuelLogs.tsx` | Add invalidation for `['fuelLogs', 'all']` query key |
## Root Cause
PostgreSQL DECIMAL columns are returned as strings by the `pg` driver. The `totalCost` field was already converted with `Number()`, but `fuelUnits` and `costPerUnit` were not, causing frontend defensive checks to fail and display 0.000.
## Test plan
- [ ] Verify Summary card displays correct total fuel units
- [ ] Verify log entries display correct gallons and price per gallon (e.g., `5.500 @ $3.459`)
- [ ] Verify adding a new fuel log immediately updates the Recent Fuel Logs list
- [ ] Run lint and type-check (passed locally)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
PostgreSQL DECIMAL columns return as strings from pg driver.
- Add Number() conversion for fuelUnits and costPerUnit in toEnhancedResponse()
- Add query invalidation for 'all' key to fix dynamic updates
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Number()conversion intoEnhancedResponse()forfuel_unitsandcost_per_unitFixes #49
Changes
backend/src/features/fuel-logs/domain/fuel-logs.service.tsNumber()conversion for fuelUnits and costPerUnitfrontend/src/features/fuel-logs/hooks/useFuelLogs.tsx['fuelLogs', 'all']query keyRoot Cause
PostgreSQL DECIMAL columns are returned as strings by the
pgdriver. ThetotalCostfield was already converted withNumber(), butfuelUnitsandcostPerUnitwere not, causing frontend defensive checks to fail and display 0.000.Test plan
5.500 @ $3.459)🤖 Generated with Claude Code