Skip to content

VSN-2626/ Fix filter criteria for _id, duration, distanceKm, and isRotation

bouslim-saloua a demandé de fusionner feature/VSN-2626 vers develop
  • _id filtering (CircuitCriteria, TripCriteria): EQUALS now uses .is() directly on the raw string; STARTS_WITH / ENDS_WITH / CONTAINS use $expr + $regexMatch + $toString to convert the ObjectId to a string before applying regex — fixes silent no-match when running regex on an ObjectId field.

  • CriteriaBuilderHelper: EQUALS reverted to case-insensitive regex (^...$) now that _id fields handle their own EQUALS path separately.

  • byDuration filtering (TripCriteria): when the input is a plain integer (minutes), the stored HH:MM:SS value is converted to total minutes in the aggregation pipeline. EQUALS maps to a [HH:MM:00, HH:MM:59] range; other conditions apply $regexMatch on the computed minutes string.

  • distanceKm filtering (TripServiceImpl): normalizes comma to dot in the input, and formats DTO distance values as "%.2f" with Locale.ROOT for consistent decimal comparison.

  • isRotation filter (TripServiceImpl): was built in TripCriteria but never wired into the criteria list — added the missing addCriteriaIfNotNull call.

  • Removed unused imports ScheduleChangeAction and CircuitScheduleChangeHistory from TripServiceImpl.

Rapports de requête de fusion