using MisIngredientesVue.Core.Attributes; using MisIngredientesVue.Core.Services; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace MisIngredientesVue.Core.Models { public class Supplier : RepositoryEntityWithTenantId { [Required] public string Name { get; set; } [Required] public string LegalName { get; set; } [Required] public string TaxPayerIdNo { get; set; } public string Contact { get; set; } public string Phone { get; set; } public string Email { get; set; } public string Job { get; set; } public string Address { get; set; } public string Comments { get; set; } //Esta propiedad es para guardar los comentarios del cliente actual [NotMapped] public string ClientComments { get; set; } public PaymentType PaymentType { get; set; } //Tipo de pago public PaymentCutoffType PaymentCutoff { get; set; } //Corte para pago [MaxLength(20)] public string PaymentCutoffDays { get; set; } //Días de corte de pago (1,2,3,4) [NotMapped] public int[] PaymentCutoffDaysArray { get; set; } [MaxLength(20)] public string PaymentDays { get; set; } //Días de crédito (1,2,3,4) [NotMapped] public int[] PaymentDaysArray { get; set; } public int CreditDays { get; set; } //Días de crédito //true significa que es un proveedor que se registró a sí mismo, //false significa que un proveedor que agregó un restaurante [DoNotUpdate] public bool IsVerified { get; set; } public List Contacts { get; set; } public List Accounts { get; set; } } public class SupplierContact : RepositoryEntityWithTenantId { public int SupplierId { get; set; } public Supplier Supplier { get; set; } [Required] public string Name { get; set; } public string Phone { get; set; } public string Email { get; set; } public string Job { get; set; } } public class SupplierAccount : RepositoryEntityWithTenantId { public int SupplierId { get; set; } public Supplier Supplier { get; set; } [Required] public string Bank { get; set; } public PaymentMethod PaymentMethod { get; set; } [Required] public string AccountNumber { get; set; } public string Clabe { get; set; } } //Tabla para los restaurantes, para que puedan agregar proveedores verificados a su lista de proveedores public class Client_Supplier { [Required] [Unique] [IgnoreRelationship] public string Client_TenantId { get; set; } [Required] [Unique] [IgnoreRelationship] public string Supplier_TenantId { get; set; } public string Comments { get; set; } } //Tabla para los proveedores, para que puedan agregar clientes verificados a su lista de clientes //public class Supplier_Client //{ // [Required] // [IgnoreRelationship] // public string Client_TenantId { get; set; } // [Required] // [IgnoreRelationship] // public string Supplier_TenantId { get; set; } // public string Comments { get; set; } //} public enum PaymentType { Cash = 0, //Contado Credit = 1 //Crédito } public enum PaymentMethod { Cash = 0, Transference = 1, Check = 2 } public enum PaymentCutoffType { Weekly = 0, //Corte semanal CalendarDays = 1 //Días Naturales } }