aboutsummaryrefslogtreecommitdiff
path: root/src/Enmarcha.Sources.OpenTripPlannerGql/Queries/StopTile.cs
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2026-03-19 18:56:34 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2026-03-19 18:56:34 +0100
commitbee85bf92aab84087798ffa9f3f16336acef2fce (patch)
tree4fc8e2907e6618940cd9bdeb3da1a81172aab459 /src/Enmarcha.Sources.OpenTripPlannerGql/Queries/StopTile.cs
parentfed5d57b9e5d3df7c34bccb7a120bfa274b2039a (diff)
Basic backoffice for alert management
Diffstat (limited to 'src/Enmarcha.Sources.OpenTripPlannerGql/Queries/StopTile.cs')
-rw-r--r--src/Enmarcha.Sources.OpenTripPlannerGql/Queries/StopTile.cs25
1 files changed, 18 insertions, 7 deletions
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<StopTileRequestContent.Bbox>
+public class StopTileRequestContent : IGraphRequest<StopTileRequestContent.TileRequestParams>
{
- 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