77458383d1
- Expand inline guard, return and logger blocks across the monitor services, init classes and tests - Have INordPoolPriceService take a per-date fetch delegate and expose ParseAndAdjust, moving the HA fetch call into NordPoolInit so the service can be registered singleton - Record the NordPool and boiler service lifetimes in AGENTS.md - Drop the unused persisted-state argument from the boiler test data helper
21 lines
661 B
C#
21 lines
661 B
C#
using System.Text.Json;
|
|
using NordPool.Models;
|
|
|
|
namespace NordPoolManager.Interface;
|
|
|
|
public interface INordPoolPriceService
|
|
{
|
|
NordPoolPrice? TodayNordPoolPrice { get; }
|
|
NordPoolPrice? TomorrowNordPoolPrice { get; }
|
|
double CurrentPrice { get; }
|
|
int DayQuartersIndex { get; }
|
|
DateTime? LastUpdatedDate { get; }
|
|
DateOnly? LastFetchedDate { get; }
|
|
|
|
Task FetchPricesAsync(Func<DateOnly, Task<NordPoolPrice>> fetchPricesForDate);
|
|
NordPoolPrice ParseAndAdjust(JsonElement? element);
|
|
void UpdateCurrentPrice();
|
|
double GetCurrentPrice();
|
|
bool ShouldFetchNewPrices(DateOnly dateOnly);
|
|
void RollOverPrices(DateOnly date);
|
|
} |