aboutsummaryrefslogtreecommitdiff
path: root/src/Costasdev.Busurbano.Backend/Services/Processors/NextStopsProcessor.cs
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-12-29 00:41:52 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2025-12-29 00:41:52 +0100
commita304c24b32c0327436bbd8c2853e60668e161b42 (patch)
tree08f65c05daca134cf4d2e4f779bd15d98fd66370 /src/Costasdev.Busurbano.Backend/Services/Processors/NextStopsProcessor.cs
parent120a3c6bddd0fb8d9fa05df4763596956554c025 (diff)
Rename a lot of stuff, add Santiago real time
Diffstat (limited to 'src/Costasdev.Busurbano.Backend/Services/Processors/NextStopsProcessor.cs')
-rw-r--r--src/Costasdev.Busurbano.Backend/Services/Processors/NextStopsProcessor.cs34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/Costasdev.Busurbano.Backend/Services/Processors/NextStopsProcessor.cs b/src/Costasdev.Busurbano.Backend/Services/Processors/NextStopsProcessor.cs
deleted file mode 100644
index a00a68a..0000000
--- a/src/Costasdev.Busurbano.Backend/Services/Processors/NextStopsProcessor.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using Costasdev.Busurbano.Sources.OpenTripPlannerGql.Queries;
-
-namespace Costasdev.Busurbano.Backend.Services.Processors;
-
-public class NextStopsProcessor : IArrivalsProcessor
-{
- private readonly FeedService _feedService;
-
- public NextStopsProcessor(FeedService feedService)
- {
- _feedService = feedService;
- }
-
- public Task ProcessAsync(ArrivalsContext context)
- {
- var feedId = context.StopId.Split(':')[0];
-
- foreach (var arrival in context.Arrivals)
- {
- if (arrival.RawOtpTrip is not ArrivalsAtStopResponse.Arrival otpArrival) continue;
-
- // Filter stoptimes that are after the current stop's departure
- var currentStopDeparture = otpArrival.ScheduledDepartureSeconds;
-
- arrival.NextStops = otpArrival.Trip.Stoptimes
- .Where(s => s.ScheduledDeparture > currentStopDeparture)
- .OrderBy(s => s.ScheduledDeparture)
- .Select(s => _feedService.NormalizeStopName(feedId, s.Stop.Name))
- .ToList();
- }
-
- return Task.CompletedTask;
- }
-}