aboutsummaryrefslogtreecommitdiff
path: root/src/Enmarcha.Backend/Services/FareService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Enmarcha.Backend/Services/FareService.cs')
-rw-r--r--src/Enmarcha.Backend/Services/FareService.cs14
1 files changed, 11 insertions, 3 deletions
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<AppConfiguration> 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);
}
}