Refactor boiler control and price logic: Introduce PriceConsts, improve BoilerAction handling with switch, and update namespaces for better structure.

This commit is contained in:
Marius
2026-03-16 12:08:14 +02:00
parent 42b1fe3b18
commit 17a2e67078
8 changed files with 34 additions and 19 deletions
+3 -4
View File
@@ -5,7 +5,7 @@ using Microsoft.Extensions.Logging;
using NordPool.Models;
using NordPool.Models.Dtos;
using NordPoolManager.Interface;
using NordPoolManager.Models;
using NordPoolManager.Models.Consts;
namespace NordPoolManager;
@@ -49,8 +49,7 @@ public class NordPoolPriceService(Services services, IMapper mapper, ILogger<Nor
LastUpdatedDate = DateTime.UtcNow;
LastFetchedDate = today;
logger.LogInformation(
"Prices ready for today ({Today}). Today prices count: {TodayCount}, Tomorrow prices count: {TomorrowCount}",
logger.LogInformation("Prices ready for today ({Today}). Today prices count: {TodayCount}, Tomorrow prices count: {TomorrowCount}",
today, TodayNordPoolPrice?.Prices?.Count ?? 0, TomorrowNordPoolPrice?.Prices?.Count ?? 0);
}
@@ -149,7 +148,7 @@ public class NordPoolPriceService(Services services, IMapper mapper, ILogger<Nor
LastFetchedDate = today;
}
internal async Task<NordPoolPrice> GetNordPoolPriceAsync(DateOnly date)
private async Task<NordPoolPrice> GetNordPoolPriceAsync(DateOnly date)
{
var nordPoolPricesDto = await _nordPoolServices.GetPricesForDateAsync(
new NordpoolGetPricesForDateParameters