api อุทธร

This commit is contained in:
Kittapath 2023-12-13 10:40:59 +07:00
parent d4ae5f8c53
commit c1b3ad7f7a
10 changed files with 12651 additions and 0 deletions

View file

@ -0,0 +1,150 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class addtableDisciplineComplaint_Appeals : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DisciplineComplaint_Appeals",
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"),
Status = table.Column<string>(type: "longtext", nullable: false, comment: "สถานะอุทธรณ์/ร้องทุกข์")
.Annotation("MySql:CharSet", "utf8mb4"),
Title = table.Column<string>(type: "text", nullable: true, comment: "เรื่องที่อุทธรณ์/ร้องทุกข์")
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "text", nullable: true, comment: "รายละเอียดของเรื่องอุทธรณ์/ร้องทุกข์")
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<string>(type: "longtext", nullable: false, comment: "ประเภทอุทธรณ์หรือร้องทุกข์")
.Annotation("MySql:CharSet", "utf8mb4"),
Year = table.Column<int>(type: "int", nullable: true, comment: "ปีงบประมาณ"),
CaseType = table.Column<string>(type: "longtext", nullable: true, comment: "ประเภทคดี")
.Annotation("MySql:CharSet", "utf8mb4"),
CaseNumber = table.Column<string>(type: "longtext", nullable: true, comment: "คดีเลขที่")
.Annotation("MySql:CharSet", "utf8mb4"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "ProfileId", collation: "ascii_general_ci"),
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
Fullname = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อ-นามสกุลผู้อุทธรณ์/ร้องทุกข์")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineComplaint_Appeals", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineComplaint_Appeal_Docs",
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"),
DisciplineComplaint_AppealId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineComplaint_Appeal_Docs", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineComplaint_Appeal_Docs_DisciplineComplaint_Appeals_~",
column: x => x.DisciplineComplaint_AppealId,
principalTable: "DisciplineComplaint_Appeals",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DisciplineComplaint_Appeal_Docs_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DisciplineComplaint_Appeal_Historys",
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"),
Status = table.Column<string>(type: "longtext", nullable: false, comment: "สถานะอุทธรณ์/ร้องทุกข์")
.Annotation("MySql:CharSet", "utf8mb4"),
DisciplineComplaint_AppealId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DisciplineComplaint_Appeal_Historys", x => x.Id);
table.ForeignKey(
name: "FK_DisciplineComplaint_Appeal_Historys_DisciplineComplaint_Appe~",
column: x => x.DisciplineComplaint_AppealId,
principalTable: "DisciplineComplaint_Appeals",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_DisciplineComplaint_Appeal_Docs_DisciplineComplaint_AppealId",
table: "DisciplineComplaint_Appeal_Docs",
column: "DisciplineComplaint_AppealId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineComplaint_Appeal_Docs_DocumentId",
table: "DisciplineComplaint_Appeal_Docs",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DisciplineComplaint_Appeal_Historys_DisciplineComplaint_Appe~",
table: "DisciplineComplaint_Appeal_Historys",
column: "DisciplineComplaint_AppealId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DisciplineComplaint_Appeal_Docs");
migrationBuilder.DropTable(
name: "DisciplineComplaint_Appeal_Historys");
migrationBuilder.DropTable(
name: "DisciplineComplaint_Appeals");
}
}
}

View file

@ -135,6 +135,225 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
b.ToTable("DisciplineComplaints");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<string>("CaseNumber")
.HasColumnType("longtext")
.HasComment("คดีเลขที่");
b.Property<string>("CaseType")
.HasColumnType("longtext")
.HasComment("ประเภทคดี");
b.Property<string>("CitizenId")
.HasMaxLength(13)
.HasColumnType("varchar(13)")
.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<string>("Description")
.HasColumnType("text")
.HasComment("รายละเอียดของเรื่องอุทธรณ์/ร้องทุกข์");
b.Property<string>("Fullname")
.HasColumnType("longtext")
.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<Guid>("ProfileId")
.HasColumnType("char(36)")
.HasComment("ProfileId");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("longtext")
.HasComment("สถานะอุทธรณ์/ร้องทุกข์");
b.Property<string>("Title")
.HasColumnType("text")
.HasComment("เรื่องที่อุทธรณ์/ร้องทุกข์");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("longtext")
.HasComment("ประเภทอุทธรณ์หรือร้องทุกข์");
b.Property<int?>("Year")
.HasColumnType("int")
.HasComment("ปีงบประมาณ");
b.HasKey("Id");
b.ToTable("DisciplineComplaint_Appeals");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", 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>("DisciplineComplaint_AppealId")
.HasColumnType("char(36)");
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.HasKey("Id");
b.HasIndex("DisciplineComplaint_AppealId");
b.HasIndex("DocumentId");
b.ToTable("DisciplineComplaint_Appeal_Docs");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_History", 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>("DisciplineComplaint_AppealId")
.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<string>("Status")
.IsRequired()
.HasColumnType("longtext")
.HasComment("สถานะอุทธรณ์/ร้องทุกข์");
b.HasKey("Id");
b.HasIndex("DisciplineComplaint_AppealId");
b.ToTable("DisciplineComplaint_Appeal_Historys");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Channel", b =>
{
b.Property<Guid>("Id")
@ -10091,6 +10310,36 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
b.ToTable("ProfilePositions");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal")
.WithMany("DisciplineComplaint_Appeal_Docs")
.HasForeignKey("DisciplineComplaint_AppealId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document")
.WithMany()
.HasForeignKey("DocumentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DisciplineComplaint_Appeal");
b.Navigation("Document");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_History", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal")
.WithMany("DisciplineComplaint_Appeal_Historys")
.HasForeignKey("DisciplineComplaint_AppealId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DisciplineComplaint_Appeal");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint")
@ -11227,6 +11476,13 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
b.Navigation("DisciplineInvestigates");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", b =>
{
b.Navigation("DisciplineComplaint_Appeal_Docs");
b.Navigation("DisciplineComplaint_Appeal_Historys");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b =>
{
b.Navigation("DisciplineDisciplinary_DirectorInvestigates");