@tmlmobilidade/interfaces 20260615.953.39 → 20260615.1034.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -408,6 +408,8 @@ export function ridesBatchAggregationPipeline({ ...filter }) {
|
|
|
408
408
|
pipeline.push({ $match: { start_time_scheduled: { $gte: filter.date_start, $lte: filter.date_end } } });
|
|
409
409
|
// Stage 2: Filter by agency IDs (required)
|
|
410
410
|
pipeline.push({ $match: { agency_id: { $in: filter.agency_ids ?? [] } } });
|
|
411
|
+
// Stage 2.1: Sort by start_time_scheduled
|
|
412
|
+
pipeline.push({ $sort: { start_time_scheduled: 1 } });
|
|
411
413
|
// Stage 3: Filter by line IDs if provided
|
|
412
414
|
if (filter.line_ids?.length)
|
|
413
415
|
pipeline.push({ $match: { line_id: { $in: filter.line_ids.map(id => Number(id)) } } });
|