ลบรับโอน ขอโอน

This commit is contained in:
Kittapath 2023-08-05 17:53:07 +07:00
parent c56e3b06b9
commit 61ddd26c0e
11 changed files with 26700 additions and 175 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,269 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addtableplacementtransfer : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PlacementReceives",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
CitizenId = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "เลขประจำตัวประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
PrefixId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Firstname = table.Column<string>(type: "longtext", nullable: false, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
Lastname = table.Column<string>(type: "longtext", nullable: false, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
DateOfBirth = table.Column<DateTime>(type: "datetime(6)", maxLength: 40, nullable: false, comment: "วันเกิด"),
GenderId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Nationality = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สัญชาติ")
.Annotation("MySql:CharSet", "utf8mb4"),
Race = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "เชื้อชาติ")
.Annotation("MySql:CharSet", "utf8mb4"),
ReligionId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
BloodGroupId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
RelationshipId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TelephoneNumber = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "เบอร์โทร")
.Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column<string>(type: "longtext", nullable: false, comment: "สถานะคำขอ")
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementReceives", x => x.Id);
table.ForeignKey(
name: "FK_PlacementReceives_BloodGroups_BloodGroupId",
column: x => x.BloodGroupId,
principalTable: "BloodGroups",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Genders_GenderId",
column: x => x.GenderId,
principalTable: "Genders",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Organizations_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organizations",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Prefixes_PrefixId",
column: x => x.PrefixId,
principalTable: "Prefixes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PlacementReceives_Relationships_RelationshipId",
column: x => x.RelationshipId,
principalTable: "Relationships",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Religions_ReligionId",
column: x => x.ReligionId,
principalTable: "Religions",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PlacementTransfers",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Organization = table.Column<string>(type: "longtext", nullable: true, comment: "หน่วยงานที่ขอโอนไป")
.Annotation("MySql:CharSet", "utf8mb4"),
Reason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผล")
.Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column<string>(type: "longtext", nullable: false, comment: "สถานะคำขอ")
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementTransfers", x => x.Id);
table.ForeignKey(
name: "FK_PlacementTransfers_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PlacementReceiveDocs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PlacementReceiveId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementReceiveDocs", x => x.Id);
table.ForeignKey(
name: "FK_PlacementReceiveDocs_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PlacementReceiveDocs_PlacementReceives_PlacementReceiveId",
column: x => x.PlacementReceiveId,
principalTable: "PlacementReceives",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PlacementTransferDocs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
.Annotation("MySql:CharSet", "utf8mb4"),
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
.Annotation("MySql:CharSet", "utf8mb4"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PlacementTransferId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementTransferDocs", x => x.Id);
table.ForeignKey(
name: "FK_PlacementTransferDocs_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PlacementTransferDocs_PlacementTransfers_PlacementTransferId",
column: x => x.PlacementTransferId,
principalTable: "PlacementTransfers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceiveDocs_DocumentId",
table: "PlacementReceiveDocs",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceiveDocs_PlacementReceiveId",
table: "PlacementReceiveDocs",
column: "PlacementReceiveId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_BloodGroupId",
table: "PlacementReceives",
column: "BloodGroupId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_GenderId",
table: "PlacementReceives",
column: "GenderId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_OrganizationId",
table: "PlacementReceives",
column: "OrganizationId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PrefixId",
table: "PlacementReceives",
column: "PrefixId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_RelationshipId",
table: "PlacementReceives",
column: "RelationshipId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_ReligionId",
table: "PlacementReceives",
column: "ReligionId");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransferDocs_DocumentId",
table: "PlacementTransferDocs",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransferDocs_PlacementTransferId",
table: "PlacementTransferDocs",
column: "PlacementTransferId");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransfers_ProfileId",
table: "PlacementTransfers",
column: "ProfileId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PlacementReceiveDocs");
migrationBuilder.DropTable(
name: "PlacementTransferDocs");
migrationBuilder.DropTable(
name: "PlacementReceives");
migrationBuilder.DropTable(
name: "PlacementTransfers");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,258 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addtableplacementtransfer1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_Organizations_OrganizationId",
table: "PlacementReceives");
migrationBuilder.RenameColumn(
name: "OrganizationId",
table: "PlacementReceives",
newName: "PositionTypeId");
migrationBuilder.RenameIndex(
name: "IX_PlacementReceives_OrganizationId",
table: "PlacementReceives",
newName: "IX_PlacementReceives_PositionTypeId");
migrationBuilder.AddColumn<Guid>(
name: "OrganizationPositionId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionLevelId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionLineId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionNumberId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionPathId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionPathSideId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<DateTime>(
name: "RecruitDate",
table: "PlacementReceives",
type: "datetime(6)",
nullable: true,
comment: "วันที่บรรจุ");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_OrganizationPositionId",
table: "PlacementReceives",
column: "OrganizationPositionId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionLevelId",
table: "PlacementReceives",
column: "PositionLevelId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionLineId",
table: "PlacementReceives",
column: "PositionLineId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionNumberId",
table: "PlacementReceives",
column: "PositionNumberId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionPathId",
table: "PlacementReceives",
column: "PositionPathId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionPathSideId",
table: "PlacementReceives",
column: "PositionPathSideId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_OrganizationPositions_OrganizationPosition~",
table: "PlacementReceives",
column: "OrganizationPositionId",
principalTable: "OrganizationPositions",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionLevels_PositionLevelId",
table: "PlacementReceives",
column: "PositionLevelId",
principalTable: "PositionLevels",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionLines_PositionLineId",
table: "PlacementReceives",
column: "PositionLineId",
principalTable: "PositionLines",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionNumbers_PositionNumberId",
table: "PlacementReceives",
column: "PositionNumberId",
principalTable: "PositionNumbers",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionPathSides_PositionPathSideId",
table: "PlacementReceives",
column: "PositionPathSideId",
principalTable: "PositionPathSides",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionPaths_PositionPathId",
table: "PlacementReceives",
column: "PositionPathId",
principalTable: "PositionPaths",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionTypes_PositionTypeId",
table: "PlacementReceives",
column: "PositionTypeId",
principalTable: "PositionTypes",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_OrganizationPositions_OrganizationPosition~",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionLevels_PositionLevelId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionLines_PositionLineId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionNumbers_PositionNumberId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionPathSides_PositionPathSideId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionPaths_PositionPathId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionTypes_PositionTypeId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_OrganizationPositionId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionLevelId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionLineId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionNumberId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionPathId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionPathSideId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "OrganizationPositionId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionLevelId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionLineId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionNumberId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionPathId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionPathSideId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "RecruitDate",
table: "PlacementReceives");
migrationBuilder.RenameColumn(
name: "PositionTypeId",
table: "PlacementReceives",
newName: "OrganizationId");
migrationBuilder.RenameIndex(
name: "IX_PlacementReceives_PositionTypeId",
table: "PlacementReceives",
newName: "IX_PlacementReceives_OrganizationId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_Organizations_OrganizationId",
table: "PlacementReceives",
column: "OrganizationId",
principalTable: "Organizations",
principalColumn: "Id");
}
}
}

