From bee85bf92aab84087798ffa9f3f16336acef2fce Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Thu, 19 Mar 2026 18:56:34 +0100 Subject: Basic backoffice for alert management --- .../Queries/StopTile.cs | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src/Enmarcha.Sources.OpenTripPlannerGql/Queries/StopTile.cs') diff --git a/src/Enmarcha.Sources.OpenTripPlannerGql/Queries/StopTile.cs b/src/Enmarcha.Sources.OpenTripPlannerGql/Queries/StopTile.cs index fad28eb..6079ea3 100644 --- a/src/Enmarcha.Sources.OpenTripPlannerGql/Queries/StopTile.cs +++ b/src/Enmarcha.Sources.OpenTripPlannerGql/Queries/StopTile.cs @@ -3,19 +3,30 @@ using System.Text.Json.Serialization; namespace Enmarcha.Sources.OpenTripPlannerGql.Queries; -public class StopTileRequestContent : IGraphRequest +public class StopTileRequestContent : IGraphRequest { - public record Bbox(double MinLon, double MinLat, double MaxLon, double MaxLat); + public record TileRequestParams( + double MinLon, + double MinLat, + double MaxLon, + double MaxLat, + string[]? Feeds = null + ); - public static string Query(Bbox bbox) + public static string Query(TileRequestParams req) { + var feedsFilter = req.Feeds != null && req.Feeds.Length > 0 + ? $"feeds: [{string.Join(", ", req.Feeds.Select(f => $"\"{f}\""))}]" + : string.Empty; + return string.Create(CultureInfo.InvariantCulture, $@" query Query {{ stopsByBbox( - minLat: {bbox.MinLat:F6} - minLon: {bbox.MinLon:F6} - maxLon: {bbox.MaxLon:F6} - maxLat: {bbox.MaxLat:F6} + minLat: {req.MinLat:F6} + minLon: {req.MinLon:F6} + maxLon: {req.MaxLon:F6} + maxLat: {req.MaxLat:F6} + {feedsFilter} ) {{ gtfsId code -- cgit v1.3