using ColaFlow.Modules.ProjectManagement.Application.Services;

namespace ColaFlow.API.Services;

/// <summary>
/// Adapter that implements IProjectNotificationService by delegating to IRealtimeNotificationService
/// This allows the ProjectManagement module to send notifications without depending on the API layer
/// </summary>
public class ProjectNotificationServiceAdapter(IRealtimeNotificationService realtimeService)
    : IProjectNotificationService
{
    // Project notifications
    public Task NotifyProjectCreated(Guid tenantId, Guid projectId, object project)
    {
        return realtimeService.NotifyProjectCreated(tenantId, projectId, project);
    }

    public Task NotifyProjectUpdated(Guid tenantId, Guid projectId, object project)
    {
        return realtimeService.NotifyProjectUpdated(tenantId, projectId, project);
    }

    public Task NotifyProjectArchived(Guid tenantId, Guid projectId)
    {
        return realtimeService.NotifyProjectArchived(tenantId, projectId);
    }

    // Epic notifications
    public Task NotifyEpicCreated(Guid tenantId, Guid projectId, Guid epicId, object epic)
    {
        return realtimeService.NotifyEpicCreated(tenantId, projectId, epicId, epic);
    }

    public Task NotifyEpicUpdated(Guid tenantId, Guid projectId, Guid epicId, object epic)
    {
        return realtimeService.NotifyEpicUpdated(tenantId, projectId, epicId, epic);
    }

    public Task NotifyEpicDeleted(Guid tenantId, Guid projectId, Guid epicId)
    {
        return realtimeService.NotifyEpicDeleted(tenantId, projectId, epicId);
    }

    // Story notifications
    public Task NotifyStoryCreated(Guid tenantId, Guid projectId, Guid epicId, Guid storyId, object story)
    {
        return realtimeService.NotifyStoryCreated(tenantId, projectId, epicId, storyId, story);
    }

    public Task NotifyStoryUpdated(Guid tenantId, Guid projectId, Guid epicId, Guid storyId, object story)
    {
        return realtimeService.NotifyStoryUpdated(tenantId, projectId, epicId, storyId, story);
    }

    public Task NotifyStoryDeleted(Guid tenantId, Guid projectId, Guid epicId, Guid storyId)
    {
        return realtimeService.NotifyStoryDeleted(tenantId, projectId, epicId, storyId);
    }

    // Task notifications
    public Task NotifyTaskCreated(Guid tenantId, Guid projectId, Guid storyId, Guid taskId, object task)
    {
        return realtimeService.NotifyTaskCreated(tenantId, projectId, storyId, taskId, task);
    }

    public Task NotifyTaskUpdated(Guid tenantId, Guid projectId, Guid storyId, Guid taskId, object task)
    {
        return realtimeService.NotifyTaskUpdated(tenantId, projectId, storyId, taskId, task);
    }

    public Task NotifyTaskDeleted(Guid tenantId, Guid projectId, Guid storyId, Guid taskId)
    {
        return realtimeService.NotifyTaskDeleted(tenantId, projectId, storyId, taskId);
    }

    public Task NotifyTaskAssigned(Guid tenantId, Guid projectId, Guid taskId, Guid assigneeId)
    {
        return realtimeService.NotifyTaskAssigned(tenantId, projectId, taskId, assigneeId);
    }
}
