feat(frontend): migrate to driverUuid and enhance driver filtering
Refactor frontend components to use driverUuid as primary identifier for driver operations and improve driver filtering logic for circuit assignments.
Planning Module (planingChauffeur):
-
Add uuid field to Driver interface in types.ts
-
Update driver-schedule.tsx to use driverUuid:
- Add getDriverUuid helper function (uuid || id fallback)
- Replace loadedDriverIdsRef with loadedDriverUuidsRef (string[])
- Update fetchSlotsForDriversPage to accept and use driverUuids
- Update fetchSlotsForDate to use driverUuids
- Modify AffectTrip, reAffectTrip, disAffectTrip to retrieve driverUuid from driversList and pass to API
- Update all useEffect dependencies to use driverUuids
-
Update planningDriverStore methods:
- AffectTrip: accept driverUuid parameter
- reAffectTrip: accept driverUuid parameter
- disAffectTrip: remove driverId parameter
- fetchKmVide: accept driverUuid parameter
- fetchDailyTripsForDrivers: use driverUuids in request body
Circuit Form Module (circuit-form/chauffeur):
- Update use-chauffeur-stepper.ts:
- Use driverUuid exclusively in driverOptions (value: driver.driverUuid)
- Filter drivers using hasActiveCircuit and hasActiveCircuitInPeriod:
- Exclude drivers with active circuits IN the specified period
- WITH_CIRCUIT filter: show only drivers with circuit OUTSIDE period
- ALL filter: show all drivers except those with circuit IN period
- Remove rank display from dropdown labels
- Keep distance (km) in labels for proximity information
This migration ensures consistent UUID usage across the frontend and provides better filtering to prevent assignment conflicts, aligning with backend changes for driver identification.