Add Master Data

This commit is contained in:
Thanakarn Klangkasame
2025-10-10 16:22:06 +07:00
parent ad0d9e41ba
commit d4ab1cb592
55 changed files with 16058 additions and 197 deletions

View File

@@ -4,7 +4,7 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
public sealed class Role : BaseEntity
{
public string Code { get; set; } = default!; // system code, unique per tenant
public string Code { get; set; } = default!;
public string Name { get; set; } = default!;
public ICollection<UserRole> UserRoles { get; set; } = new List<UserRole>();

View File

@@ -0,0 +1,25 @@
using AMREZ.EOP.Domain.Entities.Common;
namespace AMREZ.EOP.Domain.Entities.MasterData;
public abstract class MasterBase : BaseEntity
{
public string Scope { get; set; } = "global";
public string Code { get; set; } = null!;
public string Name { get; set; } = null!;
public Dictionary<string, string>? NameI18n { get; set; }
public Guid? OverridesGlobalId { get; set; }
public bool IsActive { get; set; } = true;
public bool IsSystem { get; set; } = false;
public Dictionary<string, object>? Meta { get; set; }
}
public abstract class MasterBlockBase : BaseEntity
{
public Guid GlobalId { get; set; }
}

View File

@@ -0,0 +1,22 @@
using AMREZ.EOP.Domain.Entities.Common;
namespace AMREZ.EOP.Domain.Entities.Customers;
public sealed class Address : BaseEntity
{
public string? Line1 { get; set; }
public string? Line2 { get; set; }
public string? Village { get; set; }
public string? Soi { get; set; }
public string? Road { get; set; }
public string? Subdistrict { get; set; }
public string? District { get; set; }
public string? Province { get; set; }
public string? PostalCode { get; set; }
public string CountryCode { get; set; } = "TH";
public bool Verified { get; set; }
public double? GeoLat { get; set; }
public double? GeoLng { get; set; }
public ICollection<CustomerAddress> CustomerLinks { get; set; } = new List<CustomerAddress>();
}

View File

@@ -0,0 +1,15 @@
using AMREZ.EOP.Domain.Entities.Common;
using AMREZ.EOP.Domain.Shared.Customer;
namespace AMREZ.EOP.Domain.Entities.Customers;
public sealed class CustomerAddress : BaseEntity
{
public Guid CustomerProfileId { get; set; }
public Guid AddressId { get; set; }
public AddressLabel Label { get; set; }
public bool IsDefault { get; set; }
public CustomerProfile Customer { get; set; } = default!;
public Address Address { get; set; } = default!;
}

View File

@@ -0,0 +1,15 @@
using AMREZ.EOP.Domain.Entities.Common;
using AMREZ.EOP.Domain.Shared.Customer;
namespace AMREZ.EOP.Domain.Entities.Customers;
public sealed class CustomerContact : BaseEntity
{
public Guid CustomerProfileId { get; set; }
public ContactType Type { get; set; }
public string Value { get; set; } = default!;
public bool IsPrimary { get; set; }
public bool IsVerified { get; set; }
public CustomerProfile Customer { get; set; } = default!;
}

View File

@@ -0,0 +1,18 @@
using AMREZ.EOP.Domain.Entities.Common;
using AMREZ.EOP.Domain.Shared.Customer;
namespace AMREZ.EOP.Domain.Entities.Customers;
public sealed class CustomerProfile : BaseEntity
{
public PartyType Type { get; set; }
public string DisplayName { get; set; } = default!;
public CustomerStatus Status { get; set; } = CustomerStatus.Active;
public PersonProfile? Person { get; set; }
public OrganizationProfile? Organization { get; set; }
public ICollection<CustomerContact> Contacts { get; set; } = new List<CustomerContact>();
public ICollection<CustomerAddress> Addresses { get; set; } = new List<CustomerAddress>();
public ICollection<CustomerTag> Tags { get; set; } = new List<CustomerTag>();
}

View File

@@ -0,0 +1,11 @@
using AMREZ.EOP.Domain.Entities.Common;
namespace AMREZ.EOP.Domain.Entities.Customers;
public sealed class CustomerTag : BaseEntity
{
public Guid CustomerProfileId { get; set; }
public string Tag { get; set; } = default!;
public CustomerProfile Customer { get; set; } = default!;
}

View File

@@ -0,0 +1,17 @@
using AMREZ.EOP.Domain.Entities.Common;
namespace AMREZ.EOP.Domain.Entities.Customers;
public sealed class OrganizationProfile : BaseEntity
{
public Guid CustomerProfileId { get; set; }
public string LegalNameTh { get; set; } = default!;
public string? LegalNameEn { get; set; }
public string? RegistrationNo { get; set; }
public string? TaxId13 { get; set; }
public string? BranchCode { get; set; }
public string? CompanyType { get; set; }
public CustomerProfile Customer { get; set; } = default!;
}

View File

@@ -0,0 +1,19 @@
using AMREZ.EOP.Domain.Entities.Common;
namespace AMREZ.EOP.Domain.Entities.Customers;
public sealed class PersonProfile : BaseEntity
{
public Guid CustomerProfileId { get; set; }
public string? Prefix { get; set; }
public string? FirstNameTh { get; set; }
public string? LastNameTh { get; set; }
public string? FirstNameEn { get; set; }
public string? LastNameEn { get; set; }
public DateTime? BirthDate { get; set; }
public string? NationalId { get; set; }
public string? PassportNo { get; set; }
public CustomerProfile Customer { get; set; } = default!;
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Allergen : MasterBase
{
}
public class AllergenBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,10 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Brand : MasterBase
{
public string? ExternalRef { get; set; }
}
public class BrandBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,26 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Category : MasterBase
{
public Guid? ParentId { get; set; }
public Category? Parent { get; set; }
public ICollection<Category> Children { get; set; } = new List<Category>();
public string? Path { get; set; }
public int SortOrder { get; set; } = 0;
}
public class CategoryBlock : MasterBlockBase
{
}
public class CategoryExt
{
public Guid CategoryId { get; set; }
public Category Category { get; set; } = null!;
public string? Slug { get; set; }
public string? SeoTitle { get; set; }
public string? SeoDescription { get; set; }
public string? ImageUrl { get; set; }
public Dictionary<string, object>? ChannelVisibility { get; set; }
public Dictionary<string, object>? FacetSchema { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class ComplianceStatus : MasterBase
{
}
public class ComplianceStatusBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Country : MasterBase
{
}
public class CountryBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,10 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Currency : MasterBase
{
public byte Exponent { get; set; } = 2;
}
public class CurrencyBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class DocControlStatus : MasterBase
{
}
public class DocControlStatusBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class FuncTest : MasterBase
{
}
public class FuncTestBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class HazardClass : MasterBase
{
}
public class HazardClassBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Language : MasterBase
{
}
public class LanguageBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,10 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Manufacturer : MasterBase
{
public string? CountryCode { get; set; }
}
public class ManufacturerBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Market : MasterBase
{
}
public class MarketBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class PackingGroup : MasterBase
{
}
public class PackingGroupBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class QaStage : MasterBase
{
}
public class QaStageBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class QcStatus : MasterBase
{
}
public class QcStatusBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class RecallClass : MasterBase
{
}
public class RecallClassBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class RiskClass : MasterBase
{
}
public class RiskClassBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Route : MasterBase
{
}
public class RouteBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class RxSchedule : MasterBase
{
}
public class RxScheduleBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Species : MasterBase
{
}
public class SpeciesBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class StabilityStatus : MasterBase
{
}
public class StabilityStatusBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class SterilizationMethod : MasterBase
{
}
public class SterilizationMethodBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,11 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Uom : MasterBase
{
public string? BaseCode { get; set; }
public decimal? SiFactor { get; set; }
}
public class UomBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Entities.MasterData;
public class Vvm : MasterBase
{
}
public class VvmBlock : MasterBlockBase
{
}

View File

@@ -0,0 +1,9 @@
namespace AMREZ.EOP.Domain.Shared.Customer;
public enum AddressLabel
{
Billing,
Shipping,
Registered,
Other
}

View File

@@ -0,0 +1,11 @@
namespace AMREZ.EOP.Domain.Shared.Customer;
public enum ContactType
{
Email,
Phone,
Line,
Whatsapp,
WeChat,
Other
}

View File

@@ -0,0 +1,8 @@
namespace AMREZ.EOP.Domain.Shared.Customer;
public enum CustomerStatus
{
Active,
Inactive,
Blacklisted
}

View File

@@ -0,0 +1,7 @@
namespace AMREZ.EOP.Domain.Shared.Customer;
public enum PartyType
{
Person,
Organization
}