From a304c24b32c0327436bbd8c2853e60668e161b42 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Mon, 29 Dec 2025 00:41:52 +0100 Subject: Rename a lot of stuff, add Santiago real time --- .../Services/ArrivalsPipeline.cs | 61 ---------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/Costasdev.Busurbano.Backend/Services/ArrivalsPipeline.cs (limited to 'src/Costasdev.Busurbano.Backend/Services/ArrivalsPipeline.cs') diff --git a/src/Costasdev.Busurbano.Backend/Services/ArrivalsPipeline.cs b/src/Costasdev.Busurbano.Backend/Services/ArrivalsPipeline.cs deleted file mode 100644 index 3c9368c..0000000 --- a/src/Costasdev.Busurbano.Backend/Services/ArrivalsPipeline.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Costasdev.Busurbano.Backend.Types; -using Costasdev.Busurbano.Backend.Types.Arrivals; - -namespace Costasdev.Busurbano.Backend.Services; - -public class ArrivalsContext -{ - /// - /// The full GTFS ID of the stop (e.g., "vitrasa:1400") - /// - public required string StopId { get; set; } - - /// - /// The public code of the stop (e.g., "1400") - /// - public required string StopCode { get; set; } - - /// - /// Whether to return a reduced number of arrivals (e.g., 4 instead of 10) - /// - public bool IsReduced { get; set; } - - public Position? StopLocation { get; set; } - - public required List Arrivals { get; set; } - public required DateTime NowLocal { get; set; } -} - -public interface IArrivalsProcessor -{ - /// - /// Processes the arrivals in the context. Processors are executed in the order they are registered. - /// - Task ProcessAsync(ArrivalsContext context); -} - -/// -/// Orchestrates the enrichment of arrival data through a series of processors. -/// This follows a pipeline pattern where each step (processor) adds or modifies data -/// in the shared ArrivalsContext. -/// -public class ArrivalsPipeline -{ - private readonly IEnumerable _processors; - - public ArrivalsPipeline(IEnumerable processors) - { - _processors = processors; - } - - /// - /// Executes all registered processors sequentially. - /// - public async Task ExecuteAsync(ArrivalsContext context) - { - foreach (var processor in _processors) - { - await processor.ProcessAsync(context); - } - } -} -- cgit v1.3