Files
ColaFlow/colaflow-api/src/ColaFlow.API/Services/IRealtimeNotificationService.cs
Yaojia Wang 96fed691ab feat(backend): Add SignalR real-time notifications for Sprint events - Sprint 2 Story 3 Task 5
Implemented comprehensive SignalR notifications for Sprint lifecycle events.

Features:
- Extended IRealtimeNotificationService with 5 Sprint notification methods
- Implemented Sprint notification service methods in RealtimeNotificationService
- Created SprintEventHandlers to handle all 5 Sprint domain events
- Updated UpdateSprintCommandHandler to publish SprintUpdatedEvent
- SignalR events broadcast to both project and tenant groups

Sprint Events Implemented:
1. SprintCreated - New sprint created
2. SprintUpdated - Sprint details modified
3. SprintStarted - Sprint transitioned to Active status
4. SprintCompleted - Sprint transitioned to Completed status
5. SprintDeleted - Sprint removed

Technical Details:
- Event handlers catch and log errors (fire-and-forget pattern)
- Notifications include SprintId, SprintName, ProjectId, and Timestamp
- Multi-tenant isolation via tenant groups
- Project-level targeting via project groups

Frontend Integration:
- Frontend can listen to 'SprintCreated', 'SprintUpdated', 'SprintStarted', 'SprintCompleted', 'SprintDeleted' events
- Real-time UI updates for sprint changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 00:35:33 +01:00

44 lines
2.4 KiB
C#

namespace ColaFlow.API.Services;
public interface IRealtimeNotificationService
{
// Project-level notifications
Task NotifyProjectCreated(Guid tenantId, Guid projectId, object project);
Task NotifyProjectUpdated(Guid tenantId, Guid projectId, object project);
Task NotifyProjectArchived(Guid tenantId, Guid projectId);
Task NotifyProjectUpdate(Guid tenantId, Guid projectId, object data);
// Epic notifications
Task NotifyEpicCreated(Guid tenantId, Guid projectId, Guid epicId, object epic);
Task NotifyEpicUpdated(Guid tenantId, Guid projectId, Guid epicId, object epic);
Task NotifyEpicDeleted(Guid tenantId, Guid projectId, Guid epicId);
// Story notifications
Task NotifyStoryCreated(Guid tenantId, Guid projectId, Guid epicId, Guid storyId, object story);
Task NotifyStoryUpdated(Guid tenantId, Guid projectId, Guid epicId, Guid storyId, object story);
Task NotifyStoryDeleted(Guid tenantId, Guid projectId, Guid epicId, Guid storyId);
// Task notifications
Task NotifyTaskCreated(Guid tenantId, Guid projectId, Guid storyId, Guid taskId, object task);
Task NotifyTaskUpdated(Guid tenantId, Guid projectId, Guid storyId, Guid taskId, object task);
Task NotifyTaskDeleted(Guid tenantId, Guid projectId, Guid storyId, Guid taskId);
Task NotifyTaskAssigned(Guid tenantId, Guid projectId, Guid taskId, Guid assigneeId);
// Issue notifications
Task NotifyIssueCreated(Guid tenantId, Guid projectId, object issue);
Task NotifyIssueUpdated(Guid tenantId, Guid projectId, object issue);
Task NotifyIssueDeleted(Guid tenantId, Guid projectId, Guid issueId);
Task NotifyIssueStatusChanged(Guid tenantId, Guid projectId, Guid issueId, string oldStatus, string newStatus);
// Sprint notifications
Task NotifySprintCreated(Guid tenantId, Guid projectId, Guid sprintId, string sprintName);
Task NotifySprintUpdated(Guid tenantId, Guid projectId, Guid sprintId, string sprintName);
Task NotifySprintStarted(Guid tenantId, Guid projectId, Guid sprintId, string sprintName);
Task NotifySprintCompleted(Guid tenantId, Guid projectId, Guid sprintId, string sprintName);
Task NotifySprintDeleted(Guid tenantId, Guid projectId, Guid sprintId, string sprintName);
// User-level notifications
Task NotifyUser(Guid userId, string message, string type = "info");
Task NotifyUsersInTenant(Guid tenantId, string message, string type = "info");
}