feat: refactor week number handling to use WeekDefinitionId across multiple entities and queries

This commit is contained in:
masoodafar-web
2025-12-19 10:41:22 +03:30
parent 3cb95dc349
commit 8b784101be
83 changed files with 17592 additions and 566 deletions
+10
View File
@@ -1,5 +1,6 @@
using CMSMicroservice.Infrastructure.Persistence;
using CMSMicroservice.Infrastructure.Data.Seeding;
using CMSMicroservice.Application.Common.Interfaces;
using CMSMicroservice.WebApi.Hubs;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
@@ -144,6 +145,11 @@ if (app.Environment.IsDevelopment())
var dbContext = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
var migrationSeeder = new NetworkParentIdMigrationSeeder(dbContext, migrationLogger);
await migrationSeeder.SeedAsync();
// Seed WeekDefinitions (هفته‌ها)
var weekSeederLogger = scope.ServiceProvider.GetRequiredService<ILogger<WeekDefinitionSeeder>>();
var weekSeeder = new WeekDefinitionSeeder(dbContext, weekSeederLogger);
await weekSeeder.SeedAsync();
}
}
else
@@ -152,6 +158,10 @@ else
app.UseHsts();
}
// Load WeekDefinition cache (برای هر دو محیط Development و Production)
var weekDefinitionRepository = app.Services.GetRequiredService<IWeekDefinitionRepository>();
await weekDefinitionRepository.ReloadCacheAsync();
app.UseRouting();
app.UseCors("AllowAll");