diff --git a/BMA.EHR.API.Command/BMA.EHR.API.Command.csproj b/BMA.EHR.API.Command/BMA.EHR.API.Command.csproj
index 218c5f05..4510e069 100644
--- a/BMA.EHR.API.Command/BMA.EHR.API.Command.csproj
+++ b/BMA.EHR.API.Command/BMA.EHR.API.Command.csproj
@@ -7,9 +7,15 @@
+
+
+
+
+
+
diff --git a/BMA.EHR.API.Command/FileDownloadResponse.cs b/BMA.EHR.API.Command/FileDownloadResponse.cs
new file mode 100644
index 00000000..653309fb
--- /dev/null
+++ b/BMA.EHR.API.Command/FileDownloadResponse.cs
@@ -0,0 +1,11 @@
+namespace BMA.EHR.API.Command
+{
+ public class FileDownloadResponse
+ {
+ public string FileName { get; set; } = string.Empty;
+
+ public string FileType { get; set; } = string.Empty;
+
+ public byte[] FileContent { get; set; }
+ }
+}
diff --git a/BMA.EHR.API.Command/MinIOService.cs b/BMA.EHR.API.Command/MinIOService.cs
deleted file mode 100644
index 34e8b61a..00000000
--- a/BMA.EHR.API.Command/MinIOService.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-using BMA.EHR.Infrastructure.Persistence;
-using Microsoft.EntityFrameworkCore;
-using System.Net.Http.Headers;
-
-namespace BMA.EHR.API.Command
-{
- public class MinIOService
- {
- // #region " Fields "
-
- // private readonly ApplicationDBContext _context;
- // private readonly IConfiguration _configuration;
- // private readonly IWebHostEnvironment _webHostEnvironment;
- // private readonly AmazonS3Client _s3Client;
- // private string _bucketName = string.Empty;
-
- // #endregion
-
- // #region " Constructors "
-
- // public MinIOService(ApplicationDBContext context,
- // IConfiguration configuration,
- // IWebHostEnvironment webHostEnvironment)
- // {
- // _context = context;
- // _configuration = configuration;
- // _webHostEnvironment = webHostEnvironment;
-
- // var config = new AmazonS3Config
- // {
- // ServiceURL = _configuration["MinIO:Endpoint"],
- // ForcePathStyle = true
- // };
-
- // _s3Client = new AmazonS3Client(_configuration["MinIO:AccessKey"], _configuration["MinIO:SecretKey"], config);
- // this._bucketName = _configuration["MinIO:BucketName"] ?? "bma-recruit";
- // }
-
- // #endregion
-
- // #region " Methods "
-
- // public async Task UploadFileAsync(IFormFile file, string newFileName = "")
- // {
- // var fileName = "";
- // var fileExt = Path.GetExtension(file.FileName);
- // if (newFileName != "")
- // fileName = $"{newFileName}";
- // else
- // fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.Trim('"');
-
-
- // var tmpDir = Path.Combine(_webHostEnvironment.ContentRootPath, "tmp");
- // if (!Directory.Exists(tmpDir))
- // Directory.CreateDirectory(tmpDir);
-
- // var tmpFile = Path.Combine(tmpDir, $"tmp_{DateTime.Now.ToString("ddMMyyyyHHmmss")}{fileExt}");
-
- // try
- // {
- // using (var ms = new MemoryStream())
- // {
- // var id = Guid.NewGuid();
- // file.CopyTo(ms);
- // var fileBytes = ms.ToArray();
- // System.IO.MemoryStream filestream = new System.IO.MemoryStream(fileBytes);
-
- // var request = new PutObjectRequest
- // {
- // BucketName = _bucketName,
- // Key = id.ToString("D"),
- // InputStream = filestream,
- // ContentType = file.ContentType,
- // CannedACL = S3CannedACL.PublicRead
- // };
-
- // await _s3Client.PutObjectAsync(request);
-
- // // create document object
- // var doc = new Document()
- // {
- // FileName = fileName,
- // FileType = file.ContentType,
- // FileSize = Convert.ToInt32(file.Length),
- // ObjectRefId = id,
- // CreatedDate = DateTime.Now
- // };
-
- // await _context.Documents.AddAsync(doc);
- // await _context.SaveChangesAsync();
-
- // return doc;
- // }
- // }
- // catch
- // {
- // throw;
- // }
- // finally
- // {
- // File.Delete(tmpFile);
- // }
- // }
-
- // public async Task DownloadFileAsync(Guid fileId)
- // {
- // try
- // {
- // var doc = await _context.Documents.AsQueryable()
- // .FirstOrDefaultAsync(x => x.Id == fileId);
-
- // if (doc == null)
- // throw new Exception(GlobalMessages.FileNotFoundOnServer);
-
- // using (var memoryStream = new MemoryStream())
- // {
- // GetObjectRequest request = new GetObjectRequest
- // {
- // BucketName = _bucketName,
- // Key = doc.ObjectRefId.ToString("D")
- // };
-
- // using (GetObjectResponse response = await _s3Client.GetObjectAsync(request))
- // {
- // using (Stream responseStream = response.ResponseStream)
- // {
- // responseStream.CopyTo(memoryStream);
- // }
- // }
-
- // var fileContent = memoryStream.ToArray();
-
- // return new FileDownloadResponse
- // {
- // FileName = doc.FileName,
- // FileType = doc.FileType,
- // FileContent = fileContent
- // };
- // };
- // }
- // catch
- // {
- // throw;
- // }
- // }
-
- // public async Task DeleteFileAsync(Guid fileId)
- // {
- // try
- // {
- // var doc = await _context.Documents.AsQueryable()
- // .FirstOrDefaultAsync(x => x.Id == fileId);
-
- // if (doc == null)
- // throw new Exception(GlobalMessages.FileNotFoundOnServer);
- // else
- // {
- // DeleteObjectRequest request = new DeleteObjectRequest
- // {
- // BucketName = _bucketName,
- // Key = doc?.ObjectRefId.ToString("D")
- // };
-
- // // delete from minio
- // await _s3Client.DeleteObjectAsync(request);
-
-
- // _context.Documents.Remove(doc);
- // await _context.SaveChangesAsync();
- // }
- // }
- // catch
- // {
- // throw;
- // }
- // }
-
- // public async Task ImagesPath(Guid fileId)
- // {
- // if (fileId == null)
- // return "";
-
- // var doc = await _context.Documents.AsQueryable()
- // .FirstOrDefaultAsync(x => x.Id == fileId);
-
- // if (doc == null)
- // throw new Exception(GlobalMessages.FileNotFoundOnServer);
- // var config = new AmazonS3Config
- // {
- // ServiceURL = _configuration.GetValue("MinIO:Endpoint"),
- // ForcePathStyle = true
- // };
-
- // DateTime expires = DateTime.UtcNow.AddHours(6);
- // GetPreSignedUrlRequest request = new GetPreSignedUrlRequest
- // {
- // BucketName = _bucketName,
- // Key = doc?.ObjectRefId.ToString("D"),
- // Expires = expires,
- // };
- // string path = _s3Client.GetPreSignedURL(request);
-
- // return path;
- // }
-
- // #endregion
- }
-}
\ No newline at end of file
diff --git a/BMA.EHR.Application/BMA.EHR.Application.csproj b/BMA.EHR.Application/BMA.EHR.Application.csproj
index b40d14e1..5bf43f93 100644
--- a/BMA.EHR.Application/BMA.EHR.Application.csproj
+++ b/BMA.EHR.Application/BMA.EHR.Application.csproj
@@ -7,6 +7,7 @@
+
diff --git a/BMA.EHR.Application/Repositories/FileDownloadResponse.cs b/BMA.EHR.Application/Repositories/FileDownloadResponse.cs
new file mode 100644
index 00000000..8f863717
--- /dev/null
+++ b/BMA.EHR.Application/Repositories/FileDownloadResponse.cs
@@ -0,0 +1,11 @@
+namespace BMA.EHR.Application.Repositories
+{
+ public class FileDownloadResponse
+ {
+ public string FileName { get; set; } = string.Empty;
+
+ public string FileType { get; set; } = string.Empty;
+
+ public byte[] FileContent { get; set; }
+ }
+}
diff --git a/BMA.EHR.Domain/Models/Organizations/AvailablePositionLevelEntity.cs b/BMA.EHR.Domain/Models/Organizations/AvailablePositionLevelEntity.cs
index 55fc0d87..ac61754c 100644
--- a/BMA.EHR.Domain/Models/Organizations/AvailablePositionLevelEntity.cs
+++ b/BMA.EHR.Domain/Models/Organizations/AvailablePositionLevelEntity.cs
@@ -1,4 +1,5 @@
using BMA.EHR.Domain.Models.Base;
+using BMA.EHR.Domain.Models.MetaData;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -8,17 +9,13 @@ namespace BMA.EHR.Domain.Models.Organizations
public class AvailablePositionLevelEntity : EntityBase
{
- [ForeignKey("PositionMasterId")]
- public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; }
+ // [ForeignKey("PositionMasterId")]
+ // public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; }
[Column(Order = 2), Comment("PositionMasterId")]
- public Guid? PositionMasterId { get; set; }
+ public PositionMasterEntity? PositionMaster { get; set; }
[Column(Order = 3), Comment("PositionLevelId")]
- public Guid? PositionLevelId { get; set; }
-
-
-
-
+ public PositionLevel? PositionLevel { get; set; }
}
}
diff --git a/BMA.EHR.Domain/Models/Organizations/OrganizationEntity.cs b/BMA.EHR.Domain/Models/Organizations/OrganizationEntity.cs
index e1cb0e05..21fb8e24 100644
--- a/BMA.EHR.Domain/Models/Organizations/OrganizationEntity.cs
+++ b/BMA.EHR.Domain/Models/Organizations/OrganizationEntity.cs
@@ -2,65 +2,44 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using BMA.EHR.Domain.Models.Base;
+using BMA.EHR.Domain.Models.MetaData;
namespace BMA.EHR.Domain.Models.Organizations
{
public class OrganizationEntity : EntityBase
{
-
- //[ForeignKey("OrganizationOrganizationId")]
- //public OrganizationOrganization? OrganizationOrganization_OrganizationOrganizationId { get; set; }
-
[Column(Order = 2), Comment("OrganizationOrganizationId")]
- public Guid? OrganizationOrganizationId { get; set; }
-
- //[ForeignKey("OrganizationShortNameId")]
- //public OrganizationShortName? OrganizationShortName_OrganizationShortNameId { get; set; }
+ public OrganizationOrganization? OrganizationOrganization { get; set; }
[Column(Order = 3), Comment("OrganizationShortNameId")]
- public Guid? OrganizationShortNameId { get; set; }
-
- //[ForeignKey("OrganizationTypeId")]
- //public OrganizationType? OrganizationType_OrganizationTypeId { get; set; }
+ public OrganizationShortName? OrganizationShortName { get; set; }
[Column(Order = 4), Comment("OrganizationTypeId")]
- public Guid? OrganizationTypeId { get; set; }
-
- //[ForeignKey("OrganizationLevelId")]
- //public OrganizationLevel? OrganizationLevel_OrganizationLevelId { get; set; }
+ public OrganizationType? OrganizationType { get; set; }
[Column(Order = 5), Comment("OrganizationLevelId")]
- public Guid? OrganizationLevelId { get; set; }
-
- //[ForeignKey("OrganizationTelExternalId")]
- //public OrganizationTelExternal? OrganizationTelExternal_OrganizationTelExternalId { get; set; }
+ public OrganizationLevel? OrganizationLevel { get; set; }
[Column(Order = 6), Comment("OrganizationTelExternalId")]
- public Guid? OrganizationTelExternalId { get; set; }
-
- //[ForeignKey("OrganizationTelInternalId")]
- //public OrganizationTelInternal? OrganizationTelInternal_OrganizationTelInternalId { get; set; }
+ public OrganizationTelExternal? OrganizationTelExternal { get; set; }
[Column(Order = 7), Comment("OrganizationTelInternalId")]
- public Guid? OrganizationTelInternalId { get; set; }
-
- //[ForeignKey("OrganizationFaxId")]
- //public OrganizationFax? OrganizationFax_OrganizationFaxId { get; set; }
+ public OrganizationTelInternal? OrganizationTelInternal { get; set; }
[Column(Order = 8), Comment("OrganizationFaxId")]
- public Guid? OrganizationFaxId { get; set; }
+ public OrganizationFax? OrganizationFax { get; set; }
- [ForeignKey("ParentId")]
- public OrganizationEntity? Organization_ParentId { get; set; }
+ // [ForeignKey("ParentId")]
+ // public OrganizationEntity? Organization_ParentId { get; set; }
[Column(Order = 9), Comment("ParentId")]
- public Guid? ParentId { get; set; }
+ public OrganizationEntity? Parent { get; set; }
- [Column(Order = 10), Comment("OrganizationAgencyId")]
- public Guid? OrganizationAgencyId { get; set; }
+ // [Column(Order = 10), Comment("OrganizationAgencyId")]
+ // public OrganizationAgency? OrganizationAgency { get; set; }
- [Column(Order = 11), Comment("OrganizationGovernmentAgencyId")]
- public Guid? OrganizationGovernmentAgencyId { get; set; }
+ // [Column(Order = 11), Comment("OrganizationGovernmentAgencyId")]
+ // public OrganizationGovernmentAgency? OrganizationGovernmentAgency { get; set; }
[Column(Order = 12), Comment("OrganizationOrder")]
public int? OrganizationOrder { get; set; }
@@ -80,7 +59,7 @@ namespace BMA.EHR.Domain.Models.Organizations
[Column(Order = 17), Comment("กอง")]
public string? Pile { get; set; }
- public Guid? OrganizationStatusId { get; set; }
+ public OrganizationStatus? OrganizationStatus { get; set; }
public List Organizations { get; } = new();
diff --git a/BMA.EHR.Domain/Models/Organizations/OrganizationPositionEntity.cs b/BMA.EHR.Domain/Models/Organizations/OrganizationPositionEntity.cs
index 76aebdd5..7c379003 100644
--- a/BMA.EHR.Domain/Models/Organizations/OrganizationPositionEntity.cs
+++ b/BMA.EHR.Domain/Models/Organizations/OrganizationPositionEntity.cs
@@ -8,11 +8,11 @@ namespace BMA.EHR.Domain.Models.Organizations
public class OrganizationPositionEntity : EntityBase
{
- [ForeignKey("PositionMasterId")]
- public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; }
+ // [ForeignKey("PositionMasterId")]
+ // public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; }
[Column(Order = 2), Comment("Position Master")]
- public Guid? PositionMasterId { get; set; }
+ public PositionMasterEntity? PositionMaster { get; set; }
[Column(Order = 3), Comment("Is Director")]
public bool? IsDirector { get; set; }
@@ -20,14 +20,14 @@ namespace BMA.EHR.Domain.Models.Organizations
[Column(Order = 4), Comment("positionUserNote")]
public string? PositionUserNote { get; set; }
- [ForeignKey("OrganizationId")]
- public OrganizationEntity? Organization_OrganizationId { get; set; }
+ // [ForeignKey("OrganizationId")]
+ // public OrganizationEntity? Organization_OrganizationId { get; set; }
[Column(Order = 5), Comment("OrganizationId")]
- public Guid? OrganizationId { get; set; }
+ public OrganizationEntity? Organization { get; set; }
[Column(Order = 6), Comment("PositionNumberId")]
- public Guid? PositionNumberId { get; set; }
+ public PositionNumberEntity? PositionNumber { get; set; }
}
}
diff --git a/BMA.EHR.Domain/Models/Organizations/PositionMasterEntity.cs b/BMA.EHR.Domain/Models/Organizations/PositionMasterEntity.cs
index 1cd6dfd8..a9d1f2c5 100644
--- a/BMA.EHR.Domain/Models/Organizations/PositionMasterEntity.cs
+++ b/BMA.EHR.Domain/Models/Organizations/PositionMasterEntity.cs
@@ -2,63 +2,39 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using BMA.EHR.Domain.Models.Base;
+using BMA.EHR.Domain.Models.MetaData;
namespace BMA.EHR.Domain.Models.Organizations
{
public class PositionMasterEntity : EntityBase
{
-
- //[ForeignKey("PositionId")]
- //public Position? Position_PositionId { get; set; }
-
[Column(Order = 2), Comment("PositionId")]
public Guid? PositionId { get; set; }
- //[ForeignKey("PositionPathId")]
- //public PositionPath? PositionPath_PositionPathId { get; set; }
-
[Column(Order = 3), Comment("PositionPathId")]
- public Guid? PositionPathId { get; set; }
-
- //[ForeignKey("PositionTypeId")]
- //public PositionType? PositionType_PositionTypeId { get; set; }
+ public PositionPath? PositionPath { get; set; }
[Column(Order = 4), Comment("PositionTypeId")]
- public Guid? PositionTypeId { get; set; }
-
- //[ForeignKey("PositionExecutiveId")]
- //public PositionExecutive? PositionExecutive_PositionExecutiveId { get; set; }
+ public PositionType? PositionType { get; set; }
[Column(Order = 5), Comment("PositionExecutiveId")]
- public Guid? PositionExecutiveId { get; set; }
-
- //[ForeignKey("ExcutiveSideId")]
- //public PositionExecutiveSide? PositionExecutiveSide_ExcutiveSideId { get; set; }
+ public PositionExecutive? PositionExecutive { get; set; }
[Column(Order = 6), Comment("PositionExecutiveSideId")]
- public Guid? PositionExecutiveSideId { get; set; }
-
- //[ForeignKey("PathSideId")]
- //public PositionPathSide? PositionPathSide_PathSideId { get; set; }
+ public PositionExecutiveSide? PositionExecutiveSide { get; set; }
[Column(Order = 7), Comment("PositionPathSideId")]
- public Guid? PositionPathSideId { get; set; }
+ public PositionPathSide? PositionPathSide { get; set; }
[Column(Order = 8), Comment("PositionLineId")]
- public Guid? PositionLineId { get; set; }
-
- //[Column(Order = 9), Comment("PositionLevelId")]
- //public Guid? PositionLevelId { get; set; }
+ public PositionLine? PositionLine { get; set; }
[Column(Order = 10), Comment("PositionStatusId")]
- public Guid? PositionStatusId { get; set; }
+ public PositionStatus? PositionStatus { get; set; }
[Column(Order = 11), Comment("PositionCondition")]
public string? PositionCondition { get; set; }
- [Column(Order = 12), Comment("PositionStatus")]
- public Guid? PositionStatus { get; set; }
-
[Column(Order = 13), Comment("PositionMasterUserNote")]
public string? PositionMasterUserNote { get; set; }
diff --git a/BMA.EHR.Domain/Models/Organizations/PositionNumberEntity.cs b/BMA.EHR.Domain/Models/Organizations/PositionNumberEntity.cs
index 656cf551..d16d362f 100644
--- a/BMA.EHR.Domain/Models/Organizations/PositionNumberEntity.cs
+++ b/BMA.EHR.Domain/Models/Organizations/PositionNumberEntity.cs
@@ -2,6 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using BMA.EHR.Domain.Models.Base;
+using BMA.EHR.Domain.Models.MetaData;
namespace BMA.EHR.Domain.Models.Organizations
{
@@ -11,14 +12,7 @@ namespace BMA.EHR.Domain.Models.Organizations
[MaxLength(300), Column(Order = 2), Comment("ชื่อ")]
public string? Name { get; set; }
- //[ForeignKey("OrganizationShortNameId")]
- //public OrganizationShortName? OrganizationShortName_OrganizationShortNameId { get; set; }
-
[Column(Order = 3), Comment("Shortname")]
- public Guid? OrganizationShortNameId { get; set; }
-
-
-
-
+ public OrganizationShortName? OrganizationShortName { get; set; }
}
}
diff --git a/BMA.EHR.Domain/Models/Organizations/ProfilePosition.cs b/BMA.EHR.Domain/Models/Organizations/ProfilePosition.cs
index c06cfe43..ae4735f1 100644
--- a/BMA.EHR.Domain/Models/Organizations/ProfilePosition.cs
+++ b/BMA.EHR.Domain/Models/Organizations/ProfilePosition.cs
@@ -1,4 +1,5 @@
using BMA.EHR.Domain.Models.Base;
+using BMA.EHR.Domain.Models.HR;
namespace BMA.EHR.Domain.Models.Organizations
{
@@ -7,10 +8,8 @@ namespace BMA.EHR.Domain.Models.Organizations
///
public class ProfilePosition : EntityBase
{
- public OrganizationPositionEntity OrganizationPosition { get; set; }
+ public OrganizationPositionEntity? OrganizationPosition { get; set; }
- public Guid OrganizationPositionId { get; set; }
-
- public Guid? ProfileId { get; set; }
+ public Profile? Profile { get; set; }
}
}
diff --git a/BMA.EHR.Domain/Models/Placement/PlacementProfile.cs b/BMA.EHR.Domain/Models/Placement/PlacementProfile.cs
index 9121fb1b..02d0f0bf 100644
--- a/BMA.EHR.Domain/Models/Placement/PlacementProfile.cs
+++ b/BMA.EHR.Domain/Models/Placement/PlacementProfile.cs
@@ -56,12 +56,18 @@ namespace BMA.EHR.Domain.Models.Placement
[MaxLength(40), Comment("สัญชาติ")]
public string? Nationality { get; set; }
+ [MaxLength(40), Comment("เชื้อชาติ")]
+ public string? Race { get; set; }
[MaxLength(40), Comment("วันเกิด")]
public DateTime? DateOfBirth { get; set; }
[Comment("Id สถานภาพ")]
public Relationship? Relationship { get; set; }
+ [Comment("Id กลุ่มเลือด")]
+ public BloodGroup? BloodGroup { get; set; }
+ [Comment("Id ศาสนา")]
+ public Religion? Religion { get; set; }
[MaxLength(200), Comment("อีเมล")]
public string? Email { get; set; }
diff --git a/BMA.EHR.Domain/Shared/GlobalMessages.cs b/BMA.EHR.Domain/Shared/GlobalMessages.cs
index 0afc8707..c5b6b0b3 100644
--- a/BMA.EHR.Domain/Shared/GlobalMessages.cs
+++ b/BMA.EHR.Domain/Shared/GlobalMessages.cs
@@ -1,33 +1,58 @@
namespace BMA.EHR.Domain.Shared
{
- public class GlobalMessages
- {
- public static readonly string Success = "สำเร็จ";
+ public class GlobalMessages
+ {
+ public static readonly string Success = "สำเร็จ";
- public static readonly string Error = "เกิดข้อผิดพลาด";
+ public static readonly string Error = "เกิดข้อผิดพลาด";
- public static readonly string DataNotFound = "ไม่พบข้อมูลในระบบ";
+ public static readonly string DataNotFound = "ไม่พบข้อมูลในระบบ";
- public static readonly string NotAuthorized = "กรุณาเข้าสู่ระบบก่อนใช้งาน!";
+ public static readonly string NotAuthorized = "กรุณาเข้าสู่ระบบก่อนใช้งาน!";
- public static readonly string ForbiddenAccess = "คุณไม่ได้รับอนุญาติให้เข้าใช้งาน!";
+ public static readonly string ForbiddenAccess = "คุณไม่ได้รับอนุญาติให้เข้าใช้งาน!";
- public static readonly string ExceptionOccured = "เกิดข้อผิดพลาดขึ้นในระบบ กรุณาติดต่อผู้ดูแลระบบ!";
+ public static readonly string ExceptionOccured = "เกิดข้อผิดพลาดขึ้นในระบบ กรุณาติดต่อผู้ดูแลระบบ!";
+
+ public static readonly string FileNotFoundOnServer = "ไม่พบไฟล์ในระบบ!!";
#region " Meta Data "
public static readonly string DataExist5 = "เนื่องจากมีการกำหนดวันหยุดในการทำงาน 5 วันอยู่";
- public static readonly string DataExist6 = "เนื่องจากมีการกำหนดวันหยุดในการทำงาน 6 วันอยู่";
+ public static readonly string DataExist6 = "เนื่องจากมีการกำหนดวันหยุดในการทำงาน 6 วันอยู่";
- public static readonly string NameDupicate = "ชื่อวันหยุดนี้มีอยู่ในระบบอยู่แล้ว";
+ public static readonly string NameDupicate = "ชื่อวันหยุดนี้มีอยู่ในระบบอยู่แล้ว";
- public static readonly string HolidayOfYearNotFound = "ไม่พบข้อมูลวันหยุดในปีที่คุณระบุ";
+ public static readonly string HolidayOfYearNotFound = "ไม่พบข้อมูลวันหยุดในปีที่คุณระบุ";
- public static readonly string HolidayOfYearNotCopy = "ไม่สามารถคัดลอกวันหยุดย้อนหลังได้";
+ public static readonly string HolidayOfYearNotCopy = "ไม่สามารถคัดลอกวันหยุดย้อนหลังได้";
- public static readonly string DestinationHolidayIsExist = "ข้อมูลวันหยุดในปีที่ระบุมีอยู่แล้ว";
+ public static readonly string DestinationHolidayIsExist = "ข้อมูลวันหยุดในปีที่ระบุมีอยู่แล้ว";
+ public static readonly string ProvinceNotFound = "ไม่พบข้อมูลจังหวัด";
+ public static readonly string DistrictNotFound = "ไม่พบข้อมูลเขต";
+ public static readonly string SubDistrictNotFound = "ไม่พบข้อมูลแขวง";
+ public static readonly string PrefixNotFound = "ไม่พบข้อมูลคำนำหน้า";
+ public static readonly string GenderNotFound = "ไม่พบข้อมูลเพศ";
+ public static readonly string RelationshipNotFound = "ไม่พบข้อมูลความสัมพันธ์";
+ public static readonly string BloodGroupNotFound = "ไม่พบข้อมูลกลุ่มเลือก";
+ public static readonly string ReligionNotFound = "ไม่พบข้อมูลศาสนา";
- #endregion
- }
+ #endregion
+
+ #region " Organization "
+ public static readonly string PositionPosNoNotFound = "ไม่พบข้อมูลเลขที่ตำแหน่ง";
+ public static readonly string PositionPathNotFound = "ไม่พบข้อมูลตำแหน่ง";
+ public static readonly string PositionLineNotFound = "ไม่พบข้อมูลสายงาน";
+ public static readonly string PositionPathSideNotFound = "ไม่พบข้อมูลด้าน/สาขา";
+ public static readonly string PositionTypeNotFound = "ไม่พบข้อมูลประเภทตำแหน่ง";
+ public static readonly string PositionLevelNotFound = "ไม่พบข้อมูลอันดับ/ระดับ";
+ public static readonly string PositionExecutiveNotFound = "ไม่พบข้อมูลตำแหน่งทางการบริหาร";
+ public static readonly string PositionExecutiveSideNotFound = "ไม่พบข้อมูลด้านทางการบริหาร";
+ public static readonly string PositionEmployeeGroupNotFound = "ไม่พบข้อมูลกลุ่มงาน";
+ public static readonly string PositionEmployeeLevelNotFound = "ไม่พบข้อมูลระดับชั้นงาน";
+ public static readonly string PositionEmployeePositionSideNotFound = "ไม่พบข้อมูลด้านของตำแหน่ง";
+ public static readonly string PositionEmployeePositionNotFound = "ไม่พบข้อมูลตำแหน่ง";
+ #endregion
+ }
}
diff --git a/BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj b/BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj
index 3ad1be21..0f8a6718 100644
--- a/BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj
+++ b/BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj
@@ -7,6 +7,7 @@
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs b/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs
index cae8b382..77ebf1b6 100644
--- a/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs
+++ b/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs
@@ -1,4 +1,5 @@
using BMA.EHR.Application.Common.Interfaces;
+using BMA.EHR.Application.Repositories;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
@@ -10,8 +11,10 @@ namespace BMA.EHR.Infrastructure
{
public static IServiceCollection AddPersistence(this IServiceCollection services,
IConfiguration configuration)
- {
- var connectionString = configuration.GetConnectionString("DefaultConnection");
+ {
+ services.AddTransient();
+
+ var connectionString = configuration.GetConnectionString("DefaultConnection");
services.AddDbContext(options =>
options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString),
diff --git a/BMA.EHR.Infrastructure/Migrations/20230705060909_Update table Org link table.Designer.cs b/BMA.EHR.Infrastructure/Migrations/20230705060909_Update table Org link table.Designer.cs
new file mode 100644
index 00000000..404c5096
--- /dev/null
+++ b/BMA.EHR.Infrastructure/Migrations/20230705060909_Update table Org link table.Designer.cs
@@ -0,0 +1,10312 @@
+//
+using System;
+using BMA.EHR.Infrastructure.Persistence;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace BMA.EHR.Infrastructure.Migrations
+{
+ [DbContext(typeof(ApplicationDBContext))]
+ [Migration("20230705060909_Update table Org link table")]
+ partial class UpdatetableOrglinktable
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.8")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Commands.DeploymentChannel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("IsSendEmail")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsSendInbox")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.ToTable("DeploymentChannels");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Documents.Document", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Detail")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)");
+
+ b.Property("FileSize")
+ .HasColumnType("int");
+
+ b.Property("FileType")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ObjectRefId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Documents");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Name")
+ .HasColumnType("longtext")
+ .HasComment("ยังไม่ชัวใช้อะไรเป็นkey");
+
+ b.HasKey("Id");
+
+ b.ToTable("LimitLeaves");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("LimitLeaveId")
+ .HasColumnType("char(36)");
+
+ b.Property("NumLeave")
+ .HasColumnType("double")
+ .HasComment("จำนวนที่ลาได้");
+
+ b.Property("TypeLeaveId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LimitLeaveId");
+
+ b.HasIndex("TypeLeaveId");
+
+ b.ToTable("LimitTypeLeaves");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)");
+
+ b.Property("Ability")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)");
+
+ b.Property("AvatarId")
+ .HasColumnType("char(36)");
+
+ b.Property("AvatarRef")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)");
+
+ b.Property("BirthDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันเกิด");
+
+ b.Property("BloodGroupId")
+ .HasColumnType("char(36)")
+ .HasComment("Id กลุ่มเลือด");
+
+ b.Property("CitizenId")
+ .HasMaxLength(13)
+ .HasColumnType("varchar(13)")
+ .HasComment("รหัสบัตรประชาชน");
+
+ b.Property("Couple")
+ .HasColumnType("tinyint(1)")
+ .HasComment("คู่สมรส");
+
+ b.Property("CoupleCareer")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("อาชีพคู่สมรส");
+
+ b.Property("CoupleFirstName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อคู่สมรส");
+
+ b.Property("CoupleLastName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุลคู่สมรส");
+
+ b.Property("CoupleLastNameOld")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุลคู่สมรส(เดิม)");
+
+ b.Property("CouplePrefixId")
+ .HasColumnType("char(36)")
+ .HasComment("Id คำนำหน้าคู่สมรส");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUser")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("varchar(250)");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("CurrentAddress")
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasComment("ที่อยู่ปัจจุบัน");
+
+ b.Property("CurrentDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id เขตปัจจุบัน");
+
+ b.Property("CurrentProvinceId")
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัดปัจจุบัน");
+
+ b.Property("CurrentSubDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id แขวงปัจจุบัน");
+
+ b.Property("CurrentZipCode")
+ .HasMaxLength(5)
+ .HasColumnType("varchar(5)")
+ .HasComment("รหัสไปรษณีย์ปัจจุบัน");
+
+ b.Property("DateAppoint")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DateRetire")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DateStart")
+ .HasColumnType("datetime(6)");
+
+ b.Property("EmployeeClass")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("ประเภทลูกจ้าง");
+
+ b.Property("EmployeeType")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("ประเภทการจ้าง");
+
+ b.Property("EntryStatus")
+ .IsRequired()
+ .HasMaxLength(5)
+ .HasColumnType("varchar(5)");
+
+ b.Property("FatherCareer")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("อาชีพบิดา");
+
+ b.Property("FatherFirstName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อบิดา");
+
+ b.Property("FatherLastName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุลบิดา");
+
+ b.Property("FatherPrefixId")
+ .HasColumnType("char(36)")
+ .HasComment("Id คำนำหน้าบิดา");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อ");
+
+ b.Property("FirstNameOld")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อ(เดิม)");
+
+ b.Property("GenderId")
+ .HasColumnType("char(36)")
+ .HasComment("Id เพศ");
+
+ b.Property("GovAgeAbsent")
+ .HasColumnType("int");
+
+ b.Property("GovAgePlus")
+ .HasColumnType("int");
+
+ b.Property("GovernmentCode")
+ .HasColumnType("longtext");
+
+ b.Property("IsActive")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsLeave")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsProbation")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsTransfer")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsVerified")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุล");
+
+ b.Property("LastNameOld")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุล(เดิม)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("LeaveDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LeaveDateOrder")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LeaveDetail")
+ .HasColumnType("longtext");
+
+ b.Property("LeaveNumberOrder")
+ .HasColumnType("longtext");
+
+ b.Property("LeaveReason")
+ .HasMaxLength(1000)
+ .HasColumnType("varchar(1000)");
+
+ b.Property("LimitLeaveId")
+ .HasColumnType("char(36)");
+
+ b.Property("ModifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("MotherCareer")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("อาชีพมารดา");
+
+ b.Property("MotherFirstName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อมารดา");
+
+ b.Property("MotherLastName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุลมารดา");
+
+ b.Property("MotherPrefixId")
+ .HasColumnType("char(36)")
+ .HasComment("Id คำนำหน้ามารดา");
+
+ b.Property("Nationality")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("สัญชาติ");
+
+ b.Property("Oc")
+ .HasColumnType("longtext")
+ .HasComment("สังกัด");
+
+ b.Property("OcId")
+ .HasColumnType("char(36)")
+ .HasComment("Id สังกัด");
+
+ b.Property("OrganizationOrganization")
+ .HasColumnType("longtext");
+
+ b.Property("OrganizationOrganizationId")
+ .HasColumnType("char(36)");
+
+ b.Property("OrganizationShortName")
+ .HasColumnType("longtext");
+
+ b.Property("OrganizationShortNameId")
+ .HasColumnType("char(36)");
+
+ b.Property("Physical")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("สถานภาพทางกาย");
+
+ b.Property("PosNo")
+ .HasColumnType("longtext")
+ .HasComment("เลขที่ตำแหน่ง");
+
+ b.Property("PosNoEmployee")
+ .HasColumnType("longtext")
+ .HasComment("เลขที่ตำแหน่งลูกจ้าง");
+
+ b.Property("PosNoId")
+ .HasColumnType("char(36)")
+ .HasComment("Id เลขที่ตำแหน่ง");
+
+ b.Property("Position")
+ .HasColumnType("longtext")
+ .HasComment("ตำแหน่ง");
+
+ b.Property("PositionEmployeeGroup")
+ .HasColumnType("longtext")
+ .HasComment("กลุ่มงาน");
+
+ b.Property("PositionEmployeeGroupId")
+ .HasColumnType("char(36)")
+ .HasComment("Id กลุ่มงาน");
+
+ b.Property("PositionEmployeeLevel")
+ .HasColumnType("longtext")
+ .HasComment("ระดับชั้นงาน");
+
+ b.Property("PositionEmployeeLevelId")
+ .HasColumnType("char(36)")
+ .HasComment(" Id ระดับชั้นงาน");
+
+ b.Property("PositionEmployeePosition")
+ .HasColumnType("longtext")
+ .HasComment("ตำแหน่ง");
+
+ b.Property("PositionEmployeePositionId")
+ .HasColumnType("char(36)")
+ .HasComment("Id ตำแหน่ง");
+
+ b.Property("PositionEmployeePositionSide")
+ .HasColumnType("longtext")
+ .HasComment("ด้านของตำแหน่ง");
+
+ b.Property("PositionEmployeePositionSideId")
+ .HasColumnType("char(36)")
+ .HasComment("Id ด้านของตำแหน่ง");
+
+ b.Property("PositionExecutive")
+ .HasColumnType("longtext")
+ .HasComment("ตำแหน่งทางการบริหาร");
+
+ b.Property("PositionExecutiveId")
+ .HasColumnType("char(36)")
+ .HasComment("Id ตำแหน่งทางการบริหาร");
+
+ b.Property("PositionExecutiveSide")
+ .HasColumnType("longtext")
+ .HasComment("ด้านทางการบริหาร");
+
+ b.Property("PositionExecutiveSideId")
+ .HasColumnType("char(36)")
+ .HasComment("Id ด้านทางการบริหาร");
+
+ b.Property("PositionId")
+ .HasColumnType("char(36)")
+ .HasComment("Id ตำแหน่ง");
+
+ b.Property("PositionLevel")
+ .HasColumnType("longtext")
+ .HasComment("ระดับ");
+
+ b.Property("PositionLevelId")
+ .HasColumnType("char(36)")
+ .HasComment(" Id ระดับ");
+
+ b.Property("PositionLine")
+ .HasColumnType("longtext")
+ .HasComment("สายงาน");
+
+ b.Property("PositionLineId")
+ .HasColumnType("char(36)")
+ .HasComment("Id สายงาน");
+
+ b.Property("PositionPathSide")
+ .HasColumnType("longtext")
+ .HasComment("ด้าน/สาขา");
+
+ b.Property("PositionPathSideId")
+ .HasColumnType("char(36)")
+ .HasComment("Id ด้าน/สาขา");
+
+ b.Property("PositionType")
+ .HasColumnType("longtext")
+ .HasComment("ประเภทตำแหน่ง");
+
+ b.Property("PositionTypeId")
+ .HasColumnType("char(36)")
+ .HasComment("Id ประเภทตำแหน่ง");
+
+ b.Property("PrefixId")
+ .HasColumnType("char(36)")
+ .HasComment("Id คำนำหน้า");
+
+ b.Property("PrefixOldId")
+ .HasColumnType("char(36)")
+ .HasComment("Id คำนำหน้า(เดิม)");
+
+ b.Property("ProfileType")
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)");
+
+ b.Property("Race")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("เชื้อชาติ");
+
+ b.Property("ReasonSameDate")
+ .HasColumnType("longtext");
+
+ b.Property("RegistrationAddress")
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasComment("Id แขวงตามทะเบียนบ้าน");
+
+ b.Property("RegistrationDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id เขตตามทะเบียนบ้าน");
+
+ b.Property("RegistrationProvinceId")
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัดตามทะเบียนบ้าน");
+
+ b.Property("RegistrationSame")
+ .HasColumnType("tinyint(1)")
+ .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่");
+
+ b.Property("RegistrationSubDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("แขวงตามทะเบียนบ้าน");
+
+ b.Property("RegistrationZipCode")
+ .HasMaxLength(5)
+ .HasColumnType("varchar(5)")
+ .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน");
+
+ b.Property("RelationshipId")
+ .HasColumnType("char(36)")
+ .HasComment("Id สถานะภาพ");
+
+ b.Property("ReligionId")
+ .HasColumnType("char(36)")
+ .HasComment("Id ศาสนา");
+
+ b.Property("TelephoneNumber")
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("เบอร์โทร");
+
+ b.Property("TransferDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("VerifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("VerifiedUser")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AvatarId");
+
+ b.HasIndex("LimitLeaveId");
+
+ b.ToTable("Profiles");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DateEnd")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่สิ้นสุด");
+
+ b.Property("DateStart")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่เริ่มต้น");
+
+ b.Property("Detail")
+ .HasColumnType("longtext")
+ .HasComment("รายละเอียด");
+
+ b.Property("Field")
+ .HasColumnType("longtext")
+ .HasComment("ด้าน");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("ProfileId")
+ .HasColumnType("char(36)");
+
+ b.Property("Reference")
+ .HasColumnType("longtext")
+ .HasComment("เอกสารอ้างอิง");
+
+ b.Property("Remark")
+ .HasColumnType("longtext")
+ .HasComment("หมายเหตุ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ProfileId");
+
+ b.ToTable("ProfileAbilitys");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbilityHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DateEnd")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่สิ้นสุด");
+
+ b.Property("DateStart")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่เริ่มต้น");
+
+ b.Property("Detail")
+ .HasColumnType("longtext")
+ .HasComment("รายละเอียด");
+
+ b.Property("Field")
+ .HasColumnType("longtext")
+ .HasComment("ด้าน");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("ProfileAbilityId")
+ .HasColumnType("char(36)");
+
+ b.Property("Reference")
+ .HasColumnType("longtext")
+ .HasComment("เอกสารอ้างอิง");
+
+ b.Property("Remark")
+ .HasColumnType("longtext")
+ .HasComment("หมายเหตุ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ProfileAbilityId");
+
+ b.ToTable("ProfileAbilityHistorys");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAddressHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("CurrentAddress")
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasComment("ที่อยู่ปัจจุบัน");
+
+ b.Property("CurrentDistrict")
+ .HasColumnType("longtext")
+ .HasComment("เขตปัจจุบัน");
+
+ b.Property("CurrentDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id เขตปัจจุบัน");
+
+ b.Property("CurrentProvince")
+ .HasColumnType("longtext")
+ .HasComment("จังหวัดปัจจุบัน");
+
+ b.Property("CurrentProvinceId")
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัดปัจจุบัน");
+
+ b.Property("CurrentSubDistrict")
+ .HasColumnType("longtext")
+ .HasComment("แขวงปัจจุบัน");
+
+ b.Property("CurrentSubDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id แขวงปัจจุบัน");
+
+ b.Property("CurrentZipCode")
+ .HasMaxLength(5)
+ .HasColumnType("varchar(5)")
+ .HasComment("รหัสไปรษณีย์ปัจจุบัน");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("ProfileId")
+ .HasColumnType("char(36)");
+
+ b.Property("RegistrationAddress")
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasComment("ที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RegistrationDistrict")
+ .HasColumnType("longtext")
+ .HasComment("เขตตามทะเบียนบ้าน");
+
+ b.Property("RegistrationDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id เขตตามทะเบียนบ้าน");
+
+ b.Property("RegistrationProvince")
+ .HasColumnType("longtext")
+ .HasComment("จังหวัดตามทะเบียนบ้าน");
+
+ b.Property("RegistrationProvinceId")
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัดตามทะเบียนบ้าน");
+
+ b.Property("RegistrationSame")
+ .HasColumnType("tinyint(1)")
+ .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่");
+
+ b.Property("RegistrationSubDistrict")
+ .HasColumnType("longtext")
+ .HasComment("แขวงตามทะเบียนบ้าน");
+
+ b.Property("RegistrationSubDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id แขวงตามทะเบียนบ้าน");
+
+ b.Property("RegistrationZipCode")
+ .HasMaxLength(5)
+ .HasColumnType("varchar(5)")
+ .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ProfileId");
+
+ b.ToTable("ProfileAddressHistories");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("Date")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่ได้รับ");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Name")
+ .HasColumnType("longtext")
+ .HasComment("ชื่อแบบประเมิน");
+
+ b.Property("Point1")
+ .HasColumnType("double")
+ .HasComment("ผลประเมินส่วนที่1 (คะแนน)");
+
+ b.Property("Point1Total")
+ .HasColumnType("double")
+ .HasComment("ส่วนที่1 (คะแนน)");
+
+ b.Property("Point2")
+ .HasColumnType("double")
+ .HasComment("ผลประเมินส่วนที่2 (คะแนน)");
+
+ b.Property("Point2Total")
+ .HasColumnType("double")
+ .HasComment("ส่วนที่2 (คะแนน)");
+
+ b.Property("PointSum")
+ .HasColumnType("double")
+ .HasComment("ผลประเมินรวม (คะแนน)");
+
+ b.Property("PointSumTotal")
+ .HasColumnType("double")
+ .HasComment("ผลรวม (คะแนน)");
+
+ b.Property("ProfileId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ProfileId");
+
+ b.ToTable("ProfileAssessments");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessmentHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("Date")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่ได้รับ");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Name")
+ .HasColumnType("longtext")
+ .HasComment("ชื่อแบบประเมิน");
+
+ b.Property("Point1")
+ .HasColumnType("double")
+ .HasComment("ผลประเมินส่วนที่1 (คะแนน)");
+
+ b.Property("Point1Total")
+ .HasColumnType("double")
+ .HasComment("ส่วนที่1 (คะแนน)");
+
+ b.Property("Point2")
+ .HasColumnType("double")
+ .HasComment("ผลประเมินส่วนที่2 (คะแนน)");
+
+ b.Property("Point2Total")
+ .HasColumnType("double")
+ .HasComment("ส่วนที่2 (คะแนน)");
+
+ b.Property("PointSum")
+ .HasColumnType("double")
+ .HasComment("ผลประเมินรวม (คะแนน)");
+
+ b.Property("PointSumTotal")
+ .HasColumnType("double")
+ .HasComment("ผลรวม (คะแนน)");
+
+ b.Property("ProfileAssessmentId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ProfileAssessmentId");
+
+ b.ToTable("ProfileAssessmentHistorys");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAvatarHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("AvatarFileId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("ProfileId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AvatarFileId");
+
+ b.HasIndex("ProfileId");
+
+ b.ToTable("ProfileAvatarHistories");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CertificateNo")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("เลขที่ใบอนุญาต");
+
+ b.Property("CertificateType")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อใบอนุญาต");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property