Files
ColaFlow/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/EventHandlers/TaskDeletedEventHandler.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

29 lines
1.0 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 TaskDeletedEvent - sends SignalR notification
/// </summary>
public class TaskDeletedEventHandler(
IProjectNotificationService notificationService,
ILogger<TaskDeletedEventHandler> logger)
: INotificationHandler<TaskDeletedEvent>
{
public async Task Handle(TaskDeletedEvent notification, CancellationToken cancellationToken)
{
logger.LogInformation("Handling TaskDeletedEvent for task {TaskId}", notification.TaskId);
await notificationService.NotifyTaskDeleted(
notification.TenantId.Value,
notification.ProjectId.Value,
notification.StoryId.Value,
notification.TaskId.Value);
logger.LogInformation("SignalR notification sent for task {TaskId}", notification.TaskId);
}
}