using System.ComponentModel.DataAnnotations;

namespace OnlineSalesAutoCrop.CoreAPI.Models.Requests.Integrations;

public class IntegrationMaterialRequest
{
    [Required(ErrorMessage = "Material type is required.")]
    [StringLength(4, ErrorMessage = "Material type cannot exceed 4 characters.")]
    public string MaterialType { get; set; } 

    [Required(ErrorMessage = "Material type description is required.")]
    [StringLength(25, ErrorMessage = "Material type description cannot exceed 25 characters.")]
    public string MaterialTypeDescription { get; set; } 

    [Required(ErrorMessage = "Material code is required.")]
    [StringLength(10, ErrorMessage = "Material code cannot exceed 10 characters.")]
    public string MaterialCode { get; set; } 

    [Required(ErrorMessage = "Material description is required.")]
    [StringLength(40, ErrorMessage = "Material description cannot exceed 40 characters.")]
    public string MaterialDescription { get; set; }

    [Required(ErrorMessage = "BrandCode is required.")]
    [StringLength(3, ErrorMessage = "BrandCode cannot exceed 3 characters.")]
    public string BrandCode { get; set; }

    [Required(ErrorMessage = "BrandName is required.")]
    [StringLength(20, ErrorMessage = "BrandName cannot exceed 20 characters.")]
    public string BrandName { get; set; }

    [Required(ErrorMessage = "Material group code is required.")]
    [StringLength(9, ErrorMessage = "Material group code cannot exceed 9 characters.")]
    public string MaterialGroupCode { get; set; } 

    [Required(ErrorMessage = "Material group description is required.")]
    [StringLength(20, ErrorMessage = "Material group description cannot exceed 20 characters.")]
    public string MaterialGroupDescription { get; set; } 

    [Required(ErrorMessage = "Base unit of measure is required.")]
    [StringLength(3, ErrorMessage = "Base unit of measure cannot exceed 3 characters.")]
    public string BaseUnitOfMeasure { get; set; } 

    [Required(ErrorMessage = "Sales unit of measure is required.")]
    [StringLength(3, ErrorMessage = "Sales unit of measure cannot exceed 3 characters.")]
    public string SalesUnitOfMeasure { get; set; } 

    [Required(ErrorMessage = "Unit conversion with base UoM is required.")]
    [Range(0.001, 999.999, ErrorMessage = "Unit conversion must be between 0.001 and 999.999.")]
    public decimal UnitConversionWithBaseUoM { get; set; }

    [Required(ErrorMessage = "Plant code is required.")]
    [StringLength(4, ErrorMessage = "Plant code cannot exceed 4 characters.")]
    public string PlantCode { get; set; } 

    [Required(ErrorMessage = "Plant description is required.")]
    [StringLength(30, ErrorMessage = "Plant description cannot exceed 30 characters.")]
    public string PlantDescription { get; set; } 

    [Required(ErrorMessage = "Storage location code is required.")]
    [StringLength(4, ErrorMessage = "Storage location code cannot exceed 4 characters.")]
    public string StorageLocationCode { get; set; } 

    [Required(ErrorMessage = "Storage location description is required.")]
    [StringLength(16, ErrorMessage = "Storage location description cannot exceed 16 characters.")]
    public string StorageLocationDescription { get; set; } 

    [Required(ErrorMessage = "Sales Organization code is required.")]
    [StringLength(4, ErrorMessage = "Sales Organization code cannot exceed 4 characters.")]
    public string SalesOrganization { get; set; } 

    [Required(ErrorMessage = "Sales Organization Description is required.")]
    [StringLength(16, ErrorMessage = "Sales Organization Description cannot exceed 16 characters.")]
    public string SalesOrganizationDescription { get; set; } 
}

public class GetMaterialByCodeRequest
{
    [Required(ErrorMessage = "Material code is required.")]
    [StringLength(10, ErrorMessage = "Material code cannot exceed 10 characters.")]
    public string MaterialCode { get; set; }
}