using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace OnlineSalesAutoCrop.CoreAPI.Models.Requests.Integrations;

public class IntegrationCustomerRequest
{
    [Required(ErrorMessage = "Customer number is required.")]
    [StringLength(10, ErrorMessage = "Customer number cannot exceed 10 characters.")]
    public string CustomerNumber { get; set; } 

    [Required(ErrorMessage = "Customer name is required.")]
    [StringLength(35, ErrorMessage = "Customer name cannot exceed 35 characters.")]
    public string CustomerName { get; set; } 

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

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

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

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

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

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

    [Required(ErrorMessage = "Distribution channel is required.")]
    [StringLength(2, ErrorMessage = "Distribution channel cannot exceed 2 characters.")]
    public string DistributionChannel { get; set; } 

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

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

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

    [Required(ErrorMessage = "Mobile number is required.")]
    [StringLength(31, ErrorMessage = "Mobile number cannot exceed 31 characters.")]
    [Phone(ErrorMessage = "Mobile number is not a valid phone number.")]
    public string MobileNumber { get; set; } 

    [Required(ErrorMessage = "Email address is required.")]
    [StringLength(241, ErrorMessage = "Email address cannot exceed 241 characters.")]
    [EmailAddress(ErrorMessage = "Email address is not valid.")]
    public string EmailAddress { get; set; } 

    [Required(ErrorMessage = "Business/Tax number is required.")]
    [StringLength(16, ErrorMessage = "Business/Tax number cannot exceed 16 characters.")]
    public string BusinessTaxNumber { get; set; } 

    [Required(ErrorMessage = "Credit limit is required.")]
    [Range(0, 9999999999999.99, ErrorMessage = "Credit limit must be between 0 and 9,999,999,999,999.99.")]
    public decimal CreditLimit { get; set; }

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

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

    [Required(ErrorMessage = "Customer group is required.")]
    [StringLength(2, ErrorMessage = "Customer group cannot exceed 2 characters.")]
    public string CustomerGroup { get; set; } 

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

    [Required(ErrorMessage = "Customer price group is required.")]
    [StringLength(2, ErrorMessage = "Customer price group cannot exceed 2 characters.")]
    public string CustomerPriceGroup { get; set; } 

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

    [Required(ErrorMessage = "Status code is required.")]
    [StringLength(1, ErrorMessage = "Status code cannot exceed 1 character.")]
    public string StatusCode { get; set; } 

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

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

    [Required(ErrorMessage = "Payment terms description is required.")]
    public string PaymentTermsDescription { get; set; } 

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

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

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

    [Required(ErrorMessage = "Sales Unit/Area-AV is required.")]
    [StringLength(10, ErrorMessage = "Sales Unit/Area-AV cannot exceed 10 characters.")]
    public string SalesUnitAreaAV { get; set; } 

    [Required(ErrorMessage = "Sales Unit/Area-AV description is required.")]
    [StringLength(40, ErrorMessage = "Sales Unit/Area-AV description cannot exceed 40 characters.")]
    public string SalesUnitAreaAVDescription { get; set; } 

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

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

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

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



public class CustomerByCompanyCodeRequest
{
    [Required(ErrorMessage = "Customer Number is required")]
    [StringLength(10, MinimumLength = 1, ErrorMessage = "Customer Number must be between 1 and 10 characters")]
    public string CustomerNumber { get; set; } = string.Empty;


    [Required(ErrorMessage = "Company Code is required")]
    [StringLength(4, MinimumLength = 1, ErrorMessage = "Company Code must be between 1 and 4 characters")]
    public string CompanyCode { get; set; } = string.Empty;
}