Skip to content

feat(circuit): migrate to driverUuid and implement enhanced circuit filtering

kawtar.bouarif a demandé de fusionner feature/vsn-2078 vers develop

Refactor circuit service to use driverUuid as primary identifier and implement sophisticated driver filtering logic for circuit assignments.

Driver UUID Migration:

  • Replace driverId with driverUuid across DTOs, services, and repositories
  • Update TripDay model to store tripDriverUuid instead of tripDriverId
  • Refactor TripDriverAssignmentService to use driverUuid exclusively
  • Update Kafka producers/consumers to use driverUuid in events:
    • DriverAssignedDTO, DriverAssignmentEventDTO, RoadMapCreationEvent
  • Remove driverId fallback logic in assignment handling
  • Update algorithm communication to use driverUuid only
  • Add driverUuid-based repository methods and queries

Circuit Filtering Enhancements:

  • Add hasActiveCircuit and hasActiveCircuitInPeriod fields to DriverMapResponseDTO
    • hasActiveCircuit: indicates if driver has any active circuit (all periods)
    • hasActiveCircuitInPeriod: indicates if driver has circuit in specified period
  • Implement differentiated filtering logic:
    • MAP: Display all drivers with circuits (includeOutOfPeriodAssignments=true)
    • LIST: Display only drivers with circuits outside the period to avoid conflicts
  • Add includeOutOfPeriodAssignments flag to DriverSearchRequestDTO
  • Update DriverSearchService to calculate circuit status based on period overlap
  • Add findByIsActiveTrue() repository method for fetching all active assignments

Algorithm Integration:

  • Remove driverId from drivers before sending to ranking algorithm
  • Algorithm now receives and returns driverUuid exclusively
  • Remove enrichDriverScoresWithUuid (no longer needed)

Kafka Events:

  • Update TripPlanningProducerService to use driverUuid in events
  • Update RoadMapProducerService to use driverUuid
  • Update DriverAssignmentConsumerService to handle driverUuid events

Error Handling:

  • Add DRIVER_ALREADY_HAS_CIRCUIT_IN_PERIOD error constant
  • Improve error messages to reference driverUuid instead of driverId

This refactoring ensures consistent UUID usage across the circuit module and provides better filtering capabilities to prevent assignment conflicts.

Rapports de requête de fusion