fix: Convert DECIMAL columns to numbers in fuel logs API (#49) #50
Reference in New Issue
Block a user
Delete Branch "issue-49-fix-fuel-display"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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