namespace ColaFlow.Modules.ProjectManagement.Domain.Enums;

/// <summary>
/// Sprint Status
/// </summary>
public class SprintStatus
{
    public string Name { get; init; }

    public static readonly SprintStatus Planned = new() { Name = "Planned" };
    public static readonly SprintStatus Active = new() { Name = "Active" };
    public static readonly SprintStatus Completed = new() { Name = "Completed" };

    private SprintStatus() { Name = string.Empty; }

    public static SprintStatus FromString(string status)
    {
        return status?.ToLowerInvariant() switch
        {
            "planned" => Planned,
            "active" => Active,
            "completed" => Completed,
            _ => throw new ArgumentException($"Invalid sprint status: {status}", nameof(status))
        };
    }

    public static IEnumerable<SprintStatus> GetAll()
    {
        yield return Planned;
        yield return Active;
        yield return Completed;
    }

    public override string ToString() => Name;
}
