Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ Sending "000000" as a stop ID will result in a testing/placeholder response bein
"operatorId": "", // Deprecated
"patternId": "1607_0_2",
"stopHeadsign": "Oeiras Parque",
"stopId": "", // Deprecated
"stopId": "121270",
"stopSequence": 30,
"timetabledArrivalTime": "18:39:00",
"timetabledDepartureTime": "18:39:00"
},
Expand Down Expand Up @@ -1139,3 +1140,4 @@ Returns a list of PIPs (Passenger Information Screens) in the Lisbon metropolita
If you'd like to contribute new features or help fix any errors, please fork this repository and submit a pull request. We welcome contributions of all kinds, including bug fixes, documentation improvements, and new features.



30 changes: 20 additions & 10 deletions apps/server/src/endpoints/pips/estimates.endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: '0000_0_0',
stopHeadsign: 'Olá :)',
stopId: '', // Deprecated
stopId: '000000',
stopSequence: -1,
timetabledArrivalTime: '23:59:59',
timetabledDepartureTime: '23:59:59',
},
Expand All @@ -94,7 +95,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: '0000_0_0',
stopHeadsign: 'Olá :)',
stopId: '', // Deprecated
stopId: '000000',
stopSequence: -1,
timetabledArrivalTime: '23:59:59',
timetabledDepartureTime: '23:59:59',
},
Expand Down Expand Up @@ -125,7 +127,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: '0000_0_0',
stopHeadsign: 'Sem estimativas. Consulte site para +info.',
stopId: '', // Deprecated
stopId: '000001',
stopSequence: -1,
timetabledArrivalTime: '23:59:59',
timetabledDepartureTime: '23:59:59',
},
Expand Down Expand Up @@ -156,7 +159,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: '0000_0_0',
stopHeadsign: 'Paragem desativada.',
stopId: '', // Deprecated
stopId: '000002', // Ensures that stopId is always an integer | id #999999 is taken by an actual stop so this was the next logical id
stopSequence: -1,
timetabledArrivalTime: '23:59:59',
timetabledDepartureTime: '23:59:59',
},
Expand All @@ -174,7 +178,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: '0000_0_0',
stopHeadsign: 'Painel inativo.',
stopId: '', // Deprecated
stopId: '000002', // Ensures that stopId is always an integer | id #999999 is taken by an actual stop so this was the next logical id
stopSequence: -1,
timetabledArrivalTime: '23:59:59',
timetabledDepartureTime: '23:59:59',
},
Expand Down Expand Up @@ -283,7 +288,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: estimate.patternId,
stopHeadsign: estimate.tripHeadsign,
stopId: '', // Deprecated
stopId: estimate.stopId,
stopSequence: estimate.stopSequence,
timetabledArrivalTime: estimate.stopArrivalEta || estimate.stopDepartureEta,
timetabledDepartureTime: estimate.stopArrivalEta || estimate.stopDepartureEta,
};
Expand All @@ -304,7 +310,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: estimate.patternId,
stopHeadsign: estimate.tripHeadsign,
stopId: '', // Deprecated
stopId: estimate.stopId,
stopSequence: estimate.stopSequence,
timetabledArrivalTime: estimate.stopArrivalEta || estimate.stopDepartureEta,
timetabledDepartureTime: estimate.stopArrivalEta || estimate.stopDepartureEta,
};
Expand All @@ -325,7 +332,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: estimate.patternId,
stopHeadsign: estimate.tripHeadsign,
stopId: '', // Deprecated
stopId: estimate.stopId,
stopSequence: estimate.stopSequence,
timetabledArrivalTime: estimate.stopScheduledArrivalTime || estimate.stopScheduledDepartuteTime,
timetabledDepartureTime: estimate.stopScheduledArrivalTime || estimate.stopScheduledDepartuteTime,
};
Expand Down Expand Up @@ -355,7 +363,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: '0000_0_0',
stopHeadsign: 'Sem estimativas em tempo real.',
stopId: '', // Deprecated
stopId: '',
stopSequence: -1,
timetabledArrivalTime: '23:59:59',
timetabledDepartureTime: '23:59:59',
},
Expand All @@ -373,7 +382,8 @@ FASTIFY.server.post<RequestSchema>('/pips/estimates', async (request, reply) =>
operatorId: '', // Deprecated
patternId: '0000_0_1',
stopHeadsign: 'Consulte o site para +info.',
stopId: '', // Deprecated
stopId: '',
stopSequence: -1,
timetabledArrivalTime: '23:59:59',
timetabledDepartureTime: '23:59:59',
},
Expand Down