2177 lines
86 KiB
C#
2177 lines
86 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using AMREZ.EOP.Infrastructures.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace AMREZ.EOP.Infrastructures.Migrations
|
|
{
|
|
[DbContext(typeof(AppDbContext))]
|
|
[Migration("20251009040810_AddCustomer")]
|
|
partial class AddCustomer
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.9")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.Permission", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "Code")
|
|
.IsUnique();
|
|
|
|
b.ToTable("permissions", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_permissions_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_permissions_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.Role", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "Code")
|
|
.IsUnique();
|
|
|
|
b.ToTable("roles", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_roles_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_roles_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.RolePermission", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<Guid>("PermissionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("RoleId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PermissionId");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "PermissionId");
|
|
|
|
b.HasIndex("TenantId", "RoleId", "PermissionId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("role_permissions", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_role_permissions_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_role_permissions_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.User", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasDefaultValue(0);
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(true);
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<DateTimeOffset?>("LockoutEndUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("MfaEnabled")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false);
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.ToTable("users", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_users_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_users_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserExternalAccount", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<DateTimeOffset>("LinkedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("Provider")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Subject")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "UserId");
|
|
|
|
b.HasIndex("TenantId", "Provider", "Subject")
|
|
.IsUnique();
|
|
|
|
b.ToTable("user_external_accounts", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_user_external_accounts_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_user_external_accounts_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserIdentity", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<string>("Identifier")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<bool>("IsPrimary")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false);
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset?>("VerifiedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "Type", "Identifier")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("TenantId", "UserId", "Type", "IsPrimary")
|
|
.HasDatabaseName("ix_user_identity_primary_per_type");
|
|
|
|
b.ToTable("user_identities", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_user_identities_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_user_identities_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserMfaFactor", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("AddedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<string>("CredentialId")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("Enabled")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(true);
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("Label")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTimeOffset?>("LastUsedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("PhoneE164")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PublicKey")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Secret")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "UserId");
|
|
|
|
b.ToTable("user_mfa_factors", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_user_mfa_factors_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_user_mfa_factors_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserPasswordHistory", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("ChangedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "UserId", "ChangedAt");
|
|
|
|
b.ToTable("user_password_histories", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_user_password_histories_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_user_password_histories_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserRole", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<Guid>("RoleId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.HasIndex("TenantId", "RoleId");
|
|
|
|
b.HasIndex("TenantId", "UserId", "RoleId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("user_roles", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_user_roles_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_user_roles_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserSession", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<string>("DeviceId")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTimeOffset?>("ExpiresAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<DateTimeOffset>("IssuedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("RefreshTokenHash")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTimeOffset?>("RevokedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<string>("UserAgent")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "DeviceId");
|
|
|
|
b.HasIndex("TenantId", "UserId");
|
|
|
|
b.ToTable("user_sessions", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_user_sessions_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_user_sessions_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.Address", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("CountryCode")
|
|
.IsRequired()
|
|
.HasMaxLength(2)
|
|
.HasColumnType("character varying(2)");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<string>("District")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<double?>("GeoLat")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<double?>("GeoLng")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("Line1")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("Line2")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("PostalCode")
|
|
.HasMaxLength(10)
|
|
.HasColumnType("character varying(10)");
|
|
|
|
b.Property<string>("Province")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("Road")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("Soi")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("Subdistrict")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<bool>("Verified")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Village")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.ToTable("addresses", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_addresses_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_addresses_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.CustomerAddress", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AddressId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<Guid>("CustomerProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("IsDefault")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false);
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<int>("Label")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "AddressId");
|
|
|
|
b.HasIndex("TenantId", "CustomerProfileId", "Label");
|
|
|
|
b.HasIndex("TenantId", "CustomerProfileId", "Label", "IsDefault")
|
|
.IsUnique()
|
|
.HasDatabaseName("ux_default_customer_address_per_label")
|
|
.HasFilter("\"IsDefault\" = TRUE");
|
|
|
|
b.ToTable("customer_addresses", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_customer_addresses_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_customer_addresses_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.CustomerContact", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<Guid>("CustomerProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<bool>("IsPrimary")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false);
|
|
|
|
b.Property<bool>("IsVerified")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false);
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "CustomerProfileId", "Type");
|
|
|
|
b.HasIndex("TenantId", "CustomerProfileId", "Type", "IsPrimary")
|
|
.IsUnique()
|
|
.HasDatabaseName("ux_customer_contact_primary_per_type")
|
|
.HasFilter("\"IsPrimary\" = TRUE");
|
|
|
|
b.ToTable("customer_contacts", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_customer_contacts_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_customer_contacts_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.CustomerProfile", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "DisplayName");
|
|
|
|
b.ToTable("customer_profiles", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_customer_profiles_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_customer_profiles_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.CustomerTag", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<Guid>("CustomerProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("Tag")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "CustomerProfileId", "Tag")
|
|
.IsUnique();
|
|
|
|
b.ToTable("customer_tags", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_customer_tags_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_customer_tags_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.OrganizationProfile", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("BranchCode")
|
|
.HasMaxLength(5)
|
|
.HasColumnType("character varying(5)");
|
|
|
|
b.Property<string>("CompanyType")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<Guid>("CustomerProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("LegalNameEn")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("LegalNameTh")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("RegistrationNo")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("TaxId13")
|
|
.HasMaxLength(13)
|
|
.HasColumnType("character varying(13)");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "CustomerProfileId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("TenantId", "TaxId13", "BranchCode")
|
|
.IsUnique()
|
|
.HasFilter("\"TaxId13\" IS NOT NULL");
|
|
|
|
b.ToTable("organization_profiles", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_organization_profiles_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_organization_profiles_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.PersonProfile", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime?>("BirthDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<Guid>("CustomerProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("FirstNameEn")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("FirstNameTh")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("LastNameEn")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("LastNameTh")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("NationalId")
|
|
.HasMaxLength(13)
|
|
.HasColumnType("character varying(13)");
|
|
|
|
b.Property<string>("PassportNo")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<string>("Prefix")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "CustomerProfileId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("person_profiles", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_person_profiles_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_person_profiles_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.Department", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<Guid?>("ParentDepartmentId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "Code")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("TenantId", "ParentDepartmentId");
|
|
|
|
b.ToTable("departments", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_departments_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_departments_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.EmergencyContact", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<bool>("IsPrimary")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("Phone")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Relationship")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "UserProfileId", "IsPrimary");
|
|
|
|
b.ToTable("emergency_contacts", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_emergency_contacts_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_emergency_contacts_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.EmployeeAddress", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("City")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("Country")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<bool>("IsPrimary")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Line1")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("Line2")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PostalCode")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<string>("State")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "UserProfileId", "IsPrimary");
|
|
|
|
b.ToTable("employee_addresses", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_employee_addresses_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_employee_addresses_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.EmployeeBankAccount", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("AccountHolder")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("AccountNumber")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("BankName")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("Branch")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<bool>("IsPrimary")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Note")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "UserProfileId", "IsPrimary");
|
|
|
|
b.ToTable("employee_bank_accounts", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_employee_bank_accounts_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_employee_bank_accounts_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.Employment", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<Guid?>("DepartmentId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("EmploymentType")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime?>("EndDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<Guid?>("ManagerUserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("PositionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("StartDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("WorkEmail")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("WorkPhone")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "DepartmentId");
|
|
|
|
b.HasIndex("TenantId", "PositionId");
|
|
|
|
b.HasIndex("TenantId", "UserProfileId", "StartDate");
|
|
|
|
b.ToTable("employments", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_employments_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_employments_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.Position", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<int?>("Level")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "Code")
|
|
.IsUnique();
|
|
|
|
b.ToTable("positions", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_positions_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_positions_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.UserProfile", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created_at")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("created_by");
|
|
|
|
b.Property<DateTime?>("DateOfBirth")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid?>("DepartmentId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("FirstName")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<int?>("Gender")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false)
|
|
.HasColumnName("is_deleted");
|
|
|
|
b.Property<string>("LastName")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("MiddleName")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Nickname")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid?>("PositionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid")
|
|
.HasColumnName("tenant_id");
|
|
|
|
b.Property<DateTimeOffset?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("text")
|
|
.HasColumnName("updated_by");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DepartmentId");
|
|
|
|
b.HasIndex("PositionId");
|
|
|
|
b.HasIndex("TenantId");
|
|
|
|
b.HasIndex("TenantId", "UserId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("user_profiles", null, t =>
|
|
{
|
|
t.HasCheckConstraint("ck_user_profiles_tenant_not_null", "tenant_id is not null");
|
|
|
|
t.HasCheckConstraint("ck_user_profiles_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Tenancy.TenantConfig", b =>
|
|
{
|
|
b.Property<string>("TenantKey")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("ConnectionString")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(true);
|
|
|
|
b.Property<int>("Mode")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Schema")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<Guid>("TenantId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAtUtc")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at_utc")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.HasKey("TenantKey");
|
|
|
|
b.HasAlternateKey("TenantId");
|
|
|
|
b.HasIndex("IsActive");
|
|
|
|
b.HasIndex("TenantId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("tenants", "meta");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Tenancy.TenantDomain", b =>
|
|
{
|
|
b.Property<string>("Domain")
|
|
.HasMaxLength(253)
|
|
.HasColumnType("character varying(253)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(true);
|
|
|
|
b.Property<bool>("IsPlatformBaseDomain")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(false);
|
|
|
|
b.Property<string>("TenantKey")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAtUtc")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated_at_utc")
|
|
.HasDefaultValueSql("now() at time zone 'utc'");
|
|
|
|
b.HasKey("Domain");
|
|
|
|
b.HasIndex("IsActive");
|
|
|
|
b.HasIndex("IsPlatformBaseDomain");
|
|
|
|
b.HasIndex("TenantKey");
|
|
|
|
b.ToTable("tenant_domains", "meta");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.RolePermission", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.Permission", "Permission")
|
|
.WithMany("RolePermissions")
|
|
.HasForeignKey("PermissionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.Role", "Role")
|
|
.WithMany("RolePermissions")
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.Permission", null)
|
|
.WithMany()
|
|
.HasForeignKey("TenantId", "PermissionId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.Role", null)
|
|
.WithMany()
|
|
.HasForeignKey("TenantId", "RoleId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Permission");
|
|
|
|
b.Navigation("Role");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserExternalAccount", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.User", "User")
|
|
.WithMany("ExternalAccounts")
|
|
.HasForeignKey("TenantId", "UserId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserIdentity", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.User", "User")
|
|
.WithMany("Identities")
|
|
.HasForeignKey("TenantId", "UserId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserMfaFactor", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.User", "User")
|
|
.WithMany("MfaFactors")
|
|
.HasForeignKey("TenantId", "UserId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserPasswordHistory", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.User", "User")
|
|
.WithMany("PasswordHistories")
|
|
.HasForeignKey("TenantId", "UserId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserRole", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.Role", "Role")
|
|
.WithMany("UserRoles")
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.User", "User")
|
|
.WithMany("UserRoles")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.Role", null)
|
|
.WithMany()
|
|
.HasForeignKey("TenantId", "RoleId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.User", null)
|
|
.WithMany()
|
|
.HasForeignKey("TenantId", "UserId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Role");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.UserSession", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.User", "User")
|
|
.WithMany("Sessions")
|
|
.HasForeignKey("TenantId", "UserId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.CustomerAddress", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Customers.Address", "Address")
|
|
.WithMany("CustomerLinks")
|
|
.HasForeignKey("TenantId", "AddressId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Customers.CustomerProfile", "Customer")
|
|
.WithMany("Addresses")
|
|
.HasForeignKey("TenantId", "CustomerProfileId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Address");
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.CustomerContact", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Customers.CustomerProfile", "Customer")
|
|
.WithMany("Contacts")
|
|
.HasForeignKey("TenantId", "CustomerProfileId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.CustomerTag", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Customers.CustomerProfile", "Customer")
|
|
.WithMany("Tags")
|
|
.HasForeignKey("TenantId", "CustomerProfileId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.OrganizationProfile", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Customers.CustomerProfile", "Customer")
|
|
.WithOne("Organization")
|
|
.HasForeignKey("AMREZ.EOP.Domain.Entities.Customers.OrganizationProfile", "TenantId", "CustomerProfileId")
|
|
.HasPrincipalKey("AMREZ.EOP.Domain.Entities.Customers.CustomerProfile", "TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.PersonProfile", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Customers.CustomerProfile", "Customer")
|
|
.WithOne("Person")
|
|
.HasForeignKey("AMREZ.EOP.Domain.Entities.Customers.PersonProfile", "TenantId", "CustomerProfileId")
|
|
.HasPrincipalKey("AMREZ.EOP.Domain.Entities.Customers.CustomerProfile", "TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.Department", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.HumanResources.Department", "Parent")
|
|
.WithMany("Children")
|
|
.HasForeignKey("TenantId", "ParentDepartmentId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("Parent");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.EmergencyContact", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.HumanResources.UserProfile", "UserProfile")
|
|
.WithMany("EmergencyContacts")
|
|
.HasForeignKey("TenantId", "UserProfileId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("UserProfile");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.EmployeeAddress", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.HumanResources.UserProfile", "UserProfile")
|
|
.WithMany("Addresses")
|
|
.HasForeignKey("TenantId", "UserProfileId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("UserProfile");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.EmployeeBankAccount", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.HumanResources.UserProfile", "UserProfile")
|
|
.WithMany("BankAccounts")
|
|
.HasForeignKey("TenantId", "UserProfileId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("UserProfile");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.Employment", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.HumanResources.Department", "Department")
|
|
.WithMany()
|
|
.HasForeignKey("TenantId", "DepartmentId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.HumanResources.Position", "Position")
|
|
.WithMany()
|
|
.HasForeignKey("TenantId", "PositionId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.HumanResources.UserProfile", "UserProfile")
|
|
.WithMany("Employments")
|
|
.HasForeignKey("TenantId", "UserProfileId")
|
|
.HasPrincipalKey("TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Department");
|
|
|
|
b.Navigation("Position");
|
|
|
|
b.Navigation("UserProfile");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.UserProfile", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.HumanResources.Department", null)
|
|
.WithMany("Profiles")
|
|
.HasForeignKey("DepartmentId");
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.HumanResources.Position", null)
|
|
.WithMany("Profiles")
|
|
.HasForeignKey("PositionId");
|
|
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Authentications.User", "User")
|
|
.WithOne()
|
|
.HasForeignKey("AMREZ.EOP.Domain.Entities.HumanResources.UserProfile", "TenantId", "UserId")
|
|
.HasPrincipalKey("AMREZ.EOP.Domain.Entities.Authentications.User", "TenantId", "Id")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Tenancy.TenantDomain", b =>
|
|
{
|
|
b.HasOne("AMREZ.EOP.Domain.Entities.Tenancy.TenantConfig", null)
|
|
.WithMany()
|
|
.HasForeignKey("TenantKey")
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.Permission", b =>
|
|
{
|
|
b.Navigation("RolePermissions");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.Role", b =>
|
|
{
|
|
b.Navigation("RolePermissions");
|
|
|
|
b.Navigation("UserRoles");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Authentications.User", b =>
|
|
{
|
|
b.Navigation("ExternalAccounts");
|
|
|
|
b.Navigation("Identities");
|
|
|
|
b.Navigation("MfaFactors");
|
|
|
|
b.Navigation("PasswordHistories");
|
|
|
|
b.Navigation("Sessions");
|
|
|
|
b.Navigation("UserRoles");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.Address", b =>
|
|
{
|
|
b.Navigation("CustomerLinks");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.Customers.CustomerProfile", b =>
|
|
{
|
|
b.Navigation("Addresses");
|
|
|
|
b.Navigation("Contacts");
|
|
|
|
b.Navigation("Organization");
|
|
|
|
b.Navigation("Person");
|
|
|
|
b.Navigation("Tags");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.Department", b =>
|
|
{
|
|
b.Navigation("Children");
|
|
|
|
b.Navigation("Profiles");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.Position", b =>
|
|
{
|
|
b.Navigation("Profiles");
|
|
});
|
|
|
|
modelBuilder.Entity("AMREZ.EOP.Domain.Entities.HumanResources.UserProfile", b =>
|
|
{
|
|
b.Navigation("Addresses");
|
|
|
|
b.Navigation("BankAccounts");
|
|
|
|
b.Navigation("EmergencyContacts");
|
|
|
|
b.Navigation("Employments");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|