using System.ComponentModel.DataAnnotations;

namespace PowderCoating.Application.DTOs.Lookup;

public class AppointmentTypeLookupDto
{
    public int Id { get; set; }
    public string TypeCode { get; set; } = string.Empty;
    public string DisplayName { get; set; } = string.Empty;
    public int DisplayOrder { get; set; }
    public string ColorClass { get; set; } = "primary";
    public string? IconClass { get; set; }
    public bool RequiresJobLink { get; set; }
    public bool IsActive { get; set; }
    public bool IsSystemDefined { get; set; }
    public string? Description { get; set; }
    public int AppointmentCount { get; set; }  // Number of appointments using this type
}

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

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

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

    [Required, MaxLength(50)]
    public string ColorClass { get; set; } = "primary";

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

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

    public bool RequiresJobLink { get; set; }
}

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

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

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

    [Required, MaxLength(50)]
    public string ColorClass { get; set; } = "primary";

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

    public bool IsActive { get; set; }

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

    public bool RequiresJobLink { get; set; }
}
