diff --git a/BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj b/BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj index b4da4155..acc06d30 100644 --- a/BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj +++ b/BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj @@ -15,6 +15,7 @@ + diff --git a/BMA.EHR.Discipline.Service/Program.cs b/BMA.EHR.Discipline.Service/Program.cs index d33c885a..012bcc72 100644 --- a/BMA.EHR.Discipline.Service/Program.cs +++ b/BMA.EHR.Discipline.Service/Program.cs @@ -18,9 +18,10 @@ using Serilog.Exceptions; using Serilog.Sinks.Elasticsearch; using System.Reflection; using System.Text; -using System.Transactions; +using System.Data; using BMA.EHR.Discipline.Service.Filters; using BMA.EHR.Application.Repositories; +using Hangfire.Oracle.Core; var builder = WebApplication.CreateBuilder(args); { @@ -101,17 +102,18 @@ var builder = WebApplication.CreateBuilder(args); // Register DbContext var defaultConnection = builder.Configuration.GetConnectionString("DefaultConnection"); builder.Services.AddDbContext(options => - options.UseMySql(defaultConnection, ServerVersion.AutoDetect(defaultConnection))); + options.UseOracle(defaultConnection, o => o.MigrationsHistoryTable("__DisciplineMigrationsHistory"))); builder.Services.AddHealthChecks(); + // Add Hangfire services. builder.Services.AddHangfire(configuration => configuration .SetDataCompatibilityLevel(CompatibilityLevel.Version_170) .UseSimpleAssemblyNameTypeSerializer() .UseRecommendedSerializerSettings() .UseStorage( - new MySqlStorage( + new OracleStorage( defaultConnection, - new MySqlStorageOptions + new OracleStorageOptions { TransactionIsolationLevel = IsolationLevel.ReadCommitted, QueuePollInterval = TimeSpan.FromSeconds(15), @@ -121,7 +123,7 @@ var builder = WebApplication.CreateBuilder(args); DashboardJobListLimit = 50000, TransactionTimeout = TimeSpan.FromMinutes(1), InvisibilityTimeout = TimeSpan.FromHours(3), - TablesPrefix = "Hangfire" + SchemaName = "HANGFIRE" }))); builder.Services.AddHangfireServer(); } diff --git a/BMA.EHR.Discipline.Service/appsettings.json b/BMA.EHR.Discipline.Service/appsettings.json index 56e379dc..24e4603e 100644 --- a/BMA.EHR.Discipline.Service/appsettings.json +++ b/BMA.EHR.Discipline.Service/appsettings.json @@ -14,10 +14,15 @@ "AllowedHosts": "*", "ConnectionStrings": { //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", - "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + //"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + //"ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + //"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + //"DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + + "DefaultConnection": "User Id=sys;Password=FPTadmin2357;DBA Privilege=SYSDBA;Data Source=192.168.1.80:1521/FREE", + "ExamConnection": "User Id=sys;Password=FPTadmin2357;DBA Privilege=SYSDBA;Data Source=192.168.1.80:1521/FREE", + "LeaveConnection": "User Id=sys;Password=FPTadmin2357;DBA Privilege=SYSDBA;Data Source=192.168.1.80:1521/FREE", + "DisciplineConnection": "User Id=sys;Password=FPTadmin2357;DBA Privilege=SYSDBA;Data Source=192.168.1.80:1521/FREE" }, "Jwt": { "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", diff --git a/BMA.EHR.Domain/Models/Commands/Core/CommandReceiver.cs b/BMA.EHR.Domain/Models/Commands/Core/CommandReceiver.cs index f51197ad..9b5234a5 100644 --- a/BMA.EHR.Domain/Models/Commands/Core/CommandReceiver.cs +++ b/BMA.EHR.Domain/Models/Commands/Core/CommandReceiver.cs @@ -27,10 +27,10 @@ namespace BMA.EHR.Domain.Models.Commands.Core [MaxLength(100), Required, Comment("นามสกุล")] public string LastName { get; set; } = string.Empty; - [Column(TypeName = "text"), Comment("หมายเหตุ")] + [Column(TypeName = "NCLOB"), Comment("หมายเหตุ")] public string Comment { get; set; } = string.Empty; - [Column(TypeName = "text"), Comment("หมายเหตุแนวนอน")] + [Column(TypeName = "NCLOB"), Comment("หมายเหตุแนวนอน")] public string Comment2 { get; set; } = string.Empty; [Comment("รหัสอ้างอิงไปยังข้อมูลผู้บรรจุ")] diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineComplaint.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineComplaint.cs index 72473794..b4e1a342 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineComplaint.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineComplaint.cs @@ -14,10 +14,10 @@ namespace BMA.EHR.Domain.Models.Discipline [Required, Comment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)")] public string RespondentType { get; set; } = string.Empty; - [Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")] + [Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "NCLOB")] public string Title { get; set; } = string.Empty; - [Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "text")] + [Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "NCLOB")] public string? Description { get; set; } = string.Empty; [Comment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ")] diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineComplaint_Appeal.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineComplaint_Appeal.cs index d492fbec..52b3a4df 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineComplaint_Appeal.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineComplaint_Appeal.cs @@ -12,10 +12,10 @@ namespace BMA.EHR.Domain.Models.Discipline [Required, Comment("สถานะอุทธรณ์/ร้องทุกข์")] public string Status { get; set; } = string.Empty; - [Comment("เรื่องที่อุทธรณ์/ร้องทุกข์"), Column(TypeName = "text")] + [Comment("เรื่องที่อุทธรณ์/ร้องทุกข์"), Column(TypeName = "NCLOB")] public string? Title { get; set; } = string.Empty; - [Comment("รายละเอียดของเรื่องอุทธรณ์/ร้องทุกข์"), Column(TypeName = "text")] + [Comment("รายละเอียดของเรื่องอุทธรณ์/ร้องทุกข์"), Column(TypeName = "NCLOB")] public string? Description { get; set; } = string.Empty; [Required, Comment("ประเภทอุทธรณ์หรือร้องทุกข์")] diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs index 802c2034..61b151a9 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs @@ -14,10 +14,10 @@ namespace BMA.EHR.Domain.Models.Discipline [Required, Comment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)")] public string RespondentType { get; set; } = string.Empty; - [Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")] + [Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "NCLOB")] public string Title { get; set; } = string.Empty; - [Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "text")] + [Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "NCLOB")] public string? Description { get; set; } = string.Empty; [Comment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ")] diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs index 5c39781e..d4c2ae7a 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs @@ -14,10 +14,10 @@ namespace BMA.EHR.Domain.Models.Discipline [Required, Comment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)")] public string RespondentType { get; set; } = string.Empty; - [Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")] + [Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "NCLOB")] public string Title { get; set; } = string.Empty; - [Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "text")] + [Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "NCLOB")] public string? Description { get; set; } = string.Empty; [Comment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ")] diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineReport_Profile.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineReport_Profile.cs index 1b8c664a..c5e52bc5 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineReport_Profile.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineReport_Profile.cs @@ -40,7 +40,7 @@ namespace BMA.EHR.Domain.Models.Discipline [Comment("วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน")] public DateTime? EndDateSuspend { get; set; } - [Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")] + [Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "NCLOB")] public string? Title { get; set; } = string.Empty; [Comment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")] public string? OffenseDetails { get; set; } = string.Empty; diff --git a/BMA.EHR.Domain/Models/Discipline/Document.cs b/BMA.EHR.Domain/Models/Discipline/Document.cs index c6719759..25806cd0 100644 --- a/BMA.EHR.Domain/Models/Discipline/Document.cs +++ b/BMA.EHR.Domain/Models/Discipline/Document.cs @@ -17,7 +17,7 @@ namespace BMA.EHR.Domain.Models.Discipline [Required, MaxLength(128)] public string FileType { get; set; } = string.Empty; - [Column(TypeName = "text")] + [Column(TypeName = "NCLOB")] public string Detail { get; set; } = string.Empty; [Required] diff --git a/BMA.EHR.Domain/Models/HR/ProfileDiscipline.cs b/BMA.EHR.Domain/Models/HR/ProfileDiscipline.cs index 166d0858..6bfacd40 100644 --- a/BMA.EHR.Domain/Models/HR/ProfileDiscipline.cs +++ b/BMA.EHR.Domain/Models/HR/ProfileDiscipline.cs @@ -14,7 +14,7 @@ namespace BMA.EHR.Domain.Models.HR // public int Order { get; set; } [Comment("ระดับความผิด")] public string? Level { get; set; } - [Column(TypeName = "text")] + [Column(TypeName = "NCLOB")] [Comment("รายละเอียด")] public string? Detail { get; set; } [Comment("เอกสารอ้างอิง (เลขที่คำสั่ง)")] diff --git a/BMA.EHR.Domain/Models/HR/ProfileDisciplineHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileDisciplineHistory.cs index 68f3673d..b7f19368 100644 --- a/BMA.EHR.Domain/Models/HR/ProfileDisciplineHistory.cs +++ b/BMA.EHR.Domain/Models/HR/ProfileDisciplineHistory.cs @@ -10,7 +10,7 @@ namespace BMA.EHR.Domain.Models.HR { [Comment("ระดับความผิด")] public string? Level { get; set; } - [Column(TypeName = "text")] + [Column(TypeName = "NCLOB")] [Comment("รายละเอียด")] public string? Detail { get; set; } [Comment("เอกสารอ้างอิง (เลขที่คำสั่ง)")] diff --git a/BMA.EHR.Domain/Models/Insignias/InsigniaRequest.cs b/BMA.EHR.Domain/Models/Insignias/InsigniaRequest.cs index 1f9d1120..d0ba1a3a 100644 --- a/BMA.EHR.Domain/Models/Insignias/InsigniaRequest.cs +++ b/BMA.EHR.Domain/Models/Insignias/InsigniaRequest.cs @@ -13,7 +13,7 @@ namespace BMA.EHR.Domain.Models.Insignias [Required, MaxLength(50)] public string RequestStatus { get; set; } - [Column(TypeName = "text")] + [Column(TypeName = "NCLOB")] public string RequestNote { get; set; } public InsigniaPeriod Period { get; set; } diff --git a/BMA.EHR.Domain/Models/Insignias/InsigniaRequestProfile.cs b/BMA.EHR.Domain/Models/Insignias/InsigniaRequestProfile.cs index 776b6d9c..04f5e23b 100644 --- a/BMA.EHR.Domain/Models/Insignias/InsigniaRequestProfile.cs +++ b/BMA.EHR.Domain/Models/Insignias/InsigniaRequestProfile.cs @@ -22,13 +22,13 @@ namespace BMA.EHR.Domain.Models.Insignias // [MaxLength(50)] // public string? DocumentStatus { get; set; } - // [Column(TypeName = "text")] + // [Column(TypeName = "NCLOB")] // public string? Note { get; set; } // [MaxLength(50)] // public string? Special { get; set; } - [Column(TypeName = "text"), Comment("รายละเอียดเครื่องราชฯที่ขอ")] + [Column(TypeName = "NCLOB"), Comment("รายละเอียดเครื่องราชฯที่ขอ")] public string? MatchingConditions { get; set; } [Comment("สถานะตำแหน่งที่ยื่นขอ")] diff --git a/BMA.EHR.Domain/Models/Notifications/Inbox.cs b/BMA.EHR.Domain/Models/Notifications/Inbox.cs index 283581a7..1e15e613 100644 --- a/BMA.EHR.Domain/Models/Notifications/Inbox.cs +++ b/BMA.EHR.Domain/Models/Notifications/Inbox.cs @@ -10,13 +10,13 @@ namespace BMA.EHR.Domain.Models.Notifications [Required, MaxLength(200), Comment("หัวเรื่อง")] public string Subject { get; set; } - [Required, Column(TypeName = "text"), Comment("รายละเอียดข้อความ")] + [Required, Column(TypeName = "NCLOB"), Comment("รายละเอียดข้อความ")] public string Body { get; set; } [Required, Comment("รหัสผู้รับข้อความ")] public Guid ReceiverUserId { get; set; } - [Column(TypeName = "text"), Comment("สิงที่แนบมาด้วย")] + [Column(TypeName = "NCLOB"), Comment("สิงที่แนบมาด้วย")] public string Payload { get; set; } [Comment("เปิดอ่านแล้วหรือยัง")] diff --git a/BMA.EHR.Domain/Models/Notifications/Notification.cs b/BMA.EHR.Domain/Models/Notifications/Notification.cs index cbffdafb..918174ce 100644 --- a/BMA.EHR.Domain/Models/Notifications/Notification.cs +++ b/BMA.EHR.Domain/Models/Notifications/Notification.cs @@ -7,7 +7,7 @@ namespace BMA.EHR.Domain.Models.Notifications { public class Notification : EntityBase { - [Required, Column(TypeName = "text"), Comment("รายละเอียดข้อความ")] + [Required, Column(TypeName = "NCLOB"), Comment("รายละเอียดข้อความ")] public string Body { get; set; } [Required, Comment("รหัสผู้รับข้อความ")] @@ -16,7 +16,7 @@ namespace BMA.EHR.Domain.Models.Notifications [Required, Comment("ประเภทการแจ้งเตือน")] public string Type { get; set; } - [Column(TypeName = "text"), Comment("สิงที่แนบมาด้วย")] + [Column(TypeName = "NCLOB"), Comment("สิงที่แนบมาด้วย")] public string Payload { get; set; } [Comment("เปิดอ่านแล้วหรือยัง")] diff --git a/BMA.EHR.Domain/Models/Probation/CronjobNotiProbation.cs b/BMA.EHR.Domain/Models/Probation/CronjobNotiProbation.cs index 772008b4..4275604f 100644 --- a/BMA.EHR.Domain/Models/Probation/CronjobNotiProbation.cs +++ b/BMA.EHR.Domain/Models/Probation/CronjobNotiProbation.cs @@ -14,13 +14,13 @@ namespace BMA.EHR.Domain.Models.Probation [Required, MaxLength(200), Comment("หัวเรื่อง")] public string Subject { get; set; } - [Required, Column(TypeName = "text"), Comment("รายละเอียดข้อความ")] + [Required, Column(TypeName = "NCLOB"), Comment("รายละเอียดข้อความ")] public string Body { get; set; } [Required, Comment("รหัสผู้รับข้อความ")] public Guid ReceiverUserId { get; set; } - [Column(TypeName = "text"), Comment("สิงที่แนบมาด้วย")] + [Column(TypeName = "NCLOB"), Comment("สิงที่แนบมาด้วย")] public string Payload { get; set; } = ""; [Required, Comment("ส่งอีเมล์หรือไม่?")] diff --git a/BMA.EHR.Infrastructure/Migrations/20240503063836_Init Oracle Project.Designer.cs b/BMA.EHR.Infrastructure/Migrations/20240503070436_Init Oracle Project.Designer.cs similarity index 99% rename from BMA.EHR.Infrastructure/Migrations/20240503063836_Init Oracle Project.Designer.cs rename to BMA.EHR.Infrastructure/Migrations/20240503070436_Init Oracle Project.Designer.cs index 577fbe5f..4cf3baa9 100644 --- a/BMA.EHR.Infrastructure/Migrations/20240503063836_Init Oracle Project.Designer.cs +++ b/BMA.EHR.Infrastructure/Migrations/20240503070436_Init Oracle Project.Designer.cs @@ -12,7 +12,7 @@ using Oracle.EntityFrameworkCore.Metadata; namespace BMA.EHR.Infrastructure.Migrations { [DbContext(typeof(LeaveDbContext))] - [Migration("20240503063836_Init Oracle Project")] + [Migration("20240503070436_Init Oracle Project")] partial class InitOracleProject { /// diff --git a/BMA.EHR.Infrastructure/Migrations/20240503063836_Init Oracle Project.cs b/BMA.EHR.Infrastructure/Migrations/20240503070436_Init Oracle Project.cs similarity index 100% rename from BMA.EHR.Infrastructure/Migrations/20240503063836_Init Oracle Project.cs rename to BMA.EHR.Infrastructure/Migrations/20240503070436_Init Oracle Project.cs diff --git a/BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503065717_Init Oracle Project.Designer.cs b/BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503070505_Init Oracle Project.Designer.cs similarity index 99% rename from BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503065717_Init Oracle Project.Designer.cs rename to BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503070505_Init Oracle Project.Designer.cs index 91c3a570..198bf353 100644 --- a/BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503065717_Init Oracle Project.Designer.cs +++ b/BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503070505_Init Oracle Project.Designer.cs @@ -12,7 +12,7 @@ using Oracle.EntityFrameworkCore.Metadata; namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB { [DbContext(typeof(ApplicationDBContext))] - [Migration("20240503065717_Init Oracle Project")] + [Migration("20240503070505_Init Oracle Project")] partial class InitOracleProject { /// @@ -526,12 +526,12 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Comment") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("หมายเหตุ"); b.Property("Comment2") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("หมายเหตุแนวนอน"); b.Property("CreatedAt") @@ -2684,7 +2684,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB .HasComment("วัน เดือน ปี"); b.Property("Detail") - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียด"); b.Property("LastUpdateFullName") @@ -2764,7 +2764,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB .HasComment("วัน เดือน ปี"); b.Property("Detail") - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียด"); b.Property("LastUpdateFullName") @@ -6465,7 +6465,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("RequestNote") .IsRequired() - .HasColumnType("text"); + .HasColumnType("NCLOB"); b.Property("RequestStatus") .IsRequired() @@ -6546,7 +6546,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB .HasComment("แจ้งเตือน ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)"); b.Property("MatchingConditions") - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียดเครื่องราชฯที่ขอ"); b.Property("ProfileId") @@ -9534,7 +9534,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Body") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียดข้อความ"); b.Property("CreatedAt") @@ -9589,7 +9589,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Payload") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("สิงที่แนบมาด้วย"); b.Property("ReceiveDate") @@ -9722,7 +9722,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Body") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียดข้อความ"); b.Property("CreatedAt") @@ -9777,7 +9777,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Payload") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("สิงที่แนบมาด้วย"); b.Property("ReceiveDate") @@ -13943,7 +13943,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Body") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียดข้อความ"); b.Property("CreatedAt") @@ -13998,7 +13998,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Payload") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("สิงที่แนบมาด้วย"); b.Property("ReceiveDate") diff --git a/BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503065717_Init Oracle Project.cs b/BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503070505_Init Oracle Project.cs similarity index 99% rename from BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503065717_Init Oracle Project.cs rename to BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503070505_Init Oracle Project.cs index 78204736..e0af0d53 100644 --- a/BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503065717_Init Oracle Project.cs +++ b/BMA.EHR.Infrastructure/Migrations/ApplicationDB/20240503070505_Init Oracle Project.cs @@ -62,9 +62,9 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), Subject = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "หัวเรื่อง"), - Body = table.Column(type: "text(2000)", nullable: false, comment: "รายละเอียดข้อความ"), + Body = table.Column(type: "NCLOB", nullable: false, comment: "รายละเอียดข้อความ"), ReceiverUserId = table.Column(type: "RAW(16)", nullable: false, comment: "รหัสผู้รับข้อความ"), - Payload = table.Column(type: "text(2000)", nullable: false, comment: "สิงที่แนบมาด้วย"), + Payload = table.Column(type: "NCLOB", nullable: false, comment: "สิงที่แนบมาด้วย"), IsSendMail = table.Column(type: "NUMBER(1)", nullable: false, comment: "ส่งอีเมล์หรือไม่?"), IsSendInbox = table.Column(type: "NUMBER(1)", nullable: false, comment: "ส่งกล่องข้อความหรือไม่?"), IsSendNoti = table.Column(type: "NUMBER(1)", nullable: false, comment: "ส่งการแจ้งเตือนหรือยัง"), @@ -106,9 +106,9 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), Subject = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "หัวเรื่อง"), - Body = table.Column(type: "text(2000)", nullable: false, comment: "รายละเอียดข้อความ"), + Body = table.Column(type: "NCLOB", nullable: false, comment: "รายละเอียดข้อความ"), ReceiverUserId = table.Column(type: "RAW(16)", nullable: false, comment: "รหัสผู้รับข้อความ"), - Payload = table.Column(type: "text(2000)", nullable: false, comment: "สิงที่แนบมาด้วย"), + Payload = table.Column(type: "NCLOB", nullable: false, comment: "สิงที่แนบมาด้วย"), IsOpen = table.Column(type: "NUMBER(1)", nullable: false, comment: "เปิดอ่านแล้วหรือยัง"), ReceiveDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "วันที่ได้รับ"), OpenDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่เปิดอ่าน"), @@ -234,10 +234,10 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), - Body = table.Column(type: "text(2000)", nullable: false, comment: "รายละเอียดข้อความ"), + Body = table.Column(type: "NCLOB", nullable: false, comment: "รายละเอียดข้อความ"), ReceiverUserId = table.Column(type: "RAW(16)", nullable: false, comment: "รหัสผู้รับข้อความ"), Type = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ประเภทการแจ้งเตือน"), - Payload = table.Column(type: "text(2000)", nullable: false, comment: "สิงที่แนบมาด้วย"), + Payload = table.Column(type: "NCLOB", nullable: false, comment: "สิงที่แนบมาด้วย"), IsOpen = table.Column(type: "NUMBER(1)", nullable: false, comment: "เปิดอ่านแล้วหรือยัง"), ReceiveDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "วันที่ได้รับ"), OpenDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่เปิดอ่าน"), @@ -1344,7 +1344,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), RequestStatus = table.Column(type: "NVARCHAR2(50)", maxLength: 50, nullable: false), - RequestNote = table.Column(type: "text(2000)", nullable: false), + RequestNote = table.Column(type: "NCLOB", nullable: false), PeriodId = table.Column(type: "RAW(16)", nullable: false), OrganizationId = table.Column(type: "RAW(16)", nullable: false), DocumentId = table.Column(type: "RAW(16)", nullable: true) @@ -1820,7 +1820,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB RequestDate = table.Column(type: "TIMESTAMP(7)", nullable: false), Salary = table.Column(type: "BINARY_DOUBLE", nullable: true), IsApprove = table.Column(type: "NUMBER(1)", nullable: false), - MatchingConditions = table.Column(type: "text(2000)", nullable: true, comment: "รายละเอียดเครื่องราชฯที่ขอ"), + MatchingConditions = table.Column(type: "NCLOB", nullable: true, comment: "รายละเอียดเครื่องราชฯที่ขอ"), Status = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "สถานะตำแหน่งที่ยื่นขอ"), ReasonReject = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เหตุผลไม่ยื่นขอ"), Reason = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เหตุผลการได้รับเครื่องราชฯ"), @@ -2301,8 +2301,8 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB Prefix = table.Column(type: "NVARCHAR2(50)", maxLength: 50, nullable: false, comment: "คำนำหน้านาม"), FirstName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "ชื่อ"), LastName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "นามสกุล"), - Comment = table.Column(type: "text(2000)", nullable: false, comment: "หมายเหตุ"), - Comment2 = table.Column(type: "text(2000)", nullable: false, comment: "หมายเหตุแนวนอน"), + Comment = table.Column(type: "NCLOB", nullable: false, comment: "หมายเหตุ"), + Comment2 = table.Column(type: "NCLOB", nullable: false, comment: "หมายเหตุแนวนอน"), RefPlacementProfileId = table.Column(type: "RAW(16)", nullable: true, comment: "รหัสอ้างอิงไปยังข้อมูลผู้บรรจุ"), RefDisciplineId = table.Column(type: "RAW(16)", nullable: true, comment: "รหัสอ้างอิงไปยังข้อมูลวินัย"), Amount = table.Column(type: "BINARY_DOUBLE", nullable: true, comment: "เงินเดือน"), diff --git a/BMA.EHR.Infrastructure/Migrations/ApplicationDB/ApplicationDBContextModelSnapshot.cs b/BMA.EHR.Infrastructure/Migrations/ApplicationDB/ApplicationDBContextModelSnapshot.cs index cebe9910..3d98f4dc 100644 --- a/BMA.EHR.Infrastructure/Migrations/ApplicationDB/ApplicationDBContextModelSnapshot.cs +++ b/BMA.EHR.Infrastructure/Migrations/ApplicationDB/ApplicationDBContextModelSnapshot.cs @@ -523,12 +523,12 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Comment") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("หมายเหตุ"); b.Property("Comment2") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("หมายเหตุแนวนอน"); b.Property("CreatedAt") @@ -2681,7 +2681,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB .HasComment("วัน เดือน ปี"); b.Property("Detail") - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียด"); b.Property("LastUpdateFullName") @@ -2761,7 +2761,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB .HasComment("วัน เดือน ปี"); b.Property("Detail") - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียด"); b.Property("LastUpdateFullName") @@ -6462,7 +6462,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("RequestNote") .IsRequired() - .HasColumnType("text"); + .HasColumnType("NCLOB"); b.Property("RequestStatus") .IsRequired() @@ -6543,7 +6543,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB .HasComment("แจ้งเตือน ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)"); b.Property("MatchingConditions") - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียดเครื่องราชฯที่ขอ"); b.Property("ProfileId") @@ -9531,7 +9531,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Body") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียดข้อความ"); b.Property("CreatedAt") @@ -9586,7 +9586,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Payload") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("สิงที่แนบมาด้วย"); b.Property("ReceiveDate") @@ -9719,7 +9719,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Body") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียดข้อความ"); b.Property("CreatedAt") @@ -9774,7 +9774,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Payload") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("สิงที่แนบมาด้วย"); b.Property("ReceiveDate") @@ -13940,7 +13940,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Body") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("รายละเอียดข้อความ"); b.Property("CreatedAt") @@ -13995,7 +13995,7 @@ namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB b.Property("Payload") .IsRequired() - .HasColumnType("text") + .HasColumnType("NCLOB") .HasComment("สิงที่แนบมาด้วย"); b.Property("ReceiveDate") diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20240503071644_Init Oracle Project.Designer.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20240503071644_Init Oracle Project.Designer.cs new file mode 100644 index 00000000..39000254 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20240503071644_Init Oracle Project.Designer.cs @@ -0,0 +1,3016 @@ +// +using System; +using BMA.EHR.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Oracle.EntityFrameworkCore.Metadata; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + [DbContext(typeof(DisciplineDbContext))] + [Migration("20240503071644_Init Oracle Project")] + partial class InitOracleProject + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("RAW(16)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .HasColumnType("NCLOB") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("RAW(16)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("NCLOB") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CaseNumber") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คดีเลขที่"); + + b.Property("CaseType") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ประเภทคดี"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .HasColumnType("NCLOB") + .HasComment("รายละเอียดของเรื่องอุทธรณ์/ร้องทุกข์"); + + b.Property("Fullname") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อ-นามสกุลผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Oc") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัดผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่งผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("ProfileId") + .HasColumnType("RAW(16)") + .HasComment("ProfileId"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะอุทธรณ์/ร้องทุกข์"); + + b.Property("Title") + .HasColumnType("NCLOB") + .HasComment("เรื่องที่อุทธรณ์/ร้องทุกข์"); + + b.Property("Type") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ประเภทอุทธรณ์หรือร้องทุกข์"); + + b.Property("Year") + .HasColumnType("NUMBER(10)") + .HasComment("ปีงบประมาณ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Appeals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaint_AppealId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaint_AppealId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อประเภทการร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Channels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("RAW(16)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("ชื่อ"); + + b.Property("IsAncestorDNA") + .HasColumnType("NUMBER(1)") + .HasComment("รายการเก่า"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("RAW(16)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("BINARY_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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Email") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("อีเมล"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Phone") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เบอร์โทรศัพท์"); + + b.Property("Position") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("Prefix") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้าชื่อ"); + + b.Property("Qualification") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คุณวุฒิ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineDirectors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("RAW(16)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .HasColumnType("NCLOB") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplinaryCaseFault") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("กรณีความผิด"); + + b.Property("DisciplinaryCauseText") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการสอบสวน กรณีมีมูล"); + + b.Property("DisciplinaryDateAllegation") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รับทราบข้อกล่าวหา"); + + b.Property("DisciplinaryDateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุดการสอบสวน"); + + b.Property("DisciplinaryDateEvident") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สรุปพยานหลักฐาน"); + + b.Property("DisciplinaryDateInvestigation") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่มีคำสั่งให้สอบสวน"); + + b.Property("DisciplinaryDateResult") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รายงานผลการสอบสวน"); + + b.Property("DisciplinaryDateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่มการสอบสวน"); + + b.Property("DisciplinaryDaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่ขยาย"); + + b.Property("DisciplinaryExtendStatus") + .HasColumnType("NUMBER(1)") + .HasComment("ขยายเวลา"); + + b.Property("DisciplinaryFaultLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"); + + b.Property("DisciplinaryFaultLevelOther") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับโทษความผิดกรณีอื่นๆ"); + + b.Property("DisciplinaryInvestigateAt") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สอบสวนที่"); + + b.Property("DisciplinaryRecordAccuser") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("บันทึกถ้อยคำของผู้กล่าวหา"); + + b.Property("DisciplinaryRefLaw") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("อ้างอิงมาตราตามกฎหมาย"); + + b.Property("DisciplinaryResult") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการสอบสวน เหตุผล"); + + b.Property("DisciplinaryStatusResult") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการสอบสวน ผล"); + + b.Property("DisciplinarySummaryEvidence") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"); + + b.Property("DisciplinaryWitnesses") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("พยานและบันทึกถ้อยคำพยาน"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("InvestigationCauseText") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่ต้องการขยาย"); + + b.Property("InvestigationDescription") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationExtendStatus") + .HasColumnType("NUMBER(1)") + .HasComment("ขยายเวลา"); + + b.Property("InvestigationStatusResult") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("RAW(16)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("ResultDescription") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สรุปผลการพิจารณา"); + + b.Property("ResultDisciplineType") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ประเภทวินัย"); + + b.Property("ResultInvestigate") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบเรื่องสืบสวน"); + + b.Property("ResultOc") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("หน่วยงาย/ส่วนราชการ"); + + b.Property("ResultTitleType") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ประเภทของเรื่อง"); + + b.Property("ResultYear") + .HasColumnType("NUMBER(10)") + .HasComment("ปีงบประมาณ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("NCLOB") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineDisciplinarys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่ม"); + + b.Property("DaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่การขยาย"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อการขยาย"); + + b.Property("Num") + .HasColumnType("NUMBER(10)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CommandNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่คำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDirectorId") + .HasColumnType("RAW(16)"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("Duty") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("หน้าที่"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocResult", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocResults"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CommandTypeDiscardId") + .HasColumnType("RAW(16)") + .HasComment("ประเภทออกคำสั่งงดโทด"); + + b.Property("CommandTypeId") + .HasColumnType("RAW(16)") + .HasComment("ประเภทออกคำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("ชื่อ"); + + b.Property("IsAncestorDNA") + .HasColumnType("NUMBER(1)") + .HasComment("รายการเก่า"); + + b.Property("IsReport") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ส่งไปยุติเรื่อง"); + + b.Property("IsSuspend") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ส่งไปพักราชการ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("RAW(16)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("BINARY_DOUBLE") + .HasComment("เงินเดือน"); + + b.Property("Status") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะออกคำสั่ง"); + + b.Property("StatusDiscard") + .HasColumnType("NVARCHAR2(2000)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("RAW(16)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .HasColumnType("NCLOB") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplineComplaintId") + .HasColumnType("RAW(16)"); + + b.Property("InvestigationCauseText") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่ต้องการขยาย"); + + b.Property("InvestigationDescription") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationExtendStatus") + .HasColumnType("NUMBER(1)") + .HasComment("ขยายเวลา"); + + b.Property("InvestigationStatusResult") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("RAW(16)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("NCLOB") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่ม"); + + b.Property("DaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่การขยาย"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อการขยาย"); + + b.Property("Num") + .HasColumnType("NUMBER(10)") + .HasComment("ครั้งที่ขยาย"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigateExtends"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigateRelevant_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CommandNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่คำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDirectorId") + .HasColumnType("RAW(16)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("Duty") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("หน้าที่"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_DocComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("ชื่อ"); + + b.Property("IsAncestorDNA") + .HasColumnType("NUMBER(1)") + .HasComment("รายการเก่า"); + + b.Property("IsDisciplinary") + .HasColumnType("NUMBER(1)") + .HasComment("ส่งไปสอบสวน"); + + b.Property("IsReport") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ส่งไปยุติเรื่อง"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("RAW(16)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("BINARY_DOUBLE") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CommandTypeId") + .HasColumnType("RAW(16)") + .HasComment("ประเภทออกคำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DescriptionSuspend") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เหตุที่ถูกสั่งพักราชการ/ออกจากราชการไว้ก่อน"); + + b.Property("DisciplinaryCaseFault") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("กรณีความผิด"); + + b.Property("DisciplinaryFaultLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("EndDateSuspend") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("OffenseDetails") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("RAW(16)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("BINARY_DOUBLE") + .HasComment("เงินเดือน"); + + b.Property("StartDateSuspend") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"); + + b.Property("Status") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะออกคำสั่ง"); + + b.Property("Title") + .HasColumnType("NCLOB") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineReport_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)"); + + b.Property("CreatedDate") + .HasColumnType("TIMESTAMP(7)"); + + b.Property("Detail") + .IsRequired() + .HasColumnType("NCLOB"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("NVARCHAR2(255)"); + + b.Property("FileSize") + .HasColumnType("NUMBER(10)"); + + b.Property("FileType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("NVARCHAR2(128)"); + + b.Property("ObjectRefId") + .HasColumnType("RAW(16)"); + + b.HasKey("Id"); + + b.ToTable("Documents", t => + { + t.ExcludeFromMigrations(); + }); + }); + + 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") + .WithMany("DisciplineComplaint_Docs") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Profiles") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineDisciplinarys") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinaryExtends") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigateRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocOthers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRecordAccusers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocResult", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocResults") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocSummaryEvidences") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocWitnessess") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_ProfileComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineInvestigates") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateExtends") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateRelevant_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_DocComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_ProfileComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany() + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Navigation("DisciplineComplaint_Docs"); + + b.Navigation("DisciplineComplaint_Profiles"); + + 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"); + + b.Navigation("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Navigation("DisciplineDisciplinaryExtends"); + + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocComplaintInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocInvestigateRelevants"); + + b.Navigation("DisciplineDisciplinary_DocInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocOthers"); + + b.Navigation("DisciplineDisciplinary_DocRecordAccusers"); + + b.Navigation("DisciplineDisciplinary_DocRelevants"); + + b.Navigation("DisciplineDisciplinary_DocResults"); + + b.Navigation("DisciplineDisciplinary_DocSummaryEvidences"); + + b.Navigation("DisciplineDisciplinary_DocWitnessess"); + + b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Navigation("DisciplineDisciplinarys"); + + b.Navigation("DisciplineInvestigateExtends"); + + b.Navigation("DisciplineInvestigateRelevant_Docs"); + + b.Navigation("DisciplineInvestigate_Directors"); + + b.Navigation("DisciplineInvestigate_DocComplaints"); + + b.Navigation("DisciplineInvestigate_Docs"); + + b.Navigation("DisciplineInvestigate_ProfileComplaints"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20240503071644_Init Oracle Project.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20240503071644_Init Oracle Project.cs new file mode 100644 index 00000000..76999d89 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20240503071644_Init Oracle Project.cs @@ -0,0 +1,1273 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + /// + public partial class InitOracleProject : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "DisciplineComplaint_Appeals", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + Status = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "สถานะอุทธรณ์/ร้องทุกข์"), + Title = table.Column(type: "NCLOB", nullable: true, comment: "เรื่องที่อุทธรณ์/ร้องทุกข์"), + Description = table.Column(type: "NCLOB", nullable: true, comment: "รายละเอียดของเรื่องอุทธรณ์/ร้องทุกข์"), + Type = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ประเภทอุทธรณ์หรือร้องทุกข์"), + Year = table.Column(type: "NUMBER(10)", nullable: true, comment: "ปีงบประมาณ"), + CaseType = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ประเภทคดี"), + CaseNumber = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "คดีเลขที่"), + ProfileId = table.Column(type: "RAW(16)", nullable: false, comment: "ProfileId"), + CitizenId = table.Column(type: "NVARCHAR2(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน"), + Fullname = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ-นามสกุลผู้อุทธรณ์/ร้องทุกข์"), + Position = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ตำแหน่งผู้อุทธรณ์/ร้องทุกข์"), + Oc = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สังกัดผู้อุทธรณ์/ร้องทุกข์") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineComplaint_Appeals", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DisciplineComplaint_Channels", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + Name = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อประเภทการร้องเรียน") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineComplaint_Channels", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DisciplineComplaints", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + Status = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"), + RespondentType = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"), + Title = table.Column(type: "NCLOB", nullable: false, comment: "เรื่องที่ร้องเรียน"), + Description = table.Column(type: "NCLOB", nullable: true, comment: "รายละเอียดของเรื่องร้องเรียน"), + DateReceived = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"), + LevelConsideration = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"), + DateConsideration = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่กำหนดพิจารณา"), + OffenseDetails = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"), + DateNotification = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันแจ้งเตือนล่วงหน้า"), + ComplaintFrom = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"), + Appellant = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผู้ร้องเรียน"), + Result = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผลการตรวจสอบ"), + Organization = table.Column(type: "RAW(16)", nullable: true, comment: "กรณีหน่วยงานใส่ id ของหน่วยงาน"), + ConsideredAgency = table.Column(type: "RAW(16)", nullable: false, comment: "หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineComplaints", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDirectors", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + Prefix = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "คำนำหน้าชื่อ"), + FirstName = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ"), + LastName = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "นามสกุล"), + Position = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ตำแหน่ง"), + Email = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "อีเมล"), + Phone = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เบอร์โทรศัพท์"), + Qualification = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "คุณวุฒิ") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDirectors", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "DisciplineComplaint_Appeal_Docs", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineComplaint_AppealId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineComplaint_Appeal_Docs", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineComplaint_Appeal_Docs_DisciplineComplaint_Appeals_DisciplineComplaint_AppealId", + 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); + }); + + migrationBuilder.CreateTable( + name: "DisciplineComplaint_Appeal_Historys", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + Status = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "สถานะอุทธรณ์/ร้องทุกข์"), + DisciplineComplaint_AppealId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineComplaint_Appeal_Historys", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineComplaint_Appeal_Historys_DisciplineComplaint_Appeals_DisciplineComplaint_AppealId", + column: x => x.DisciplineComplaint_AppealId, + principalTable: "DisciplineComplaint_Appeals", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineComplaint_Docs", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineComplaintId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineComplaint_Docs", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineComplaint_Docs_DisciplineComplaints_DisciplineComplaintId", + column: x => x.DisciplineComplaintId, + principalTable: "DisciplineComplaints", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineComplaint_Docs_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineComplaint_Profiles", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + PersonId = table.Column(type: "RAW(16)", nullable: true, comment: "id อ้างอิง profile"), + CitizenId = table.Column(type: "NVARCHAR2(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน"), + Prefix = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "คำนำหน้า"), + FirstName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "ชื่อ"), + LastName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "นามสกุล"), + Organization = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สังกัด"), + Position = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ตำแหน่ง"), + PosNo = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เลขที่ตำแหน่ง"), + PositionLevel = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับ"), + Salary = table.Column(type: "BINARY_DOUBLE", nullable: true, comment: "เงินเดือน"), + IsAncestorDNA = table.Column(type: "NUMBER(1)", nullable: true, comment: "รายการเก่า"), + DisciplineComplaintId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineComplaint_Profiles", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineComplaint_Profiles_DisciplineComplaints_DisciplineComplaintId", + column: x => x.DisciplineComplaintId, + principalTable: "DisciplineComplaints", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineInvestigates", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + Status = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"), + RespondentType = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"), + Title = table.Column(type: "NCLOB", nullable: false, comment: "เรื่องที่ร้องเรียน"), + Description = table.Column(type: "NCLOB", nullable: true, comment: "รายละเอียดของเรื่องร้องเรียน"), + DateReceived = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"), + LevelConsideration = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"), + DateConsideration = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่กำหนดพิจารณา"), + OffenseDetails = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"), + DateNotification = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันแจ้งเตือนล่วงหน้า"), + ComplaintFrom = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"), + Appellant = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผู้ร้องเรียน"), + ResultComplaint = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผลการตรวจสอบเรื่องร้องเรียน"), + Result = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผลการตรวจสอบ"), + Organization = table.Column(type: "RAW(16)", nullable: true, comment: "กรณีหน่วยงานใส่ id ของหน่วยงาน"), + ConsideredAgency = table.Column(type: "RAW(16)", nullable: false, comment: "หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"), + InvestigationDetail = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)"), + InvestigationDetailOther = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ลักษณะการสืบสวนกรณีเลือกอื่นๆ"), + InvestigationDateStart = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่เริ่มการสืบสวน"), + InvestigationDateEnd = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่สิ้นสุดการสืบสวน"), + InvestigationDescription = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "รายละเอียดเกี่ยวกับการสืบสวน"), + InvestigationStatusResult = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล"), + InvestigationCauseText = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"), + InvestigationExtendStatus = table.Column(type: "NUMBER(1)", nullable: false, comment: "ขยายเวลา"), + InvestigationDaysExtend = table.Column(type: "NUMBER(10)", nullable: true, comment: "จำนวนวันที่ต้องการขยาย"), + DisciplineComplaintId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineInvestigates", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineInvestigates_DisciplineComplaints_DisciplineComplaintId", + column: x => x.DisciplineComplaintId, + principalTable: "DisciplineComplaints", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinarys", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + Status = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"), + RespondentType = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"), + Title = table.Column(type: "NCLOB", nullable: false, comment: "เรื่องที่ร้องเรียน"), + Description = table.Column(type: "NCLOB", nullable: true, comment: "รายละเอียดของเรื่องร้องเรียน"), + DateReceived = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"), + LevelConsideration = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"), + DateConsideration = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่กำหนดพิจารณา"), + OffenseDetails = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"), + DateNotification = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันแจ้งเตือนล่วงหน้า"), + ComplaintFrom = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"), + Appellant = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผู้ร้องเรียน"), + ResultComplaint = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผลการตรวจสอบเรื่องร้องเรียน"), + ResultInvestigate = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผลการตรวจสอบเรื่องสืบสวน"), + Result = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผลการตรวจสอบ"), + Organization = table.Column(type: "RAW(16)", nullable: true, comment: "กรณีหน่วยงานใส่ id ของหน่วยงาน"), + ConsideredAgency = table.Column(type: "RAW(16)", nullable: false, comment: "หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"), + InvestigationDetail = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)"), + InvestigationDetailOther = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ลักษณะการสืบสวนกรณีเลือกอื่นๆ"), + InvestigationDateStart = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่เริ่มการสืบสวน"), + InvestigationDateEnd = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่สิ้นสุดการสืบสวน"), + InvestigationDescription = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "รายละเอียดเกี่ยวกับการสืบสวน"), + InvestigationStatusResult = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล"), + InvestigationCauseText = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"), + InvestigationExtendStatus = table.Column(type: "NUMBER(1)", nullable: false, comment: "ขยายเวลา"), + InvestigationDaysExtend = table.Column(type: "NUMBER(10)", nullable: true, comment: "จำนวนวันที่ต้องการขยาย"), + DisciplinaryWitnesses = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "พยานและบันทึกถ้อยคำพยาน"), + DisciplinaryRecordAccuser = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "บันทึกถ้อยคำของผู้กล่าวหา"), + DisciplinarySummaryEvidence = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"), + DisciplinaryRefLaw = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "อ้างอิงมาตราตามกฎหมาย"), + DisciplinaryFaultLevel = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"), + DisciplinaryInvestigateAt = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สอบสวนที่"), + DisciplinaryCaseFault = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "กรณีความผิด"), + DisciplinaryDateEvident = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่สรุปพยานหลักฐาน"), + DisciplinaryDateAllegation = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่รับทราบข้อกล่าวหา"), + DisciplinaryDateStart = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่เริ่มการสอบสวน"), + DisciplinaryDateEnd = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่สิ้นสุดการสอบสวน"), + DisciplinaryDaysExtend = table.Column(type: "NUMBER(10)", nullable: true, comment: "จำนวนวันที่ขยาย"), + DisciplinaryExtendStatus = table.Column(type: "NUMBER(1)", nullable: false, comment: "ขยายเวลา"), + DisciplinaryDateInvestigation = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่มีคำสั่งให้สอบสวน"), + DisciplinaryDateResult = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่รายงานผลการสอบสวน"), + DisciplinaryStatusResult = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผลการสอบสวน ผล"), + DisciplinaryCauseText = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผลการสอบสวน กรณีมีมูล"), + DisciplinaryResult = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ผลการสอบสวน เหตุผล"), + ResultDescription = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สรุปผลการพิจารณา"), + ResultOc = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "หน่วยงาย/ส่วนราชการ"), + ResultDisciplineType = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ประเภทวินัย"), + ResultTitleType = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ประเภทของเรื่อง"), + ResultYear = table.Column(type: "NUMBER(10)", nullable: true, comment: "ปีงบประมาณ"), + DisciplinaryFaultLevelOther = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับโทษความผิดกรณีอื่นๆ"), + DisciplineInvestigateId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinarys", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinarys_DisciplineInvestigates_DisciplineInvestigateId", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineInvestigate_Directors", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DisciplineDirectorId = table.Column(type: "RAW(16)", nullable: false), + DisciplineInvestigateId = table.Column(type: "RAW(16)", nullable: false), + Duty = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "หน้าที่"), + CommandNo = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เลขที่คำสั่ง") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineInvestigate_Directors", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineInvestigate_Directors_DisciplineDirectors_DisciplineDirectorId", + column: x => x.DisciplineDirectorId, + principalTable: "DisciplineDirectors", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_DisciplineInvestigateId", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineInvestigate_DocComplaints", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineInvestigateId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineInvestigate_DocComplaints", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineInvestigate_DocComplaints_DisciplineInvestigates_DisciplineInvestigateId", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineInvestigate_DocComplaints_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineInvestigate_Docs", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineInvestigateId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineInvestigate_Docs", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineInvestigate_Docs_DisciplineInvestigates_DisciplineInvestigateId", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineInvestigate_Docs_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineInvestigate_ProfileComplaints", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + PersonId = table.Column(type: "RAW(16)", nullable: true, comment: "id อ้างอิง profile"), + CitizenId = table.Column(type: "NVARCHAR2(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน"), + Prefix = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "คำนำหน้า"), + FirstName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "ชื่อ"), + LastName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "นามสกุล"), + Organization = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สังกัด"), + Position = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ตำแหน่ง"), + PosNo = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เลขที่ตำแหน่ง"), + PositionLevel = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับ"), + Salary = table.Column(type: "BINARY_DOUBLE", nullable: true, comment: "เงินเดือน"), + IsReport = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ส่งไปยุติเรื่อง"), + IsDisciplinary = table.Column(type: "NUMBER(1)", nullable: true, comment: "ส่งไปสอบสวน"), + IsAncestorDNA = table.Column(type: "NUMBER(1)", nullable: true, comment: "รายการเก่า"), + DisciplineInvestigateId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineInvestigate_ProfileComplaints", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineInvestigates_DisciplineInvestigateId", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineInvestigateExtends", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + Name = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อการขยาย"), + Num = table.Column(type: "NUMBER(10)", nullable: false, comment: "ครั้งที่ขยาย"), + DaysExtend = table.Column(type: "NUMBER(10)", nullable: true, comment: "จำนวนวันที่การขยาย"), + DateStart = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่เริ่ม"), + DateEnd = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่สิ้นสุด"), + DisciplineInvestigateId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineInvestigateExtends", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineInvestigateExtends_DisciplineInvestigates_DisciplineInvestigateId", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineInvestigateRelevant_Docs", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineInvestigateId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineInvestigateRelevant_Docs", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineInvestigates_DisciplineInvestigateId", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineInvestigateRelevant_Docs_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DirectorInvestigates", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DisciplineDirectorId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false), + Duty = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "หน้าที่"), + CommandNo = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เลขที่คำสั่ง") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DirectorInvestigates", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDirectors_DisciplineDirectorId", + column: x => x.DisciplineDirectorId, + principalTable: "DisciplineDirectors", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocComplaintInvestigates", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocComplaintInvestigates", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocInvestigateRelevants", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocInvestigateRelevants", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocInvestigates", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocInvestigates", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigates_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocOthers", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocOthers", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocOthers_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocOthers_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocRecordAccusers", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocRecordAccusers", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocRecordAccusers_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocRecordAccusers_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocRelevants", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocRelevants", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocRelevants_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocRelevants_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocResults", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocResults", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocResults_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocResults_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocSummaryEvidences", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocSummaryEvidences", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocSummaryEvidences_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocSummaryEvidences_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocWitnessess", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + DocumentId = table.Column(type: "RAW(16)", nullable: false), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocWitnessess", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocWitnessess_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocWitnessess_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_ProfileComplaintInvestigates", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + PersonId = table.Column(type: "RAW(16)", nullable: true, comment: "id อ้างอิง profile"), + CitizenId = table.Column(type: "NVARCHAR2(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน"), + Prefix = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "คำนำหน้า"), + FirstName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "ชื่อ"), + LastName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "นามสกุล"), + Organization = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สังกัด"), + Position = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ตำแหน่ง"), + PosNo = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เลขที่ตำแหน่ง"), + PositionLevel = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับ"), + Salary = table.Column(type: "BINARY_DOUBLE", nullable: true, comment: "เงินเดือน"), + Status = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สถานะออกคำสั่ง"), + CommandTypeId = table.Column(type: "RAW(16)", nullable: true, comment: "ประเภทออกคำสั่ง"), + StatusDiscard = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สถานะออกคำสั่งงดโทด"), + CommandTypeDiscardId = table.Column(type: "RAW(16)", nullable: true, comment: "ประเภทออกคำสั่งงดโทด"), + IsReport = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ส่งไปยุติเรื่อง"), + IsSuspend = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ส่งไปพักราชการ"), + IsAncestorDNA = table.Column(type: "NUMBER(1)", nullable: true, comment: "รายการเก่า"), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_ProfileComplaintInvestigates", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinaryExtends", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + Name = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อการขยาย"), + Num = table.Column(type: "NUMBER(10)", nullable: false, comment: "ครั้งที่ขยาย"), + DaysExtend = table.Column(type: "NUMBER(10)", nullable: true, comment: "จำนวนวันที่การขยาย"), + DateStart = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่เริ่ม"), + DateEnd = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่สิ้นสุด"), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinaryExtends", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinaryExtends_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DisciplineReport_Profiles", + columns: table => new + { + Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"), + CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"), + LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"), + CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), + LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), + PersonId = table.Column(type: "RAW(16)", nullable: true, comment: "id อ้างอิง profile"), + CitizenId = table.Column(type: "NVARCHAR2(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน"), + Prefix = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "คำนำหน้า"), + FirstName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "ชื่อ"), + LastName = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "นามสกุล"), + Organization = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สังกัด"), + Position = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ตำแหน่ง"), + PosNo = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เลขที่ตำแหน่ง"), + PositionLevel = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับ"), + Salary = table.Column(type: "BINARY_DOUBLE", nullable: true, comment: "เงินเดือน"), + Status = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สถานะออกคำสั่ง"), + CommandTypeId = table.Column(type: "RAW(16)", nullable: true, comment: "ประเภทออกคำสั่ง"), + DescriptionSuspend = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เหตุที่ถูกสั่งพักราชการ/ออกจากราชการไว้ก่อน"), + StartDateSuspend = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่สั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"), + EndDateSuspend = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"), + Title = table.Column(type: "NCLOB", nullable: true, comment: "เรื่องที่ร้องเรียน"), + OffenseDetails = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"), + DisciplinaryFaultLevel = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"), + DisciplinaryCaseFault = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "กรณีความผิด"), + DisciplineDisciplinaryId = table.Column(type: "RAW(16)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineReport_Profiles", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineReport_Profiles_DisciplineDisciplinarys_DisciplineDisciplinaryId", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + 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_AppealId", + table: "DisciplineComplaint_Appeal_Historys", + column: "DisciplineComplaint_AppealId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineComplaint_Docs_DisciplineComplaintId", + table: "DisciplineComplaint_Docs", + column: "DisciplineComplaintId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineComplaint_Docs_DocumentId", + table: "DisciplineComplaint_Docs", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineComplaint_Profiles_DisciplineComplaintId", + table: "DisciplineComplaint_Profiles", + column: "DisciplineComplaintId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDirectorId", + table: "DisciplineDisciplinary_DirectorInvestigates", + column: "DisciplineDirectorId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DirectorInvestigates", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DocumentId", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DocumentId", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocInvestigates", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocInvestigates_DocumentId", + table: "DisciplineDisciplinary_DocInvestigates", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocOthers_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocOthers", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocOthers_DocumentId", + table: "DisciplineDisciplinary_DocOthers", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocRecordAccusers_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocRecordAccusers", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocRecordAccusers_DocumentId", + table: "DisciplineDisciplinary_DocRecordAccusers", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocRelevants_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocRelevants", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocRelevants_DocumentId", + table: "DisciplineDisciplinary_DocRelevants", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocResults_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocResults", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocResults_DocumentId", + table: "DisciplineDisciplinary_DocResults", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocSummaryEvidences_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocSummaryEvidences", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocSummaryEvidences_DocumentId", + table: "DisciplineDisciplinary_DocSummaryEvidences", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocWitnessess_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocWitnessess", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocWitnessess_DocumentId", + table: "DisciplineDisciplinary_DocWitnessess", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_ProfileComplaintInvestigates_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinaryExtends_DisciplineDisciplinaryId", + table: "DisciplineDisciplinaryExtends", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinarys_DisciplineInvestigateId", + table: "DisciplineDisciplinarys", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_Directors_DisciplineDirectorId", + table: "DisciplineInvestigate_Directors", + column: "DisciplineDirectorId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_Directors_DisciplineInvestigateId", + table: "DisciplineInvestigate_Directors", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_DocComplaints_DisciplineInvestigateId", + table: "DisciplineInvestigate_DocComplaints", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_DocComplaints_DocumentId", + table: "DisciplineInvestigate_DocComplaints", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_Docs_DisciplineInvestigateId", + table: "DisciplineInvestigate_Docs", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_Docs_DocumentId", + table: "DisciplineInvestigate_Docs", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineInvestigateId", + table: "DisciplineInvestigate_ProfileComplaints", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigateExtends_DisciplineInvestigateId", + table: "DisciplineInvestigateExtends", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineInvestigateId", + table: "DisciplineInvestigateRelevant_Docs", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigateRelevant_Docs_DocumentId", + table: "DisciplineInvestigateRelevant_Docs", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigates_DisciplineComplaintId", + table: "DisciplineInvestigates", + column: "DisciplineComplaintId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineReport_Profiles_DisciplineDisciplinaryId", + table: "DisciplineReport_Profiles", + column: "DisciplineDisciplinaryId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "DisciplineComplaint_Appeal_Docs"); + + migrationBuilder.DropTable( + name: "DisciplineComplaint_Appeal_Historys"); + + migrationBuilder.DropTable( + name: "DisciplineComplaint_Channels"); + + migrationBuilder.DropTable( + name: "DisciplineComplaint_Docs"); + + migrationBuilder.DropTable( + name: "DisciplineComplaint_Profiles"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DirectorInvestigates"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocComplaintInvestigates"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocInvestigateRelevants"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocInvestigates"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocOthers"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocRecordAccusers"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocRelevants"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocResults"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocSummaryEvidences"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocWitnessess"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_ProfileComplaintInvestigates"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinaryExtends"); + + migrationBuilder.DropTable( + name: "DisciplineInvestigate_Directors"); + + migrationBuilder.DropTable( + name: "DisciplineInvestigate_DocComplaints"); + + migrationBuilder.DropTable( + name: "DisciplineInvestigate_Docs"); + + migrationBuilder.DropTable( + name: "DisciplineInvestigate_ProfileComplaints"); + + migrationBuilder.DropTable( + name: "DisciplineInvestigateExtends"); + + migrationBuilder.DropTable( + name: "DisciplineInvestigateRelevant_Docs"); + + migrationBuilder.DropTable( + name: "DisciplineReport_Profiles"); + + migrationBuilder.DropTable( + name: "DisciplineComplaint_Appeals"); + + migrationBuilder.DropTable( + name: "DisciplineDirectors"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinarys"); + + migrationBuilder.DropTable( + name: "DisciplineInvestigates"); + + migrationBuilder.DropTable( + name: "DisciplineComplaints"); + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs new file mode 100644 index 00000000..40cdaa4b --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs @@ -0,0 +1,3013 @@ +// +using System; +using BMA.EHR.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Oracle.EntityFrameworkCore.Metadata; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + [DbContext(typeof(DisciplineDbContext))] + partial class DisciplineDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("RAW(16)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .HasColumnType("NCLOB") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("RAW(16)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("NCLOB") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CaseNumber") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คดีเลขที่"); + + b.Property("CaseType") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ประเภทคดี"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .HasColumnType("NCLOB") + .HasComment("รายละเอียดของเรื่องอุทธรณ์/ร้องทุกข์"); + + b.Property("Fullname") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อ-นามสกุลผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Oc") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัดผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่งผู้อุทธรณ์/ร้องทุกข์"); + + b.Property("ProfileId") + .HasColumnType("RAW(16)") + .HasComment("ProfileId"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะอุทธรณ์/ร้องทุกข์"); + + b.Property("Title") + .HasColumnType("NCLOB") + .HasComment("เรื่องที่อุทธรณ์/ร้องทุกข์"); + + b.Property("Type") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ประเภทอุทธรณ์หรือร้องทุกข์"); + + b.Property("Year") + .HasColumnType("NUMBER(10)") + .HasComment("ปีงบประมาณ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Appeals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaint_AppealId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaint_AppealId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อประเภทการร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Channels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("RAW(16)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("ชื่อ"); + + b.Property("IsAncestorDNA") + .HasColumnType("NUMBER(1)") + .HasComment("รายการเก่า"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("RAW(16)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("BINARY_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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Email") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("อีเมล"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Phone") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เบอร์โทรศัพท์"); + + b.Property("Position") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("Prefix") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้าชื่อ"); + + b.Property("Qualification") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คุณวุฒิ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineDirectors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("RAW(16)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .HasColumnType("NCLOB") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplinaryCaseFault") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("กรณีความผิด"); + + b.Property("DisciplinaryCauseText") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการสอบสวน กรณีมีมูล"); + + b.Property("DisciplinaryDateAllegation") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รับทราบข้อกล่าวหา"); + + b.Property("DisciplinaryDateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุดการสอบสวน"); + + b.Property("DisciplinaryDateEvident") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สรุปพยานหลักฐาน"); + + b.Property("DisciplinaryDateInvestigation") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่มีคำสั่งให้สอบสวน"); + + b.Property("DisciplinaryDateResult") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รายงานผลการสอบสวน"); + + b.Property("DisciplinaryDateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่มการสอบสวน"); + + b.Property("DisciplinaryDaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่ขยาย"); + + b.Property("DisciplinaryExtendStatus") + .HasColumnType("NUMBER(1)") + .HasComment("ขยายเวลา"); + + b.Property("DisciplinaryFaultLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"); + + b.Property("DisciplinaryFaultLevelOther") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับโทษความผิดกรณีอื่นๆ"); + + b.Property("DisciplinaryInvestigateAt") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สอบสวนที่"); + + b.Property("DisciplinaryRecordAccuser") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("บันทึกถ้อยคำของผู้กล่าวหา"); + + b.Property("DisciplinaryRefLaw") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("อ้างอิงมาตราตามกฎหมาย"); + + b.Property("DisciplinaryResult") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการสอบสวน เหตุผล"); + + b.Property("DisciplinaryStatusResult") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการสอบสวน ผล"); + + b.Property("DisciplinarySummaryEvidence") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"); + + b.Property("DisciplinaryWitnesses") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("พยานและบันทึกถ้อยคำพยาน"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("InvestigationCauseText") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่ต้องการขยาย"); + + b.Property("InvestigationDescription") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationExtendStatus") + .HasColumnType("NUMBER(1)") + .HasComment("ขยายเวลา"); + + b.Property("InvestigationStatusResult") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("RAW(16)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("ResultDescription") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สรุปผลการพิจารณา"); + + b.Property("ResultDisciplineType") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ประเภทวินัย"); + + b.Property("ResultInvestigate") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบเรื่องสืบสวน"); + + b.Property("ResultOc") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("หน่วยงาย/ส่วนราชการ"); + + b.Property("ResultTitleType") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ประเภทของเรื่อง"); + + b.Property("ResultYear") + .HasColumnType("NUMBER(10)") + .HasComment("ปีงบประมาณ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("NCLOB") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineDisciplinarys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่ม"); + + b.Property("DaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่การขยาย"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อการขยาย"); + + b.Property("Num") + .HasColumnType("NUMBER(10)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CommandNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่คำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDirectorId") + .HasColumnType("RAW(16)"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("Duty") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("หน้าที่"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocResult", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocResults"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CommandTypeDiscardId") + .HasColumnType("RAW(16)") + .HasComment("ประเภทออกคำสั่งงดโทด"); + + b.Property("CommandTypeId") + .HasColumnType("RAW(16)") + .HasComment("ประเภทออกคำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("ชื่อ"); + + b.Property("IsAncestorDNA") + .HasColumnType("NUMBER(1)") + .HasComment("รายการเก่า"); + + b.Property("IsReport") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ส่งไปยุติเรื่อง"); + + b.Property("IsSuspend") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ส่งไปพักราชการ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("RAW(16)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("BINARY_DOUBLE") + .HasComment("เงินเดือน"); + + b.Property("Status") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะออกคำสั่ง"); + + b.Property("StatusDiscard") + .HasColumnType("NVARCHAR2(2000)") + .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("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("RAW(16)") + .HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateConsideration") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .HasColumnType("NCLOB") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplineComplaintId") + .HasColumnType("RAW(16)"); + + b.Property("InvestigationCauseText") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่ต้องการขยาย"); + + b.Property("InvestigationDescription") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationExtendStatus") + .HasColumnType("NUMBER(1)") + .HasComment("ขยายเวลา"); + + b.Property("InvestigationStatusResult") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LevelConsideration") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("RAW(16)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("NCLOB") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateEnd") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่เริ่ม"); + + b.Property("DaysExtend") + .HasColumnType("NUMBER(10)") + .HasComment("จำนวนวันที่การขยาย"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ชื่อการขยาย"); + + b.Property("Num") + .HasColumnType("NUMBER(10)") + .HasComment("ครั้งที่ขยาย"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigateExtends"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigateRelevant_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CommandNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่คำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDirectorId") + .HasColumnType("RAW(16)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("Duty") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("หน้าที่"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("DocumentId") + .HasColumnType("RAW(16)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_DocComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("RAW(16)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("ชื่อ"); + + b.Property("IsAncestorDNA") + .HasColumnType("NUMBER(1)") + .HasComment("รายการเก่า"); + + b.Property("IsDisciplinary") + .HasColumnType("NUMBER(1)") + .HasComment("ส่งไปสอบสวน"); + + b.Property("IsReport") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ส่งไปยุติเรื่อง"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Organization") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("RAW(16)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("BINARY_DOUBLE") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("NVARCHAR2(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CommandTypeId") + .HasColumnType("RAW(16)") + .HasComment("ประเภทออกคำสั่ง"); + + b.Property("CreatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DescriptionSuspend") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เหตุที่ถูกสั่งพักราชการ/ออกจากราชการไว้ก่อน"); + + b.Property("DisciplinaryCaseFault") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("กรณีความผิด"); + + b.Property("DisciplinaryFaultLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("RAW(16)"); + + b.Property("EndDateSuspend") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("NVARCHAR2(100)") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("NVARCHAR2(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("NVARCHAR2(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("TIMESTAMP(7)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("OffenseDetails") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("RAW(16)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("BINARY_DOUBLE") + .HasComment("เงินเดือน"); + + b.Property("StartDateSuspend") + .HasColumnType("TIMESTAMP(7)") + .HasComment("วันที่สั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"); + + b.Property("Status") + .HasColumnType("NVARCHAR2(2000)") + .HasComment("สถานะออกคำสั่ง"); + + b.Property("Title") + .HasColumnType("NCLOB") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineReport_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("RAW(16)"); + + b.Property("CreatedDate") + .HasColumnType("TIMESTAMP(7)"); + + b.Property("Detail") + .IsRequired() + .HasColumnType("NCLOB"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("NVARCHAR2(255)"); + + b.Property("FileSize") + .HasColumnType("NUMBER(10)"); + + b.Property("FileType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("NVARCHAR2(128)"); + + b.Property("ObjectRefId") + .HasColumnType("RAW(16)"); + + b.HasKey("Id"); + + b.ToTable("Documents", t => + { + t.ExcludeFromMigrations(); + }); + }); + + 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") + .WithMany("DisciplineComplaint_Docs") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Profiles") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineDisciplinarys") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinaryExtends") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigateRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocOthers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRecordAccusers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocResult", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocResults") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocSummaryEvidences") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocWitnessess") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_ProfileComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineInvestigates") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateExtends") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateRelevant_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_DocComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_ProfileComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany() + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Navigation("DisciplineComplaint_Docs"); + + b.Navigation("DisciplineComplaint_Profiles"); + + 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"); + + b.Navigation("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Navigation("DisciplineDisciplinaryExtends"); + + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocComplaintInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocInvestigateRelevants"); + + b.Navigation("DisciplineDisciplinary_DocInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocOthers"); + + b.Navigation("DisciplineDisciplinary_DocRecordAccusers"); + + b.Navigation("DisciplineDisciplinary_DocRelevants"); + + b.Navigation("DisciplineDisciplinary_DocResults"); + + b.Navigation("DisciplineDisciplinary_DocSummaryEvidences"); + + b.Navigation("DisciplineDisciplinary_DocWitnessess"); + + b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Navigation("DisciplineDisciplinarys"); + + b.Navigation("DisciplineInvestigateExtends"); + + b.Navigation("DisciplineInvestigateRelevant_Docs"); + + b.Navigation("DisciplineInvestigate_Directors"); + + b.Navigation("DisciplineInvestigate_DocComplaints"); + + b.Navigation("DisciplineInvestigate_Docs"); + + b.Navigation("DisciplineInvestigate_ProfileComplaints"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs b/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs index bd255aa5..1702b551 100644 --- a/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs +++ b/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs @@ -45,112 +45,18 @@ namespace BMA.EHR.Infrastructure.Persistence #endregion - // #region " Meta Data " - - // public DbSet Prefixes { get; set; } - - // public DbSet BloodGroups { get; set; } - - // public DbSet Genders { get; set; } - - // public DbSet PhysicalStatuses { get; set; } - - // public DbSet Religions { get; set; } - - // public DbSet EducationLevels { get; set; } - - // public DbSet PositionPaths { get; set; } - - // public DbSet PositionTypes { get; set; } - - // public DbSet PositionEmployeePositions { get; set; } - - // public DbSet PositionEmployeePositionSides { get; set; } - - // public DbSet PositionEmployeeGroups { get; set; } - - // public DbSet PositionEmployeeLines { get; set; } - - // public DbSet PositionEmployeeLevels { get; set; } - - // public DbSet PositionEmployeeStatuses { get; set; } - - // public DbSet PositionLines { get; set; } - - // public DbSet PositionExecutives { get; set; } - - // public DbSet PositionStatuss { get; set; } - - // public DbSet PositionLevels { get; set; } - - // public DbSet Relationships { get; set; } - - // public DbSet Positions { get; set; } - - // public DbSet PositionPathSides { get; set; } - - // public DbSet PositionExecutiveSides { get; set; } - - // public DbSet InsigniaTypes { get; set; } - - // public DbSet Insignias { get; set; } - - // public DbSet Provinces { get; set; } - - // public DbSet Districts { get; set; } - - // public DbSet SubDistricts { get; set; } - - // public DbSet Holidays { get; set; } - - // public DbSet OrganizationTypes { get; set; } - - // public DbSet OrganizationLevels { get; set; } - - // public DbSet OrganizationOrganizations { get; set; } - - // public DbSet OrganizationShortNames { get; set; } - - // public DbSet OrganizationStatuses { get; set; } - - // public DbSet OrganizationAgencys { get; set; } - - // public DbSet OrganizationGovernmentAgencys { get; set; } - - // public DbSet OrganizationTelExternals { get; set; } - - // public DbSet OrganizationTelInternals { get; set; } - - // public DbSet OrganizationFaxs { get; set; } - - // public DbSet RoyalHierarchys { get; set; } - - // public DbSet RoyalTypes { get; set; } - - // public DbSet Royals { get; set; } - - // #endregion - - // #region " Organizations " - - // public DbSet AvailablePositionLevels { get; set; } - - // public DbSet PositionMasters { get; set; } - - // public DbSet Organizations { get; set; } - - // public DbSet PositionNumbers { get; set; } - - // public DbSet OrganizationPositions { get; set; } - - // public DbSet ProfilePositions { get; set; } - - // #endregion - public DisciplineDbContext(DbContextOptions options) : base(options) { } + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + // Document + modelBuilder.Entity().Metadata.SetIsTableExcludedFromMigrations(true); + } + public Task SaveChangesAsync() { return base.SaveChangesAsync();