db-vendo-client/parse/trip.js

18 lines
365 B
JavaScript
Raw Permalink Normal View History

2020-06-11 15:33:45 +02:00
const parseTrip = (ctx, t) => { // t = raw trip
2024-12-08 21:42:57 +00:00
const {profile} = ctx;
2020-06-11 15:33:45 +02:00
// pretend the trip is a leg in a journey
2024-12-18 01:16:57 +00:00
const trip = profile.parseJourneyLeg(ctx, t);
2024-12-08 21:42:57 +00:00
trip.id = trip.tripId; // TODO journeyId
delete trip.tripId;
delete trip.reachable;
2025-01-03 10:57:24 +00:00
trip.cancelled = profile.parseCancelled(t);
2020-06-11 15:33:45 +02:00
2024-12-07 16:16:31 +00:00
// TODO opt.scheduledDays
return trip;
};
2020-06-11 15:33:45 +02:00
2022-05-07 16:17:37 +02:00
export {
parseTrip,
};