Skip to content

Commit

Permalink
add arrival time
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Feb 2, 2024
1 parent 0960e6e commit e90508a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion handlers/train.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Train {
const result = await RenfeService.getNextAVE(this._getOrigin(text), this._getDestination(text))

if (result) {
bot.say(target, `Próximo AVE de ${result.origin_stop} a ${result.destination_stop} sale a las ${result.time}`);
bot.say(target, `Próximo AVE de ${result.origin_stop} a ${result.destination_stop} sale a las ${result.time} y llega a las ${result.arrival_time}`);
}
}

Expand Down
4 changes: 2 additions & 2 deletions helpers/sqlManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ async function getCloserFutureTrain (origin, destination, type) {
try {
this.pool = await sql.connect(config.sql.connectionString)
const request = this.pool.request()
const result = await request.query(`SELECT TOP 1 CONVERT(VARCHAR(8),A.departure_time, 108) time , A.stop_name origin_stop, B.stop_name destination_stop FROM
const result = await request.query(`SELECT TOP 1 CONVERT(VARCHAR(8),A.departure_time, 108) time , A.stop_name origin_stop, B.stop_name destination_stop, B.arrival_time arrival_time FROM
(SELECT ST.trip_id , S.stop_name, ST.stop_id, ST.stop_sequence, ST.departure_time
from stop_times ST
inner join stops S ON S.stop_id = ST.stop_id
Expand All @@ -16,7 +16,7 @@ WHERE
INNER JOIN
(SELECT ST.trip_id, ST.stop_id, ST.stop_sequence, S.stop_name
(SELECT ST.trip_id, ST.stop_id, ST.stop_sequence, S.stop_name, ST.arrival_time
from stop_times ST
inner join stops S ON S.stop_id = ST.stop_id
WHERE
Expand Down

0 comments on commit e90508a

Please sign in to comment.