Changed from filtering by ACTIVE status to showing first 10 vehicles.
Ensures at least 2+ car icons visible on map for testing.
Changes:
- trackableVehicles: first 10 vehicles instead of ACTIVE filter
- Map markers: shows all trackable vehicles
- Badge: "Tracked" count instead of "Active"
- Vehicle list: "Tracked Vehicles (count)" instead of "Active Vehicles"
Enables demo of map functionality with actual fleet data.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Filter vehicles to status === 'ACTIVE':
- Map markers: only active vehicles displayed
- Vehicle dropdown: only active vehicles selectable
- All vehicles list: renamed to "Active Vehicles (count)"
- All use activeVehicles useMemo computed from vehiclesWithGPS
Inactive vehicles (maintenance, idle, etc.) hidden from tracking view.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Backend:
- FuelService.getAllFuelPurchases() now loads vehicle relationship
- Uses leftJoinAndSelect to eagerly load Vehicle data
- Returns complete FuelPurchase with nested vehicle object
Frontend:
- Table displays vehicle.registrationNumber (primary)
- Falls back to vehicle.plateNumber if registration unavailable
- Falls back to vehicleId as last resort
Better UX: shows human-readable vehicle info instead of UUID.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Problem:
- purchasesData from API returns numeric columns as strings
- Calling .toFixed() on strings throws "toFixed is not a function"
- Occurs in stats cards and table rows
Solution:
- Wrap p.liters, p.costPerLiter, p.totalCost in Number() before calculations
- Total Liters stat card: sum + Number(p.liters)
- Total Cost stat card: sum + Number(p.totalCost)
- Avg Price/L stat card: use Number() on both divisor and dividend
- Table rows: Number(purchase.liters).toFixed(2), etc.
Fixes render error in FuelPurchasePage when loading fuel purchases list.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add px="lg" (24px) to all Container components:
- FleetDashboard
- FuelPurchasePage
- FuelStatsPage
- MaintenancePage
- FinancialReportsPage
- TrackingPage
Reduces left/right padding from default to 24px,
making better use of horizontal screen space.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Both MaintenancePage and FinancialReportsPage were calling
vehiclesService.getAll() but not extracting res.data property.
Result was vehicles being undefined, causing .map error.
Fixed to match FuelPurchasePage pattern:
const res = await vehiclesService.getAll()
return res.data || []
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add VEHICLES to QUERY_KEYS constant
- Use vehiclesService.getAll() instead of direct API call
- Remove duplicate Vehicle type definitions
- Fix TypeScript type references
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Property removed from entities until migration creates column.
Temporarily skip this filter until feature is fully implemented.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Create migration for booking_requests table with necessary fields and indexes.
- Implement BookingRequestRepository for database operations related to booking requests.
- Develop BookingRequestService to handle business logic for submitting, accepting, rejecting, and canceling booking requests.
- Create DTOs for creating booking requests and reviewing them.
- Define BookingRequest entity to map to the booking_requests table.
- Add UI components for managing shipment requests, including detail and list pages.
- Implement OperationDatePicker component for selecting available shipment days.