diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs
index 289ecf81..50f663ff 100644
--- a/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs
+++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs
@@ -416,6 +416,13 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
DisciplinaryStatusResult = x.DisciplinaryStatusResult,
DisciplinaryCauseText = x.DisciplinaryCauseText,
DisciplinaryResult = x.DisciplinaryResult,
+ DisciplinaryExtendHistory = x.DisciplineDisciplinaryExtends.Select(e => new
+ {
+ Name = e.Name,
+ Num = e.Num,
+ DateStart = e.DateStart,
+ DateEnd = e.DateEnd,
+ }),
Status = x.Status,
Result = x.Result,
Director = x.DisciplineDisciplinary_DirectorInvestigates.Select(d => new
@@ -538,6 +545,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
_data.DisciplinaryStatusResult,
_data.DisciplinaryCauseText,
_data.DisciplinaryResult,
+ _data.DisciplinaryExtendHistory,
_data.Status,
_data.Result,
_data.Director,
@@ -568,12 +576,15 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
.Include(x => x.DisciplineDisciplinary_DirectorInvestigates)
.ThenInclude(x => x.DisciplineDirector)
.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates)
+ .Include(x => x.DisciplineDisciplinaryExtends)
.Where(x => x.Id == id)
.FirstOrDefaultAsync();
if (data == null)
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
if (data.Status.Trim().ToUpper() != "NEW")
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
+ var editExtend = false;
+ if (data.DisciplinaryDateEnd != req.DisciplinaryDateEnd) editExtend = true;
data.DisciplinaryWitnesses = req.DisciplinaryWitnesses;
data.DisciplinaryRecordAccuser = req.DisciplinaryRecordAccuser;
@@ -597,6 +608,24 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
data.LastUpdateFullName = FullName ?? "System Administrator";
data.LastUpdateUserId = UserId ?? "";
data.LastUpdatedAt = DateTime.Now;
+ if (editExtend == true)
+ {
+ var sumExtend = data.DisciplineDisciplinaryExtends.Count();
+ data.DisciplineDisciplinaryExtends.Add(
+ new DisciplineDisciplinaryExtend
+ {
+ Name = sumExtend > 0 ? "ขยายครั้งที่" + sumExtend : "วันที่สอบสวน",
+ Num = sumExtend,
+ DateStart = sumExtend > 0 ? data.DisciplinaryDateEnd.Value.AddDays(data.DisciplinaryDaysExtend == null ? 0 : -(double)data.DisciplinaryDaysExtend) : data.DisciplinaryDateStart,
+ DateEnd = data.DisciplinaryDateEnd,
+ CreatedFullName = FullName ?? "System Administrator",
+ CreatedUserId = UserId ?? "",
+ CreatedAt = DateTime.Now,
+ LastUpdateFullName = FullName ?? "System Administrator",
+ LastUpdateUserId = UserId ?? "",
+ LastUpdatedAt = DateTime.Now,
+ });
+ }
_context.DisciplineDisciplinary_DirectorInvestigates.RemoveRange(data.DisciplineDisciplinary_DirectorInvestigates);
foreach (var item in req.directors)
{
@@ -1470,5 +1499,32 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
await _context.SaveChangesAsync();
return Success();
}
+
+ ///
+ /// ปฏิทินรายการวินัยเรื่องสอบสวน
+ ///
+ ///
+ ///
+ /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("calendar")]
+ public async Task> GetCalendarDisciplineDisciplinary([FromBody] DisciplineCalendarRequest req)
+ {
+ var data = await _context.DisciplineDisciplinarys
+ .Where(x => x.DisciplinaryDateStart != null)
+ .Where(x => x.DisciplinaryDateEnd != null)
+ .Where(x => x.DisciplinaryDateStart.Value.Year == req.year || x.DisciplinaryDateEnd.Value.Year == req.year || x.DisciplinaryDateStart.Value.Month == req.month || x.DisciplinaryDateEnd.Value.Month == req.month)
+ .Select(x => new
+ {
+ Id = x.Id,//id ข้อมูลเรื่องสอบสวน
+ Title = x.Title,//ชื่อเรื่อง
+ DisciplinaryDateStart = x.DisciplinaryDateStart,//
+ DisciplinaryDateEnd = x.DisciplinaryDateEnd,//
+ })
+ .OrderBy(d => d.DisciplinaryDateStart.Value.Date)
+ .ToListAsync();
+ return Success(data);
+ }
}
}
diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs
index de6a638f..ec431088 100644
--- a/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs
+++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs
@@ -246,6 +246,13 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
InvestigationCauseText = x.InvestigationCauseText,
InvestigationExtendStatus = x.InvestigationExtendStatus,
InvestigationDaysExtend = x.InvestigationDaysExtend,
+ InvestigationExtendHistory = x.DisciplineInvestigateExtends.Select(e => new
+ {
+ Name = e.Name,
+ Num = e.Num,
+ DateStart = e.DateStart,
+ DateEnd = e.DateEnd,
+ }),
Status = x.Status,//สถานะเรื่องสืบสวน
Result = x.Result,//ผลการตรวจสอบ
Director = x.DisciplineInvestigate_Directors.Select(d => new
@@ -322,6 +329,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
_data.InvestigationCauseText,
_data.InvestigationExtendStatus,
_data.InvestigationDaysExtend,
+ _data.InvestigationExtendHistory,
_data.Status,
_data.Result,
_data.Director,
@@ -346,6 +354,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
public async Task> UpdateDisciplineInvestigate([FromBody] DisciplineInvestigateRequest req, Guid id)
{
var data = await _context.DisciplineInvestigates
+ .Include(x => x.DisciplineInvestigateExtends)
.Include(x => x.DisciplineInvestigate_ProfileComplaints)
.Include(x => x.DisciplineInvestigate_Directors)
.ThenInclude(x => x.DisciplineDirector)
@@ -355,6 +364,8 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
if (data.Status.Trim().ToUpper() != "NEW")
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
+ var editExtend = false;
+ if (data.InvestigationDateEnd != req.investigationDateEnd) editExtend = true;
data.InvestigationDetail = req.investigationDetail.Trim().ToUpper();
data.InvestigationDetailOther = req.investigationDetailOther;
@@ -369,6 +380,24 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
data.LastUpdateFullName = FullName ?? "System Administrator";
data.LastUpdateUserId = UserId ?? "";
data.LastUpdatedAt = DateTime.Now;
+ if (editExtend == true)
+ {
+ var sumExtend = data.DisciplineInvestigateExtends.Count();
+ data.DisciplineInvestigateExtends.Add(
+ new DisciplineInvestigateExtend
+ {
+ Name = sumExtend > 0 ? "ขยายครั้งที่" + sumExtend : "วันที่สืบสวน",
+ Num = sumExtend,
+ DateStart = sumExtend > 0 ? data.InvestigationDateEnd.Value.AddDays(data.InvestigationDaysExtend == null ? 0 : -(double)data.InvestigationDaysExtend) : data.InvestigationDateStart,
+ DateEnd = data.InvestigationDateEnd,
+ CreatedFullName = FullName ?? "System Administrator",
+ CreatedUserId = UserId ?? "",
+ CreatedAt = DateTime.Now,
+ LastUpdateFullName = FullName ?? "System Administrator",
+ LastUpdateUserId = UserId ?? "",
+ LastUpdatedAt = DateTime.Now,
+ });
+ }
_context.DisciplineInvestigate_Directors.RemoveRange(data.DisciplineInvestigate_Directors);
foreach (var item in req.directors)
{
@@ -881,5 +910,32 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
return Error(new Exception("ไม่พบไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound);
}
}
+
+ ///
+ /// ปฏิทินรายการวินัยเรื่องสืบสวน
+ ///
+ ///
+ ///
+ /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("calendar")]
+ public async Task> GetCalendarDisciplineInvestigate([FromBody] DisciplineCalendarRequest req)
+ {
+ var data = await _context.DisciplineInvestigates
+ .Where(x => x.InvestigationDateStart != null)
+ .Where(x => x.InvestigationDateEnd != null)
+ .Where(x => x.InvestigationDateStart.Value.Year == req.year || x.InvestigationDateEnd.Value.Year == req.year || x.InvestigationDateStart.Value.Month == req.month || x.InvestigationDateEnd.Value.Month == req.month)
+ .Select(x => new
+ {
+ Id = x.Id,//id ข้อมูลเรื่องสืบสวน
+ Title = x.Title,//ชื่อเรื่อง
+ InvestigationDateStart = x.InvestigationDateStart,//
+ InvestigationDateEnd = x.InvestigationDateEnd,//
+ })
+ .OrderBy(d => d.InvestigationDateStart.Value.Date)
+ .ToListAsync();
+ return Success(data);
+ }
}
}
diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineSuspendController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineSuspendController.cs
index f38e4b92..1439c88a 100644
--- a/BMA.EHR.Discipline.Service/Controllers/DisciplineSuspendController.cs
+++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineSuspendController.cs
@@ -112,6 +112,7 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
.Select(x => new
{
Id = x.Id,
+ PersonId = x.PersonId,
CitizenId = x.CitizenId,
Prefix = x.Prefix,
FirstName = x.FirstName,
diff --git a/BMA.EHR.Discipline.Service/Requests/DisciplineCalendarRequest.cs b/BMA.EHR.Discipline.Service/Requests/DisciplineCalendarRequest.cs
new file mode 100644
index 00000000..723a04a3
--- /dev/null
+++ b/BMA.EHR.Discipline.Service/Requests/DisciplineCalendarRequest.cs
@@ -0,0 +1,10 @@
+using Microsoft.EntityFrameworkCore;
+
+namespace BMA.EHR.Discipline.Service.Requests
+{
+ public class DisciplineCalendarRequest
+ {
+ public int year { get; set; }//
+ public int month { get; set; }//
+ }
+}
diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs
index 69de24ef..e20bec97 100644
--- a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs
+++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs
@@ -139,5 +139,6 @@ namespace BMA.EHR.Domain.Models.Discipline
public virtual List DisciplineDisciplinary_DocWitnessess { get; set; } = new List();
public virtual List DisciplineDisciplinary_DocOthers { get; set; } = new List();
public virtual List DisciplineDisciplinary_DocRelevants { get; set; } = new List();
+ public virtual List DisciplineDisciplinaryExtends { get; set; } = new List();
}
}
diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinaryExtend.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinaryExtend.cs
new file mode 100644
index 00000000..348e7d89
--- /dev/null
+++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinaryExtend.cs
@@ -0,0 +1,23 @@
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using BMA.EHR.Domain.Models.Base;
+using BMA.EHR.Domain.Models.MetaData;
+using BMA.EHR.Domain.Models.Organizations;
+using Microsoft.EntityFrameworkCore;
+
+namespace BMA.EHR.Domain.Models.Discipline
+{
+ public class DisciplineDisciplinaryExtend : EntityBase
+ {
+ [Comment("ชื่อการขยาย")]
+ public string? Name { get; set; }
+ [Comment("ครั้งที่ขยาย")]
+ public int Num { get; set; }
+ [Comment("วันที่เริ่ม")]
+ public DateTime? DateStart { get; set; }
+ [Comment("วันที่สิ้นสุด")]
+ public DateTime? DateEnd { get; set; }
+ [Required, Comment("Id เรื่องสอบสวน")]
+ public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
+ }
+}
diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs
index 861e21f3..9f233cfc 100644
--- a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs
+++ b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs
@@ -87,5 +87,6 @@ namespace BMA.EHR.Domain.Models.Discipline
public virtual List DisciplineInvestigateRelevant_Docs { get; set; } = new List();
public virtual List DisciplineInvestigate_Directors { get; set; } = new List();
public virtual List DisciplineDisciplinarys { get; set; } = new List();
+ public virtual List DisciplineInvestigateExtends { get; set; } = new List();
}
}
diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigateExtend.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigateExtend.cs
new file mode 100644
index 00000000..88b2046f
--- /dev/null
+++ b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigateExtend.cs
@@ -0,0 +1,23 @@
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using BMA.EHR.Domain.Models.Base;
+using BMA.EHR.Domain.Models.MetaData;
+using BMA.EHR.Domain.Models.Organizations;
+using Microsoft.EntityFrameworkCore;
+
+namespace BMA.EHR.Domain.Models.Discipline
+{
+ public class DisciplineInvestigateExtend : EntityBase
+ {
+ [Comment("ชื่อการขยาย")]
+ public string? Name { get; set; }
+ [Comment("ครั้งที่ขยาย")]
+ public int Num { get; set; }
+ [Comment("วันที่เริ่ม")]
+ public DateTime? DateStart { get; set; }
+ [Comment("วันที่สิ้นสุด")]
+ public DateTime? DateEnd { get; set; }
+ [Required, Comment("Id เรื่องสืบสวน")]
+ public DisciplineInvestigate DisciplineInvestigate { get; set; }
+ }
+}
diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231206093300_add table DisciplineInvestigateExtends.Designer.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231206093300_add table DisciplineInvestigateExtends.Designer.cs
new file mode 100644
index 00000000..c83ae56d
--- /dev/null
+++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231206093300_add table DisciplineInvestigateExtends.Designer.cs
@@ -0,0 +1,11450 @@
+//
+using System;
+using BMA.EHR.Infrastructure.Persistence;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
+{
+ [DbContext(typeof(DisciplineDbContext))]
+ [Migration("20231206093300_add table DisciplineInvestigateExtends")]
+ partial class addtableDisciplineInvestigateExtends
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.9")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("Appellant")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ผู้ร้องเรียน");
+
+ b.Property("ComplaintFrom")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)");
+
+ b.Property("ConsideredAgency")
+ .HasColumnType("char(36)")
+ .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DateConsideration")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่กำหนดพิจารณา");
+
+ b.Property("DateNotification")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันแจ้งเตือนล่วงหน้า");
+
+ b.Property("DateReceived")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("รายละเอียดของเรื่องร้องเรียน");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("LevelConsideration")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)");
+
+ b.Property("OffenseDetails")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)");
+
+ b.Property("Organization")
+ .HasColumnType("char(36)")
+ .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน");
+
+ b.Property("RespondentType")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)");
+
+ b.Property("Result")
+ .HasColumnType("longtext")
+ .HasComment("ผลการตรวจสอบ");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("เรื่องที่ร้องเรียน");
+
+ b.HasKey("Id");
+
+ b.ToTable("DisciplineComplaints");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Channel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ชื่อประเภทการร้องเรียน");
+
+ b.HasKey("Id");
+
+ b.ToTable("DisciplineComplaint_Channels");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineComplaintId")
+ .HasColumnType("char(36)");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineComplaintId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("DisciplineComplaint_Docs");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CitizenId")
+ .HasMaxLength(13)
+ .HasColumnType("varchar(13)")
+ .HasComment("รหัสบัตรประชาชน");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineComplaintId")
+ .HasColumnType("char(36)");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อ");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Organization")
+ .HasColumnType("longtext")
+ .HasComment("สังกัด");
+
+ b.Property("PersonId")
+ .HasColumnType("char(36)")
+ .HasComment("id อ้างอิง profile");
+
+ b.Property("PosNo")
+ .HasColumnType("longtext")
+ .HasComment("เลขที่ตำแหน่ง");
+
+ b.Property("Position")
+ .HasColumnType("longtext")
+ .HasComment("ตำแหน่ง");
+
+ b.Property("PositionLevel")
+ .HasColumnType("longtext")
+ .HasComment("ระดับ");
+
+ b.Property("Prefix")
+ .HasColumnType("longtext")
+ .HasComment("คำนำหน้า");
+
+ b.Property("Salary")
+ .HasColumnType("double")
+ .HasComment("เงินเดือน");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineComplaintId");
+
+ b.ToTable("DisciplineComplaint_Profiles");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("Email")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("อีเมล");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ชื่อ");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("นามสกุล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Phone")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("เบอร์โทรศัพท์");
+
+ b.Property("Position")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ตำแหน่ง");
+
+ b.Property("Prefix")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("คำนำหน้าชื่อ");
+
+ b.HasKey("Id");
+
+ b.ToTable("DisciplineDirectors");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("Appellant")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ผู้ร้องเรียน");
+
+ b.Property("ComplaintFrom")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)");
+
+ b.Property("ConsideredAgency")
+ .HasColumnType("char(36)")
+ .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DateConsideration")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่กำหนดพิจารณา");
+
+ b.Property("DateNotification")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันแจ้งเตือนล่วงหน้า");
+
+ b.Property("DateReceived")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("รายละเอียดของเรื่องร้องเรียน");
+
+ b.Property("DisciplinaryCaseFault")
+ .HasColumnType("longtext")
+ .HasComment("กรณีความผิด");
+
+ b.Property("DisciplinaryCauseText")
+ .HasColumnType("longtext")
+ .HasComment("ผลการสอบสวน กรณีมีมูล");
+
+ b.Property("DisciplinaryDateAllegation")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่รับทราบข้อกล่าวหา");
+
+ b.Property("DisciplinaryDateEnd")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่สิ้นสุดการสอบสวน");
+
+ b.Property("DisciplinaryDateEvident")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่สรุปพยานหลักฐาน");
+
+ b.Property("DisciplinaryDateInvestigation")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่มีคำสั่งให้สอบสวน");
+
+ b.Property("DisciplinaryDateResult")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่รายงานผลการสอบสวน");
+
+ b.Property("DisciplinaryDateStart")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่เริ่มการสอบสวน");
+
+ b.Property("DisciplinaryDaysExtend")
+ .HasColumnType("int")
+ .HasComment("จำนวนวันที่ขยาย");
+
+ b.Property("DisciplinaryExtendStatus")
+ .HasColumnType("tinyint(1)")
+ .HasComment("ขยายเวลา");
+
+ b.Property("DisciplinaryFaultLevel")
+ .HasColumnType("longtext")
+ .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก");
+
+ b.Property("DisciplinaryInvestigateAt")
+ .HasColumnType("longtext")
+ .HasComment("สอบสวนที่");
+
+ b.Property("DisciplinaryRecordAccuser")
+ .HasColumnType("longtext")
+ .HasComment("บันทึกถ้อยคำของผู้กล่าวหา");
+
+ b.Property("DisciplinaryRefLaw")
+ .HasColumnType("longtext")
+ .HasComment("อ้างอิงมาตราตามกฎหมาย");
+
+ b.Property("DisciplinaryResult")
+ .HasColumnType("longtext")
+ .HasComment("ผลการสอบสวน เหตุผล");
+
+ b.Property("DisciplinaryStatusResult")
+ .HasColumnType("longtext")
+ .HasComment("ผลการสอบสวน ผล");
+
+ b.Property("DisciplinarySummaryEvidence")
+ .HasColumnType("longtext")
+ .HasComment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา");
+
+ b.Property("DisciplinaryWitnesses")
+ .HasColumnType("longtext")
+ .HasComment("พยานและบันทึกถ้อยคำพยาน");
+
+ b.Property("DisciplineInvestigateId")
+ .HasColumnType("char(36)");
+
+ b.Property("InvestigationCauseText")
+ .HasColumnType("longtext")
+ .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'");
+
+ b.Property("InvestigationDateEnd")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่สิ้นสุดการสืบสวน");
+
+ b.Property("InvestigationDateStart")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่เริ่มการสืบสวน");
+
+ b.Property("InvestigationDaysExtend")
+ .HasColumnType("int")
+ .HasComment("จำนวนวันที่ต้องการขยาย");
+
+ b.Property("InvestigationDescription")
+ .HasColumnType("longtext")
+ .HasComment("รายละเอียดเกี่ยวกับการสืบสวน");
+
+ b.Property("InvestigationDetail")
+ .HasColumnType("longtext")
+ .HasComment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)");
+
+ b.Property("InvestigationDetailOther")
+ .HasColumnType("longtext")
+ .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ");
+
+ b.Property("InvestigationExtendStatus")
+ .HasColumnType("tinyint(1)")
+ .HasComment("ขยายเวลา");
+
+ b.Property("InvestigationStatusResult")
+ .HasColumnType("longtext")
+ .HasComment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("LevelConsideration")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)");
+
+ b.Property("OffenseDetails")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)");
+
+ b.Property("Organization")
+ .HasColumnType("char(36)")
+ .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน");
+
+ b.Property("RespondentType")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)");
+
+ b.Property("Result")
+ .HasColumnType("longtext")
+ .HasComment("ผลการตรวจสอบ");
+
+ b.Property("ResultComplaint")
+ .HasColumnType("longtext")
+ .HasComment("ผลการตรวจสอบเรื่องร้องเรียน");
+
+ b.Property("ResultDescription")
+ .HasColumnType("longtext")
+ .HasComment("สรุปผลการพิจารณา");
+
+ b.Property("ResultInvestigate")
+ .HasColumnType("longtext")
+ .HasComment("ผลการตรวจสอบเรื่องสืบสวน");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("เรื่องที่ร้องเรียน");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineInvestigateId");
+
+ b.ToTable("DisciplineDisciplinarys");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DateEnd")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่สิ้นสุด");
+
+ b.Property("DateStart")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่เริ่ม");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Name")
+ .HasColumnType("longtext")
+ .HasComment("ชื่อการขยาย");
+
+ b.Property("Num")
+ .HasColumnType("int")
+ .HasComment("ครั้งที่ขยาย");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.ToTable("DisciplineDisciplinaryExtends");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDirectorId")
+ .HasColumnType("char(36)");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDirectorId");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.ToTable("DisciplineDisciplinary_DirectorInvestigates");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("DisciplineDisciplinary_DocComplaintInvestigates");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("DisciplineDisciplinary_DocInvestigates");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("DisciplineDisciplinary_DocInvestigateRelevants");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("DisciplineDisciplinary_DocOthers");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("DisciplineDisciplinary_DocRecordAccusers");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRelevant", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("DisciplineDisciplinary_DocRelevants");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("DisciplineDisciplinary_DocSummaryEvidences");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("DisciplineDisciplinary_DocWitnessess");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CitizenId")
+ .HasMaxLength(13)
+ .HasColumnType("varchar(13)")
+ .HasComment("รหัสบัตรประชาชน");
+
+ b.Property("CommandTypeId")
+ .HasColumnType("char(36)")
+ .HasComment("ประเภทออกคำสั่ง");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DisciplineDisciplinaryId")
+ .HasColumnType("char(36)");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อ");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Organization")
+ .HasColumnType("longtext")
+ .HasComment("สังกัด");
+
+ b.Property("PersonId")
+ .HasColumnType("char(36)")
+ .HasComment("id อ้างอิง profile");
+
+ b.Property("PosNo")
+ .HasColumnType("longtext")
+ .HasComment("เลขที่ตำแหน่ง");
+
+ b.Property("Position")
+ .HasColumnType("longtext")
+ .HasComment("ตำแหน่ง");
+
+ b.Property("PositionLevel")
+ .HasColumnType("longtext")
+ .HasComment("ระดับ");
+
+ b.Property("Prefix")
+ .HasColumnType("longtext")
+ .HasComment("คำนำหน้า");
+
+ b.Property("Salary")
+ .HasColumnType("double")
+ .HasComment("เงินเดือน");
+
+ b.Property("Status")
+ .HasColumnType("longtext")
+ .HasComment("สถานะออกคำสั่ง");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DisciplineDisciplinaryId");
+
+ b.ToTable("DisciplineDisciplinary_ProfileComplaintInvestigates");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property