api จัดสรรเครื่องราช

This commit is contained in:
Kittapath 2023-08-18 14:35:45 +07:00
parent d30030141a
commit d5ffd5cb08
9 changed files with 15307 additions and 3 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,60 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addtableinsigniamanage : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "InsigniaManages",
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"),
InsigniaId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Year = table.Column<int>(type: "int", nullable: false, comment: "ปี"),
Total = table.Column<int>(type: "int", nullable: false, comment: "จำนวนทั้งหมด"),
Type = table.Column<string>(type: "longtext", nullable: false, comment: "ประเภทเครื่องราช")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_InsigniaManages", x => x.Id);
table.ForeignKey(
name: "FK_InsigniaManages_Insignias_InsigniaId",
column: x => x.InsigniaId,
principalTable: "Insignias",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_InsigniaManages_InsigniaId",
table: "InsigniaManages",
column: "InsigniaId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InsigniaManages");
}
}
}

View file

@ -5131,6 +5131,76 @@ namespace BMA.EHR.Infrastructure.Migrations
b.ToTable("TypeLeaves");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManage", 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>("InsigniaId")
.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<int>("Total")
.HasColumnType("int")
.HasComment("จำนวนทั้งหมด");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("longtext")
.HasComment("ประเภทเครื่องราช");
b.Property<int>("Year")
.HasColumnType("int")
.HasComment("ปี");
b.HasKey("Id");
b.HasIndex("InsigniaId");
b.ToTable("InsigniaManages");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaPeriod", b =>
{
b.Property<Guid>("Id")
@ -13425,6 +13495,17 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("ProfileTraining");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManage", b =>
{
b.HasOne("BMA.EHR.Domain.Models.MetaData.Insignia", "Insignia")
.WithMany()
.HasForeignKey("InsigniaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Insignia");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaPeriod", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "ReliefDoc")