Introduced NotificationService for managing notification logic and recipient resolution.

- Integrated SignalR for real-time notification delivery to users.
This commit is contained in:
2026-10-20 16:51:01 +05:30
parent a0df2a1bbf
commit 6b9f27573b
8 changed files with 6649 additions and 84 deletions
+11
View File
@@ -12,6 +12,7 @@ using Distribution.Features.ReceivedCheque;
using Distribution.Features.DriverComplianceConfig;
using Distribution.Features.DriverProfile;
using Distribution.Features.Grn;
using Distribution.Features.Notifications;
using Distribution.Features.Item;
using Distribution.Features.ShopPO;
using Distribution.Features.Invoice;
@@ -141,6 +142,15 @@ builder.Services.AddScoped<ReceivedChequeService>();
builder.Services.AddScoped<SupplierPaymentService>();
builder.Services.AddScoped<SysConfigService>();
builder.Services.AddScoped<INotificationRepository, NotificationRepository>();
builder.Services.AddScoped<NotificationRecipientResolver>();
builder.Services.AddScoped<NotificationService>();
builder.Services.AddScoped<INotificationService>(sp => sp.GetRequiredService<NotificationService>());
builder.Services.AddSingleton<Microsoft.AspNetCore.SignalR.IUserIdProvider, NotificationUserIdProvider>();
builder.Services.AddHostedService<NotificationCleanupJob>();
builder.Services.AddSignalR()
.AddJsonProtocol(options => options.PayloadSerializerOptions.Converters.Add(new JsonStringEnumConverter()));
builder.Services.AddMemoryCache();
builder.Services.AddHttpContextAccessor();
builder.Services.AddScoped<ICurrentUserService, CurrentUserService>();
@@ -192,5 +202,6 @@ app.UseMiddleware<AuthMiddleware>();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();
app.MapHub<NotificationHub>(NotificationHub.Path);
app.Run();