using Quadarax.Application.QLiberace.Common.Entities.Base.DaoMapper; using Microsoft.EntityFrameworkCore; using Quadarax.Application.QLiberace.Base; namespace Quadarax.Application.QLiberace.Customer.Entities.DaoMapper { public class CustomerDm: TrackedTenantDm { public override void Map(ModelBuilder builder) { if (builder == null) throw new ArgumentNullException(nameof(builder)); base.Map(builder); builder.Entity(entity => { entity.ToTable(Constants.Modules.Customer.TblCustomer, Constants.Modules.Customer.Schema); // indexes entity.HasIndex(e => e.Code, "IDX_CUSTOMER_CODE") .IsUnique(); // columns entity.Property(e => e.Code).IsRequired() .HasMaxLength(20) .HasComment("Customer code. Main key to search."); entity.Property(e => e.Name).IsRequired() .HasMaxLength(100) .HasComment("Customer head name. For identification usage."); entity.Property(e => e.TaxCountryCode).IsRequired() .HasMaxLength(5) .HasComment("Tax country region code"); entity.Property(e => e.TaxNumber) .HasMaxLength(20) .HasComment("Customer tax number (business identifier)"); entity.Property(e => e.VatIncluded).IsRequired() .HasDefaultValueSql("((1))") .HasComment("Flag if VAT calculation is allowed"); entity.Property(e => e.VatNumber) .HasMaxLength(20) .HasComment("Customer VAT number (VAT identification)"); } ); } } }