@tmlmobilidade/interfaces 20260615.923.29 → 20260615.1002.3

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.
@@ -264,12 +264,12 @@ export function ridesPipelineSeenStatus({ filter } = {}) {
264
264
  }
265
265
  export function ridesPipelineTicketingStatus({ filter } = {}) {
266
266
  const pipeline = [];
267
- if (filter?.ticketing_status?.length)
267
+ if (!filter?.ticketing_status?.length)
268
268
  return pipeline;
269
269
  const includesHasTicketing = filter.ticketing_status.includes('has_ticketing');
270
270
  const includesNoTicketing = filter.ticketing_status.includes('no_ticketing');
271
271
  // If both are present, match all documents (no filter needed)
272
- if (includesHasTicketing && !includesNoTicketing)
272
+ if (includesHasTicketing && includesNoTicketing)
273
273
  return pipeline;
274
274
  if (includesHasTicketing) {
275
275
  pipeline.push({ $match: { apex_validations_qty: { $gte: 1 } } });
@@ -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)) } } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/interfaces",
3
- "version": "20260615.923.29",
3
+ "version": "20260615.1002.3",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"