@tmlmobilidade/generate-offer-files 20250628.1106.47 → 20250628.2142.36
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.
- package/dist/main.js +3 -3
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -3,7 +3,7 @@ import LOGGER from '@helperkits/logger';
|
|
|
3
3
|
import TIMETRACKER from '@helperkits/timer';
|
|
4
4
|
import { JsonWriter } from '@helperkits/writer';
|
|
5
5
|
import { validateGtfsCalendar, validateGtfsCalendarDate, validateGtfsRouteExtended, validateGtfsStopExtended, validateGtfsStopTime, validateGtfsTripExtended } from '@tmlmobilidade/types';
|
|
6
|
-
import {
|
|
6
|
+
import { Dates, getOperationalDatesFromRange, toMetersFromKilometersOrMeters } from '@tmlmobilidade/utils';
|
|
7
7
|
import { parse as csvParser } from 'csv-parse';
|
|
8
8
|
import extract from 'extract-zip';
|
|
9
9
|
import fs from 'fs';
|
|
@@ -355,7 +355,7 @@ export async function generateOfferOutput(filePath, startDate, endDate, outputDi
|
|
|
355
355
|
const firstStopData = savedStops.get(firstStopTime.stop_id);
|
|
356
356
|
const lastStopTime = stopTimesData[stopTimesData.length - 1];
|
|
357
357
|
const lastStopData = savedStops.get(lastStopTime.stop_id);
|
|
358
|
-
const extensionScheduledInMeters =
|
|
358
|
+
const extensionScheduledInMeters = toMetersFromKilometersOrMeters(lastStopTime.shape_dist_traveled, lastStopTime.shape_dist_traveled);
|
|
359
359
|
const currentDateFormated = Dates.fromOperationalDate(currentCalendarDate, 'Europe/Lisbon').toFormat('yyyy-MM-dd');
|
|
360
360
|
//
|
|
361
361
|
const offerJourneyData = {
|
|
@@ -414,7 +414,7 @@ export async function generateOfferOutput(filePath, startDate, endDate, outputDi
|
|
|
414
414
|
for (const currentStopTime of stopTimesData) {
|
|
415
415
|
//
|
|
416
416
|
const currentStop = savedStops.get(currentStopTime.stop_id);
|
|
417
|
-
const shapeDistTraveledInMeters =
|
|
417
|
+
const shapeDistTraveledInMeters = toMetersFromKilometersOrMeters(currentStopTime.shape_dist_traveled, lastStopTime.shape_dist_traveled);
|
|
418
418
|
const offerStopData = {
|
|
419
419
|
arrivalTime: currentStopTime.arrival_time,
|
|
420
420
|
bench: null,
|