aboutsummaryrefslogtreecommitdiff
path: root/src/Enmarcha.Backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/Enmarcha.Backend')
-rw-r--r--src/Enmarcha.Backend/Controllers/AlertsController.cs1
-rw-r--r--src/Enmarcha.Backend/Controllers/Backoffice/LoginController.cs2
-rw-r--r--src/Enmarcha.Backend/Data/Migrations/20260319113819_Initial.cs1
-rw-r--r--src/Enmarcha.Backend/Data/Migrations/20260401135403_AddPushNotifications.cs1
-rw-r--r--src/Enmarcha.Backend/Data/Models/ServiceAlert.cs2
-rw-r--r--src/Enmarcha.Backend/Enmarcha.Backend.csproj.lscache562
-rw-r--r--src/Enmarcha.Backend/Helpers/SortingHelper.cs6
-rw-r--r--src/Enmarcha.Backend/Helpers/TransitKindClassifier.cs2
-rw-r--r--src/Enmarcha.Backend/Program.cs74
-rw-r--r--src/Enmarcha.Backend/Services/Processors/NextStopsProcessor.cs1
-rw-r--r--src/Enmarcha.Backend/Services/Processors/Normalisation/ColourProcessor.cs34
-rw-r--r--src/Enmarcha.Backend/Services/Processors/Normalisation/TranviasNormalizationProcessor.cs17
-rw-r--r--src/Enmarcha.Backend/Services/Processors/Normalisation/VitrasaNormalizationProcessor.cs (renamed from src/Enmarcha.Backend/Services/Processors/FeedConfigProcessor.cs)40
-rw-r--r--src/Enmarcha.Backend/Services/Processors/Normalisation/XuntaNormalizationProcessor.cs24
-rw-r--r--src/Enmarcha.Backend/Services/Processors/RealTime/CorunaRealTimeProcessor.cs (renamed from src/Enmarcha.Backend/Services/Processors/CorunaRealTimeProcessor.cs)2
-rw-r--r--src/Enmarcha.Backend/Services/Processors/RealTime/CtagShuttleRealTimeProcessor.cs (renamed from src/Enmarcha.Backend/Services/Processors/CtagShuttleRealTimeProcessor.cs)2
-rw-r--r--src/Enmarcha.Backend/Services/Processors/RealTime/RenfeRealTimeProcessor.cs (renamed from src/Enmarcha.Backend/Services/Processors/RenfeRealTimeProcessor.cs)2
-rw-r--r--src/Enmarcha.Backend/Services/Processors/RealTime/TussaRealTimeProcessor.cs (renamed from src/Enmarcha.Backend/Services/Processors/TussaRealTimeProcessor.cs)2
-rw-r--r--src/Enmarcha.Backend/Services/Processors/RealTime/VitrasaRealTimeProcessor.cs (renamed from src/Enmarcha.Backend/Services/Processors/VitrasaRealTimeProcessor.cs)2
-rw-r--r--src/Enmarcha.Backend/ViewModels/AlertFormViewModel.cs1
20 files changed, 705 insertions, 73 deletions
diff --git a/src/Enmarcha.Backend/Controllers/AlertsController.cs b/src/Enmarcha.Backend/Controllers/AlertsController.cs
index 4860399..7d19894 100644
--- a/src/Enmarcha.Backend/Controllers/AlertsController.cs
+++ b/src/Enmarcha.Backend/Controllers/AlertsController.cs
@@ -1,5 +1,4 @@
using Enmarcha.Backend.Data;
-using Enmarcha.Backend.Data.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Enmarcha.Backend/Controllers/Backoffice/LoginController.cs b/src/Enmarcha.Backend/Controllers/Backoffice/LoginController.cs
index 1e9f12f..2a5a515 100644
--- a/src/Enmarcha.Backend/Controllers/Backoffice/LoginController.cs
+++ b/src/Enmarcha.Backend/Controllers/Backoffice/LoginController.cs
@@ -1,4 +1,4 @@
-using Microsoft.AspNetCore.Authentication;
+using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Enmarcha.Backend/Data/Migrations/20260319113819_Initial.cs b/src/Enmarcha.Backend/Data/Migrations/20260319113819_Initial.cs
index 2548aa9..b3b8dba 100644
--- a/src/Enmarcha.Backend/Data/Migrations/20260319113819_Initial.cs
+++ b/src/Enmarcha.Backend/Data/Migrations/20260319113819_Initial.cs
@@ -1,4 +1,3 @@
-using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Enmarcha.Backend/Data/Migrations/20260401135403_AddPushNotifications.cs b/src/Enmarcha.Backend/Data/Migrations/20260401135403_AddPushNotifications.cs
index 964a86f..c21c754 100644
--- a/src/Enmarcha.Backend/Data/Migrations/20260401135403_AddPushNotifications.cs
+++ b/src/Enmarcha.Backend/Data/Migrations/20260401135403_AddPushNotifications.cs
@@ -1,4 +1,3 @@
-using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Enmarcha.Backend/Data/Models/ServiceAlert.cs b/src/Enmarcha.Backend/Data/Models/ServiceAlert.cs
index 8551117..2a6a48a 100644
--- a/src/Enmarcha.Backend/Data/Models/ServiceAlert.cs
+++ b/src/Enmarcha.Backend/Data/Models/ServiceAlert.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel;
+using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace Enmarcha.Backend.Data.Models;
diff --git a/src/Enmarcha.Backend/Enmarcha.Backend.csproj.lscache b/src/Enmarcha.Backend/Enmarcha.Backend.csproj.lscache
new file mode 100644
index 0000000..fa4e2b5
--- /dev/null
+++ b/src/Enmarcha.Backend/Enmarcha.Backend.csproj.lscache
@@ -0,0 +1,562 @@
+version=1
+
+# This file caches language service data to improve the performance of C# Dev Kit.
+# It is not intended for manual editing. It can safely be deleted and will be
+# regenerated automatically.
+#
+# To exclude from version control, add *.lscache to your .gitignore file.
+#
+# To disable caching, add the following to your VS Code settings:
+# "dotnet.projectsystem.enableLanguageServiceCache": false
+
+[project]
+language=C#
+primary
+lastDtbSucceeded
+
+[properties]
+AssemblyName=Enmarcha.Backend
+CommandLineArgsForDesignTimeEvaluation=-langversion:14.0 -define:TRACE
+CompilerGeneratedFilesOutputPath=
+MaxSupportedLangVersion=14.0
+ProjectAssetsFile=<PATH>obj/project.assets.json
+RootNamespace=Enmarcha.Backend
+RunAnalyzers=
+RunAnalyzersDuringLiveAnalysis=
+SolutionPath=<PATH>../../Enmarcha.slnx
+TargetFrameworkIdentifier=.NETCoreApp
+TargetPath=<PATH>bin/Debug/net10.0/Enmarcha.Backend.dll
+TargetRefPath=<PATH>obj/Debug/net10.0/ref/Enmarcha.Backend.dll
+TemporaryDependencyNodeTargetIdentifier=net10.0
+
+[commandLineArguments]
+/noconfig
+/unsafe-
+/checked-
+/nowarn:1701,1702,1701,1702
+/fullpaths
+/nostdlib+
+/errorreport:prompt
+/warn:10
+/define:TRACE;DEBUG;NET;NET10_0;NETCOREAPP;NET5_0_OR_GREATER;NET6_0_OR_GREATER;NET7_0_OR_GREATER;NET8_0_OR_GREATER;NET9_0_OR_GREATER;NET10_0_OR_GREATER;NETCOREAPP1_0_OR_GREATER;NETCOREAPP1_1_OR_GREATER;NETCOREAPP2_0_OR_GREATER;NETCOREAPP2_1_OR_GREATER;NETCOREAPP2_2_OR_GREATER;NETCOREAPP3_0_OR_GREATER;NETCOREAPP3_1_OR_GREATER
+/highentropyva+
+/nullable:enable
+/features:"InterceptorsNamespaces=;Microsoft.Extensions.Validation.Generated"
+/debug+
+/debug:portable
+/filealign:512
+/optimize-
+/pathmap:<PATH>../Enmarcha.Backend=
+/out:obj\Debug\net10.0\Enmarcha.Backend.dll
+/refout:obj\Debug\net10.0\refint\Enmarcha.Backend.dll
+/target:exe
+/warnaserror-
+/utf8output
+/deterministic+
+/langversion:14.0
+/features:use-roslyn-tokenizer=true
+/warnaserror+:NU1605,SYSLIB0011
+
+[sourceFiles]
+Configuration/AppConfiguration.cs
+Controllers/
+ AlertsController.cs
+ ArrivalsController.cs
+ Backoffice/
+ AlertsApiController.cs
+ AlertsController.cs
+ BackofficeController.cs
+ LoginController.cs
+ PushController.cs
+ RoutePlannerController.cs
+ TileController.cs
+ TrafficDataController.cs
+ TransitController.cs
+Data/
+ AppDbContext.cs
+ Migrations/
+ 20260319113819_Initial.cs
+ 20260319113819_Initial.Designer.cs
+ 20260401135403_AddPushNotifications.cs
+ 20260401135403_AddPushNotifications.Designer.cs
+ AppDbContextModelSnapshot.cs
+ Models/
+ AlertSelector.cs
+ PushSubscription.cs
+ ServiceAlert.cs
+ TranslatedString.cs
+Helpers/
+ ContrastHelper.cs
+ EnumExtensions.cs
+ SortingHelper.cs
+ TransitKindClassifier.cs
+obj/Debug/net10.0/
+ .NETCoreApp,Version=v10.0.AssemblyAttributes.cs
+ Enmarcha.Backend.AssemblyInfo.cs
+ Enmarcha.Backend.GlobalUsings.g.cs
+ Enmarcha.Backend.RazorAssemblyInfo.cs
+Program.cs
+Services/
+ AlertPhaseNotificationHostedService.cs
+ ArrivalsPipeline.cs
+ BackofficeSelectorService.cs
+ FareService.cs
+ FeedService.cs
+ Geocoding/
+ GeoapifyGeocodingService.cs
+ IGeocodingService.cs
+ NominatimGeocodingService.cs
+ OtpService.cs
+ Processors/
+ AbstractProcessor.cs
+ FilterAndSortProcessor.cs
+ NextStopsProcessor.cs
+ Normalisation/
+ ColourProcessor.cs
+ TranviasNormalizationProcessor.cs
+ VitrasaNormalizationProcessor.cs
+ XuntaNormalizationProcessor.cs
+ RealTime/
+ CorunaRealTimeProcessor.cs
+ CtagShuttleRealTimeProcessor.cs
+ RenfeRealTimeProcessor.cs
+ TussaRealTimeProcessor.cs
+ VitrasaRealTimeProcessor.cs
+ ShapeProcessor.cs
+ VitrasaUsageProcessor.cs
+ Providers/XuntaFareProvider.cs
+ PushNotificationService.cs
+ ShapeTraversalService.cs
+Telemetry.cs
+Types/Arrivals/
+ Arrival.cs
+ BusStopUsagePoint.cs
+ StopArrivalsResponse.cs
+ StopEstimatesResponse.cs
+Types/
+ ConsolidatedCirculation.cs
+ Geoapify/GeoapifyModels.cs
+ Nominatim/NominatimModels.cs
+ Otp/OtpModels.cs
+ Planner/PlannerResponse.cs
+ Transit/RouteDtos.cs
+ViewModels/AlertFormViewModel.cs
+
+[metadataReferences]
+../
+ Enmarcha.Sources.CtagShuttle/obj/Debug/net10.0/ref/Enmarcha.Sources.CtagShuttle.dll
+ Enmarcha.Sources.GtfsRealtime/obj/Debug/net10.0/ref/Enmarcha.Sources.GtfsRealtime.dll
+ Enmarcha.Sources.OpenTripPlannerGql/obj/Debug/net10.0/ref/Enmarcha.Sources.OpenTripPlannerGql.dll
+ Enmarcha.Sources.TranviasCoruna/obj/Debug/net10.0/ref/Enmarcha.Sources.TranviasCoruna.dll
+ Enmarcha.Sources.Tussa/obj/Debug/net10.0/ref/Enmarcha.Sources.Tussa.dll
+<NUGET>/
+ costasdev.vigotransitapi/0.1.0/lib/net8.0/Costasdev.VigoTransitApi.dll
+ csvhelper/33.1.0/lib/net9.0/CsvHelper.dll
+ efcore.namingconventions/10.0.1/lib/net10.0/EFCore.NamingConventions.dll
+ fuzzysharp/2.0.2/lib/netcoreapp2.1/FuzzySharp.dll
+ google.protobuf/3.33.1/lib/net5.0/Google.Protobuf.dll
+ microsoft.aspnetcore.authentication.openidconnect/10.0.5/lib/net10.0/Microsoft.AspNetCore.Authentication.OpenIdConnect.dll
+ microsoft.aspnetcore.identity.entityframeworkcore/10.0.3/lib/net10.0/Microsoft.AspNetCore.Identity.EntityFrameworkCore.dll
+ microsoft.entityframeworkcore.abstractions/10.0.3/lib/net10.0/Microsoft.EntityFrameworkCore.Abstractions.dll
+ microsoft.entityframeworkcore.relational/10.0.3/lib/net10.0/Microsoft.EntityFrameworkCore.Relational.dll
+ microsoft.entityframeworkcore/10.0.3/lib/net10.0/Microsoft.EntityFrameworkCore.dll
+ microsoft.identitymodel.abstractions/8.0.1/lib/net9.0/Microsoft.IdentityModel.Abstractions.dll
+ microsoft.identitymodel.jsonwebtokens/8.0.1/lib/net9.0/Microsoft.IdentityModel.JsonWebTokens.dll
+ microsoft.identitymodel.logging/8.0.1/lib/net9.0/Microsoft.IdentityModel.Logging.dll
+ microsoft.identitymodel.protocols.openidconnect/8.0.1/lib/net9.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
+ microsoft.identitymodel.protocols/8.0.1/lib/net9.0/Microsoft.IdentityModel.Protocols.dll
+ microsoft.identitymodel.tokens/8.0.1/lib/net9.0/Microsoft.IdentityModel.Tokens.dll
+ nettopologysuite.features/2.1.0/lib/netstandard2.0/NetTopologySuite.Features.dll
+ nettopologysuite.io.geojson/4.0.0/lib/netstandard2.0/NetTopologySuite.IO.GeoJSON.dll
+ nettopologysuite.io.postgis/2.1.0/lib/netstandard2.1/NetTopologySuite.IO.PostGis.dll
+ nettopologysuite.io.vectortiles.mapbox/1.1.0/lib/netstandard2.0/NetTopologySuite.IO.VectorTiles.Mapbox.dll
+ nettopologysuite.io.vectortiles/1.1.0/lib/netstandard2.0/NetTopologySuite.IO.VectorTiles.dll
+ nettopologysuite/2.6.0/lib/netstandard2.1/NetTopologySuite.dll
+ newtonsoft.json/13.0.3/lib/net6.0/Newtonsoft.Json.dll
+ nodatime/3.3.1/lib/net8.0/NodaTime.dll
+ npgsql.entityframeworkcore.postgresql.nettopologysuite/10.0.0/lib/net10.0/Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite.dll
+ npgsql.entityframeworkcore.postgresql/10.0.0/lib/net10.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll
+ npgsql.nettopologysuite/10.0.0/lib/net8.0/Npgsql.NetTopologySuite.dll
+ npgsql/10.0.0/lib/net10.0/Npgsql.dll
+ opentelemetry.api.providerbuilderextensions/1.15.0/lib/net10.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll
+ opentelemetry.api/1.15.0/lib/net10.0/OpenTelemetry.Api.dll
+ opentelemetry.exporter.opentelemetryprotocol/1.15.0/lib/net10.0/OpenTelemetry.Exporter.OpenTelemetryProtocol.dll
+ opentelemetry.extensions.hosting/1.15.0/lib/net10.0/OpenTelemetry.Extensions.Hosting.dll
+ opentelemetry.instrumentation.aspnetcore/1.15.0/lib/net10.0/OpenTelemetry.Instrumentation.AspNetCore.dll
+ opentelemetry.instrumentation.http/1.15.0/lib/net10.0/OpenTelemetry.Instrumentation.Http.dll
+ opentelemetry/1.15.0/lib/net10.0/OpenTelemetry.dll
+ portable.bouncycastle/1.8.1.3/lib/netstandard2.0/BouncyCastle.Crypto.dll
+ projnet/2.1.0/lib/netstandard2.1/ProjNET.dll
+ protobuf-net/2.4.0/lib/netcoreapp2.1/protobuf-net.dll
+ system.identitymodel.tokens.jwt/8.0.1/lib/net9.0/System.IdentityModel.Tokens.Jwt.dll
+ system.servicemodel.primitives/4.5.3/ref/netstandard2.0/
+ System.ServiceModel.dll
+ System.ServiceModel.Primitives.dll
+ webpush/1.0.11/lib/netstandard2.0/WebPush.dll
+C:/Program Files/dotnet/packs/Microsoft.AspNetCore.App.Ref/10.0.4/ref/net10.0/
+ Microsoft.AspNetCore.Antiforgery.dll
+ Microsoft.AspNetCore.Authentication.Abstractions.dll
+ Microsoft.AspNetCore.Authentication.BearerToken.dll
+ Microsoft.AspNetCore.Authentication.Cookies.dll
+ Microsoft.AspNetCore.Authentication.Core.dll
+ Microsoft.AspNetCore.Authentication.dll
+ Microsoft.AspNetCore.Authentication.OAuth.dll
+ Microsoft.AspNetCore.Authorization.dll
+ Microsoft.AspNetCore.Authorization.Policy.dll
+ Microsoft.AspNetCore.Components.Authorization.dll
+ Microsoft.AspNetCore.Components.dll
+ Microsoft.AspNetCore.Components.Endpoints.dll
+ Microsoft.AspNetCore.Components.Forms.dll
+ Microsoft.AspNetCore.Components.Server.dll
+ Microsoft.AspNetCore.Components.Web.dll
+ Microsoft.AspNetCore.Connections.Abstractions.dll
+ Microsoft.AspNetCore.CookiePolicy.dll
+ Microsoft.AspNetCore.Cors.dll
+ Microsoft.AspNetCore.Cryptography.Internal.dll
+ Microsoft.AspNetCore.Cryptography.KeyDerivation.dll
+ Microsoft.AspNetCore.DataProtection.Abstractions.dll
+ Microsoft.AspNetCore.DataProtection.dll
+ Microsoft.AspNetCore.DataProtection.Extensions.dll
+ Microsoft.AspNetCore.Diagnostics.Abstractions.dll
+ Microsoft.AspNetCore.Diagnostics.dll
+ Microsoft.AspNetCore.Diagnostics.HealthChecks.dll
+ Microsoft.AspNetCore.dll
+ Microsoft.AspNetCore.HostFiltering.dll
+ Microsoft.AspNetCore.Hosting.Abstractions.dll
+ Microsoft.AspNetCore.Hosting.dll
+ Microsoft.AspNetCore.Hosting.Server.Abstractions.dll
+ Microsoft.AspNetCore.Html.Abstractions.dll
+ Microsoft.AspNetCore.Http.Abstractions.dll
+ Microsoft.AspNetCore.Http.Connections.Common.dll
+ Microsoft.AspNetCore.Http.Connections.dll
+ Microsoft.AspNetCore.Http.dll
+ Microsoft.AspNetCore.Http.Extensions.dll
+ Microsoft.AspNetCore.Http.Features.dll
+ Microsoft.AspNetCore.Http.Results.dll
+ Microsoft.AspNetCore.HttpLogging.dll
+ Microsoft.AspNetCore.HttpOverrides.dll
+ Microsoft.AspNetCore.HttpsPolicy.dll
+ Microsoft.AspNetCore.Identity.dll
+ Microsoft.AspNetCore.Localization.dll
+ Microsoft.AspNetCore.Localization.Routing.dll
+ Microsoft.AspNetCore.Metadata.dll
+ Microsoft.AspNetCore.Mvc.Abstractions.dll
+ Microsoft.AspNetCore.Mvc.ApiExplorer.dll
+ Microsoft.AspNetCore.Mvc.Core.dll
+ Microsoft.AspNetCore.Mvc.Cors.dll
+ Microsoft.AspNetCore.Mvc.DataAnnotations.dll
+ Microsoft.AspNetCore.Mvc.dll
+ Microsoft.AspNetCore.Mvc.Formatters.Json.dll
+ Microsoft.AspNetCore.Mvc.Formatters.Xml.dll
+ Microsoft.AspNetCore.Mvc.Localization.dll
+ Microsoft.AspNetCore.Mvc.Razor.dll
+ Microsoft.AspNetCore.Mvc.RazorPages.dll
+ Microsoft.AspNetCore.Mvc.TagHelpers.dll
+ Microsoft.AspNetCore.Mvc.ViewFeatures.dll
+ Microsoft.AspNetCore.OutputCaching.dll
+ Microsoft.AspNetCore.RateLimiting.dll
+ Microsoft.AspNetCore.Razor.dll
+ Microsoft.AspNetCore.Razor.Runtime.dll
+ Microsoft.AspNetCore.RequestDecompression.dll
+ Microsoft.AspNetCore.ResponseCaching.Abstractions.dll
+ Microsoft.AspNetCore.ResponseCaching.dll
+ Microsoft.AspNetCore.ResponseCompression.dll
+ Microsoft.AspNetCore.Rewrite.dll
+ Microsoft.AspNetCore.Routing.Abstractions.dll
+ Microsoft.AspNetCore.Routing.dll
+ Microsoft.AspNetCore.Server.HttpSys.dll
+ Microsoft.AspNetCore.Server.IIS.dll
+ Microsoft.AspNetCore.Server.IISIntegration.dll
+ Microsoft.AspNetCore.Server.Kestrel.Core.dll
+ Microsoft.AspNetCore.Server.Kestrel.dll
+ Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes.dll
+ Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.dll
+ Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
+ Microsoft.AspNetCore.Session.dll
+ Microsoft.AspNetCore.SignalR.Common.dll
+ Microsoft.AspNetCore.SignalR.Core.dll
+ Microsoft.AspNetCore.SignalR.dll
+ Microsoft.AspNetCore.SignalR.Protocols.Json.dll
+ Microsoft.AspNetCore.StaticAssets.dll
+ Microsoft.AspNetCore.StaticFiles.dll
+ Microsoft.AspNetCore.WebSockets.dll
+ Microsoft.AspNetCore.WebUtilities.dll
+ Microsoft.Extensions.Caching.Abstractions.dll
+ Microsoft.Extensions.Caching.Memory.dll
+ Microsoft.Extensions.Configuration.Abstractions.dll
+ Microsoft.Extensions.Configuration.Binder.dll
+ Microsoft.Extensions.Configuration.CommandLine.dll
+ Microsoft.Extensions.Configuration.dll
+ Microsoft.Extensions.Configuration.EnvironmentVariables.dll
+ Microsoft.Extensions.Configuration.FileExtensions.dll
+ Microsoft.Extensions.Configuration.Ini.dll
+ Microsoft.Extensions.Configuration.Json.dll
+ Microsoft.Extensions.Configuration.KeyPerFile.dll
+ Microsoft.Extensions.Configuration.UserSecrets.dll
+ Microsoft.Extensions.Configuration.Xml.dll
+ Microsoft.Extensions.DependencyInjection.Abstractions.dll
+ Microsoft.Extensions.DependencyInjection.dll
+ Microsoft.Extensions.Diagnostics.Abstractions.dll
+ Microsoft.Extensions.Diagnostics.dll
+ Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.dll
+ Microsoft.Extensions.Diagnostics.HealthChecks.dll
+ Microsoft.Extensions.Features.dll
+ Microsoft.Extensions.FileProviders.Abstractions.dll
+ Microsoft.Extensions.FileProviders.Composite.dll
+ Microsoft.Extensions.FileProviders.Embedded.dll
+ Microsoft.Extensions.FileProviders.Physical.dll
+ Microsoft.Extensions.FileSystemGlobbing.dll
+ Microsoft.Extensions.Hosting.Abstractions.dll
+ Microsoft.Extensions.Hosting.dll
+ Microsoft.Extensions.Http.dll
+ Microsoft.Extensions.Identity.Core.dll
+ Microsoft.Extensions.Identity.Stores.dll
+ Microsoft.Extensions.Localization.Abstractions.dll
+ Microsoft.Extensions.Localization.dll
+ Microsoft.Extensions.Logging.Abstractions.dll
+ Microsoft.Extensions.Logging.Configuration.dll
+ Microsoft.Extensions.Logging.Console.dll
+ Microsoft.Extensions.Logging.Debug.dll
+ Microsoft.Extensions.Logging.dll
+ Microsoft.Extensions.Logging.EventLog.dll
+ Microsoft.Extensions.Logging.EventSource.dll
+ Microsoft.Extensions.Logging.TraceSource.dll
+ Microsoft.Extensions.ObjectPool.dll
+ Microsoft.Extensions.Options.ConfigurationExtensions.dll
+ Microsoft.Extensions.Options.DataAnnotations.dll
+ Microsoft.Extensions.Options.dll
+ Microsoft.Extensions.Primitives.dll
+ Microsoft.Extensions.Validation.dll
+ Microsoft.Extensions.WebEncoders.dll
+ Microsoft.JSInterop.dll
+ Microsoft.Net.Http.Headers.dll
+ System.Diagnostics.EventLog.dll
+ System.Formats.Cbor.dll
+ System.Security.Cryptography.Xml.dll
+ System.Threading.RateLimiting.dll
+C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.4/ref/net10.0/
+ Microsoft.CSharp.dll
+ Microsoft.VisualBasic.Core.dll
+ Microsoft.VisualBasic.dll
+ Microsoft.Win32.Primitives.dll
+ Microsoft.Win32.Registry.dll
+ mscorlib.dll
+ netstandard.dll
+ System.AppContext.dll
+ System.Buffers.dll
+ System.Collections.Concurrent.dll
+ System.Collections.dll
+ System.Collections.Immutable.dll
+ System.Collections.NonGeneric.dll
+ System.Collections.Specialized.dll
+ System.ComponentModel.Annotations.dll
+ System.ComponentModel.DataAnnotations.dll
+ System.ComponentModel.dll
+ System.ComponentModel.EventBasedAsync.dll
+ System.ComponentModel.Primitives.dll
+ System.ComponentModel.TypeConverter.dll
+ System.Configuration.dll
+ System.Console.dll
+ System.Core.dll
+ System.Data.Common.dll
+ System.Data.DataSetExtensions.dll
+ System.Data.dll
+ System.Diagnostics.Contracts.dll
+ System.Diagnostics.Debug.dll
+ System.Diagnostics.DiagnosticSource.dll
+ System.Diagnostics.FileVersionInfo.dll
+ System.Diagnostics.Process.dll
+ System.Diagnostics.StackTrace.dll
+ System.Diagnostics.TextWriterTraceListener.dll
+ System.Diagnostics.Tools.dll
+ System.Diagnostics.TraceSource.dll
+ System.Diagnostics.Tracing.dll
+ System.dll
+ System.Drawing.dll
+ System.Drawing.Primitives.dll
+ System.Dynamic.Runtime.dll
+ System.Formats.Asn1.dll
+ System.Formats.Tar.dll
+ System.Globalization.Calendars.dll
+ System.Globalization.dll
+ System.Globalization.Extensions.dll
+ System.IO.Compression.Brotli.dll
+ System.IO.Compression.dll
+ System.IO.Compression.FileSystem.dll
+ System.IO.Compression.ZipFile.dll
+ System.IO.dll
+ System.IO.FileSystem.AccessControl.dll
+ System.IO.FileSystem.dll
+ System.IO.FileSystem.DriveInfo.dll
+ System.IO.FileSystem.Primitives.dll
+ System.IO.FileSystem.Watcher.dll
+ System.IO.IsolatedStorage.dll
+ System.IO.MemoryMappedFiles.dll
+ System.IO.Pipelines.dll
+ System.IO.Pipes.AccessControl.dll
+ System.IO.Pipes.dll
+ System.IO.UnmanagedMemoryStream.dll
+ System.Linq.AsyncEnumerable.dll
+ System.Linq.dll
+ System.Linq.Expressions.dll
+ System.Linq.Parallel.dll
+ System.Linq.Queryable.dll
+ System.Memory.dll
+ System.Net.dll
+ System.Net.Http.dll
+ System.Net.Http.Json.dll
+ System.Net.HttpListener.dll
+ System.Net.Mail.dll
+ System.Net.NameResolution.dll
+ System.Net.NetworkInformation.dll
+ System.Net.Ping.dll
+ System.Net.Primitives.dll
+ System.Net.Quic.dll
+ System.Net.Requests.dll
+ System.Net.Security.dll
+ System.Net.ServerSentEvents.dll
+ System.Net.ServicePoint.dll
+ System.Net.Sockets.dll
+ System.Net.WebClient.dll
+ System.Net.WebHeaderCollection.dll
+ System.Net.WebProxy.dll
+ System.Net.WebSockets.Client.dll
+ System.Net.WebSockets.dll
+ System.Numerics.dll
+ System.Numerics.Vectors.dll
+ System.ObjectModel.dll
+ System.Reflection.DispatchProxy.dll
+ System.Reflection.dll
+ System.Reflection.Emit.dll
+ System.Reflection.Emit.ILGeneration.dll
+ System.Reflection.Emit.Lightweight.dll
+ System.Reflection.Extensions.dll
+ System.Reflection.Metadata.dll
+ System.Reflection.Primitives.dll
+ System.Reflection.TypeExtensions.dll
+ System.Resources.Reader.dll
+ System.Resources.ResourceManager.dll
+ System.Resources.Writer.dll
+ System.Runtime.CompilerServices.Unsafe.dll
+ System.Runtime.CompilerServices.VisualC.dll
+ System.Runtime.dll
+ System.Runtime.Extensions.dll
+ System.Runtime.Handles.dll
+ System.Runtime.InteropServices.dll
+ System.Runtime.InteropServices.JavaScript.dll
+ System.Runtime.InteropServices.RuntimeInformation.dll
+ System.Runtime.Intrinsics.dll
+ System.Runtime.Loader.dll
+ System.Runtime.Numerics.dll
+ System.Runtime.Serialization.dll
+ System.Runtime.Serialization.Formatters.dll
+ System.Runtime.Serialization.Json.dll
+ System.Runtime.Serialization.Primitives.dll
+ System.Runtime.Serialization.Xml.dll
+ System.Security.AccessControl.dll
+ System.Security.Claims.dll
+ System.Security.Cryptography.Algorithms.dll
+ System.Security.Cryptography.Cng.dll
+ System.Security.Cryptography.Csp.dll
+ System.Security.Cryptography.dll
+ System.Security.Cryptography.Encoding.dll
+ System.Security.Cryptography.OpenSsl.dll
+ System.Security.Cryptography.Primitives.dll
+ System.Security.Cryptography.X509Certificates.dll
+ System.Security.dll
+ System.Security.Principal.dll
+ System.Security.Principal.Windows.dll
+ System.Security.SecureString.dll
+ System.ServiceModel.Web.dll
+ System.ServiceProcess.dll
+ System.Text.Encoding.CodePages.dll
+ System.Text.Encoding.dll
+ System.Text.Encoding.Extensions.dll
+ System.Text.Encodings.Web.dll
+ System.Text.Json.dll
+ System.Text.RegularExpressions.dll
+ System.Threading.AccessControl.dll
+ System.Threading.Channels.dll
+ System.Threading.dll
+ System.Threading.Overlapped.dll
+ System.Threading.Tasks.Dataflow.dll
+ System.Threading.Tasks.dll
+ System.Threading.Tasks.Extensions.dll
+ System.Threading.Tasks.Parallel.dll
+ System.Threading.Thread.dll
+ System.Threading.ThreadPool.dll
+ System.Threading.Timer.dll
+ System.Transactions.dll
+ System.Transactions.Local.dll
+ System.ValueTuple.dll
+ System.Web.dll
+ System.Web.HttpUtility.dll
+ System.Windows.dll
+ System.Xml.dll
+ System.Xml.Linq.dll
+ System.Xml.ReaderWriter.dll
+ System.Xml.Serialization.dll
+ System.Xml.XDocument.dll
+ System.Xml.XmlDocument.dll
+ System.Xml.XmlSerializer.dll
+ System.Xml.XPath.dll
+ System.Xml.XPath.XDocument.dll
+ WindowsBase.dll
+
+[analyzerReferences]
+<NUGET>/microsoft.codeanalysis.analyzers/3.11.0/analyzers/dotnet/cs/
+ Microsoft.CodeAnalysis.Analyzers.dll
+ Microsoft.CodeAnalysis.CSharp.Analyzers.dll
+<NUGET>/microsoft.entityframeworkcore.analyzers/10.0.3/analyzers/dotnet/cs/Microsoft.EntityFrameworkCore.Analyzers.dll
+C:/Program Files/dotnet/packs/Microsoft.AspNetCore.App.Ref/10.0.4/analyzers/dotnet/cs/
+ Microsoft.AspNetCore.App.Analyzers.dll
+ Microsoft.AspNetCore.App.CodeFixes.dll
+ Microsoft.AspNetCore.App.SourceGenerators.dll
+ Microsoft.AspNetCore.Components.Analyzers.dll
+ Microsoft.Extensions.Logging.Generators.dll
+ Microsoft.Extensions.Options.SourceGeneration.dll
+ Microsoft.Extensions.Validation.ValidationsGenerator.dll
+C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.4/analyzers/dotnet/cs/
+ Microsoft.Interop.ComInterfaceGenerator.dll
+ Microsoft.Interop.JavaScript.JSImportGenerator.dll
+ Microsoft.Interop.LibraryImportGenerator.dll
+ Microsoft.Interop.SourceGeneration.dll
+ System.Text.Json.SourceGeneration.dll
+ System.Text.RegularExpressions.Generator.dll
+C:/Program Files/dotnet/sdk/10.0.104/Sdks/Microsoft.NET.Sdk.Razor/source-generators/
+ Microsoft.AspNetCore.Razor.Utilities.Shared.dll
+ Microsoft.CodeAnalysis.Razor.Compiler.dll
+ Microsoft.Extensions.ObjectPool.dll
+C:/Program Files/dotnet/sdk/10.0.104/Sdks/Microsoft.NET.Sdk.Web/analyzers/cs/
+ Microsoft.AspNetCore.Analyzers.dll
+ Microsoft.AspNetCore.Mvc.Analyzers.dll
+C:/Program Files/dotnet/sdk/10.0.104/Sdks/Microsoft.NET.Sdk/analyzers/
+ Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll
+ Microsoft.CodeAnalysis.NetAnalyzers.dll
+
+[analyzerConfigFiles]
+../../.editorconfig
+C:/Program Files/dotnet/sdk/10.0.104/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_10_default.globalconfig
+obj/Debug/net10.0/Enmarcha.Backend.GeneratedMSBuildEditorConfig.editorconfig
+
+[additionalFiles]
+Views/Alerts/
+ Delete.cshtml
+ Edit.cshtml
+ Index.cshtml
+Views/
+ Backoffice/Index.cshtml
+ Shared/_BackofficeLayout.cshtml
+ _ViewImports.cshtml
+ _ViewStart.cshtml
+
+[dynamicFiles]
+Views/Alerts/
+ Delete.cshtml
+ Edit.cshtml
+ Index.cshtml
+Views/
+ Backoffice/Index.cshtml
+ Shared/_BackofficeLayout.cshtml
+ _ViewImports.cshtml
+ _ViewStart.cshtml
diff --git a/src/Enmarcha.Backend/Helpers/SortingHelper.cs b/src/Enmarcha.Backend/Helpers/SortingHelper.cs
index 7fd4e37..bd655a9 100644
--- a/src/Enmarcha.Backend/Helpers/SortingHelper.cs
+++ b/src/Enmarcha.Backend/Helpers/SortingHelper.cs
@@ -86,6 +86,7 @@ public class SortingHelper
/// 1 = Regular numbered routes (4A, 6, 10, A, etc.)
/// 2 = Hospital (H, H1, H2, H3)
/// 3 = Others (N*, PSA*, U*, LZD, PTL)
+ /// 4 = Football (MAR, GOL and RIO)
/// </summary>
private static int GetVitrasaRouteGroup(string shortName)
{
@@ -125,6 +126,11 @@ public class SortingHelper
return 3;
}
+ if (shortName == "MAR" || shortName == "GOL" || shortName == "RIO")
+ {
+ return 4;
+ }
+
// Everything else is regular (numbered routes like 4A, 6, 10, single letters like A)
return 1;
}
diff --git a/src/Enmarcha.Backend/Helpers/TransitKindClassifier.cs b/src/Enmarcha.Backend/Helpers/TransitKindClassifier.cs
index b1fad84..fbda36c 100644
--- a/src/Enmarcha.Backend/Helpers/TransitKindClassifier.cs
+++ b/src/Enmarcha.Backend/Helpers/TransitKindClassifier.cs
@@ -1,4 +1,4 @@
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;
namespace Enmarcha.Backend.Helpers;
diff --git a/src/Enmarcha.Backend/Program.cs b/src/Enmarcha.Backend/Program.cs
index 8f21eed..785afe5 100644
--- a/src/Enmarcha.Backend/Program.cs
+++ b/src/Enmarcha.Backend/Program.cs
@@ -7,12 +7,14 @@ using Enmarcha.Backend.Services;
using Enmarcha.Backend.Services.Geocoding;
using Enmarcha.Backend.Services.Processors;
using Enmarcha.Backend.Services.Providers;
-using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.EntityFrameworkCore;
using OpenTelemetry.Logs;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
+using Enmarcha.Backend.Services.Processors.Normalisation;
+using Enmarcha.Backend.Services.Processors.RealTime;
var builder = WebApplication.CreateBuilder(args);
@@ -37,10 +39,7 @@ builder.Logging.AddOpenTelemetry(options =>
}
#if DEBUG
- options.AddOtlpExporter(exporterOptions =>
- {
- exporterOptions.Endpoint = new Uri("http://localhost:17011");
- });
+ options.AddOtlpExporter(exporterOptions => { exporterOptions.Endpoint = new Uri("http://localhost:17011"); });
#endif
});
@@ -69,6 +68,7 @@ builder.Services.AddOpenTelemetry()
for (var i = 6; i < 16; i++) bytes[i] = 0;
anonymised = new System.Net.IPAddress(bytes).ToString();
}
+
activity.SetTag("client.address", anonymised);
};
})
@@ -108,7 +108,8 @@ builder.Services.AddOpenTelemetry()
{
activity.SetTag("peer.service", "Vitrasa");
}
- else if (appConfig?.OpenTripPlannerBaseUrl != null && req.RequestUri!.ToString().StartsWith(appConfig.OpenTripPlannerBaseUrl))
+ else if (appConfig?.OpenTripPlannerBaseUrl != null &&
+ req.RequestUri!.ToString().StartsWith(appConfig.OpenTripPlannerBaseUrl))
{
activity.SetTag("peer.service", "OpenTripPlanner");
}
@@ -126,19 +127,13 @@ builder.Services.AddOpenTelemetry()
}
#if DEBUG
- tracing.AddOtlpExporter(exporterOptions =>
- {
- exporterOptions.Endpoint = new Uri("http://localhost:17011");
- });
+ tracing.AddOtlpExporter(exporterOptions => { exporterOptions.Endpoint = new Uri("http://localhost:17011"); });
#endif
});
builder.Services
.AddControllersWithViews()
- .AddJsonOptions(options =>
- {
- options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
- });
+ .AddJsonOptions(options => { options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); });
builder.Services.AddHttpClient();
builder.Services.AddMemoryCache();
@@ -146,22 +141,25 @@ builder.Services.AddMemoryCache();
builder.Services.AddDbContext<AppDbContext>(options =>
{
options.UseNpgsql(
- builder.Configuration.GetConnectionString("Database"),
- o => o.UseNetTopologySuite()
- )
- .UseCamelCaseNamingConvention();
+ builder.Configuration.GetConnectionString("Database"),
+ o => o.UseNetTopologySuite()
+ )
+ .UseCamelCaseNamingConvention();
});
-builder.Services.AddIdentityApiEndpoints<IdentityUser>()
- .AddEntityFrameworkStores<AppDbContext>();
-
var auth0Domain = builder.Configuration["Auth0:Domain"] ?? "";
var auth0ClientId = builder.Configuration["Auth0:ClientId"] ?? "";
-builder.Services.AddAuthentication()
+builder.Services.AddAuthentication(options =>
+ {
+ options.DefaultScheme = "Backoffice";
+ options.DefaultChallengeScheme = "Auth0";
+ })
.AddCookie("Backoffice", options =>
{
options.LoginPath = "/backoffice/auth/login";
+ options.Cookie.SameSite = SameSiteMode.None;
+ options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
})
.AddOpenIdConnect("Auth0", options =>
{
@@ -171,10 +169,15 @@ builder.Services.AddAuthentication()
options.ResponseType = "code";
options.CallbackPath = "/backoffice/auth/callback";
options.SignInScheme = "Backoffice";
+
+ options.CorrelationCookie.Path = "/";
+ options.NonceCookie.Path = "/";
+
options.Scope.Clear();
options.Scope.Add("openid");
options.Scope.Add("profile");
options.Scope.Add("email");
+
options.SaveTokens = true;
options.Events = new OpenIdConnectEvents
{
@@ -189,6 +192,7 @@ builder.Services.AddAuthentication()
returnTo = $"{req.Scheme}://{req.Host}{req.PathBase}{returnTo}";
logoutUri += $"&returnTo={Uri.EscapeDataString(returnTo)}";
}
+
context.Response.Redirect(logoutUri);
context.HandleResponse();
return Task.CompletedTask;
@@ -205,6 +209,14 @@ builder.Services.AddSingleton<FareService>();
builder.Services.AddScoped<IPushNotificationService, PushNotificationService>();
builder.Services.AddHostedService<AlertPhaseNotificationHostedService>();
+builder.Services.AddScoped<IArrivalsProcessor, FilterAndSortProcessor>();
+builder.Services.AddScoped<IArrivalsProcessor, NextStopsProcessor>();
+builder.Services.AddScoped<IArrivalsProcessor, ShapeProcessor>();
+builder.Services.AddScoped<IArrivalsProcessor, VitrasaNormalizationProcessor>();
+builder.Services.AddScoped<IArrivalsProcessor, XuntaNormalizationProcessor>();
+builder.Services.AddScoped<IArrivalsProcessor, TranviasNormalizationProcessor>();
+builder.Services.AddScoped<IArrivalsProcessor, ColourProcessor>();
+
builder.Services.AddScoped<IArrivalsProcessor, VitrasaRealTimeProcessor>();
builder.Services.AddScoped<IArrivalsProcessor, CorunaRealTimeProcessor>();
builder.Services.AddScoped<IArrivalsProcessor, TussaRealTimeProcessor>();
@@ -212,10 +224,6 @@ builder.Services.AddScoped<IArrivalsProcessor, CtagShuttleRealTimeProcessor>();
builder.Services.AddScoped<IArrivalsProcessor, VitrasaUsageProcessor>();
builder.Services.AddScoped<IArrivalsProcessor, RenfeRealTimeProcessor>();
-builder.Services.AddScoped<IArrivalsProcessor, FilterAndSortProcessor>();
-builder.Services.AddScoped<IArrivalsProcessor, NextStopsProcessor>();
-builder.Services.AddScoped<IArrivalsProcessor, ShapeProcessor>();
-builder.Services.AddScoped<IArrivalsProcessor, FeedConfigProcessor>();
builder.Services.AddScoped<ArrivalsPipeline>();
// builder.Services.AddKeyedScoped<IGeocodingService, NominatimGeocodingService>("Nominatim");
@@ -230,18 +238,28 @@ builder.Services.AddHttpClient<Costasdev.VigoTransitApi.VigoTransitApiClient>();
var app = builder.Build();
+var forwardedHeaderOptions = new ForwardedHeadersOptions
+{
+ ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost
+};
+
+// Crucial: Clear the networks/proxies list if you are in a container or specific Linux setup
+forwardedHeaderOptions.KnownIPNetworks.Clear();
+forwardedHeaderOptions.KnownProxies.Clear();
+
+app.UseForwardedHeaders(forwardedHeaderOptions);
+
app.UseStaticFiles();
app.UseAuthentication();
app.UseAuthorization();
-app.MapGroup("/api/identity").MapIdentityApi<IdentityUser>();
-
app.Use(async (context, next) =>
{
if (context.Request.Headers.TryGetValue("X-Session-Id", out var sessionId))
{
System.Diagnostics.Activity.Current?.SetTag("session.id", sessionId.ToString());
}
+
await next();
});
diff --git a/src/Enmarcha.Backend/Services/Processors/NextStopsProcessor.cs b/src/Enmarcha.Backend/Services/Processors/NextStopsProcessor.cs
index 1db215b..4c0b8ac 100644
--- a/src/Enmarcha.Backend/Services/Processors/NextStopsProcessor.cs
+++ b/src/Enmarcha.Backend/Services/Processors/NextStopsProcessor.cs
@@ -1,4 +1,3 @@
-using System.Text;
using Enmarcha.Sources.OpenTripPlannerGql.Queries;
namespace Enmarcha.Backend.Services.Processors;
diff --git a/src/Enmarcha.Backend/Services/Processors/Normalisation/ColourProcessor.cs b/src/Enmarcha.Backend/Services/Processors/Normalisation/ColourProcessor.cs
new file mode 100644
index 0000000..ee4379b
--- /dev/null
+++ b/src/Enmarcha.Backend/Services/Processors/Normalisation/ColourProcessor.cs
@@ -0,0 +1,34 @@
+using Enmarcha.Backend.Helpers;
+
+namespace Enmarcha.Backend.Services.Processors.Normalisation;
+
+public class ColourProcessor : IArrivalsProcessor
+{
+ private readonly FeedService _feedService;
+
+ public ColourProcessor(FeedService feedService)
+ {
+ _feedService = feedService;
+ }
+
+ public Task ProcessAsync(ArrivalsContext context)
+ {
+ var feedId = context.StopId.Split(':')[0];
+ var (fallbackColor, fallbackTextColor) = _feedService.GetFallbackColourForFeed(feedId);
+
+ foreach (var arrival in context.Arrivals)
+ {
+ if (string.IsNullOrEmpty(arrival.Route.Colour) || arrival.Route.Colour == "FFFFFF")
+ {
+ arrival.Route.Colour = fallbackColor;
+ arrival.Route.TextColour = fallbackTextColor;
+ }
+ else if (string.IsNullOrEmpty(arrival.Route.TextColour) || arrival.Route.TextColour == "000000")
+ {
+ arrival.Route.TextColour = ContrastHelper.GetBestTextColour(arrival.Route.Colour);
+ }
+ }
+
+ return Task.CompletedTask;
+ }
+}
diff --git a/src/Enmarcha.Backend/Services/Processors/Normalisation/TranviasNormalizationProcessor.cs b/src/Enmarcha.Backend/Services/Processors/Normalisation/TranviasNormalizationProcessor.cs
new file mode 100644
index 0000000..3d17a37
--- /dev/null
+++ b/src/Enmarcha.Backend/Services/Processors/Normalisation/TranviasNormalizationProcessor.cs
@@ -0,0 +1,17 @@
+namespace Enmarcha.Backend.Services.Processors.Normalisation;
+
+public class TranviasNormalizationProcessor : IArrivalsProcessor
+{
+ public Task ProcessAsync(ArrivalsContext context)
+ {
+ if (context.StopId.Split(':')[0] != "tranvias")
+ return Task.CompletedTask;
+
+ foreach (var arrival in context.Arrivals)
+ {
+ arrival.Shift = FeedService.GetShiftBadge("tranvias", arrival.TripId);
+ }
+
+ return Task.CompletedTask;
+ }
+}
diff --git a/src/Enmarcha.Backend/Services/Processors/FeedConfigProcessor.cs b/src/Enmarcha.Backend/Services/Processors/Normalisation/VitrasaNormalizationProcessor.cs
index 9fc46c7..2cca672 100644
--- a/src/Enmarcha.Backend/Services/Processors/FeedConfigProcessor.cs
+++ b/src/Enmarcha.Backend/Services/Processors/Normalisation/VitrasaNormalizationProcessor.cs
@@ -1,44 +1,19 @@
-using Enmarcha.Backend.Helpers;
using Enmarcha.Backend.Types.Arrivals;
-namespace Enmarcha.Backend.Services.Processors;
+namespace Enmarcha.Backend.Services.Processors.Normalisation;
-public class FeedConfigProcessor : IArrivalsProcessor
+public class VitrasaNormalizationProcessor : IArrivalsProcessor
{
- private readonly FeedService _feedService;
-
- public FeedConfigProcessor(FeedService feedService)
- {
- _feedService = feedService;
- }
-
public Task ProcessAsync(ArrivalsContext context)
{
- var feedId = context.StopId.Split(':')[0];
- var (fallbackColor, fallbackTextColor) = _feedService.GetFallbackColourForFeed(feedId);
+ if (context.StopId.Split(':')[0] != "vitrasa")
+ return Task.CompletedTask;
foreach (var arrival in context.Arrivals)
{
- arrival.Route.ShortName = _feedService.NormalizeRouteShortName(feedId, arrival.Route.ShortName);
- arrival.Headsign.Destination = FeedService.NormalizeStopName(feedId, arrival.Headsign.Destination);
-
- // Apply Vitrasa-specific line formatting
- if (feedId == "vitrasa")
- {
- FormatVitrasaLine(arrival);
- }
-
- arrival.Shift = FeedService.GetShiftBadge(feedId, arrival.TripId);
-
- if (string.IsNullOrEmpty(arrival.Route.Colour) || arrival.Route.Colour == "FFFFFF")
- {
- arrival.Route.Colour = fallbackColor;
- arrival.Route.TextColour = fallbackTextColor;
- }
- else if (string.IsNullOrEmpty(arrival.Route.TextColour) || arrival.Route.TextColour == "000000")
- {
- arrival.Route.TextColour = ContrastHelper.GetBestTextColour(arrival.Route.Colour);
- }
+ arrival.Headsign.Destination = FeedService.NormalizeStopName("vitrasa", arrival.Headsign.Destination);
+ FormatVitrasaLine(arrival);
+ arrival.Shift = FeedService.GetShiftBadge("vitrasa", arrival.TripId);
}
return Task.CompletedTask;
@@ -93,6 +68,7 @@ public class FeedConfigProcessor : IArrivalsProcessor
arrival.Route.ShortName = "GOL";
arrival.Headsign.Destination = "GOL ⚽: NAVIA-BOUZAS-URZAIZ-G. ESPINO";
}
+
arrival.Route.Colour = "6CACE4";
arrival.Route.TextColour = "000000";
break;
diff --git a/src/Enmarcha.Backend/Services/Processors/Normalisation/XuntaNormalizationProcessor.cs b/src/Enmarcha.Backend/Services/Processors/Normalisation/XuntaNormalizationProcessor.cs
new file mode 100644
index 0000000..9b7e498
--- /dev/null
+++ b/src/Enmarcha.Backend/Services/Processors/Normalisation/XuntaNormalizationProcessor.cs
@@ -0,0 +1,24 @@
+namespace Enmarcha.Backend.Services.Processors.Normalisation;
+
+public class XuntaNormalizationProcessor : IArrivalsProcessor
+{
+ private readonly FeedService _feedService;
+
+ public XuntaNormalizationProcessor(FeedService feedService)
+ {
+ _feedService = feedService;
+ }
+
+ public Task ProcessAsync(ArrivalsContext context)
+ {
+ if (context.StopId.Split(':')[0] != "xunta")
+ return Task.CompletedTask;
+
+ foreach (var arrival in context.Arrivals)
+ {
+ arrival.Route.ShortName = _feedService.NormalizeRouteShortName("xunta", arrival.Route.ShortName);
+ }
+
+ return Task.CompletedTask;
+ }
+}
diff --git a/src/Enmarcha.Backend/Services/Processors/CorunaRealTimeProcessor.cs b/src/Enmarcha.Backend/Services/Processors/RealTime/CorunaRealTimeProcessor.cs
index 797221f..20dc356 100644
--- a/src/Enmarcha.Backend/Services/Processors/CorunaRealTimeProcessor.cs
+++ b/src/Enmarcha.Backend/Services/Processors/RealTime/CorunaRealTimeProcessor.cs
@@ -3,7 +3,7 @@ using Enmarcha.Sources.TranviasCoruna;
using Enmarcha.Backend.Types;
using Enmarcha.Backend.Types.Arrivals;
-namespace Enmarcha.Backend.Services.Processors;
+namespace Enmarcha.Backend.Services.Processors.RealTime;
public class CorunaRealTimeProcessor : AbstractRealTimeProcessor
{
diff --git a/src/Enmarcha.Backend/Services/Processors/CtagShuttleRealTimeProcessor.cs b/src/Enmarcha.Backend/Services/Processors/RealTime/CtagShuttleRealTimeProcessor.cs
index ce2651f..804b09c 100644
--- a/src/Enmarcha.Backend/Services/Processors/CtagShuttleRealTimeProcessor.cs
+++ b/src/Enmarcha.Backend/Services/Processors/RealTime/CtagShuttleRealTimeProcessor.cs
@@ -3,7 +3,7 @@ using Enmarcha.Sources.OpenTripPlannerGql.Queries;
using Enmarcha.Backend.Types;
using Enmarcha.Backend.Types.Arrivals;
-namespace Enmarcha.Backend.Services.Processors;
+namespace Enmarcha.Backend.Services.Processors.RealTime;
public class CtagShuttleRealTimeProcessor : AbstractRealTimeProcessor
{
diff --git a/src/Enmarcha.Backend/Services/Processors/RenfeRealTimeProcessor.cs b/src/Enmarcha.Backend/Services/Processors/RealTime/RenfeRealTimeProcessor.cs
index 5e5468e..26ffa24 100644
--- a/src/Enmarcha.Backend/Services/Processors/RenfeRealTimeProcessor.cs
+++ b/src/Enmarcha.Backend/Services/Processors/RealTime/RenfeRealTimeProcessor.cs
@@ -4,7 +4,7 @@ using Enmarcha.Backend.Types.Arrivals;
using Enmarcha.Sources.GtfsRealtime;
using Arrival = Enmarcha.Backend.Types.Arrivals.Arrival;
-namespace Enmarcha.Backend.Services.Processors;
+namespace Enmarcha.Backend.Services.Processors.RealTime;
public partial class RenfeRealTimeProcessor : AbstractRealTimeProcessor
{
diff --git a/src/Enmarcha.Backend/Services/Processors/TussaRealTimeProcessor.cs b/src/Enmarcha.Backend/Services/Processors/RealTime/TussaRealTimeProcessor.cs
index 7808a3f..2cfdf28 100644
--- a/src/Enmarcha.Backend/Services/Processors/TussaRealTimeProcessor.cs
+++ b/src/Enmarcha.Backend/Services/Processors/RealTime/TussaRealTimeProcessor.cs
@@ -3,7 +3,7 @@ using Enmarcha.Backend.Types.Arrivals;
using Enmarcha.Sources.Tussa;
using Arrival = Enmarcha.Backend.Types.Arrivals.Arrival;
-namespace Enmarcha.Backend.Services.Processors;
+namespace Enmarcha.Backend.Services.Processors.RealTime;
public class TussaRealTimeProcessor : AbstractRealTimeProcessor
{
diff --git a/src/Enmarcha.Backend/Services/Processors/VitrasaRealTimeProcessor.cs b/src/Enmarcha.Backend/Services/Processors/RealTime/VitrasaRealTimeProcessor.cs
index 5bbbfab..0227f9c 100644
--- a/src/Enmarcha.Backend/Services/Processors/VitrasaRealTimeProcessor.cs
+++ b/src/Enmarcha.Backend/Services/Processors/RealTime/VitrasaRealTimeProcessor.cs
@@ -5,7 +5,7 @@ using Enmarcha.Backend.Types;
using Enmarcha.Backend.Types.Arrivals;
using Microsoft.Extensions.Options;
-namespace Enmarcha.Backend.Services.Processors;
+namespace Enmarcha.Backend.Services.Processors.RealTime;
public class VitrasaRealTimeProcessor : AbstractRealTimeProcessor
{
diff --git a/src/Enmarcha.Backend/ViewModels/AlertFormViewModel.cs b/src/Enmarcha.Backend/ViewModels/AlertFormViewModel.cs
index 6514a5a..d27fc8d 100644
--- a/src/Enmarcha.Backend/ViewModels/AlertFormViewModel.cs
+++ b/src/Enmarcha.Backend/ViewModels/AlertFormViewModel.cs
@@ -1,5 +1,4 @@
using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
using Enmarcha.Backend.Data.Models;
namespace Enmarcha.Backend.ViewModels;