using System.ComponentModel.DataAnnotations;

namespace PowderCoating.Application.DTOs.Lookup;

public class InventoryCategoryLookupDto
{
    public int Id { get; set; }
    public string CategoryCode { get; set; } = string.Empty;
    public string DisplayName { get; set; } = string.Empty;
    public int DisplayOrder { get; set; }
    public string? Description { get; set; }
    public bool IsActive { get; set; }
    public bool IsSystemDefined { get; set; }
    public bool IsCoating { get; set; }
    public int ItemCount { get; set; }  // Number of inventory items using this category
}

public class CreateInventoryCategoryLookupDto
{
    [Required]
    [MaxLength(50)]
    [Display(Name = "Category Code")]
    public string CategoryCode { get; set; } = string.Empty;

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

    [Range(1, 999)]
    [Display(Name = "Display Order")]
    public int DisplayOrder { get; set; }

    [Display(Name = "Is Coating")]
    public bool IsCoating { get; set; } = false;

    [MaxLength(500)]
    [Display(Name = "Description")]
    public string? Description { get; set; }
}

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

    [Required]
    [MaxLength(100)]
    [Display(Name = "Display Name")]
    public string DisplayName { get; set; } = string.Empty;  // CategoryCode NOT editable

    [Range(1, 999)]
    [Display(Name = "Display Order")]
    public int DisplayOrder { get; set; }

    [Display(Name = "Active")]
    public bool IsActive { get; set; }

    [Display(Name = "Is Coating")]
    public bool IsCoating { get; set; }

    [MaxLength(500)]
    [Display(Name = "Description")]
    public string? Description { get; set; }
}
