/** * SignalR Event Types for ProjectManagement Module * Corresponds to backend RealtimeNotificationService events */ // Base event interface export interface BaseSignalREvent { timestamp: string; tenantId: string; } // Connection status types export type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'failed'; // ============================================ // PROJECT EVENTS // ============================================ export interface ProjectCreatedEvent extends BaseSignalREvent { projectId: string; projectName: string; projectKey: string; description?: string; ownerId: string; } export interface ProjectUpdatedEvent extends BaseSignalREvent { projectId: string; projectName: string; projectKey: string; description?: string; } export interface ProjectArchivedEvent extends BaseSignalREvent { projectId: string; } // ============================================ // EPIC EVENTS // ============================================ export interface EpicCreatedEvent extends BaseSignalREvent { epicId: string; projectId: string; title: string; description?: string; status: string; createdBy: string; } export interface EpicUpdatedEvent extends BaseSignalREvent { epicId: string; projectId: string; title: string; description?: string; status: string; } export interface EpicDeletedEvent extends BaseSignalREvent { epicId: string; projectId: string; } // ============================================ // STORY EVENTS // ============================================ export interface StoryCreatedEvent extends BaseSignalREvent { storyId: string; projectId: string; epicId?: string; title: string; description?: string; status: string; storyPoints?: number; createdBy: string; } export interface StoryUpdatedEvent extends BaseSignalREvent { storyId: string; projectId: string; epicId?: string; title: string; description?: string; status: string; storyPoints?: number; } export interface StoryDeletedEvent extends BaseSignalREvent { storyId: string; projectId: string; } // ============================================ // TASK EVENTS // ============================================ export interface TaskCreatedEvent extends BaseSignalREvent { taskId: string; projectId: string; storyId?: string; title: string; description?: string; status: string; priority?: string; assigneeId?: string; createdBy: string; } export interface TaskUpdatedEvent extends BaseSignalREvent { taskId: string; projectId: string; storyId?: string; title: string; description?: string; status: string; priority?: string; assigneeId?: string; } export interface TaskDeletedEvent extends BaseSignalREvent { taskId: string; projectId: string; } export interface TaskAssignedEvent extends BaseSignalREvent { taskId: string; projectId: string; assigneeId: string; assignedAt: string; } // ============================================ // LEGACY ISSUE EVENTS (for backward compatibility) // ============================================ export interface IssueCreatedEvent extends BaseSignalREvent { issueId: string; projectId: string; title: string; description?: string; status: string; } export interface IssueUpdatedEvent extends BaseSignalREvent { issueId: string; projectId: string; title: string; description?: string; status: string; } export interface IssueDeletedEvent extends BaseSignalREvent { issueId: string; projectId: string; } export interface IssueStatusChangedEvent extends BaseSignalREvent { issueId: string; projectId: string; oldStatus: string; newStatus: string; changedAt: string; } // ============================================ // USER COLLABORATION EVENTS // ============================================ export interface UserJoinedProjectEvent { userId: string; projectId: string; joinedAt: string; } export interface UserLeftProjectEvent { userId: string; projectId: string; leftAt: string; } export interface TypingIndicatorEvent { userId: string; issueId: string; isTyping: boolean; } // ============================================ // NOTIFICATION EVENTS // ============================================ export interface NotificationEvent { message: string; type: 'info' | 'success' | 'warning' | 'error'; timestamp: string; } // ============================================ // EVENT CALLBACKS // ============================================ export interface ProjectHubEventCallbacks { // Project events onProjectCreated?: (event: ProjectCreatedEvent) => void; onProjectUpdated?: (event: ProjectUpdatedEvent) => void; onProjectArchived?: (event: ProjectArchivedEvent) => void; // Epic events onEpicCreated?: (event: EpicCreatedEvent) => void; onEpicUpdated?: (event: EpicUpdatedEvent) => void; onEpicDeleted?: (event: EpicDeletedEvent) => void; // Story events onStoryCreated?: (event: StoryCreatedEvent) => void; onStoryUpdated?: (event: StoryUpdatedEvent) => void; onStoryDeleted?: (event: StoryDeletedEvent) => void; // Task events onTaskCreated?: (event: TaskCreatedEvent) => void; onTaskUpdated?: (event: TaskUpdatedEvent) => void; onTaskDeleted?: (event: TaskDeletedEvent) => void; onTaskAssigned?: (event: TaskAssignedEvent) => void; // Legacy Issue events (backward compatibility) onIssueCreated?: (event: IssueCreatedEvent) => void; onIssueUpdated?: (event: IssueUpdatedEvent) => void; onIssueDeleted?: (event: IssueDeletedEvent) => void; onIssueStatusChanged?: (event: IssueStatusChangedEvent) => void; // Collaboration events onUserJoinedProject?: (event: UserJoinedProjectEvent) => void; onUserLeftProject?: (event: UserLeftProjectEvent) => void; onTypingIndicator?: (event: TypingIndicatorEvent) => void; }