Feat(holidays): Implement database-backed holiday detection system

- Adds a new `MercadosFeriados` table to the database to persist market holidays.
- Implements `HolidayDataFetcher` to update holidays weekly from Finnhub API.
- Implements `IHolidayService` with in-memory caching to check for holidays efficiently.
- Worker service now skips fetcher execution on market holidays.
- Adds a new API endpoint `/api/mercados/es-feriado/{mercado}`.
- Integrates a non-blocking holiday alert into the `BolsaLocalWidget`."
This commit is contained in:
2025-07-15 11:20:28 -03:00
parent 640b7d1ece
commit e1e23f5315
20 changed files with 592 additions and 122 deletions

View File

@@ -31,6 +31,13 @@ IHost host = Host.CreateDefaultBuilder(args)
services.AddHttpClient("BcrDataFetcher").AddPolicyHandler(GetRetryPolicy());
services.AddHttpClient("FinnhubDataFetcher").AddPolicyHandler(GetRetryPolicy());
// Servicio de caché en memoria de .NET
services.AddMemoryCache();
// Registramos nuestro nuevo servicio de feriados
services.AddScoped<IHolidayService, FinnhubHolidayService>();
services.AddScoped<IDataFetcher, HolidayDataFetcher>();
services.AddScoped<IMercadoFeriadoRepository, MercadoFeriadoRepository>();
services.AddHostedService<DataFetchingService>();
})
.Build();