| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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<Customer>
- {
- public override void Map(ModelBuilder builder)
- {
- if (builder == null) throw new ArgumentNullException(nameof(builder));
- base.Map(builder);
- builder.Entity<Customer>(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)");
- }
- );
- }
- }
- }
|