View file

@ -10447,6 +10447,365 @@ namespace BMA.EHR.Infrastructure.Migrations
b.ToTable("PlacementProfiles");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementReceive", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<Guid?>("BloodGroupId")
.HasColumnType("char(36)");
b.Property<string>("CitizenId")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("เลขประจำตัวประชาชน");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(100)
.HasComment("สร้างข้อมูลเมื่อ");
b.Property<string>("CreatedFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(104)
.HasComment("ชื่อ User ที่สร้างข้อมูล");
b.Property<string>("CreatedUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<DateTime>("DateOfBirth")
.HasMaxLength(40)
.HasColumnType("datetime(6)")
.HasComment("วันเกิด");
b.Property<string>("Firstname")
.IsRequired()
.HasColumnType("longtext")
.HasComment("ชื่อ");
b.Property<Guid?>("GenderId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(105)
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
b.Property<string>("LastUpdateUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(103)
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
b.Property<DateTime?>("LastUpdatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(102)
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
b.Property<string>("Lastname")
.IsRequired()
.HasColumnType("longtext")
.HasComment("นามสกุล");
b.Property<string>("Nationality")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasComment("สัญชาติ");
b.Property<Guid?>("OrganizationPositionId")
.HasColumnType("char(36)");
b.Property<Guid?>("PositionLevelId")
.HasColumnType("char(36)");
b.Property<Guid?>("PositionLineId")
.HasColumnType("char(36)");
b.Property<Guid?>("PositionNumberId")
.HasColumnType("char(36)");
b.Property<Guid?>("PositionPathId")
.HasColumnType("char(36)");
b.Property<Guid?>("PositionPathSideId")
.HasColumnType("char(36)");
b.Property<Guid?>("PositionTypeId")
.HasColumnType("char(36)");
b.Property<Guid>("PrefixId")
.HasColumnType("char(36)");
b.Property<string>("Race")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasComment("เชื้อชาติ");
b.Property<DateTime?>("RecruitDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่บรรจุ");
b.Property<Guid?>("RelationshipId")
.HasColumnType("char(36)");
b.Property<Guid?>("ReligionId")
.HasColumnType("char(36)");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("longtext")
.HasComment("สถานะคำขอ");
b.Property<string>("TelephoneNumber")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("เบอร์โทร");
b.HasKey("Id");
b.HasIndex("BloodGroupId");
b.HasIndex("GenderId");
b.HasIndex("OrganizationPositionId");
b.HasIndex("PositionLevelId");
b.HasIndex("PositionLineId");
b.HasIndex("PositionNumberId");
b.HasIndex("PositionPathId");
b.HasIndex("PositionPathSideId");
b.HasIndex("PositionTypeId");
b.HasIndex("PrefixId");
b.HasIndex("RelationshipId");
b.HasIndex("ReligionId");
b.ToTable("PlacementReceives");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementReceiveDoc", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(100)
.HasComment("สร้างข้อมูลเมื่อ");
b.Property<string>("CreatedFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(104)
.HasComment("ชื่อ User ที่สร้างข้อมูล");
b.Property<string>("CreatedUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<Guid>("DocumentId")
.HasColumnType("char(36)");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(105)
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
b.Property<string>("LastUpdateUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(103)
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
b.Property<DateTime?>("LastUpdatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(102)
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
b.Property<Guid>("PlacementReceiveId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("DocumentId");
b.HasIndex("PlacementReceiveId");
b.ToTable("PlacementReceiveDocs");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementTransfer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(100)
.HasComment("สร้างข้อมูลเมื่อ");
b.Property<string>("CreatedFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(104)
.HasComment("ชื่อ User ที่สร้างข้อมูล");
b.Property<string>("CreatedUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(105)
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
b.Property<string>("LastUpdateUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(103)
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
b.Property<DateTime?>("LastUpdatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(102)
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
b.Property<string>("Organization")
.HasColumnType("longtext")
.HasComment("หน่วยงานที่ขอโอนไป");
b.Property<Guid>("ProfileId")
.HasColumnType("char(36)");
b.Property<string>("Reason")
.HasColumnType("longtext")
.HasComment("เหตุผล");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("longtext")
.HasComment("สถานะคำขอ");
b.HasKey("Id");
b.HasIndex("ProfileId");
b.ToTable("PlacementTransfers");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementTransferDoc", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(100)
.HasComment("สร้างข้อมูลเมื่อ");
b.Property<string>("CreatedFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(104)
.HasComment("ชื่อ User ที่สร้างข้อมูล");
b.Property<string>("CreatedUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<Guid>("DocumentId")
.HasColumnType("char(36)");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(105)
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
b.Property<string>("LastUpdateUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(103)
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
b.Property<DateTime?>("LastUpdatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(102)
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
b.Property<Guid>("PlacementTransferId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("DocumentId");
b.HasIndex("PlacementTransferId");
b.ToTable("PlacementTransferDocs");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementType", b =>
{
b.Property<Guid>("Id")
@ -11928,6 +12287,132 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("Religion");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementReceive", b =>
{
b.HasOne("BMA.EHR.Domain.Models.MetaData.BloodGroup", "BloodGroup")
.WithMany()
.HasForeignKey("BloodGroupId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.Gender", "Gender")
.WithMany()
.HasForeignKey("GenderId");
b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", "OrganizationPosition")
.WithMany()
.HasForeignKey("OrganizationPositionId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel")
.WithMany()
.HasForeignKey("PositionLevelId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLine", "PositionLine")
.WithMany()
.HasForeignKey("PositionLineId");
b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", "PositionNumber")
.WithMany()
.HasForeignKey("PositionNumberId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "PositionPath")
.WithMany()
.HasForeignKey("PositionPathId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPathSide", "PositionPathSide")
.WithMany()
.HasForeignKey("PositionPathSideId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType")
.WithMany()
.HasForeignKey("PositionTypeId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.Prefix", "Prefix")
.WithMany()
.HasForeignKey("PrefixId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.MetaData.Relationship", "Relationship")
.WithMany()
.HasForeignKey("RelationshipId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.Religion", "Religion")
.WithMany()
.HasForeignKey("ReligionId");
b.Navigation("BloodGroup");
b.Navigation("Gender");
b.Navigation("OrganizationPosition");
b.Navigation("PositionLevel");
b.Navigation("PositionLine");
b.Navigation("PositionNumber");
b.Navigation("PositionPath");
b.Navigation("PositionPathSide");
b.Navigation("PositionType");
b.Navigation("Prefix");
b.Navigation("Relationship");
b.Navigation("Religion");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementReceiveDoc", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document")
.WithMany()
.HasForeignKey("DocumentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.Placement.PlacementReceive", "PlacementReceive")
.WithMany("PlacementReceiveDocs")
.HasForeignKey("PlacementReceiveId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Document");
b.Navigation("PlacementReceive");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementTransfer", b =>
{
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
.WithMany()
.HasForeignKey("ProfileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Profile");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementTransferDoc", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document")
.WithMany()
.HasForeignKey("DocumentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.Placement.PlacementTransfer", "PlacementTransfer")
.WithMany("PlacementTransferDocs")
.HasForeignKey("PlacementTransferId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Document");
b.Navigation("PlacementTransfer");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementPeriodHistory", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Retirement.RetirementPeriod", "RetirementPeriod")
@ -12163,6 +12648,16 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("PlacementEducations");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementReceive", b =>
{
b.Navigation("PlacementReceiveDocs");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Placement.PlacementTransfer", b =>
{
b.Navigation("PlacementTransferDocs");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementPeriod", b =>
{
b.Navigation("RetirementPeriodHistorys");