feat: implement SignalR notifications for project status changes

This commit is contained in:
2025-12-14 12:13:23 +03:30
parent 14fda440c1
commit da46d45601
8 changed files with 80 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
using GozareshgirProgramManager.Application._Common.Models;
using GozareshgirProgramManager.Application.Interfaces;
using GozareshgirProgramManager.Domain.ProjectAgg.Events;
using MediatR;
namespace GozareshgirProgramManager.Application.DomainEventHandlers.ProjectSection;
public class TaskSectionStatusChangedHandler:INotificationHandler<DomainEventNotification<TaskSectionStatusChangedEvent>>
{
private readonly IBoardNotificationPublisher _boardNotificationPublisher;
public TaskSectionStatusChangedHandler(IBoardNotificationPublisher boardNotificationPublisher)
{
_boardNotificationPublisher = boardNotificationPublisher;
}
public Task Handle(DomainEventNotification<TaskSectionStatusChangedEvent> notification, CancellationToken cancellationToken)
{
var domainEvent = notification.DomainEvent;
_boardNotificationPublisher.SendProjectStatusChanged(domainEvent.UserId,domainEvent.OldStatus,domainEvent.NewStatus,domainEvent.SectionId);
return Task.CompletedTask;
}
}

View File

@@ -0,0 +1,9 @@
using GozareshgirProgramManager.Domain.ProjectAgg.Enums;
namespace GozareshgirProgramManager.Application.Interfaces;
public interface IBoardNotificationPublisher
{
Task SendProjectStatusChanged(long userId, TaskSectionStatus oldStatus,
TaskSectionStatus newStatus, Guid sectionId);
}

View File

@@ -1,6 +0,0 @@
namespace GozareshgirProgramManager.Application.Interfaces;
public interface IBoardNotificationService
{
Task SendProjectAssignedAsync();
}