using System.ComponentModel.DataAnnotations;

namespace PowderCoating.Application.DTOs.Lookup;

public class JobPriorityLookupDto
{
    public int Id { get; set; }
    public string PriorityCode { get; set; } = string.Empty;
    public string DisplayName { get; set; } = string.Empty;
    public int DisplayOrder { get; set; }
    public string ColorClass { get; set; } = "secondary";
    public string? IconClass { get; set; }
    public bool IsActive { get; set; }
    public bool IsSystemDefined { get; set; }
    public string? Description { get; set; }
    public int JobCount { get; set; }  // Number of jobs using this priority
}

public class CreateJobPriorityLookupDto
{
    [Required, MaxLength(50)]
    public string PriorityCode { get; set; } = string.Empty;

    [Required, MaxLength(100)]
    public string DisplayName { get; set; } = string.Empty;

    [Range(1, 999)]
    public int DisplayOrder { get; set; }

    [RegularExpression("^(primary|secondary|success|danger|warning|info|dark)$")]
    public string ColorClass { get; set; } = "secondary";

    [MaxLength(50)]
    public string? IconClass { get; set; }

    [MaxLength(500)]
    public string? Description { get; set; }
}

public class UpdateJobPriorityLookupDto
{
    public int Id { get; set; }

    [Required, MaxLength(100)]
    public string DisplayName { get; set; } = string.Empty;  // PriorityCode NOT editable

    [Range(1, 999)]
    public int DisplayOrder { get; set; }

    [RegularExpression("^(primary|secondary|success|danger|warning|info|dark)$")]
    public string ColorClass { get; set; } = "secondary";

    [MaxLength(50)]
    public string? IconClass { get; set; }

    public bool IsActive { get; set; }

    [MaxLength(500)]
    public string? Description { get; set; }
}
