From 52cf717a823d8de8f2fb5d422ead444394663456 Mon Sep 17 00:00:00 2001 From: Movies22 Date: Fri, 30 Jan 2026 21:48:56 +0000 Subject: [PATCH 1/2] Added stopId and stopSequence to estimated endpoint This change is useful on multi-stop requests (i.e. if someone were to send a request to this endpoint with all stops for a given terminal) as it makes it possible to identify the corresponding stop for each estimate. --- .../src/endpoints/pips/estimates.endpoint.ts | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/apps/server/src/endpoints/pips/estimates.endpoint.ts b/apps/server/src/endpoints/pips/estimates.endpoint.ts index 226627d9..d8d243e6 100644 --- a/apps/server/src/endpoints/pips/estimates.endpoint.ts +++ b/apps/server/src/endpoints/pips/estimates.endpoint.ts @@ -76,7 +76,8 @@ FASTIFY.server.post('/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', }, @@ -94,7 +95,8 @@ FASTIFY.server.post('/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', }, @@ -125,7 +127,8 @@ FASTIFY.server.post('/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', }, @@ -156,7 +159,8 @@ FASTIFY.server.post('/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', }, @@ -174,7 +178,8 @@ FASTIFY.server.post('/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', }, @@ -283,7 +288,8 @@ FASTIFY.server.post('/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, }; @@ -304,7 +310,8 @@ FASTIFY.server.post('/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, }; @@ -325,7 +332,8 @@ FASTIFY.server.post('/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, }; @@ -355,7 +363,8 @@ FASTIFY.server.post('/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', }, @@ -373,7 +382,8 @@ FASTIFY.server.post('/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', }, From c05d8bed8a206347f5fed33679d0491a89e2ba00 Mon Sep 17 00:00:00 2001 From: Movies22 Date: Fri, 30 Jan 2026 21:52:54 +0000 Subject: [PATCH 2/2] Update README.md to reflect changes to /pips/estimates endpoint --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2eab9350..6edc6c03 100644 --- a/README.md +++ b/README.md @@ -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" }, @@ -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. +