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 : IProjectNotificationService
{
    private readonly IRealtimeNotificationService _realtimeService;

    public ProjectNotificationServiceAdapter(IRealtimeNotificationService realtimeService)
    {
        _realtimeService = realtimeService;
    }

    // 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);
    }
}
