
using DocumentFormat.OpenXml.Wordprocessing;
using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;

namespace OnlineSalesAutoCrop.CoreAPI.Models.Requests.MobileApp;

public class GetMarketHeirarchyByEmpRequest
{
    [Required, NotNull, StringLength(maximumLength: 10, MinimumLength = 3, ErrorMessage = "EmployeeNumber must be between 3 and 10 characters.")]
    public string EmployeeNumber { get; set; }
}

public class GetBrandsRequest : PagedRequest
{
    [StringLength(6, MinimumLength = 1, ErrorMessage = "Brand code must be between 1 and 6 characters.")]
    public string? BrandCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Sales organization code must be between 1 and 10 characters.")]
    public string? SalesOrgCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Employee number must be between 1 and 10 characters.")]
    public string? EmployeeNumber { get; set; }
}


public class GetMaterialsRequest : PagedRequest
{
    [StringLength(10, MinimumLength = 1, ErrorMessage = "Sales organization code must be between 1 and 10 characters.")]
    public string SalesOrgCode { get; set; }

    [StringLength(6, MinimumLength = 1, ErrorMessage = "Brand code must be between 1 and 6 characters.")]
    public string? BrandCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Material Code must be between 1 and 10 characters.")]
    public string? MaterialCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Employee number must be between 1 and 10 characters.")]
    public string? EmployeeNumber { get; set; }
}

public class GetMaterialStockRequest : PagedRequest
{
    [StringLength(10, MinimumLength = 1, ErrorMessage = "Plant Code must be between 1 and 10 characters.")]
    public string PlantCode { get; set; }
}

public class GetMaterialPriceRequest : PagedRequest
{
    [StringLength(10, MinimumLength = 1, ErrorMessage = "Sales organization code must be between 1 and 10 characters.")]
    public string SalesOrgCode { get; set; }

    [StringLength(6, MinimumLength = 1, ErrorMessage = "Brand code must be between 1 and 6 characters.")]
    public string? BrandCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Material Code must be between 1 and 10 characters.")]
    public string? MaterialCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Employee number must be between 1 and 10 characters.")]
    public string? EmployeeNumber { get; set; }
}


public class GetCustomersRequest : PagedRequest
{
    [StringLength(10, MinimumLength = 3, ErrorMessage = "Sales organization code must be between 1 and 10 characters.")]
    public string SalesOrgCode { get; set; }

    [StringLength(5, MinimumLength = 3, ErrorMessage = "Teritory Code must be between 1 and 5 characters.")]
    public string? TeritoryCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Customer Code must be between 1 and 10 characters.")]
    public string? CustomerCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Employee number must be between 1 and 10 characters.")]
    public string? EmployeeNumber { get; set; }
}

public class GetAttendanceByEmpRequest
{
    [Required, NotNull, StringLength(maximumLength: 10, MinimumLength = 3, ErrorMessage = "EmployeeNumber must be between 3 and 10 characters.")]
    public string EmployeeNumber { get; set; }
    public DateTime? AttendanceDate { get; set; }
}

public class UpsertAttendanceByEmpRequest
{
    [Required, NotNull, StringLength(maximumLength: 10, MinimumLength = 3, ErrorMessage = "EmployeeNumber must be between 3 and 10 characters.")]
    public string EmployeeNumber { get; set; }
    public TimeSpan? CheckInTime { get; set; }
    public string? CheckInLatitude { get; set; }
    public string? CheckInLongitude { get; set; }
    public string? CheckInLocationName { get; set; }
    public TimeSpan? CheckOutTime { get; set; }
    public string? CheckOutLatitude { get; set; }
    public string? CheckOutLongitude { get; set; }
    public string? CheckOutLocationName { get; set; }
    public bool IsCheckIn => CheckInTime.HasValue ? true : false;
    public bool IsCheckOut => CheckOutTime.HasValue ? true : false;
}

public class GetDiscountRequest : PagedRequest
{
    [StringLength(10, MinimumLength = 3, ErrorMessage = "Sales organization code must be between 1 and 10 characters.")]
    public string SalesOrgCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Customer Code must be between 1 and 10 characters.")]
    public string? CustomerCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Employee number must be between 1 and 10 characters.")]
    public string? EmployeeNumber { get; set; }

    [StringLength(10, MinimumLength = 3, ErrorMessage = "Material Code must be between 1 and 10 characters.")]
    public string? MaterialCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Discount Code must be between 1 and 10 characters.")]
    public string? DiscountCode { get; set; }
}

public class GetDiscountMaterialRequest : PagedRequest
{
    [StringLength(10, MinimumLength = 3, ErrorMessage = "Sales organization code must be between 1 and 10 characters.")]
    public string SalesOrgCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Customer Code must be between 1 and 10 characters.")]
    public string? CustomerCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Employee number must be between 1 and 10 characters.")]
    public string? EmployeeNumber { get; set; }

    [StringLength(10, MinimumLength = 3, ErrorMessage = "Material Code must be between 1 and 10 characters.")]
    public string? MaterialCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Discount Code must be between 1 and 10 characters.")]
    public string? DiscountCode { get; set; }
}



public class GetFOCRequest : PagedRequest
{
    [StringLength(10, MinimumLength = 3, ErrorMessage = "Sales organization code must be between 1 and 10 characters.")]
    public string SalesOrgCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Customer Code must be between 1 and 10 characters.")]
    public string? CustomerCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Employee number must be between 1 and 10 characters.")]
    public string? EmployeeNumber { get; set; }

    [StringLength(10, MinimumLength = 3, ErrorMessage = "Material Code must be between 1 and 10 characters.")]
    public string? MaterialCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Discount Code must be between 1 and 10 characters.")]
    public string? FOCCode { get; set; }

}

public class GetFOCMaterialRequest : PagedRequest
{
    [StringLength(10, MinimumLength = 3, ErrorMessage = "Sales organization code must be between 1 and 10 characters.")]
    public string SalesOrgCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Customer Code must be between 1 and 10 characters.")]
    public string? CustomerCode { get; set; }

    [StringLength(10, MinimumLength = 5, ErrorMessage = "Employee number must be between 1 and 10 characters.")]
    public string? EmployeeNumber { get; set; }

    [StringLength(10, MinimumLength = 3, ErrorMessage = "Material Code must be between 1 and 10 characters.")]
    public string? MaterialCode { get; set; }

    [StringLength(10, MinimumLength = 1, ErrorMessage = "Discount Code must be between 1 and 10 characters.")]
    public string? FOCCode { get; set; }
}

public class GetPaymentTermRequest : PagedRequest
{
    [StringLength(10, MinimumLength = 3, ErrorMessage = "Sales organization code must be between 1 and 10 characters.")]
    public string SalesOrgCode { get; set; }

    [StringLength(10, MinimumLength = 3, ErrorMessage = "PayementTerm Code must be between 3 and 10 characters.")]
    public string? PaymentTermCode { get; set; }
}