feat: refactor week number handling to use WeekDefinitionId across multiple entities and queries
This commit is contained in:
@@ -6,6 +6,7 @@ using CMSMicroservice.Infrastructure.BackgroundJobs;
|
||||
using CMSMicroservice.Infrastructure.Services.Monitoring;
|
||||
using CMSMicroservice.Infrastructure.Configuration;
|
||||
using CMSMicroservice.Infrastructure.Services.Payment;
|
||||
using CMSMicroservice.Infrastructure.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
@@ -83,6 +84,10 @@ public static class ConfigureServices
|
||||
|
||||
services.AddScoped<IApplicationDbContext>(p => p.GetRequiredService<ApplicationDbContext>());
|
||||
|
||||
// Week Definition Repository - کش در حافظه برای هفتهها (Singleton برای کش، با IServiceScopeFactory برای دسترسی به DbContext)
|
||||
services.AddSingleton<WeekDefinitionRepository>();
|
||||
services.AddSingleton<IWeekDefinitionRepository>(sp => sp.GetRequiredService<WeekDefinitionRepository>());
|
||||
|
||||
// Background Workers - Deprecated: Using Hangfire instead
|
||||
// services.AddHostedService<WeeklyNetworkCommissionWorker>();
|
||||
services.AddScoped<WeeklyCommissionJob>(); // Hangfire Job (Scoped for DI)
|
||||
|
||||
Reference in New Issue
Block a user