Files
ColaFlow/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/EventHandlers/EpicUpdatedEventHandler.cs
Yaojia Wang 63ff1a9914
Some checks failed
Code Coverage / Generate Coverage Report (push) Has been cancelled
Tests / Run Tests (9.0.x) (push) Has been cancelled
Tests / Docker Build Test (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Clean up
2025-11-09 18:40:36 +01:00

37 lines
1.2 KiB
C#

using MediatR;
using Microsoft.Extensions.Logging;
using ColaFlow.Modules.ProjectManagement.Domain.Events;
using ColaFlow.Modules.ProjectManagement.Application.Services;
namespace ColaFlow.Modules.ProjectManagement.Application.EventHandlers;
/// <summary>
/// Handler for EpicUpdatedEvent - sends SignalR notification
/// </summary>
public class EpicUpdatedEventHandler(
IProjectNotificationService notificationService,
ILogger<EpicUpdatedEventHandler> logger)
: INotificationHandler<EpicUpdatedEvent>
{
public async Task Handle(EpicUpdatedEvent notification, CancellationToken cancellationToken)
{
logger.LogInformation("Handling EpicUpdatedEvent for epic {EpicId}", notification.EpicId);
var epicData = new
{
Id = notification.EpicId.Value,
ProjectId = notification.ProjectId.Value,
Name = notification.EpicName,
UpdatedAt = DateTime.UtcNow
};
await notificationService.NotifyEpicUpdated(
notification.TenantId.Value,
notification.ProjectId.Value,
notification.EpicId.Value,
epicData);
logger.LogInformation("SignalR notification sent for epic {EpicId}", notification.EpicId);
}
}