namespace OpenWarehouse.warehouse.api.Common.TaskManager;

public static class TaskStatusClass
{
    private static readonly Dictionary<TaskStatus, string?> TaskStatusDictionary = new()
    {
        { TaskStatus.Accepted, "Accepted" },
        { TaskStatus.Crated, "Created" },
        { TaskStatus.Error, "Error" },
        { TaskStatus.Processing, "Processing" },
        { TaskStatus.Success, "Success" },
        { TaskStatus.NotFullSuccess, "Not full sucess"}
    };

    public static string ToString(this TaskStatus status)
    {
        if (!TaskStatusDictionary.TryGetValue(status, out string? value) && value == "")
            throw new NotImplementedException();
        return value ?? "";
    }
}