using ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate;
using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects;

namespace ColaFlow.Modules.ProjectManagement.Domain.Repositories;

/// <summary>
/// Repository interface for Project aggregate
/// </summary>
public interface IProjectRepository
{
    /// <summary>
    /// Gets a project by its ID
    /// </summary>
    Task<Project?> GetByIdAsync(ProjectId id, CancellationToken cancellationToken = default);

    /// <summary>
    /// Gets a project by its unique key
    /// </summary>
    Task<Project?> GetByKeyAsync(string key, CancellationToken cancellationToken = default);

    /// <summary>
    /// Gets all projects with pagination
    /// </summary>
    Task<List<Project>> GetAllAsync(CancellationToken cancellationToken = default);

    /// <summary>
    /// Gets project containing specific epic
    /// </summary>
    Task<Project?> GetProjectWithEpicAsync(EpicId epicId, CancellationToken cancellationToken = default);

    /// <summary>
    /// Gets project containing specific story
    /// </summary>
    Task<Project?> GetProjectWithStoryAsync(StoryId storyId, CancellationToken cancellationToken = default);

    /// <summary>
    /// Gets project containing specific task
    /// </summary>
    Task<Project?> GetProjectWithTaskAsync(TaskId taskId, CancellationToken cancellationToken = default);

    /// <summary>
    /// Adds a new project
    /// </summary>
    Task AddAsync(Project project, CancellationToken cancellationToken = default);

    /// <summary>
    /// Updates an existing project
    /// </summary>
    void Update(Project project);

    /// <summary>
    /// Deletes a project
    /// </summary>
    void Delete(Project project);
}
