From f1b0b5f7ceaf6d23ae347e12cf29eef617c7dc9b Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Sat, 21 Mar 2026 00:36:25 +0100 Subject: feat: enhance geocoding and stop search with performance metrics and improved response handling --- src/Enmarcha.Backend/Services/FareService.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/Enmarcha.Backend/Services/FareService.cs') diff --git a/src/Enmarcha.Backend/Services/FareService.cs b/src/Enmarcha.Backend/Services/FareService.cs index bf85f03..fda5eb5 100644 --- a/src/Enmarcha.Backend/Services/FareService.cs +++ b/src/Enmarcha.Backend/Services/FareService.cs @@ -22,6 +22,9 @@ public class FareService private const decimal SantiagoCashFare = 1.00M; private const decimal SantiagoCardFare = 0.36M; + private const decimal OurenseCashFare = 0.85M; + private const decimal OurenseCardFare = 0.49M; + public FareService( IOptions config, XuntaFareProvider xuntaFareProvider, @@ -71,6 +74,9 @@ public class FareService case "vitrasa": total += VitrasaCashFare; break; + case "ourense": + total += OurenseCashFare; + break; case "xunta": // TODO: Handle potentiall blow-ups if (leg.From is not { ZoneId: not null }) @@ -126,6 +132,11 @@ public class FareService maxUsages = 2; initialFare = SantiagoCardFare; break; + case "ourense": + maxMinutes = 60; + maxUsages = 2; + initialFare = OurenseCardFare; + break; case "xunta": if (leg.From?.ZoneId == null || leg.To?.ZoneId == null) { @@ -182,9 +193,7 @@ public class FareService } else { - // Free transfer for city systems or non-ATM Xunta (though non-ATM Xunta has maxUsages=1) validTicket.UsedTimes++; - _logger.LogDebug("Free transfer for {FeedId}", leg.FeedId); } } else @@ -199,7 +208,6 @@ public class FareService StartZone = leg.FeedId == "xunta" ? leg.From!.ZoneId! : string.Empty, TotalPaid = initialFare }); - _logger.LogDebug("New ticket for {FeedId}: {Cost}€", leg.FeedId, initialFare); } } -- cgit v1.3