diff --git a/BMA.EHR.Application/ApplicationServicesRegistration.cs b/BMA.EHR.Application/ApplicationServicesRegistration.cs index c6c52809..ef2020e6 100644 --- a/BMA.EHR.Application/ApplicationServicesRegistration.cs +++ b/BMA.EHR.Application/ApplicationServicesRegistration.cs @@ -1,17 +1,15 @@ -using BMA.EHR.Application.Repositories.BloodGroup; -using BMA.EHR.Application.Repositories.Prefix; +using BMA.EHR.Application.Repositories; using Microsoft.Extensions.DependencyInjection; namespace BMA.EHR.Application { public static class ApplicationServicesRegistration - { - public static IServiceCollection AddApplication(this IServiceCollection services) - { - services.AddTransient(); - services.AddTransient(); + { + public static IServiceCollection AddApplication(this IServiceCollection services) + { + services.AddTransient(); - return services; - } - } + return services; + } + } } diff --git a/BMA.EHR.Application/Common/Interfaces/IApplicationDBContext.cs b/BMA.EHR.Application/Common/Interfaces/IApplicationDBContext.cs index f25ba617..2422892b 100644 --- a/BMA.EHR.Application/Common/Interfaces/IApplicationDBContext.cs +++ b/BMA.EHR.Application/Common/Interfaces/IApplicationDBContext.cs @@ -1,31 +1,10 @@ -using BMA.EHR.Domain.Entities.MetaData.BloodGroup; -using BMA.EHR.Domain.Entities.MetaData.Prefix; +using BMA.EHR.Domain.Models.MetaData; using Microsoft.EntityFrameworkCore; namespace BMA.EHR.Application.Common.Interfaces { public interface IApplicationDBContext { - #region " Prefix " - - DbSet MD_Prefixes { get; set; } - - DbSet MD_Prefix_Drafts { get; set; } - - DbSet MD_Prefix_Histories { get; set; } - - #endregion - - #region " BloodGroup " - - DbSet MD_BloodGroups { get; set; } - - DbSet MD_BloodGroup_Drafts { get; set; } - - DbSet MD_BloodGroup_Histories { get; set; } - - #endregion - DbSet Set() where T : class; Task SaveChangesAsync(); diff --git a/BMA.EHR.Application/Common/Interfaces/IGenericRepository.cs b/BMA.EHR.Application/Common/Interfaces/IGenericRepository.cs index 336f10df..22889247 100644 --- a/BMA.EHR.Application/Common/Interfaces/IGenericRepository.cs +++ b/BMA.EHR.Application/Common/Interfaces/IGenericRepository.cs @@ -8,5 +8,12 @@ namespace BMA.EHR.Application.Common.Interfaces Task GetByIdAsync(S id); Task> GetAllAsync(); - } + + Task AddAsync(T entity); + + Task UpdateAsync(T entity); + + Task DeleteAsync(T entity); + + } } diff --git a/BMA.EHR.Application/Repositories/BloodGroup/BloodGroupRepository.cs b/BMA.EHR.Application/Repositories/BloodGroup/BloodGroupRepository.cs deleted file mode 100644 index 7888759d..00000000 --- a/BMA.EHR.Application/Repositories/BloodGroup/BloodGroupRepository.cs +++ /dev/null @@ -1,28 +0,0 @@ -using BMA.EHR.Application.Common.Interfaces; -using BMA.EHR.Domain.Entities.MetaData.BloodGroup; -using Microsoft.AspNetCore.Http; - -namespace BMA.EHR.Application.Repositories.BloodGroup -{ - public class BloodGroupRepository : GenericRepository - { - #region " Fields " - - private readonly IApplicationDBContext _dbContext; - private readonly IHttpContextAccessor _httpContextAccessor; - - #endregion - - #region " Constructor and Destructor " - - public BloodGroupRepository(IApplicationDBContext dbContext, - IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor) - { - _dbContext = dbContext; - _httpContextAccessor = httpContextAccessor; - } - - #endregion - - } -} \ No newline at end of file diff --git a/BMA.EHR.Application/Repositories/GenericRepository.cs b/BMA.EHR.Application/Repositories/GenericRepository.cs index 8d3c57ba..5d5685b6 100644 --- a/BMA.EHR.Application/Repositories/GenericRepository.cs +++ b/BMA.EHR.Application/Repositories/GenericRepository.cs @@ -29,9 +29,9 @@ namespace BMA.EHR.Application.Repositories #region " Properties " - private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value; + protected string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value; - private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; + protected string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; #endregion @@ -47,6 +47,43 @@ namespace BMA.EHR.Application.Repositories return await _dbSet.FindAsync(id); } + public async Task AddAsync(T entity) + { + //if (entity is IAuditableEntity) + //{ + // (entity as IAuditableEntity).CreatedUserId = Guid.Parse(UserId); + // (entity as IAuditableEntity).CreatedUserFullName = FullName; + // (entity as IAuditableEntity).CreatedDate = DateTime.Now; + //} + + + await _dbSet.AddAsync(entity); + await _dbContext.SaveChangesAsync(); + + return entity; + } + + public async Task UpdateAsync(T entity) + { + //if (entity is IAuditableEntity) + //{ + // (entity as IAuditableEntity).ModifiedUserId = Guid.Parse(UserId); + // (entity as IAuditableEntity).ModifiedUserFullName = FullName; + // (entity as IAuditableEntity).ModifiedDate = DateTime.Now; + //} + + _dbSet.Update(entity); + await _dbContext.SaveChangesAsync(); + + return entity; + } + + public async Task DeleteAsync(T entity) + { + _dbSet.Remove(entity); + await _dbContext.SaveChangesAsync(); + } + #endregion } } diff --git a/BMA.EHR.Application/Repositories/Prefix/PrefixRepository.cs b/BMA.EHR.Application/Repositories/PrefixRepository.cs similarity index 57% rename from BMA.EHR.Application/Repositories/Prefix/PrefixRepository.cs rename to BMA.EHR.Application/Repositories/PrefixRepository.cs index 7eafc7a6..1b6a2b15 100644 --- a/BMA.EHR.Application/Repositories/Prefix/PrefixRepository.cs +++ b/BMA.EHR.Application/Repositories/PrefixRepository.cs @@ -1,28 +1,18 @@ using BMA.EHR.Application.Common.Interfaces; -using BMA.EHR.Domain.Entities.MetaData.Prefix; +using BMA.EHR.Domain.Models.MetaData; using Microsoft.AspNetCore.Http; +using System.Security.AccessControl; -namespace BMA.EHR.Application.Repositories.Prefix +namespace BMA.EHR.Application.Repositories { - public class PrefixRepository : GenericRepository + public class PrefixRepository : GenericRepository { - #region " Fields " - private readonly IApplicationDBContext _dbContext; private readonly IHttpContextAccessor _httpContextAccessor; - - #endregion - - #region " Constructor and Destructor " - - public PrefixRepository(IApplicationDBContext dbContext, - IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor) + public PrefixRepository(IApplicationDBContext dbContext, IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor) { _dbContext = dbContext; _httpContextAccessor = httpContextAccessor; } - - #endregion - } } diff --git a/BMA.EHR.Domain/Common/BaseController.cs b/BMA.EHR.Domain/Common/BaseController.cs index b1ed9c9f..44d8dac0 100644 --- a/BMA.EHR.Domain/Common/BaseController.cs +++ b/BMA.EHR.Domain/Common/BaseController.cs @@ -1,35 +1,11 @@ using BMA.EHR.Domain.Shared; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using System.Security.Claims; namespace BMA.EHR.Domain.Common { public class BaseController : ControllerBase { - #region " Fields " - - private readonly IHttpContextAccessor _httpContextAccessor; - - #endregion - - #region " Constructor and Destructor " - - public BaseController(IHttpContextAccessor httpContextAccessor) - { - _httpContextAccessor = httpContextAccessor; - } - - #endregion - - #region " Properties " - - private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value; - - private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; - - #endregion - #region " Methods " #region " Protected " diff --git a/BMA.EHR.Domain/Common/BaseDataEntity.cs b/BMA.EHR.Domain/Common/BaseDataEntity.cs deleted file mode 100644 index bf6bf413..00000000 --- a/BMA.EHR.Domain/Common/BaseDataEntity.cs +++ /dev/null @@ -1,13 +0,0 @@ -using BMA.EHR.Domain.Common.Interfaces; -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace BMA.EHR.Domain.Common -{ - public abstract class BaseDataEntity : BaseEntity, IActivableEntity - { - [Required, Column(Order = 990), Comment("สถานะการใช้งาน")] - public bool IsActive { get; set; } = true; - } -} diff --git a/BMA.EHR.Domain/Common/BaseDraftEntity.cs b/BMA.EHR.Domain/Common/BaseDraftEntity.cs deleted file mode 100644 index c7589207..00000000 --- a/BMA.EHR.Domain/Common/BaseDraftEntity.cs +++ /dev/null @@ -1,13 +0,0 @@ -using BMA.EHR.Domain.Common.Interfaces; -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace BMA.EHR.Domain.Common -{ - public class BaseDraftEntity : BaseDataEntity, IPublishableEntity - { - [Required, Column(Order = 899), Comment("สถานะการเผยแพร่ข้อมูล")] - public bool IsPublished { get; set; } = false; - } -} diff --git a/BMA.EHR.Domain/Common/BaseEntity.cs b/BMA.EHR.Domain/Common/BaseEntity.cs deleted file mode 100644 index f5c74f8e..00000000 --- a/BMA.EHR.Domain/Common/BaseEntity.cs +++ /dev/null @@ -1,36 +0,0 @@ -using BMA.EHR.Domain.Common.Interfaces; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BMA.EHR.Domain.Common -{ - public class BaseEntity : IAuditableEntity - { - [Key, Column(Order = 0), Comment("คีย์หลัก")] - public virtual T Id { get; set; } - - [Required, Column(Order = 991), Comment("User Id ที่สร้างข้อมูล")] - public Guid CreatedUserId { get; set; } = Guid.Empty; - - [Required, Column(Order = 992), Comment("ชื่อ User ที่สร้างข้อมูล")] - public string CreatedUserFullName { get; set; } = string.Empty; - - [Required, Column(Order = 993), Comment("สร้างข้อมูลเมื่อ")] - public DateTime CreatedDate { get; set; } = DateTime.Now; - - [Column(Order = 994), Comment("User Id ที่แก้ไขข้อมูล")] - public Guid? ModifiedUserId { get; set; } - - [Column(Order = 995), Comment("ชื่อ User ที่แก้ไขข้อมูล")] - public string? ModifiedUserFullName { get; set; } - - [Column(Order = 996), Comment("แก้ไขข้อมูลเมื่อ")] - public DateTime? ModifiedDate { get; set; } - } -} diff --git a/BMA.EHR.Domain/Common/Interfaces/IActivableEntity.cs b/BMA.EHR.Domain/Common/Interfaces/IActivableEntity.cs deleted file mode 100644 index cf767610..00000000 --- a/BMA.EHR.Domain/Common/Interfaces/IActivableEntity.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace BMA.EHR.Domain.Common.Interfaces -{ - public interface IActivableEntity - { - bool IsActive { get; set; } - } -} diff --git a/BMA.EHR.Domain/Common/Interfaces/IAuditableEntity.cs b/BMA.EHR.Domain/Common/Interfaces/IAuditableEntity.cs deleted file mode 100644 index 3633e37f..00000000 --- a/BMA.EHR.Domain/Common/Interfaces/IAuditableEntity.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace BMA.EHR.Domain.Common.Interfaces -{ - public interface IAuditableEntity - { - Guid CreatedUserId { get; set; } - - string CreatedUserFullName { get; set; } - - DateTime CreatedDate { get; set; } - - Guid? ModifiedUserId { get; set; } - - string? ModifiedUserFullName { get; set; } - - DateTime? ModifiedDate { get; set; } - } -} diff --git a/BMA.EHR.Domain/Common/Interfaces/IPublishableEntity.cs b/BMA.EHR.Domain/Common/Interfaces/IPublishableEntity.cs deleted file mode 100644 index 75e47db5..00000000 --- a/BMA.EHR.Domain/Common/Interfaces/IPublishableEntity.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BMA.EHR.Domain.Common.Interfaces -{ - public interface IPublishableEntity - { - bool IsPublished { get; set; } - } -} diff --git a/BMA.EHR.Domain/Entities/MetaData/BloodGroup/BloodGroupDraftEntity.cs b/BMA.EHR.Domain/Entities/MetaData/BloodGroup/BloodGroupDraftEntity.cs deleted file mode 100644 index a7b6c564..00000000 --- a/BMA.EHR.Domain/Entities/MetaData/BloodGroup/BloodGroupDraftEntity.cs +++ /dev/null @@ -1,13 +0,0 @@ -using BMA.EHR.Domain.Common; -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace BMA.EHR.Domain.Entities.MetaData.BloodGroup -{ - public class BloodGroupDraftEntity : BaseDraftEntity - { - [Required, MaxLength(2), Column(Order = 1), Comment("ชื่อหมู่โลหิต")] - public string Name { get; set; } = string.Empty; - } -} diff --git a/BMA.EHR.Domain/Entities/MetaData/BloodGroup/BloodGroupEntity.cs b/BMA.EHR.Domain/Entities/MetaData/BloodGroup/BloodGroupEntity.cs deleted file mode 100644 index 883823f7..00000000 --- a/BMA.EHR.Domain/Entities/MetaData/BloodGroup/BloodGroupEntity.cs +++ /dev/null @@ -1,13 +0,0 @@ -using BMA.EHR.Domain.Common; -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace BMA.EHR.Domain.Entities.MetaData.BloodGroup -{ - public class BloodGroupEntity : BaseDataEntity - { - [Required, MaxLength(2), Column(Order = 1), Comment("ชื่อหมู่โลหิต")] - public string Name { get; set; } = string.Empty; - } -} diff --git a/BMA.EHR.Domain/Entities/MetaData/BloodGroup/BloodGroupPublishHistoryEntity.cs b/BMA.EHR.Domain/Entities/MetaData/BloodGroup/BloodGroupPublishHistoryEntity.cs deleted file mode 100644 index 619a15e6..00000000 --- a/BMA.EHR.Domain/Entities/MetaData/BloodGroup/BloodGroupPublishHistoryEntity.cs +++ /dev/null @@ -1,15 +0,0 @@ -using BMA.EHR.Domain.Common; -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations.Schema; - -namespace BMA.EHR.Domain.Entities.MetaData.BloodGroup -{ - public class BloodGroupPublishHistoryEntity : BaseEntity - { - [Column(Order = 1), Comment("รายละเอียดการแก้ไข")] - public string Detail { get; set; } = string.Empty; - - [Column(Order = 2), Comment("เก็บ Object ที่มีการอัพเดตในระบบ")] - public string ObjectValue { get; set; } = string.Empty; - } -} diff --git a/BMA.EHR.Domain/Entities/MetaData/Prefix/PrefixDraftEntity.cs b/BMA.EHR.Domain/Entities/MetaData/Prefix/PrefixDraftEntity.cs deleted file mode 100644 index 7c59bbf4..00000000 --- a/BMA.EHR.Domain/Entities/MetaData/Prefix/PrefixDraftEntity.cs +++ /dev/null @@ -1,13 +0,0 @@ -using BMA.EHR.Domain.Common; -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace BMA.EHR.Domain.Entities.MetaData.Prefix -{ - public class PrefixDraftEntity : BaseDraftEntity - { - [Required, MaxLength(100), Column(Order = 1), Comment("รายละเอียดคำนำหน้า")] - public string Name { get; set; } = string.Empty; - } -} diff --git a/BMA.EHR.Domain/Entities/MetaData/Prefix/PrefixEntity.cs b/BMA.EHR.Domain/Entities/MetaData/Prefix/PrefixEntity.cs deleted file mode 100644 index 9ec66833..00000000 --- a/BMA.EHR.Domain/Entities/MetaData/Prefix/PrefixEntity.cs +++ /dev/null @@ -1,13 +0,0 @@ -using BMA.EHR.Domain.Common; -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace BMA.EHR.Domain.Entities.MetaData.Prefix -{ - public class PrefixEntity : BaseDataEntity - { - [Required, MaxLength(100), Column(Order = 1), Comment("รายละเอียดคำนำหน้า")] - public string Name { get; set; } = string.Empty; - } -} diff --git a/BMA.EHR.Domain/Entities/MetaData/Prefix/PrefixPublishHistoryEntity.cs b/BMA.EHR.Domain/Entities/MetaData/Prefix/PrefixPublishHistoryEntity.cs deleted file mode 100644 index c4231eb1..00000000 --- a/BMA.EHR.Domain/Entities/MetaData/Prefix/PrefixPublishHistoryEntity.cs +++ /dev/null @@ -1,15 +0,0 @@ -using BMA.EHR.Domain.Common; -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations.Schema; - -namespace BMA.EHR.Domain.Entities.MetaData.Prefix -{ - public class PrefixPublishHistoryEntity : BaseEntity - { - [Column(Order = 1), Comment("รายละเอียดการแก้ไข")] - public string Detail { get; set; } = string.Empty; - - [Column(Order = 2), Comment("เก็บ Object ที่มีการอัพเดตในระบบ")] - public string ObjectValue { get; set; } = string.Empty; - } -} diff --git a/BMA.EHR.Domain/Models/AvailablePositionLevelEntity.cs b/BMA.EHR.Domain/Models/AvailablePositionLevelEntity.cs new file mode 100644 index 00000000..666a9872 --- /dev/null +++ b/BMA.EHR.Domain/Models/AvailablePositionLevelEntity.cs @@ -0,0 +1,24 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Organization.Service.Models +{ + public class AvailablePositionLevelEntity : EntityBase + { + + [ForeignKey("PositionMasterId")] + public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; } + + [Column(Order = 2), Comment("PositionMasterId")] + public Guid? PositionMasterId { get; set; } + + [Column(Order = 3), Comment("PositionLevelId")] + public Guid? PositionLevelId { get; set; } + + + + + } +} diff --git a/BMA.EHR.Domain/Models/Base/EntityBase.cs b/BMA.EHR.Domain/Models/Base/EntityBase.cs new file mode 100644 index 00000000..00f2259d --- /dev/null +++ b/BMA.EHR.Domain/Models/Base/EntityBase.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text.Json.Serialization; + +namespace BMA.EHR.Domain.Models.Base +{ + public class EntityBase + { + [Key, Column(Order = 0), Comment("PrimaryKey")] + [JsonPropertyName("id")] + public Guid Id { get; set; } + + [Required, Column(Order = 100), Comment("สร้างข้อมูลเมื่อ")] + public DateTime CreatedAt { get; set; } = DateTime.Now; + + [Column(Order = 101), Comment("User Id ที่สร้างข้อมูล"), MaxLength(40)] + public string CreatedUserId { get; set; } = string.Empty; + + [Column(Order = 102), Comment("แก้ไขข้อมูลล่าสุดเมื่อ")] + public DateTime? LastUpdatedAt { get; set; } + + [Column(Order = 103), Comment("User Id ที่แก้ไขข้อมูลล่าสุด"), MaxLength(40)] + public string LastUpdateUserId { get; set; } = string.Empty; + + [Column(Order = 104), Comment("ชื่อ User ที่สร้างข้อมูล"), MaxLength(200)] + public string CreatedFullName { get; set; } = string.Empty; + + [Column(Order = 105), Comment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), MaxLength(200)] + public string LastUpdateFullName { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Domain/Models/Base/EntityLinkBase.cs b/BMA.EHR.Domain/Models/Base/EntityLinkBase.cs new file mode 100644 index 00000000..fd70f2ed --- /dev/null +++ b/BMA.EHR.Domain/Models/Base/EntityLinkBase.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text.Json.Serialization; + +namespace BMA.EHR.Organization.Service.Models +{ + public class EntityLinkBase + { + [Key, Column(Order = 0), Comment("PrimaryKey")] + [JsonPropertyName("id")] + public Guid Id { get; set; } + + + } +} diff --git a/BMA.EHR.Domain/Models/Documents/Document.cs b/BMA.EHR.Domain/Models/Documents/Document.cs new file mode 100644 index 00000000..82bf5cc9 --- /dev/null +++ b/BMA.EHR.Domain/Models/Documents/Document.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.Documents +{ + public class Document + { + [Key] + public Guid Id { get; set; } + + [Required, MaxLength(255)] + public string FileName { get; set; } = string.Empty; + + [Required] + public int FileSize { get; set; } = 0; + + [Required, MaxLength(128)] + public string FileType { get; set; } = string.Empty; + + [Column(TypeName = "text")] + public string Detail { get; set; } = string.Empty; + + [Required] + public Guid ObjectRefId { get; set; } + + [Required] + public DateTime CreatedDate { get; set; } = DateTime.Now; + } +} diff --git a/BMA.EHR.Domain/Models/HR/LimitLeave.cs b/BMA.EHR.Domain/Models/HR/LimitLeave.cs new file mode 100644 index 00000000..de1552af --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/LimitLeave.cs @@ -0,0 +1,13 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class LimitLeave : EntityBase + { + [Comment("ยังไม่ชัวใช้อะไรเป็นkey")] + public string? Name { get; set; } + public virtual List LimitTypeLeaves { get; set; } = new List(); + public virtual List Profiles { get; set; } = new List(); + } +} diff --git a/BMA.EHR.Domain/Models/HR/LimitTypeLeave.cs b/BMA.EHR.Domain/Models/HR/LimitTypeLeave.cs new file mode 100644 index 00000000..a1d0b122 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/LimitTypeLeave.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class LimitTypeLeave : EntityBase + { + [Comment("ประเภทการลา")] + public virtual TypeLeave? TypeLeave { get; set; } + [Comment("จำนวนที่ลาได้")] + public double? NumLeave { get; set; } + public LimitLeave? LimitLeave { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/Profile.cs b/BMA.EHR.Domain/Models/HR/Profile.cs new file mode 100644 index 00000000..04043cd4 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/Profile.cs @@ -0,0 +1,293 @@ +using BMA.EHR.Profile.Service.Models.Documents; +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class Profile : EntityBase + { + [Key] + public Guid Id { get; set; } + [MaxLength(13), Comment("รหัสบัตรประชาชน")] + public string? CitizenId { get; set; } + [MaxLength(50)] + public string? ProfileType { get; set; } + [MaxLength(20), Comment("ประเภทการจ้าง")] + public string? EmployeeType { get; set; } + [MaxLength(20), Comment("ประเภทลูกจ้าง")] + public string? EmployeeClass { get; set; } + [Comment("Id คำนำหน้า")] + public Guid? PrefixId { get; set; } + [Required, MaxLength(100), Comment("ชื่อ")] + public string? FirstName { get; set; } + [Required, MaxLength(100), Comment("นามสกุล")] + public string? LastName { get; set; } + [Comment("Id คำนำหน้า(เดิม)")] + public Guid? PrefixOldId { get; set; } + [Required, MaxLength(100), Comment("ชื่อ(เดิม)")] + public string? FirstNameOld { get; set; } + [Required, MaxLength(100), Comment("นามสกุล(เดิม)")] + public string? LastNameOld { get; set; } + [MaxLength(100)] + public string AvatarRef { get; set; } + [Comment("Id เพศ")] + public Guid? GenderId { get; set; } + [MaxLength(100), Comment("สัญชาติ")] + public string? Nationality { get; set; } + [MaxLength(100), Comment("เชื้อชาติ")] + public string? Race { get; set; } + [Comment("Id ศาสนา")] + public Guid? ReligionId { get; set; } + [Required, Comment("วันเกิด")] + public DateTime BirthDate { get; set; } + [Comment("Id กลุ่มเลือด")] + public Guid? BloodGroupId { get; set; } + [Comment("Id สถานะภาพ")] + public Guid? RelationshipId { get; set; } + [MaxLength(50), Comment("เบอร์โทร")] + public string? TelephoneNumber { get; set; } + [Comment("คู่สมรส")] + public bool? Couple { get; set; } + [Comment("Id คำนำหน้าคู่สมรส")] + public Guid? CouplePrefixId { get; set; } + [MaxLength(100), Comment("ชื่อคู่สมรส")] + public string? CoupleFirstName { get; set; } + [MaxLength(100), Comment("นามสกุลคู่สมรส")] + public string? CoupleLastName { get; set; } + [MaxLength(100), Comment("นามสกุลคู่สมรส(เดิม)")] + public string? CoupleLastNameOld { get; set; } + [MaxLength(100), Comment("อาชีพคู่สมรส")] + public string? CoupleCareer { get; set; } + [Comment("Id คำนำหน้าบิดา")] + public Guid? FatherPrefixId { get; set; } + [MaxLength(100), Comment("ชื่อบิดา")] + public string? FatherFirstName { get; set; } + + [MaxLength(100), Comment("นามสกุลบิดา")] + public string? FatherLastName { get; set; } + + [MaxLength(100), Comment("อาชีพบิดา")] + public string? FatherCareer { get; set; } + [Comment("Id คำนำหน้ามารดา")] + public Guid? MotherPrefixId { get; set; } + + [MaxLength(100), Comment("ชื่อมารดา")] + public string? MotherFirstName { get; set; } + + [MaxLength(100), Comment("นามสกุลมารดา")] + public string? MotherLastName { get; set; } + + [MaxLength(100), Comment("อาชีพมารดา")] + public string? MotherCareer { get; set; } + [MaxLength(200), Comment("ที่อยู่ปัจจุบัน")] + public string? CurrentAddress { get; set; } + [Comment("Id แขวงปัจจุบัน")] + public Guid? CurrentSubDistrictId { get; set; } + [Comment("Id เขตปัจจุบัน")] + public Guid? CurrentDistrictId { get; set; } + [Comment("Id จังหวัดปัจจุบัน")] + public Guid? CurrentProvinceId { get; set; } + [MaxLength(5), Comment("รหัสไปรษณีย์ปัจจุบัน")] + public string? CurrentZipCode { get; set; } + [Comment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่")] + public bool? RegistrationSame { get; set; } = false; + [MaxLength(200), Comment("Id แขวงตามทะเบียนบ้าน")] + public string? RegistrationAddress { get; set; } + [Comment("แขวงตามทะเบียนบ้าน")] + public Guid? RegistrationSubDistrictId { get; set; } + [Comment("Id เขตตามทะเบียนบ้าน")] + public Guid? RegistrationDistrictId { get; set; } + [Comment("Id จังหวัดตามทะเบียนบ้าน")] + public Guid? RegistrationProvinceId { get; set; } + [MaxLength(5), Comment("รหัสไปรษณีย์ตามทะเบียนบ้าน")] + public string? RegistrationZipCode { get; set; } + + public DateTime? DateAppoint { get; set; } + + public DateTime? DateStart { get; set; } + + public DateTime? DateRetire { get; set; } + + public string? ReasonSameDate { get; set; } + // public Guid? AffiliationId { get; set; } + // public Guid? PositionId { get; set; } + // public Guid? WorkId { get; set; } + // public Guid? TypeId { get; set; } + // public Guid? LevelId { get; set; } + // public Guid? NumberId { get; set; } + // public Guid? BusinessId { get; set; } + [Comment("Id สังกัด")] + public Guid? OcId { get; set; } + [Comment("สังกัด")] + public string? Oc { get; set; } + public Guid? OrganizationShortNameId { get; set; } + public string? OrganizationShortName { get; set; } + public string? GovernmentCode { get; set; } + public Guid? OrganizationOrganizationId { get; set; } + public string? OrganizationOrganization { get; set; } + [Comment("Id ตำแหน่ง")] + public Guid? PositionId { get; set; } + [Comment("ตำแหน่ง")] + public string? Position { get; set; } + [Comment("Id เลขที่ตำแหน่ง")] + public Guid? PosNoId { get; set; } + [Comment("เลขที่ตำแหน่ง")] + public string? PosNo { get; set; } + [Comment("เลขที่ตำแหน่งลูกจ้าง")] + public string? PosNoEmployee { get; set; } + [Comment("Id สายงาน")] + public Guid? PositionLineId { get; set; } + [Comment("สายงาน")] + public string? PositionLine { get; set; } + [Comment("Id ด้าน/สาขา")] + public Guid? PositionPathSideId { get; set; } + [Comment("ด้าน/สาขา")] + public string? PositionPathSide { get; set; } + [Comment("Id ประเภทตำแหน่ง")] + public Guid? PositionTypeId { get; set; } + [Comment("ประเภทตำแหน่ง")] + public string? PositionType { get; set; } + [Comment(" Id ระดับ")] + public Guid? PositionLevelId { get; set; } + [Comment("ระดับ")] + public string? PositionLevel { get; set; } + [Comment("Id ตำแหน่งทางการบริหาร")] + public Guid? PositionExecutiveId { get; set; } + [Comment("ตำแหน่งทางการบริหาร")] + public string? PositionExecutive { get; set; } + [Comment("Id ด้านทางการบริหาร")] + public Guid? PositionExecutiveSideId { get; set; } + [Comment("ด้านทางการบริหาร")] + public string? PositionExecutiveSide { get; set; } + + [Comment("Id ตำแหน่ง")] + public Guid? PositionEmployeePositionId { get; set; } + [Comment("ตำแหน่ง")] + public string? PositionEmployeePosition { get; set; } + [Comment("Id ด้านของตำแหน่ง")] + public Guid? PositionEmployeePositionSideId { get; set; } + [Comment("ด้านของตำแหน่ง")] + public string? PositionEmployeePositionSide { get; set; } + [Comment(" Id ระดับชั้นงาน")] + public Guid? PositionEmployeeLevelId { get; set; } + [Comment("ระดับชั้นงาน")] + public string? PositionEmployeeLevel { get; set; } + [Comment("Id กลุ่มงาน")] + public Guid? PositionEmployeeGroupId { get; set; } + [Comment("กลุ่มงาน")] + public string? PositionEmployeeGroup { get; set; } + + [MaxLength(100), Comment("สถานภาพทางกาย")] + public string Physical { get; set; } + + [MaxLength(100)] + public string Ability { get; set; } + + public bool IsActive { get; set; } = true; + + public bool IsLeave { get; set; } = false; + + public DateTime? LeaveDate { get; set; } + + [MaxLength(1000)] + public string? LeaveReason { get; set; } + public string? LeaveDetail { get; set; } + public string? LeaveNumberOrder { get; set; } + public DateTime? LeaveDateOrder { get; set; } + + public DateTime? CreatedDate { get; set; } + + public DateTime? ModifiedDate { get; set; } + + [MaxLength(250)] + public string CreatedUser { get; set; } = string.Empty; + + [MaxLength(5)] + public string EntryStatus { get; set; } = "st1"; // สถานะการตรวจสอบ st1 = create; st2 = pending + + public bool IsTransfer { get; set; } = false; + + public DateTime? TransferDate { get; set; } + + public int GovAgeAbsent { get; set; } = 0; + + public int GovAgePlus { get; set; } = 0; + + // public OrganizationEntity? Organization { get; set; } + + // public PositionNumberEntity PositionNumber { get; set; } + + // public Position Position { get; set; } + + // public PositionExecutive PositionExecutive { get; set; } + + public bool IsVerified { get; set; } = false; + + [MaxLength(100)] + public string VerifiedUser { get; set; } = string.Empty; + + public DateTime? VerifiedDate { get; set; } + + public Document? Avatar { get; set; } + + public bool IsProbation { get; set; } = true; + + // public PositionType PositionType { get; set; } // ประเภทตำแหน่ง + + // public PositionLevel PositionLevel { get; set; } // ระดับ + + // public OrganizationPositionEntity? OrganizationPosition { get; set; } + public LimitLeave? LimitLeave { get; set; } + + public virtual List Educations { get; set; } = new List(); + + public virtual List Honors { get; set; } = new List(); + public virtual List Assessments { get; set; } = new List(); + + public virtual List Disciplines { get; set; } = new List(); + + public virtual List Certificates { get; set; } = new List(); + + public virtual List Trainings { get; set; } = new List(); + + public virtual List Insignias { get; set; } = new List(); + + public virtual List Salaries { get; set; } = new List(); + + public virtual List ProfileHistory { get; set; } = new List(); + + public virtual List CoupleHistory { get; set; } = new List(); + + public virtual List FatherHistory { get; set; } = new List(); + + public virtual List MotherHistory { get; set; } = new List(); + + public virtual List FamilyHistory { get; set; } = new List(); + + public virtual List GovernmentHistory { get; set; } = new List(); + + public virtual List Leaves { get; set; } = new List(); + + public virtual List CurrentAddressHistory { get; set; } = new List(); + + public virtual List RegistrationAddressHistory { get; set; } = new List(); + + public virtual List AddressHistory { get; set; } = new List(); + + public virtual List Others { get; set; } = new List(); + + public virtual List Abilitys { get; set; } = new List(); + + public virtual List Dutys { get; set; } = new List(); + + public virtual List Nopaids { get; set; } = new List(); + + public virtual List AvatarHistory { get; set; } = new List(); + + public virtual List Papers { get; set; } = new List(); + + public virtual List Childrens { get; set; } = new List(); + public virtual List ChangeNames { get; set; } = new List(); + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileAbility.cs b/BMA.EHR.Domain/Models/HR/ProfileAbility.cs new file mode 100644 index 00000000..d8b52e40 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileAbility.cs @@ -0,0 +1,47 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAbility : EntityBase + { + [Comment("ด้าน")] + /// + /// ด้าน (ใช้เฉพาะ ความสามารถพิเศษ) + /// + public string? Field { get; set; } + [Comment("รายละเอียด")] + /// + /// รายละเอียด + /// + public string? Detail { get; set; } + [Comment("หมายเหตุ")] + /// + /// หมายเหตุ + /// + public string? Remark { get; set; } + [Comment("วันที่เริ่มต้น")] + + /// + /// วันที่เริ่มต้น + /// + public DateTime? DateStart { get; set; } + [Comment("วันที่สิ้นสุด")] + /// + /// วันที่สิ้นสุด + /// + public DateTime? DateEnd { get; set; } + [Comment("เอกสารอ้างอิง")] + /// + /// เอกสารอ้างอิง + /// + public string? Reference { get; set; } + // public string? Side { get; set; } + // public string? Detail { get; set; } + // public string? Note { get; set; } + public virtual List ProfileAbilityHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} \ No newline at end of file diff --git a/BMA.EHR.Domain/Models/HR/ProfileAbilityHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileAbilityHistory.cs new file mode 100644 index 00000000..d49b3e83 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileAbilityHistory.cs @@ -0,0 +1,45 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAbilityHistory : EntityBase + { + [Comment("ด้าน")] + /// + /// ด้าน (ใช้เฉพาะ ความสามารถพิเศษ) + /// + public string? Field { get; set; } + [Comment("รายละเอียด")] + /// + /// รายละเอียด + /// + public string? Detail { get; set; } + [Comment("หมายเหตุ")] + /// + /// หมายเหตุ + /// + public string? Remark { get; set; } + [Comment("วันที่เริ่มต้น")] + /// + /// วันที่เริ่มต้น + /// + public DateTime? DateStart { get; set; } + [Comment("วันที่สิ้นสุด")] + /// + /// วันที่สิ้นสุด + /// + public DateTime? DateEnd { get; set; } + [Comment("เอกสารอ้างอิง")] + /// + /// เอกสารอ้างอิง + /// + public string? Reference { get; set; } + // public string? Side { get; set; } + // public string? Detail { get; set; } + // public string? Note { get; set; } + public virtual ProfileAbility? ProfileAbility { get; set; } + } +} \ No newline at end of file diff --git a/BMA.EHR.Domain/Models/HR/ProfileAddressHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileAddressHistory.cs new file mode 100644 index 00000000..418617c3 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileAddressHistory.cs @@ -0,0 +1,47 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAddressHistory : EntityBase + { + [Comment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่")] + public bool? RegistrationSame { get; set; } + [MaxLength(200), Comment("ที่อยู่ตามทะเบียนบ้าน")] + public string? RegistrationAddress { get; set; } + [Comment("Id แขวงตามทะเบียนบ้าน")] + public Guid? RegistrationSubDistrictId { get; set; } + [Comment("แขวงตามทะเบียนบ้าน")] + public string? RegistrationSubDistrict { get; set; } + [Comment("Id เขตตามทะเบียนบ้าน")] + public Guid? RegistrationDistrictId { get; set; } + [Comment("เขตตามทะเบียนบ้าน")] + public string? RegistrationDistrict { get; set; } + [Comment("Id จังหวัดตามทะเบียนบ้าน")] + public Guid? RegistrationProvinceId { get; set; } + [Comment("จังหวัดตามทะเบียนบ้าน")] + public string? RegistrationProvince { get; set; } + [MaxLength(5), Comment("รหัสไปรษณีย์ตามทะเบียนบ้าน")] + public string? RegistrationZipCode { get; set; } + [MaxLength(200), Comment("ที่อยู่ปัจจุบัน")] + public string? CurrentAddress { get; set; } + [Comment("Id แขวงปัจจุบัน")] + public Guid? CurrentSubDistrictId { get; set; } + [Comment("แขวงปัจจุบัน")] + public string? CurrentSubDistrict { get; set; } + [Comment("Id เขตปัจจุบัน")] + public Guid? CurrentDistrictId { get; set; } + [Comment("เขตปัจจุบัน")] + public string? CurrentDistrict { get; set; } + [Comment("Id จังหวัดปัจจุบัน")] + public Guid? CurrentProvinceId { get; set; } + [Comment("จังหวัดปัจจุบัน")] + public string? CurrentProvince { get; set; } + [MaxLength(5), Comment("รหัสไปรษณีย์ปัจจุบัน")] + public string? CurrentZipCode { get; set; } + public virtual Profile? Profile { get; set; } + } +} + diff --git a/BMA.EHR.Domain/Models/HR/ProfileAssessment.cs b/BMA.EHR.Domain/Models/HR/ProfileAssessment.cs new file mode 100644 index 00000000..5d0b9153 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileAssessment.cs @@ -0,0 +1,29 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAssessment : EntityBase + { + [Comment("ชื่อแบบประเมิน")] + public string? Name { get; set; } + [Comment("วันที่ได้รับ")] + public DateTime? Date { get; set; } + [Comment("ส่วนที่1 (คะแนน)")] + public double? Point1Total { get; set; } + [Comment("ผลประเมินส่วนที่1 (คะแนน)")] + public double? Point1 { get; set; } + [Comment("ส่วนที่2 (คะแนน)")] + public double? Point2Total { get; set; } + [Comment("ผลประเมินส่วนที่2 (คะแนน)")] + public double? Point2 { get; set; } + [Comment("ผลรวม (คะแนน)")] + public double? PointSumTotal { get; set; } + [Comment("ผลประเมินรวม (คะแนน)")] + public double? PointSum { get; set; } + public virtual List ProfileAssessmentHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileAssessmentHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileAssessmentHistory.cs new file mode 100644 index 00000000..c592b107 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileAssessmentHistory.cs @@ -0,0 +1,28 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAssessmentHistory : EntityBase + { + [Comment("ชื่อแบบประเมิน")] + public string? Name { get; set; } + [Comment("วันที่ได้รับ")] + public DateTime? Date { get; set; } + [Comment("ส่วนที่1 (คะแนน)")] + public double? Point1Total { get; set; } + [Comment("ผลประเมินส่วนที่1 (คะแนน)")] + public double? Point1 { get; set; } + [Comment("ส่วนที่2 (คะแนน)")] + public double? Point2Total { get; set; } + [Comment("ผลประเมินส่วนที่2 (คะแนน)")] + public double? Point2 { get; set; } + [Comment("ผลรวม (คะแนน)")] + public double? PointSumTotal { get; set; } + [Comment("ผลประเมินรวม (คะแนน)")] + public double? PointSum { get; set; } + public virtual ProfileAssessment? ProfileAssessment { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileAvatarHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileAvatarHistory.cs new file mode 100644 index 00000000..27ab1f94 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileAvatarHistory.cs @@ -0,0 +1,15 @@ +using BMA.EHR.Profile.Service.Models.Documents; +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAvatarHistory : EntityBase + { + [Comment("Id ไฟล์รูปใน minio")] + public Document AvatarFile { get; set; } + [Comment("Id ทะเบียนประวัติ")] + public Profile Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileCertificate.cs b/BMA.EHR.Domain/Models/HR/ProfileCertificate.cs new file mode 100644 index 00000000..67fb477b --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileCertificate.cs @@ -0,0 +1,31 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileCertificate : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + [MaxLength(20), Comment("เลขที่ใบอนุญาต")] + public string? CertificateNo { get; set; } + [MaxLength(200), Comment("หน่วยงานผู้ออกใบอนุญาต")] + public string? Issuer { get; set; } + [Comment("วันที่ออกใบอนุญาต")] + public DateTime? IssueDate { get; set; } + [Comment("วันที่หมดอายุ")] + public DateTime? ExpireDate { get; set; } + [MaxLength(100), Comment("ชื่อใบอนุญาต")] + public string? CertificateType { get; set; } + // public string? Name { get; set; } + // public string? CertiNumber { get; set; } + // public DateTime? Start { get; set; } + // public DateTime? End { get; set; } + public virtual List ProfileCertificateHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileCertificateHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileCertificateHistory.cs new file mode 100644 index 00000000..79d46ff7 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileCertificateHistory.cs @@ -0,0 +1,26 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileCertificateHistory : EntityBase + { + [MaxLength(20), Comment("เลขที่ใบอนุญาต")] + public string? CertificateNo { get; set; } + [MaxLength(200), Comment("หน่วยงานผู้ออกใบอนุญาต")] + public string? Issuer { get; set; } + [Comment("วันที่ออกใบอนุญาต")] + public DateTime? IssueDate { get; set; } + [Comment("วันที่หมดอายุ")] + public DateTime? ExpireDate { get; set; } + [MaxLength(100), Comment("ชื่อใบอนุญาต")] + public string? CertificateType { get; set; } + // public string? Name { get; set; } + // public string? CertiNumber { get; set; } + // public DateTime? Start { get; set; } + // public DateTime? End { get; set; } + public virtual ProfileCertificate? ProfileCertificate { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileChangeName.cs b/BMA.EHR.Domain/Models/HR/ProfileChangeName.cs new file mode 100644 index 00000000..c4c1048a --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileChangeName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; +using BMA.EHR.Profile.Service.Models.Documents; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileChangeName : EntityBase + { + [Comment("Id คำนำหน้า")] + public Guid? PrefixId { get; set; } + [Comment("คำนำหน้า")] + public string? Prefix { get; set; } + [MaxLength(100), Comment("ชื่อ")] + public string? FirstName { get; set; } + [MaxLength(100), Comment("นามสกุล")] + public string? LastName { get; set; } + [MaxLength(100), Comment("สถานะ")] + public string? Status { get; set; } + [Comment("เอกสารการเปลี่ยนชื่อ")] + public Document? Document { get; set; } + public virtual List ProfileChangeNameHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileChangeNameHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileChangeNameHistory.cs new file mode 100644 index 00000000..18562565 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileChangeNameHistory.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; +using BMA.EHR.Profile.Service.Models.Documents; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileChangeNameHistory : EntityBase + { + [Comment("Id คำนำหน้า")] + public Guid? PrefixId { get; set; } + [Comment("คำนำหน้า")] + public string? Prefix { get; set; } + [MaxLength(100), Comment("ชื่อ")] + public string? FirstName { get; set; } + [MaxLength(100), Comment("นามสกุล")] + public string? LastName { get; set; } + [MaxLength(100), Comment("สถานะ")] + public string? Status { get; set; } + [Comment("เอกสารการเปลี่ยนชื่อ")] + public Document? Document { get; set; } + public virtual ProfileChangeName? ProfileChangeName { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileChildren.cs b/BMA.EHR.Domain/Models/HR/ProfileChildren.cs new file mode 100644 index 00000000..a35a3331 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileChildren.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileChildren : EntityBase + { + [Comment("Id คำนำหน้าบุตร")] + public Guid? ChildrenPrefixId { get; set; } + [Comment("คำนำหน้าบุตร")] + public string? ChildrenPrefix { get; set; } + [Comment("ชื่อบุตร")] + public string? ChildrenFirstName { get; set; } + [Comment("นามสกุลบุตร")] + public string? ChildrenLastName { get; set; } + [Comment("อาชีพบุตร")] + public string? ChildrenCareer { get; set; } + public virtual List ProfileChildrenHistorys { get; set; } = new List(); + public Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileChildrenHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileChildrenHistory.cs new file mode 100644 index 00000000..4db0b071 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileChildrenHistory.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileChildrenHistory : EntityBase + { + [Comment("Id คำนำหน้าบุตร")] + public Guid? ChildrenPrefixId { get; set; } + [Comment("คำนำหน้าบุตร")] + public string? ChildrenPrefix { get; set; } + [Comment("ชื่อบุตร")] + public string? ChildrenFirstName { get; set; } + [Comment("นามสกุลบุตร")] + public string? ChildrenLastName { get; set; } + [Comment("อาชีพบุตร")] + public string? ChildrenCareer { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileCoupleHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileCoupleHistory.cs new file mode 100644 index 00000000..44521a93 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileCoupleHistory.cs @@ -0,0 +1,31 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileCoupleHistory + { + [Key, Comment("ไม่ใช้")] + public int Id { get; set; } + + [Required] + [MaxLength(50)] + public string Prefix { get; set; } + + [Required] + [MaxLength(100)] + public string FirstName { get; set; } + + [Required] + [MaxLength(100)] + public string LastName { get; set; } + + [MaxLength(100)] + public string Career { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileCurrentAddressHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileCurrentAddressHistory.cs new file mode 100644 index 00000000..b307eea3 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileCurrentAddressHistory.cs @@ -0,0 +1,34 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileCurrentAddressHistory + { + [Key, Comment("ไม่ใช้")] + public int Id { get; set; } + + [MaxLength(200)] + [Required] + public string Address { get; set; } + + [Required] + public Guid SubDistrictId { get; set; } + + [Required] + public Guid DistrictId { get; set; } + + [Required] + public Guid ProvinceId { get; set; } + + [MaxLength(5)] + [Required] + public string ZipCode { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} + diff --git a/BMA.EHR.Domain/Models/HR/ProfileDiscipline.cs b/BMA.EHR.Domain/Models/HR/ProfileDiscipline.cs new file mode 100644 index 00000000..05de9c35 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileDiscipline.cs @@ -0,0 +1,34 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileDiscipline : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + [Comment("ระดับความผิด")] + public string? Level { get; set; } + [Column(TypeName = "text")] + [Comment("รายละเอียด")] + public string? Detail { get; set; } + [Comment("เอกสารอ้างอิง (เลขที่คำสั่ง)")] + public string? RefCommandNo { get; set; } + [Comment("เอกสารอ้างอิง (ลงวันที่)")] + public DateTime? RefCommandDate { get; set; } + [Comment("วัน เดือน ปี")] + public DateTime? Date { get; set; } + // public DateTime? Date { get; set; } + // public string? Status { get; set; } + // public string? Level { get; set; } + // public string? RefNo { get; set; } + // public DateTime? RefDate { get; set; } + public virtual List ProfileDisciplineHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileDisciplineHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileDisciplineHistory.cs new file mode 100644 index 00000000..d49afcc3 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileDisciplineHistory.cs @@ -0,0 +1,29 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileDisciplineHistory : EntityBase + { + [Comment("ระดับความผิด")] + public string? Level { get; set; } + [Column(TypeName = "text")] + [Comment("รายละเอียด")] + public string? Detail { get; set; } + [Comment("เอกสารอ้างอิง (เลขที่คำสั่ง)")] + public string? RefCommandNo { get; set; } + [Comment("เอกสารอ้างอิง (ลงวันที่)")] + public DateTime? RefCommandDate { get; set; } + [Comment("วัน เดือน ปี")] + public DateTime? Date { get; set; } + // public DateTime? Date { get; set; } + // public string? Status { get; set; } + // public string? Level { get; set; } + // public string? RefNo { get; set; } + // public DateTime? RefDate { get; set; } + public virtual ProfileDiscipline? ProfileDiscipline { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileDuty.cs b/BMA.EHR.Domain/Models/HR/ProfileDuty.cs new file mode 100644 index 00000000..e527f943 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileDuty.cs @@ -0,0 +1,21 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileDuty : EntityBase + { + [Comment("เริ่มต้น")] + public DateTime? DateStart { get; set; } + [Comment("สิ้นสุด")] + public DateTime? DateEnd { get; set; } + [Comment("รายละเอียด")] + public string? Detail { get; set; } + [Comment("เอกสารอ้างอิง")] + public string? Reference { get; set; } + public virtual List ProfileDutyHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} \ No newline at end of file diff --git a/BMA.EHR.Domain/Models/HR/ProfileDutyHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileDutyHistory.cs new file mode 100644 index 00000000..b3672250 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileDutyHistory.cs @@ -0,0 +1,20 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileDutyHistory : EntityBase + { + [Comment("เริ่มต้น")] + public DateTime? DateStart { get; set; } + [Comment("สิ้นสุด")] + public DateTime? DateEnd { get; set; } + [Comment("รายละเอียด")] + public string? Detail { get; set; } + [Comment("เอกสารอ้างอิง")] + public string? Reference { get; set; } + public virtual ProfileDuty? ProfileDuty { get; set; } + } +} \ No newline at end of file diff --git a/BMA.EHR.Domain/Models/HR/ProfileEducation.cs b/BMA.EHR.Domain/Models/HR/ProfileEducation.cs new file mode 100644 index 00000000..9235d252 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileEducation.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileEducation : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + [MaxLength(1000), Comment("สถานศึกษา")] + public string? Institute { get; set; } + [MaxLength(200), Comment("วุฒิการศึกษา")] + public string? Degree { get; set; } + [MaxLength(200), Comment("สาขาวิชา/ทาง")] + public string? Field { get; set; } + [MaxLength(20), Comment("เกรดเฉลี่ย")] + public string? Gpa { get; set; } + [MaxLength(1000), Comment("ประเทศ")] + public string? Country { get; set; } + [MaxLength(1000), Comment("ระยะเวลา")] + public string? Duration { get; set; } + [MaxLength(1000), Comment("ข้อมูลการติดต่อ")] + public string? Other { get; set; } + [MaxLength(1000), Comment("ทุน")] + public string? FundName { get; set; } + [Comment("ระยะเวลาหลักสูตร")] + public int DurationYear { get; set; } + [Comment("วันที่สำเร็จการศึกษา")] + public DateTime? FinishDate { get; set; } + [Comment("ตั้งแต่")] + public DateTime? StartDate { get; set; } + [Comment("ถึง")] + public DateTime? EndDate { get; set; } + [Comment("ระดับศึกษา")] + public string? EducationLevel { get; set; } + [Comment("Id ระดับศึกษา")] + public Guid? EducationLevelId { get; set; } + [Comment("เป็นวุฒิการศึกษาในตำแหน่ง")] + public string? PositionPath { get; set; } + [Comment("Id เป็นวุฒิการศึกษาในตำแหน่ง")] + public Guid? PositionPathId { get; set; } + public virtual List ProfileEducationHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileEducationHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileEducationHistory.cs new file mode 100644 index 00000000..a7acc65e --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileEducationHistory.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileEducationHistory : EntityBase + { + [MaxLength(1000), Comment("สถานศึกษา")] + public string? Institute { get; set; }// + [MaxLength(200), Comment("วุฒิการศึกษา")] + public string? Degree { get; set; }// + [MaxLength(200), Comment("สาขาวิชา/ทาง")] + public string? Field { get; set; }// + [MaxLength(20), Comment("เกรดเฉลี่ย")] + public string? Gpa { get; set; }// + [MaxLength(1000), Comment("ประเทศ")] + public string? Country { get; set; }// + [MaxLength(1000), Comment("ระยะเวลา")] + public string? Duration { get; set; }// + [MaxLength(1000), Comment("ข้อมูลการติดต่อ")] + public string? Other { get; set; }// + [MaxLength(1000), Comment("ทุน")] + public string? FundName { get; set; }// + [Comment("ระยะเวลาหลักสูตร")] + public int DurationYear { get; set; }// + [Comment("วันที่สำเร็จการศึกษา")] + public DateTime? FinishDate { get; set; }// + [Comment("ตั้งแต่")] + public DateTime? StartDate { get; set; }// + [Comment("ถึง")] + public DateTime? EndDate { get; set; }// + [Comment("ระดับศึกษา")] + public string? EducationLevel { get; set; } + [Comment("Id ระดับศึกษา")] + public Guid? EducationLevelId { get; set; } + [Comment("เป็นวุฒิการศึกษาในตำแหน่ง")] + public string? PositionPath { get; set; } + [Comment("Id เป็นวุฒิการศึกษาในตำแหน่ง")] + public Guid? PositionPathId { get; set; } + public virtual ProfileEducation? ProfileEducation { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileFamilyHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileFamilyHistory.cs new file mode 100644 index 00000000..c67a78c7 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileFamilyHistory.cs @@ -0,0 +1,50 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileFamilyHistory : EntityBase + { + [Comment("คู่สมรส")] + public bool? Couple { get; set; } + + [Comment("Id คำนำหน้าคู่สมรส")] + public Guid? CouplePrefixId { get; set; } + [Comment("คำนำหน้าคู่สมรส")] + public string? CouplePrefix { get; set; } + [Comment("ชื่อคู่สมรส")] + public string? CoupleFirstName { get; set; } + [Comment("นามสกุลคู่สมรส")] + public string? CoupleLastName { get; set; } + [Comment("นามสกุลคู่สมรส(เดิม)")] + public string? CoupleLastNameOld { get; set; } + [Comment("อาชีพคู่สมรส")] + public string? CoupleCareer { get; set; } + [Comment("Id คำนำหน้าบิดา")] + public Guid? FatherPrefixId { get; set; } + [Comment("คำนำหน้าบิดา")] + public string? FatherPrefix { get; set; } + [Comment("ชื่อบิดา")] + public string? FatherFirstName { get; set; } + [Comment("นามสกุลบิดา")] + public string? FatherLastName { get; set; } + [Comment("อาชีพบิดา")] + public string? FatherCareer { get; set; } + + [Comment("Id คำนำหน้ามารดา")] + public Guid? MotherPrefixId { get; set; } + [Comment("คำนำหน้ามารดา")] + public string? MotherPrefix { get; set; } + [Comment("ชื่อมารดา")] + public string? MotherFirstName { get; set; } + [Comment("นามสกุลมารดา")] + public string? MotherLastName { get; set; } + [Comment("อาชีพมารดา")] + public string? MotherCareer { get; set; } + public virtual Profile? Profile { get; set; } + + public virtual List Childrens { get; set; } = new List(); + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileFatherHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileFatherHistory.cs new file mode 100644 index 00000000..2bcf9ed9 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileFatherHistory.cs @@ -0,0 +1,31 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileFatherHistory + { + [Key, Comment("ไม่ใช้")] + public int Id { get; set; } + + [Required] + [MaxLength(50)] + public string Prefix { get; set; } + + [Required] + [MaxLength(100)] + public string FirstName { get; set; } + + [Required] + [MaxLength(100)] + public string LastName { get; set; } + + [MaxLength(100)] + public string Career { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileGovernmentHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileGovernmentHistory.cs new file mode 100644 index 00000000..d7dc9f17 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileGovernmentHistory.cs @@ -0,0 +1,54 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileGovernmentHistory : EntityBase + { + [Comment("เหตุผลกรณีไม่ตรงวัน")] + public string? ReasonSameDate { get; set; } + [Comment("Id สังกัด")] + public Guid? OcId { get; set; } + [Comment("สังกัด")] + public string? Oc { get; set; } + [Comment("Id ตำแหน่ง")] + public Guid? PositionId { get; set; } + [Comment("ตำแหน่ง")] + public string? Position { get; set; } + [Comment("Id เลขที่ตำแหน่ง")] + public Guid? PosNoId { get; set; } + [Comment("เลขที่ตำแหน่ง")] + public string? PosNo { get; set; } + [Comment("สายงาน")] + public string? PositionLine { get; set; } + [Comment("ประเภทตำแหน่ง")] + public string? PositionType { get; set; } + [Comment("ระดับตำแหน่ง")] + public string? PositionLevel { get; set; } + [Comment("ตำแหน่งทางการบริหาร")] + public string? PositionExecutive { get; set; } + [Comment("ตำแหน่ง")] + public string? PositionEmployeePosition { get; set; } + [Comment("ด้านของตำแหน่ง")] + public string? PositionEmployeePositionSide { get; set; } + [Comment("ระดับชั้นงาน")] + public string? PositionEmployeeLevel { get; set; } + [Comment("กลุ่มงาน")] + public string? PositionEmployeeGroup { get; set; } + [Comment("วันที่สั่งบรรจุ")] + public DateTime? DateAppoint { get; set; } + [Comment("เริ่มปฎิบัติราชการ")] + public DateTime? DateStart { get; set; } + [Comment("วันเกษียณอายุ")] + public string? RetireDate { get; set; } + [Comment("อายุราชการ")] + public string? GovAge { get; set; } + [Comment("ขาดราชการ")] + public int? GovAgeAbsent { get; set; } = 0; + [Comment("อายุราชการเกื้อกูล")] + public int? GovAgePlus { get; set; } = 0; + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileHistory.cs new file mode 100644 index 00000000..c6599b8d --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileHistory.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileHistory : EntityBase + { + [MaxLength(13), Comment("รหัสบัตรประชาชน")] + public string? CitizenId { get; set; } + [Comment("Id คำนำหน้า")] + public Guid? PrefixId { get; set; } + [Comment("คำนำหน้า")] + public string? Prefix { get; set; } + [Required, MaxLength(100), Comment("ชื่อ")] + public string? FirstName { get; set; } + [Required, MaxLength(100), Comment("นามสกุล")] + public string? LastName { get; set; } + [Comment("Id เพศ")] + public Guid? GenderId { get; set; } + [Comment("เพศ")] + public string? Gender { get; set; } + [MaxLength(100), Comment("สัญชาติ")] + public string? Nationality { get; set; } + [MaxLength(100), Comment("เชื้อชาติ")] + public string? Race { get; set; } + [Comment("Id ศาสนา")] + public Guid? ReligionId { get; set; } + [Comment("ศาสนา")] + public string? Religion { get; set; } + [Required, Comment("วันเกิด")] + public DateTime BirthDate { get; set; } + [Comment("Id กลุ่มเลือด")] + public Guid? BloodGroupId { get; set; } + [Comment("กลุ่มเลือด")] + public string? BloodGroup { get; set; } + [Comment("Id สถานะภาพ")] + public Guid? RelationshipId { get; set; } + [Comment("สถานะภาพ")] + public string? Relationship { get; set; } + [MaxLength(50), Comment("เบอร์โทร")] + public string? TelephoneNumber { get; set; } + [MaxLength(20), Comment("ประเภทการจ้าง")] + public string? EmployeeType { get; set; } + [MaxLength(20), Comment("ประเภทลูกจ้าง")] + public string? EmployeeClass { get; set; } + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileHonor.cs b/BMA.EHR.Domain/Models/HR/ProfileHonor.cs new file mode 100644 index 00000000..78f807da --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileHonor.cs @@ -0,0 +1,30 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileHonor : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + // [MaxLength(20)] + // public string? No { get; set; } + [MaxLength(200), Comment("หน่วยงานที่ออก")] + public string? Issuer { get; set; } + [MaxLength(2000), Comment("รายละเอียด")] + public string? Detail { get; set; } + [Comment("วันที่ได้รับ")] + public DateTime? IssueDate { get; set; } + + // public DateTime? ReceiveDate { get; set; } + // public string? Detail { get; set; } + // public Guid? OrganizationOrganizationId { get; set; } + // public string? OrganizationOrganization { get; set; } + public virtual List ProfileHonorHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileHonorHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileHonorHistory.cs new file mode 100644 index 00000000..8cf1768c --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileHonorHistory.cs @@ -0,0 +1,23 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileHonorHistory : EntityBase + { + [MaxLength(200), Comment("หน่วยงานที่ออก")] + public string? Issuer { get; set; } + [MaxLength(2000), Comment("รายละเอียด")] + public string? Detail { get; set; } + [Comment("วันที่ได้รับ")] + public DateTime? IssueDate { get; set; } + + // public DateTime? ReceiveDate { get; set; } + // public string? Detail { get; set; } + // public Guid? OrganizationOrganizationId { get; set; } + // public string? OrganizationOrganization { get; set; } + public virtual ProfileHonor? ProfileHonor { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileInsignia.cs b/BMA.EHR.Domain/Models/HR/ProfileInsignia.cs new file mode 100644 index 00000000..271c0a6e --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileInsignia.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileInsignia : EntityBase + { + [Comment("ปีที่ยื่นขอ")] + public int Year { get; set; } + [MaxLength(20), Comment("ลำดับที่")] + public string? No { get; set; } + [MaxLength(300), Comment("ราชกิจจาฯ ฉบับที่")] + public string? Issue { get; set; } + [MaxLength(30), Comment("เล่มที่")] + public string? VolumeNo { get; set; } + [MaxLength(30), Comment("เล่ม")] + public string? Volume { get; set; } + [MaxLength(30), Comment("ตอน")] + public string? Section { get; set; } + [MaxLength(30), Comment("หน้า")] + public string? Page { get; set; } + [Comment("วันที่ประกาศในราชกิจจาฯ")] + public DateTime? DateAnnounce { get; set; } + [Comment("ลงวันที่")] + public DateTime? ReceiveDate { get; set; } + [Comment("ประเภท")] + public string? InsigniaType { get; set; } + [Comment("ชื่อเครื่องราชฯ")] + public string? Insignia { get; set; } + public Guid? InsigniaId { get; set; } + public virtual List ProfileInsigniaHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileInsigniaHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileInsigniaHistory.cs new file mode 100644 index 00000000..258eeed6 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileInsigniaHistory.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileInsigniaHistory : EntityBase + { + [Comment("ปีที่ยื่นขอ")] + public int Year { get; set; } + [MaxLength(20), Comment("ลำดับที่")] + public string? No { get; set; } + [MaxLength(300), Comment("ราชกิจจาฯ ฉบับที่")] + public string? Issue { get; set; } + [MaxLength(30), Comment("เล่มที่")] + public string? VolumeNo { get; set; } + [MaxLength(30), Comment("เล่ม")] + public string? Volume { get; set; } + [MaxLength(30), Comment("ตอน")] + public string? Section { get; set; } + [MaxLength(30), Comment("หน้า")] + public string? Page { get; set; } + [Comment("วันที่ประกาศในราชกิจจาฯ")] + public DateTime? DateAnnounce { get; set; } + [Comment("ลงวันที่")] + public DateTime? ReceiveDate { get; set; } + [Comment("ประเภท")] + public string? InsigniaType { get; set; } + [Comment("ชื่อเครื่องราชฯ")] + public string? Insignia { get; set; } + public Guid? InsigniaId { get; set; } + public virtual ProfileInsignia? ProfileInsignia { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileLeave.cs b/BMA.EHR.Domain/Models/HR/ProfileLeave.cs new file mode 100644 index 00000000..0047bf5d --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileLeave.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileLeave : EntityBase + { + [Comment("วัน เดือน ปี ที่เริ่มลา")] + public DateTime? DateStartLeave { get; set; } + [Comment("วัน เดือน ปี ที่สิ้นสุดลา")] + public DateTime? DateEndLeave { get; set; } + [Comment("ลาครั้งที่")] + public double? NumLeave { get; set; } + [Comment("ลามาแล้ว")] + public double? SumLeave { get; set; } + [Comment("รวมเป็น")] + public double? TotalLeave { get; set; } + [Comment("สถานะ")] + public string? Status { get; set; } + [Comment("เหตุผล")] + public string? Reason { get; set; } + public virtual List ProfileLeaveHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + [Comment("ประเภทการลา")] + public virtual TypeLeave? TypeLeave { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileLeaveHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileLeaveHistory.cs new file mode 100644 index 00000000..2d779968 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileLeaveHistory.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileLeaveHistory : EntityBase + { + [Comment("วัน เดือน ปี ที่เริ่มลา")] + public DateTime? DateStartLeave { get; set; } + [Comment("วัน เดือน ปี ที่สิ้นสุดลา")] + public DateTime? DateEndLeave { get; set; } + [Comment("ลาครั้งที่")] + public double? NumLeave { get; set; } + [Comment("ลามาแล้ว")] + public double? SumLeave { get; set; } + [Comment("รวมเป็น")] + public double? TotalLeave { get; set; } + [Comment("สถานะ")] + public string? Status { get; set; } + [Comment("เหตุผล")] + public string? Reason { get; set; } + [Comment("ประเภทการลา")] + public virtual TypeLeave? TypeLeave { get; set; } + public virtual ProfileLeave? ProfileLeave { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileMotherHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileMotherHistory.cs new file mode 100644 index 00000000..a513aa3a --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileMotherHistory.cs @@ -0,0 +1,31 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileMotherHistory + { + [Key, Comment("ไม่ใช้")] + public int Id { get; set; } + + [Required] + [MaxLength(50)] + public string Prefix { get; set; } + + [Required] + [MaxLength(100)] + public string FirstName { get; set; } + + [Required] + [MaxLength(100)] + public string LastName { get; set; } + + [MaxLength(100)] + public string Career { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileNopaid.cs b/BMA.EHR.Domain/Models/HR/ProfileNopaid.cs new file mode 100644 index 00000000..abcb4021 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileNopaid.cs @@ -0,0 +1,30 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileNopaid : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + // [MaxLength(20)] + // public string No { get; set; } + // [MaxLength(200)] + // public string Issuer { get; set; } + // [MaxLength(2000)] + // public string Detail { get; set; } + // public DateTime IssueDate { get; set; } + [Comment("วัน เดือน ปี")] + public DateTime? Date { get; set; } + [Comment("รายละเอียด")] + public string? Detail { get; set; } + [Comment("เอกสารอ้างอิง")] + public string? Reference { get; set; } + public virtual List ProfileNopaidHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileNopaidHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileNopaidHistory.cs new file mode 100644 index 00000000..937d6e45 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileNopaidHistory.cs @@ -0,0 +1,18 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileNopaidHistory : EntityBase + { + [Comment("วัน เดือน ปี")] + public DateTime? Date { get; set; } + [Comment("รายละเอียด")] + public string? Detail { get; set; } + [Comment("เอกสารอ้างอิง")] + public string? Reference { get; set; } + public virtual ProfileNopaid? ProfileNopaid { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileOrganization.cs b/BMA.EHR.Domain/Models/HR/ProfileOrganization.cs new file mode 100644 index 00000000..50873ee2 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileOrganization.cs @@ -0,0 +1,15 @@ +using BMA.EHR.Profile.Service.Models.Documents; +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileOrganization : EntityBase + { + [Comment("Id หน่วยงานที่สังกัด")] + public Guid? OrganizationId { get; set; } + [Comment("User Id KeyCloak")] + public Guid? UserId { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileOther.cs b/BMA.EHR.Domain/Models/HR/ProfileOther.cs new file mode 100644 index 00000000..29c8cd80 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileOther.cs @@ -0,0 +1,18 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileOther : EntityBase + { + [Comment("วันที่")] + public DateTime? Date { get; set; } + [Comment("รายละเอียด")] + public string? Detail { get; set; } + public virtual List ProfileOtherHistorys { get; set; } = new List(); + public Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileOtherHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileOtherHistory.cs new file mode 100644 index 00000000..df4c6f3f --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileOtherHistory.cs @@ -0,0 +1,17 @@ +using System; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileOtherHistory : EntityBase + { + [Comment("วันที่")] + public DateTime? Date { get; set; } + [Comment("รายละเอียด")] + public string? Detail { get; set; } + public ProfileOther? ProfileOther { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfilePaper.cs b/BMA.EHR.Domain/Models/HR/ProfilePaper.cs new file mode 100644 index 00000000..216b61e1 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfilePaper.cs @@ -0,0 +1,19 @@ +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Profile.Service.Models.Documents; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfilePaper : EntityBase + { + // [Key] + // public int Id { get; set; } + [Required, MaxLength(255), Comment("ชื่อไฟล์")] + public string? Detail { get; set; } + [Required, MaxLength(255), Comment("ประเภทไฟล์-ไม่ใช้")] + public string? CategoryName { get; set; } + public Document Document { get; set; } + public virtual Profile Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileRegistrationAddressHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileRegistrationAddressHistory.cs new file mode 100644 index 00000000..2ec67450 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileRegistrationAddressHistory.cs @@ -0,0 +1,34 @@ +using System; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileRegistrationAddressHistory + { + [Key, Comment("ไม่ใช้")] + public int Id { get; set; } + + [MaxLength(200)] + [Required] + public string Address { get; set; } + + [Required] + public Guid SubDistrictId { get; set; } + + [Required] + public Guid DistrictId { get; set; } + + [Required] + public Guid ProvinceId { get; set; } + + [MaxLength(5)] + [Required] + public string ZipCode { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} + diff --git a/BMA.EHR.Domain/Models/HR/ProfileSalary.cs b/BMA.EHR.Domain/Models/HR/ProfileSalary.cs new file mode 100644 index 00000000..eaa2c8f9 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileSalary.cs @@ -0,0 +1,54 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalary : EntityBase + { + [Comment("วัน เดือน ปี รับตำแหน่ง")] + public DateTime? Date { get; set; } + [Comment("เงินเดือน")] + public double? Amount { get; set; } + [Comment("เงินประจำตำแหน่ง")] + public double? PositionSalaryAmount { get; set; } + [Comment("เงินค่าตอบแทนรายเดือน")] + public double? MouthSalaryAmount { get; set; } + [Comment("Id สังกัด")] + public Guid? OcId { get; set; } + [Comment("Id ชื่อย่อหน่วยงาน")] + public Guid? OrganizationShortNameId { get; set; } + [Comment("Id ตำแหน่ง")] + public Guid? PositionId { get; set; } + [Comment("Id เลขที่ตำแหน่ง")] + public Guid? PosNoId { get; set; } + [Comment("เลขที่ตำแหน่งลูกจ้าง")] + public string? PosNoEmployee { get; set; } + [Comment("Id สายงาน")] + public Guid? PositionLineId { get; set; } + [Comment("Id ด้าน/สาขา")] + public Guid? PositionPathSideId { get; set; } + [Comment("Id ประเภทตำแหน่ง")] + public Guid? PositionTypeId { get; set; } + [Comment("Id ระดับ")] + public Guid? PositionLevelId { get; set; } + [Comment("Id ตำแหน่งทางการบริหาร")] + public Guid? PositionExecutiveId { get; set; } + [Comment("Id ด้านทางการบริหาร")] + public Guid? PositionExecutiveSideId { get; set; } + [Comment("Id ตำแหน่ง")] + public Guid? PositionEmployeePositionId { get; set; } + [Comment("Id ด้านของตำแหน่ง")] + public Guid? PositionEmployeePositionSideId { get; set; } + [Comment(" Id ระดับชั้นงาน")] + public Guid? PositionEmployeeLevelId { get; set; } + [Comment("Id กลุ่มงาน")] + public Guid? PositionEmployeeGroupId { get; set; } + + [Comment("ตำแหน่ง (รายละเอียด)")] + public string? SalaryClass { get; set; } + [Comment("เอกสารอ้างอิง")] + public string? SalaryRef { get; set; } + public virtual List ProfileSalaryHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileSalaryHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileSalaryHistory.cs new file mode 100644 index 00000000..0ed6bb84 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileSalaryHistory.cs @@ -0,0 +1,79 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryHistory : EntityBase + { + [Comment("วัน เดือน ปี รับตำแหน่ง")] + public DateTime? Date { get; set; } + [Comment("เงินเดือน")] + public double? Amount { get; set; } + [Comment("เงินประจำตำแหน่ง")] + public double? PositionSalaryAmount { get; set; } + [Comment("เงินค่าตอบแทนรายเดือน")] + public double? MouthSalaryAmount { get; set; } + [Comment("Id สังกัด")] + public Guid? OcId { get; set; } + [Comment("สังกัด")] + public string? Oc { get; set; } + public Guid? OrganizationShortNameId { get; set; } + public string? OrganizationShortName { get; set; } + [Comment("Id ตำแหน่ง")] + public Guid? PositionId { get; set; } + [Comment("ตำแหน่ง")] + public string? Position { get; set; } + [Comment("Id เลขที่ตำแหน่ง")] + public Guid? PosNoId { get; set; } + [Comment("เลขที่ตำแหน่ง")] + public string? PosNo { get; set; } + [Comment("เลขที่ตำแหน่งลูกจ้าง")] + public string? PosNoEmployee { get; set; } + [Comment("Id สายงาน")] + public Guid? PositionLineId { get; set; } + [Comment("สายงาน")] + public string? PositionLine { get; set; } + [Comment("Id ด้าน/สาขา")] + public Guid? PositionPathSideId { get; set; } + [Comment("ด้าน/สาขา")] + public string? PositionPathSide { get; set; } + [Comment("Id ประเภทตำแหน่ง")] + public Guid? PositionTypeId { get; set; } + [Comment("ประเภทตำแหน่ง")] + public string? PositionType { get; set; } + [Comment(" Id ระดับ")] + public Guid? PositionLevelId { get; set; } + [Comment("ระดับ")] + public string? PositionLevel { get; set; } + [Comment("Id ด้านทางการบริหาร")] + public Guid? PositionExecutiveId { get; set; } + [Comment("ตำแหน่งทางการบริหาร")] + public string? PositionExecutive { get; set; } + [Comment("Id ด้านทางการบริหาร")] + public Guid? PositionExecutiveSideId { get; set; } + [Comment("ด้านทางการบริหาร")] + public string? PositionExecutiveSide { get; set; } + + [Comment("Id ตำแหน่ง")] + public Guid? PositionEmployeePositionId { get; set; } + [Comment("ตำแหน่ง")] + public string? PositionEmployeePosition { get; set; } + [Comment("Id ด้านของตำแหน่ง")] + public Guid? PositionEmployeePositionSideId { get; set; } + [Comment("ด้านของตำแหน่ง")] + public string? PositionEmployeePositionSide { get; set; } + [Comment(" Id ระดับชั้นงาน")] + public Guid? PositionEmployeeLevelId { get; set; } + [Comment("ระดับชั้นงาน")] + public string? PositionEmployeeLevel { get; set; } + [Comment("Id กลุ่มงาน")] + public Guid? PositionEmployeeGroupId { get; set; } + [Comment("กลุ่มงาน")] + public string? PositionEmployeeGroup { get; set; } + [Comment("ตำแหน่ง (รายละเอียด)")] + public string? SalaryClass { get; set; } + [Comment("เอกสารอ้างอิง")] + public string? SalaryRef { get; set; } + public virtual ProfileSalary? ProfileSalary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileSalaryOrganization.cs b/BMA.EHR.Domain/Models/HR/ProfileSalaryOrganization.cs new file mode 100644 index 00000000..8129d680 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileSalaryOrganization.cs @@ -0,0 +1,20 @@ +using BMA.EHR.Profile.Service.Models; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryOrganization + { + [ForeignKey("ProfileSalary"), Comment("ไม่ใช้")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + // public OrganizationEntity Organization { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileSalaryPosition.cs b/BMA.EHR.Domain/Models/HR/ProfileSalaryPosition.cs new file mode 100644 index 00000000..1bd2e343 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileSalaryPosition.cs @@ -0,0 +1,20 @@ +using BMA.EHR.Domain.Models.MetaData; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryPosition + { + [ForeignKey("ProfileSalary"), Comment("ไม่ใช้")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + public Position Position { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileSalaryPositionLevel.cs b/BMA.EHR.Domain/Models/HR/ProfileSalaryPositionLevel.cs new file mode 100644 index 00000000..25eca844 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileSalaryPositionLevel.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryPositionLevel + { + [ForeignKey("ProfileSalary"), Comment("ไม่ใช้")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + // public PositionLevel PositionLevel { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + } +} + diff --git a/BMA.EHR.Domain/Models/HR/ProfileSalaryPositionNumber.cs b/BMA.EHR.Domain/Models/HR/ProfileSalaryPositionNumber.cs new file mode 100644 index 00000000..d9de9a16 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileSalaryPositionNumber.cs @@ -0,0 +1,20 @@ +using BMA.EHR.Profile.Service.Models; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryPositionNumber + { + [ForeignKey("ProfileSalary"), Comment("ไม่ใช้")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + // public PositionNumberEntity PositionNumber { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileSalaryPositionType.cs b/BMA.EHR.Domain/Models/HR/ProfileSalaryPositionType.cs new file mode 100644 index 00000000..20d7b760 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileSalaryPositionType.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryPositionType + { + + [ForeignKey("ProfileSalary"), Comment("ไม่ใช้")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + // public PositionType PositionType { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + + } +} + diff --git a/BMA.EHR.Domain/Models/HR/ProfileTraining.cs b/BMA.EHR.Domain/Models/HR/ProfileTraining.cs new file mode 100644 index 00000000..b1dd654c --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileTraining.cs @@ -0,0 +1,34 @@ +using System; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileTraining : EntityBase + { + [MaxLength(200), Comment("ชื่อโครงการ/หลักสูตรการฝึกอบรม")] + public string? Name { get; set; } + [MaxLength(200), Comment("หัวข้อการฝึกอบรม/ดูงาน")] + public string? Topic { get; set; } + [MaxLength(200), Comment("ปีที่อบรม (พ.ศ.)")] + public int? Yearly { get; set; } + [MaxLength(200), Comment("สถานที่ฝึกอบรม/ดูงาน")] + public string? Place { get; set; } + [MaxLength(200), Comment("รวมระยะเวลาในการฝึกอบรม/ดูงาน")] + public string? Duration { get; set; } + [MaxLength(200), Comment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน")] + public string? Department { get; set; } + [MaxLength(200), Comment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ")] + public string? NumberOrder { get; set; } + [Comment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่")] + public DateTime? DateOrder { get; set; } + [Comment("วันเริ่มต้นการฝึกอบรม/ดูงาน")] + public DateTime? StartDate { get; set; } + [Comment("วันสิ้นสุดการฝึกอบรม/ดูงาน")] + public DateTime? EndDate { get; set; } + public virtual List ProfileTrainingHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/ProfileTrainingHistory.cs b/BMA.EHR.Domain/Models/HR/ProfileTrainingHistory.cs new file mode 100644 index 00000000..5c74a698 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/ProfileTrainingHistory.cs @@ -0,0 +1,33 @@ +using System; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileTrainingHistory : EntityBase + { + [MaxLength(200), Comment("ชื่อโครงการ/หลักสูตรการฝึกอบรม")] + public string? Name { get; set; } + [MaxLength(200), Comment("หัวข้อการฝึกอบรม/ดูงาน")] + public string? Topic { get; set; } + [MaxLength(200), Comment("ปีที่อบรม (พ.ศ.)")] + public int? Yearly { get; set; } + [MaxLength(200), Comment("สถานที่ฝึกอบรม/ดูงาน")] + public string? Place { get; set; } + [MaxLength(200), Comment("รวมระยะเวลาในการฝึกอบรม/ดูงาน")] + public string? Duration { get; set; } + [MaxLength(200), Comment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน")] + public string? Department { get; set; } + [MaxLength(200), Comment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ")] + public string? NumberOrder { get; set; } + [Comment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่")] + public DateTime? DateOrder { get; set; } + [Comment("วันเริ่มต้นการฝึกอบรม/ดูงาน")] + public DateTime? StartDate { get; set; } + [Comment("วันสิ้นสุดการฝึกอบรม/ดูงาน")] + public DateTime? EndDate { get; set; } + public virtual ProfileTraining? ProfileTraining { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/HR/TypeLeave.cs b/BMA.EHR.Domain/Models/HR/TypeLeave.cs new file mode 100644 index 00000000..3ec93729 --- /dev/null +++ b/BMA.EHR.Domain/Models/HR/TypeLeave.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class TypeLeave : EntityBase + { + [Comment("ประเภทการลา")] + public string? Name { get; set; } + public virtual List LimitTypeLeaves { get; set; } = new List(); + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/BloodGroup.cs b/BMA.EHR.Domain/Models/MetaData/BloodGroup.cs new file mode 100644 index 00000000..07700c29 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/BloodGroup.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class BloodGroup : EntityBase + { + [Required, MaxLength(2), Column(Order = 1), Comment("ชื่อหมู่โลหิต")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/District.cs b/BMA.EHR.Domain/Models/MetaData/District.cs new file mode 100644 index 00000000..36c17aba --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/District.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class District : EntityBase + { + [Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + public virtual List SubDistricts { get; set; } = new(); + + public virtual Province? Province { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/EducationLevel.cs b/BMA.EHR.Domain/Models/MetaData/EducationLevel.cs new file mode 100644 index 00000000..e24a19bd --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/EducationLevel.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class EducationLevel : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ระดับการศึกษา")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/Gendor.cs b/BMA.EHR.Domain/Models/MetaData/Gendor.cs new file mode 100644 index 00000000..ab4e8b0b --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/Gendor.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class Gender : EntityBase + { + [Required, MaxLength(20), Column(Order = 1), Comment("เพศ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/Holiday.cs b/BMA.EHR.Domain/Models/MetaData/Holiday.cs new file mode 100644 index 00000000..8fdc0538 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/Holiday.cs @@ -0,0 +1,28 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class Holiday : EntityBase + { + [Required, Column(Order = 1), Comment("ประจำปี")] + public int Year { get; set; } = 0; + + [Required, Column(Order = 2), Comment("วันหยุด")] + public DateTime HolidayDate { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 3), Comment("วันหยุด(Original)")] + public DateTime OriginalDate { get; set; } = DateTime.Now.Date; + + [Required, MaxLength(250), Column(Order = 4), Comment("ชื่อวันหยุด")] + public string Name { get; set; } = string.Empty; + + [Required, Column(Order = 5), Comment("เป็นวันหยุดพิเศษหรือไม่")] + public bool IsSpecial { get; set; } = true; + + [Required, Column(Order = 6), Comment("ประเภทของวันหยุดสำหรับ ทำงาน 5 วัน=`NORMAL`,ทำงาน 6 วัน=`6DAYS`")] + public string Category { get; set; } = "NORMAL"; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/Insignia.cs b/BMA.EHR.Domain/Models/MetaData/Insignia.cs new file mode 100644 index 00000000..b79ae069 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/Insignia.cs @@ -0,0 +1,27 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class Insignia : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อเครื่องราชย์")] + public string Name { get; set; } = string.Empty; + + [Required, MaxLength(30), Column(Order = 2), Comment("ชื่อย่อเครื่องราชย์")] + public string ShortName { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Column(Order = 4), Comment("ลำดับชั้นของเครื่องราชย์ เอาไว้ตรวจสอบเวลาขอว่าต้องได้ชั้นที่สูงกว่าที่เคยได้รับแล้วเท่านั้น")] + public int Level { get; set; } = 0; + + [Column(Order = 5), Comment("หมายเหตุ")] + public string Note { get; set; } = string.Empty; + + public virtual InsigniaType? InsigniaType { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/InsigniaType.cs b/BMA.EHR.Domain/Models/MetaData/InsigniaType.cs new file mode 100644 index 00000000..fa7f4936 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/InsigniaType.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class InsigniaType : EntityBase + { + [Required, MaxLength(50), Column(Order = 1), Comment("ชื่อประเภทเครื่องราชย์")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationAgency.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationAgency.cs new file mode 100644 index 00000000..f026a27a --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationAgency.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationAgency : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงานต้นสังกัด")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationFax.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationFax.cs new file mode 100644 index 00000000..5c9aa1f0 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationFax.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationFax : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์โทรสาร")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationGovernmentAgency.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationGovernmentAgency.cs new file mode 100644 index 00000000..f192f1ff --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationGovernmentAgency.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationGovernmentAgency : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ส่วนราชการต้นสังกัด")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationLevel.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationLevel.cs new file mode 100644 index 00000000..caa40e10 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationLevel.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationLevel : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ระดับ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationOrganization.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationOrganization.cs new file mode 100644 index 00000000..9c4105cf --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationOrganization.cs @@ -0,0 +1,19 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationOrganization : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงาน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Column(Order = 3), Comment("หมายเหตุ")] + public string Note { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationShortName.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationShortName.cs new file mode 100644 index 00000000..ce013c10 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationShortName.cs @@ -0,0 +1,23 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationShortName : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสหน่วยงาน")] + public string AgencyCode { get; set; } = string.Empty; + [MaxLength(100), Column(Order = 2), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสส่วนราชการ")] + public string? GovernmentCode { get; set; } = string.Empty; + [Required, MaxLength(100), Column(Order = 3), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ตัวย่อหน่วยงาน")] + public string? Name { get; set; } = string.Empty; + + [Column(Order = 4), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Column(Order = 5), Comment("หมายเหตุ")] + public string Note { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationStatus.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationStatus.cs new file mode 100644 index 00000000..56a21303 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationStatus.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationStatus : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ สถานะ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationTelExternal.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationTelExternal.cs new file mode 100644 index 00000000..c158f5a0 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationTelExternal.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationTelExternal : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์ติดต่อภายนอก")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationTelInternal.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationTelInternal.cs new file mode 100644 index 00000000..65b67fab --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationTelInternal.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationTelInternal : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์ติดต่อภายใน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/OrganizationType.cs b/BMA.EHR.Domain/Models/MetaData/OrganizationType.cs new file mode 100644 index 00000000..1700f07e --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/OrganizationType.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class OrganizationType : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ประเภท")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PhysicalStatus.cs b/BMA.EHR.Domain/Models/MetaData/PhysicalStatus.cs new file mode 100644 index 00000000..974e89d0 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PhysicalStatus.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PhysicalStatus : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("สถานภาพทางกาย")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/Position.cs b/BMA.EHR.Domain/Models/MetaData/Position.cs new file mode 100644 index 00000000..b66ce161 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/Position.cs @@ -0,0 +1,37 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class Position : EntityBase + { + [Required, MaxLength(300), Column(Order = 1), Comment("ชื่อตำแหน่ง")] + public string Name { get; set; } = string.Empty; + + [MaxLength(300), Column(Order = 2), Comment("ด้าน/สาขา")] + public virtual PositionPathSide? PathSide { get; set; } + + [MaxLength(300), Column(Order = 3), Comment("ชื่อตำแหน่งทางการบริหาร")] + public string ExecutiveName { get; set; } = string.Empty; + + [MaxLength(300), Column(Order = 4), Comment("ด้านทางการบริหาร")] + public virtual PositionExecutiveSide? ExecutiveSide { get; set; } + + [Column(Order = 5), Comment("สายงาน")] + public virtual PositionPath? PositionPath { get; set; } + + [Column(Order = 6), Comment("ตำแหน่งประเภท")] + public virtual PositionType? PositionType { get; set; } + + [Column(Order = 7), Comment("ระดับ")] + public virtual PositionLevel? PositionLevel { get; set; } + + [Column(Order = 8), Comment("ตำแหน่งสำหรับข้าราชการหรือลูกจ้าง officer/employee")] + public string PositionCategory { get; set; } = string.Empty; + + [Column(Order = 9), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionEmployeeGroup.cs b/BMA.EHR.Domain/Models/MetaData/PositionEmployeeGroup.cs new file mode 100644 index 00000000..6533a3ad --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionEmployeeGroup.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionEmployeeGroup : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อกลุ่มงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionEmployeeLevel.cs b/BMA.EHR.Domain/Models/MetaData/PositionEmployeeLevel.cs new file mode 100644 index 00000000..1906a6dc --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionEmployeeLevel.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionEmployeeLevel : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionEmployeeLine.cs b/BMA.EHR.Domain/Models/MetaData/PositionEmployeeLine.cs new file mode 100644 index 00000000..e1e0dd21 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionEmployeeLine.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionEmployeeLine : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสายงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionEmployeePosition.cs b/BMA.EHR.Domain/Models/MetaData/PositionEmployeePosition.cs new file mode 100644 index 00000000..760b3053 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionEmployeePosition.cs @@ -0,0 +1,19 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionEmployeePosition : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Column(Order = 3), Comment("หมายเหตุ")] + public string Note { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionEmployeePositionSide.cs b/BMA.EHR.Domain/Models/MetaData/PositionEmployeePositionSide.cs new file mode 100644 index 00000000..f8373a98 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionEmployeePositionSide.cs @@ -0,0 +1,19 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionEmployeePositionSide : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อด้านของตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Column(Order = 3), Comment("หมายเหตุ")] + public string Note { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionEmployeeStatus.cs b/BMA.EHR.Domain/Models/MetaData/PositionEmployeeStatus.cs new file mode 100644 index 00000000..0139d2d4 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionEmployeeStatus.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionEmployeeStatus : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสถานะของตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionExecutive.cs b/BMA.EHR.Domain/Models/MetaData/PositionExecutive.cs new file mode 100644 index 00000000..7b9fc221 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionExecutive.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionExecutive : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อตำแหน่งทางการบริหารของข้อมูลตำแหน่งของข้าราชการ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionExecutiveSide.cs b/BMA.EHR.Domain/Models/MetaData/PositionExecutiveSide.cs new file mode 100644 index 00000000..4f97d836 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionExecutiveSide.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionExecutiveSide : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อด้านทางการบริหาร")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Column(Order = 3), Comment("หมายเหตุ")] + public string Note { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionLevel.cs b/BMA.EHR.Domain/Models/MetaData/PositionLevel.cs new file mode 100644 index 00000000..527cc40e --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionLevel.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionLevel : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อระดับตำแหน่ง")] + public string Name { get; set; } = string.Empty; + + [Required, MaxLength(100), Column(Order = 2), Comment("ชื่อย่อระดับตำแหน่ง")] + public string ShortName { get; set; } = string.Empty; + + [Column(Order = 3), Comment("ลำดับชั้นของระดับตำแหน่ง")] + public int Level { get; set; } = 0; + + [Column(Order = 4), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionLine.cs b/BMA.EHR.Domain/Models/MetaData/PositionLine.cs new file mode 100644 index 00000000..5051d0b4 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionLine.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionLine : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสายงานของข้อมูลตำแหน่งของข้าราชการ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionPath.cs b/BMA.EHR.Domain/Models/MetaData/PositionPath.cs new file mode 100644 index 00000000..81a279ac --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionPath.cs @@ -0,0 +1,19 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionPath : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสายงาน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Column(Order = 3), Comment("หมายเหตุ")] + public string Note { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionPathSide.cs b/BMA.EHR.Domain/Models/MetaData/PositionPathSide.cs new file mode 100644 index 00000000..d111d8a1 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionPathSide.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionPathSide : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อด้าน/สาขา")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Column(Order = 3), Comment("หมายเหตุ")] + public string Note { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionStatus.cs b/BMA.EHR.Domain/Models/MetaData/PositionStatus.cs new file mode 100644 index 00000000..2a6bd13d --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionStatus.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionStatus : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสถานะของตำแหน่งของข้อมูลตำแหน่งของข้าราชการ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/PositionType.cs b/BMA.EHR.Domain/Models/MetaData/PositionType.cs new file mode 100644 index 00000000..8bc005ff --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/PositionType.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class PositionType : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อประเภทตำแหน่ง")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/Prefix.cs b/BMA.EHR.Domain/Models/MetaData/Prefix.cs new file mode 100644 index 00000000..d18796a7 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/Prefix.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class Prefix : EntityBase + { + [Required, MaxLength(50), Column(Order = 2), Comment("รายละเอียดคำนำหน้า")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/Province.cs b/BMA.EHR.Domain/Models/MetaData/Province.cs new file mode 100644 index 00000000..d04505d8 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/Province.cs @@ -0,0 +1,18 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class Province : EntityBase + { + [Required, MaxLength(150), Column(Order = 1), Comment("จังหวัด")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + public virtual List Districts { get; set; } = new(); + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/Relationship.cs b/BMA.EHR.Domain/Models/MetaData/Relationship.cs new file mode 100644 index 00000000..99adb149 --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/Relationship.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class Relationship : EntityBase + { + [Required, MaxLength(50), Column(Order = 1), Comment("ชื่อความสัมพันธ์")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/Religion.cs b/BMA.EHR.Domain/Models/MetaData/Religion.cs new file mode 100644 index 00000000..d02aca6f --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/Religion.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class Religion : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ศาสนา")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/Royal.cs b/BMA.EHR.Domain/Models/MetaData/Royal.cs new file mode 100644 index 00000000..a07cb62f --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/Royal.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class Royal : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อประเภทข้อมูลเหรียญตรา")] + public string Name { get; set; } = string.Empty; + + [Required, MaxLength(10), Column(Order = 2), Comment("ชื่อย่อเหรียญตรา")] + public string ShortName { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/RoyalHierarchy.cs b/BMA.EHR.Domain/Models/MetaData/RoyalHierarchy.cs new file mode 100644 index 00000000..5115736f --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/RoyalHierarchy.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class RoyalHierarchy : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อลำดับชั้นข้อมูลเครื่องราชฯ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/RoyalType.cs b/BMA.EHR.Domain/Models/MetaData/RoyalType.cs new file mode 100644 index 00000000..c95e03bc --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/RoyalType.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class RoyalType : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อประเภทข้อมูลเครื่องราชฯ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/BMA.EHR.Domain/Models/MetaData/SubDistrict.cs b/BMA.EHR.Domain/Models/MetaData/SubDistrict.cs new file mode 100644 index 00000000..058c959d --- /dev/null +++ b/BMA.EHR.Domain/Models/MetaData/SubDistrict.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Domain.Models.MetaData +{ + public class SubDistrict : EntityBase + { + [Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")] + public string Name { get; set; } = string.Empty; + + [Required, MaxLength(10), Column(Order = 2), Comment("รหัสไปรษณีย์")] + public string ZipCode { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + public virtual District? District { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/OrganizationEntity.cs b/BMA.EHR.Domain/Models/OrganizationEntity.cs new file mode 100644 index 00000000..48c12637 --- /dev/null +++ b/BMA.EHR.Domain/Models/OrganizationEntity.cs @@ -0,0 +1,88 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Organization.Service.Models +{ + 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; } + + [Column(Order = 3), Comment("OrganizationShortNameId")] + public Guid? OrganizationShortNameId { get; set; } + + //[ForeignKey("OrganizationTypeId")] + //public OrganizationType? OrganizationType_OrganizationTypeId { get; set; } + + [Column(Order = 4), Comment("OrganizationTypeId")] + public Guid? OrganizationTypeId { get; set; } + + //[ForeignKey("OrganizationLevelId")] + //public OrganizationLevel? OrganizationLevel_OrganizationLevelId { get; set; } + + [Column(Order = 5), Comment("OrganizationLevelId")] + public Guid? OrganizationLevelId { get; set; } + + //[ForeignKey("OrganizationTelExternalId")] + //public OrganizationTelExternal? OrganizationTelExternal_OrganizationTelExternalId { get; set; } + + [Column(Order = 6), Comment("OrganizationTelExternalId")] + public Guid? OrganizationTelExternalId { get; set; } + + //[ForeignKey("OrganizationTelInternalId")] + //public OrganizationTelInternal? OrganizationTelInternal_OrganizationTelInternalId { get; set; } + + [Column(Order = 7), Comment("OrganizationTelInternalId")] + public Guid? OrganizationTelInternalId { get; set; } + + //[ForeignKey("OrganizationFaxId")] + //public OrganizationFax? OrganizationFax_OrganizationFaxId { get; set; } + + [Column(Order = 8), Comment("OrganizationFaxId")] + public Guid? OrganizationFaxId { get; set; } + + [ForeignKey("ParentId")] + public OrganizationEntity? Organization_ParentId { get; set; } + + [Column(Order = 9), Comment("ParentId")] + public Guid? ParentId { get; set; } + + [Column(Order = 10), Comment("OrganizationAgencyId")] + public Guid? OrganizationAgencyId { get; set; } + + [Column(Order = 11), Comment("OrganizationGovernmentAgencyId")] + public Guid? OrganizationGovernmentAgencyId { get; set; } + + [Column(Order = 12), Comment("OrganizationOrder")] + public int? OrganizationOrder { get; set; } + + [Column(Order = 13), Comment("OrganizationUserNote")] + public string? OrganizationUserNote { get; set; } + + [Column(Order = 14), Comment("หน่วยงาน")] + public string? Agency { get; set; } + + [Column(Order = 15), Comment("ส่วนราชการ")] + public string? Government { get; set; } + + [Column(Order = 16), Comment("ฝ่าย/ส่วน")] + public string? Department { get; set; } + + [Column(Order = 17), Comment("กอง")] + public string? Pile { get; set; } + + public Guid? OrganizationStatusId { get; set; } + + public List Organizations { get; } = new(); + + } +} diff --git a/BMA.EHR.Domain/Models/OrganizationPositionEntity.cs b/BMA.EHR.Domain/Models/OrganizationPositionEntity.cs new file mode 100644 index 00000000..9e9b0aab --- /dev/null +++ b/BMA.EHR.Domain/Models/OrganizationPositionEntity.cs @@ -0,0 +1,33 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Organization.Service.Models +{ + public class OrganizationPositionEntity : EntityBase + { + + [ForeignKey("PositionMasterId")] + public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; } + + [Column(Order = 2), Comment("Position Master")] + public Guid? PositionMasterId { get; set; } + + [Column(Order = 3), Comment("Is Director")] + public bool? IsDirector { get; set; } + + [Column(Order = 4), Comment("positionUserNote")] + public string? PositionUserNote { get; set; } + + [ForeignKey("OrganizationId")] + public OrganizationEntity? Organization_OrganizationId { get; set; } + + [Column(Order = 5), Comment("OrganizationId")] + public Guid? OrganizationId { get; set; } + + [Column(Order = 6), Comment("PositionNumberId")] + public Guid? PositionNumberId { get; set; } + + } +} diff --git a/BMA.EHR.Domain/Models/OrganizationPublishHistoryEntity.cs b/BMA.EHR.Domain/Models/OrganizationPublishHistoryEntity.cs new file mode 100644 index 00000000..c760597e --- /dev/null +++ b/BMA.EHR.Domain/Models/OrganizationPublishHistoryEntity.cs @@ -0,0 +1,15 @@ +using BMA.EHR.Domain.Models.Base; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Organization.Service.Models +{ + public class OrganizationPublishHistoryEntity : EntityBase + { + [Column(Order = 1), Comment("รายละเอียดการแก้ไข")] + public string Detail { get; set; } = string.Empty; + + [Column(Order = 2), Comment("เก็บ Object ที่มีการอัพเดตในระบบ")] + public string ObjectValue { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Domain/Models/PositionMasterEntity.cs b/BMA.EHR.Domain/Models/PositionMasterEntity.cs new file mode 100644 index 00000000..f610a4bb --- /dev/null +++ b/BMA.EHR.Domain/Models/PositionMasterEntity.cs @@ -0,0 +1,79 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Organization.Service.Models +{ + 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; } + + [Column(Order = 4), Comment("PositionTypeId")] + public Guid? PositionTypeId { get; set; } + + //[ForeignKey("PositionExecutiveId")] + //public PositionExecutive? PositionExecutive_PositionExecutiveId { get; set; } + + [Column(Order = 5), Comment("PositionExecutiveId")] + public Guid? PositionExecutiveId { get; set; } + + //[ForeignKey("ExcutiveSideId")] + //public PositionExecutiveSide? PositionExecutiveSide_ExcutiveSideId { get; set; } + + [Column(Order = 6), Comment("PositionExecutiveSideId")] + public Guid? PositionExecutiveSideId { get; set; } + + //[ForeignKey("PathSideId")] + //public PositionPathSide? PositionPathSide_PathSideId { get; set; } + + [Column(Order = 7), Comment("PositionPathSideId")] + public Guid? PositionPathSideId { get; set; } + + [Column(Order = 8), Comment("PositionLineId")] + public Guid? PositionLineId { get; set; } + + //[Column(Order = 9), Comment("PositionLevelId")] + //public Guid? PositionLevelId { get; set; } + + [Column(Order = 10), Comment("PositionStatusId")] + public Guid? PositionStatusId { 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; } + + [Column(Order = 14), Comment("IsDirector")] + public bool? IsDirector { get; set; } + + [Column(Order = 15), Comment("คุณวุฒิ")] + public string? Qualification { get; set; } + + public string? PositionPathSideObject { get; set; } + + public string? PositionExecutiveSideObject { get; set; } + + //public List AvailablePositionLevels { get; } = new(); + public List PositionMasterHistorys { get; } = new(); + + } +} diff --git a/BMA.EHR.Domain/Models/PositionMasterHistoryEntity.cs b/BMA.EHR.Domain/Models/PositionMasterHistoryEntity.cs new file mode 100644 index 00000000..1830c978 --- /dev/null +++ b/BMA.EHR.Domain/Models/PositionMasterHistoryEntity.cs @@ -0,0 +1,54 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Organization.Service.Models +{ + public class PositionMasterHistoryEntity : EntityBase + { + [Column(Order = 2), Comment("Position")] + public string? Position { get; set; } + + [Column(Order = 3), Comment("PositionPath")] + public string? PositionPath { get; set; } + + [Column(Order = 4), Comment("PositionType")] + public string? PositionType { get; set; } + + [Column(Order = 5), Comment("PositionExecutive")] + public string? PositionExecutive { get; set; } + + [Column(Order = 6), Comment("PositionExecutiveSide")] + public string? PositionExecutiveSide { get; set; } + + [Column(Order = 7), Comment("PositionPathSide")] + public string? PositionPathSide { get; set; } + + [Column(Order = 8), Comment("PositionLine")] + public string? PositionLine { get; set; } + + [Column(Order = 10), Comment("PositionStatus")] + public string? PositionStatus { get; set; } + + [Column(Order = 11), Comment("PositionCondition")] + public string? PositionCondition { get; set; } + + [Column(Order = 12), Comment("PositionLevel")] + public string? PositionLevel { get; set; } + + [Column(Order = 13), Comment("PositionMasterUserNote")] + public string? PositionMasterUserNote { get; set; } + + [Column(Order = 14), Comment("IsDirector")] + public bool? IsDirector { get; set; } + + [Column(Order = 15), Comment("คุณวุฒิ")] + public string? Qualification { get; set; } + public PositionMasterEntity? PositionMasterEntity { get; set; } + + public string? PositionPathSideObject { get; set; } + + public string? PositionExecutiveSideObject { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/PositionNumberEntity.cs b/BMA.EHR.Domain/Models/PositionNumberEntity.cs new file mode 100644 index 00000000..5016b4a7 --- /dev/null +++ b/BMA.EHR.Domain/Models/PositionNumberEntity.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Organization.Service.Models +{ + public class PositionNumberEntity : EntityBase + { + + [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; } + + + + + } +} diff --git a/BMA.EHR.Domain/Models/ProfilePosition.cs b/BMA.EHR.Domain/Models/ProfilePosition.cs new file mode 100644 index 00000000..4c2354e1 --- /dev/null +++ b/BMA.EHR.Domain/Models/ProfilePosition.cs @@ -0,0 +1,16 @@ +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Organization.Service.Models +{ + /// + /// Link Profile กับ OrganizationPosition + /// + public class ProfilePosition : EntityBase + { + public OrganizationPositionEntity OrganizationPosition { get; set; } + + public Guid OrganizationPositionId { get; set; } + + public Guid? ProfileId { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Report2/Report2.cs b/BMA.EHR.Domain/Models/Report2/Report2.cs new file mode 100644 index 00000000..5d265ed9 --- /dev/null +++ b/BMA.EHR.Domain/Models/Report2/Report2.cs @@ -0,0 +1,82 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Organization.Service.Models.Report2 +{ + public class Report2 : EntityBase + { + [Comment("รหัสส่วนราชการเดิม")] + public string? OrganizationShortNameOld { get; set; } + public string? GovernmentCodeOld { get; set; } + + [Comment("ชื่อหน่วยงานเดิม")] + public string? OrganizationOrganizationOld { get; set; } + + [Comment("ตำแหน่งเลขที่เดิม")] + public string? PositionNumOld { get; set; } + + [Comment("ประเภทตำแหน่งเดิม")] + public string? PositionTypeOld { get; set; } + + [Comment("ตำแหน่งทางการบริหารเดิม")] + public string? PositionExecutiveOld { get; set; } + + [Comment("ด้านทางบริหารเดิม")] + public string? PositionExecutiveSideOld { get; set; } + + [Comment("ตำแหน่งในสายงานเดิม")] + public string? PositionPathOld { get; set; } + + [Comment("ด้าน/สาขาเดิม")] + public string? PositionPathSideOld { get; set; } + + [Comment("ระดับตำแหน่งเดิม")] + public string? PositionLevelOld { get; set; } + + [Comment("รหัสส่วนราชการ")] + public Guid? OrganizationShortNameId { get; set; } + public string? OrganizationShortName { get; set; } + public string? GovernmentCode { get; set; } + + [Comment("ชื่อหน่วยงาน")] + public Guid? OrganizationOrganizationId { get; set; } + public string? OrganizationOrganization { get; set; } + + [Comment("ตำแหน่งเลขที่")] + public Guid? PositionNumId { get; set; } + public string? PositionNum { get; set; } + + [Comment("ประเภทตำแหน่ง")] + public Guid? PositionTypeId { get; set; } + public string? PositionType { get; set; } + + [Comment("ตำแหน่งทางการบริหาร")] + public Guid? PositionExecutiveId { get; set; } + public string? PositionExecutive { get; set; } + + [Comment("ด้านทางบริหาร")] + public Guid? PositionExecutiveSideId { get; set; } + public string? PositionExecutiveSide { get; set; } + + [Comment("ตำแหน่งในสายงาน")] + public Guid? PositionPathId { get; set; } + public string? PositionPath { get; set; } + + [Comment("ด้าน/สาขา")] + public Guid? PositionPathSideId { get; set; } + public string? PositionPathSide { get; set; } + + [Comment("ระดับตำแหน่ง")] + public Guid? PositionLevelId { get; set; } + public string? PositionLevel { get; set; } + + [Comment("สถานะการเปลี่ยนแปลง")] + public string? Status { get; set; } + + [Comment("สังกัดที่ถือครอง")] + public Guid? ProfilePositionId { get; set; } + public Guid? OrganizationPositionId { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Report2/Report2DetailHistory.cs b/BMA.EHR.Domain/Models/Report2/Report2DetailHistory.cs new file mode 100644 index 00000000..ffc26113 --- /dev/null +++ b/BMA.EHR.Domain/Models/Report2/Report2DetailHistory.cs @@ -0,0 +1,12 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Organization.Service.Models.Report2 +{ + public class Report2DetailHistory : EntityBase + { + public string? Detail { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Report2/Report2History.cs b/BMA.EHR.Domain/Models/Report2/Report2History.cs new file mode 100644 index 00000000..2a9b00df --- /dev/null +++ b/BMA.EHR.Domain/Models/Report2/Report2History.cs @@ -0,0 +1,94 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; + +namespace BMA.EHR.Organization.Service.Models.Report2 +{ + public class Report2History : EntityBase + { + [Comment("ชื่อ-สกุล")] + public string? FullName { get; set; } + [Comment("คุณวุฒิ")] + public string? Education { get; set; } + [Comment("เงินเดือน")] + public double? Salary { get; set; } + [Comment("เงินประจำตำแหน่ง")] + public double? SalaryPosition { get; set; } + [Comment("เงินตอบแทนรายเดือน")] + public double? SalaryMonth { get; set; } + + [Comment("รหัสส่วนราชการ กำหนดเดิม")] + public string? OldOrganizationShortName { get; set; } + public string? OldGovernmentCode { get; set; } + + [Comment("ชื่อหน่วยงาน กำหนดเดิม")] + public string? OldOrganizationOrganization { get; set; } + + [Comment("ตำแหน่งเลขที่ กำหนดเดิม")] + public string? OldPositionNum { get; set; } + + [Comment("ประเภทตำแหน่ง กำหนดเดิม")] + public string? OldPositionType { get; set; } + + [Comment("ตำแหน่งทางการบริหาร กำหนดเดิม")] + public string? OldPositionExecutive { get; set; } + + [Comment("ด้านทางบริหาร กำหนดเดิม")] + public string? OldPositionExecutiveSide { get; set; } + + [Comment("ตำแหน่งในสายงาน กำหนดเดิม")] + public string? OldPositionPath { get; set; } + + [Comment("ด้าน/สาขา กำหนดเดิม")] + public string? OldPositionPathSide { get; set; } + + [Comment("ระดับตำแหน่ง กำหนดเดิม")] + public string? OldPositionLevel { get; set; } + + [Comment("รหัสส่วนราชการ กำหนดใหม่")] + public Guid? NewOrganizationShortNameId { get; set; } + public string? NewOrganizationShortName { get; set; } + public string? NewGovernmentCode { get; set; } + + [Comment("ชื่อหน่วยงาน กำหนดใหม่")] + public Guid? NewOrganizationOrganizationId { get; set; } + public string? NewOrganizationOrganization { get; set; } + + [Comment("ตำแหน่งเลขที่ กำหนดใหม่")] + public Guid? NewPositionNumId { get; set; } + public string? NewPositionNum { get; set; } + + [Comment("ประเภทตำแหน่ง กำหนดใหม่")] + public Guid? NewPositionTypeId { get; set; } + public string? NewPositionType { get; set; } + + [Comment("ตำแหน่งทางการบริหาร กำหนดใหม่")] + public Guid? NewPositionExecutiveId { get; set; } + public string? NewPositionExecutive { get; set; } + + [Comment("ด้านทางบริหาร กำหนดใหม่")] + public Guid? NewPositionExecutiveSideId { get; set; } + public string? NewPositionExecutiveSide { get; set; } + + [Comment("ตำแหน่งในสายงาน กำหนดใหม่")] + public Guid? NewPositionPathId { get; set; } + public string? NewPositionPath { get; set; } + + [Comment("ด้าน/สาขา กำหนดใหม่")] + public Guid? NewPositionPathSideId { get; set; } + public string? NewPositionPathSide { get; set; } + + [Comment("ระดับตำแหน่ง กำหนดใหม่")] + public Guid? NewPositionLevelId { get; set; } + public string? NewPositionLevel { get; set; } + + [Comment("สถานะการเปลี่ยนแปลง")] + public string? Status { get; set; } + + [Comment("สังกัดที่ถือครอง")] + public Guid? ProfilePositionId { get; set; } + public Guid? OrganizationPositionId { get; set; } + public Report2DetailHistory? Report2DetailHistory { get; set; } + } +} diff --git a/BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj b/BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj index ff53cf3e..e355a7c5 100644 --- a/BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj +++ b/BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj @@ -17,6 +17,8 @@ + + diff --git a/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs b/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs index a82ea5b3..cae8b382 100644 --- a/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs +++ b/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs @@ -11,34 +11,20 @@ namespace BMA.EHR.Infrastructure public static IServiceCollection AddPersistence(this IServiceCollection services, IConfiguration configuration) { - services.AddDbContext(options => - options.UseOracle(configuration.GetConnectionString("DefaultConnection"), - b => b.MigrationsAssembly(typeof(ApplicationDBContext).Assembly.FullName)), ServiceLifetime.Transient); + var connectionString = configuration.GetConnectionString("DefaultConnection"); + services.AddDbContext(options => + options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString), + b => + { + b.MigrationsAssembly(typeof(ApplicationDBContext).Assembly.FullName); + b.MigrationsHistoryTable("__EHRMigrationsHistory"); + + }), + ServiceLifetime.Transient); + services.AddScoped(provider => provider.GetService()); - return services; - } - - public static IServiceCollection AddEmailSender(this IServiceCollection services, - IConfiguration configuration) - { - - - - - - return services; - } - - public static IServiceCollection AddS3Storage(this IServiceCollection services, - IConfiguration configuration) - { - - - - - return services; } diff --git a/BMA.EHR.Infrastructure/Migrations/20230625113156_Init Project.Designer.cs b/BMA.EHR.Infrastructure/Migrations/20230625113156_Init Project.Designer.cs deleted file mode 100644 index 1bebe353..00000000 --- a/BMA.EHR.Infrastructure/Migrations/20230625113156_Init Project.Designer.cs +++ /dev/null @@ -1,376 +0,0 @@ -// -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 -{ - [DbContext(typeof(ApplicationDBContext))] - [Migration("20230625113156_Init Project")] - partial class InitProject - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.BloodGroup.BloodGroupDraftEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(990) - .HasComment("สถานะการใช้งาน"); - - b.Property("IsPublished") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(899) - .HasComment("สถานะการเผยแพร่ข้อมูล"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("NVARCHAR2(2)") - .HasColumnOrder(1) - .HasComment("ชื่อหมู่โลหิต"); - - b.HasKey("Id"); - - b.ToTable("MD_BloodGroup_Drafts"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.BloodGroup.BloodGroupEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(990) - .HasComment("สถานะการใช้งาน"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("NVARCHAR2(2)") - .HasColumnOrder(1) - .HasComment("ชื่อหมู่โลหิต"); - - b.HasKey("Id"); - - b.ToTable("MD_BloodGroups"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.BloodGroup.BloodGroupPublishHistoryEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Detail") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(1) - .HasComment("รายละเอียดการแก้ไข"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("ObjectValue") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(2) - .HasComment("เก็บ Object ที่มีการอัพเดตในระบบ"); - - b.HasKey("Id"); - - b.ToTable("MD_BloodGroup_Histories"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.Prefix.PrefixDraftEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(990) - .HasComment("สถานะการใช้งาน"); - - b.Property("IsPublished") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(899) - .HasComment("สถานะการเผยแพร่ข้อมูล"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("NVARCHAR2(100)") - .HasColumnOrder(1) - .HasComment("รายละเอียดคำนำหน้า"); - - b.HasKey("Id"); - - b.ToTable("MD_Prefix_Drafts"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.Prefix.PrefixEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(990) - .HasComment("สถานะการใช้งาน"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("NVARCHAR2(100)") - .HasColumnOrder(1) - .HasComment("รายละเอียดคำนำหน้า"); - - b.HasKey("Id"); - - b.ToTable("MD_Prefixes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.Prefix.PrefixPublishHistoryEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Detail") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(1) - .HasComment("รายละเอียดการแก้ไข"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("ObjectValue") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(2) - .HasComment("เก็บ Object ที่มีการอัพเดตในระบบ"); - - b.HasKey("Id"); - - b.ToTable("MD_Prefix_Histories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BMA.EHR.Infrastructure/Migrations/20230625113156_Init Project.cs b/BMA.EHR.Infrastructure/Migrations/20230625113156_Init Project.cs deleted file mode 100644 index d3ef1481..00000000 --- a/BMA.EHR.Infrastructure/Migrations/20230625113156_Init Project.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace BMA.EHR.Infrastructure.Migrations -{ - /// - public partial class InitProject : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "MD_BloodGroup_Drafts", - columns: table => new - { - Id = table.Column(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"), - Name = table.Column(type: "NVARCHAR2(2)", maxLength: 2, nullable: false, comment: "ชื่อหมู่โลหิต"), - IsPublished = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการเผยแพร่ข้อมูล"), - IsActive = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน"), - CreatedUserId = table.Column(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"), - CreatedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), - CreatedDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), - ModifiedUserId = table.Column(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"), - ModifiedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"), - ModifiedDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ") - }, - constraints: table => - { - table.PrimaryKey("PK_MD_BloodGroup_Drafts", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "MD_BloodGroup_Histories", - columns: table => new - { - Id = table.Column(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"), - Detail = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "รายละเอียดการแก้ไข"), - ObjectValue = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "เก็บ Object ที่มีการอัพเดตในระบบ"), - CreatedUserId = table.Column(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"), - CreatedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), - CreatedDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), - ModifiedUserId = table.Column(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"), - ModifiedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"), - ModifiedDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ") - }, - constraints: table => - { - table.PrimaryKey("PK_MD_BloodGroup_Histories", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "MD_BloodGroups", - columns: table => new - { - Id = table.Column(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"), - Name = table.Column(type: "NVARCHAR2(2)", maxLength: 2, nullable: false, comment: "ชื่อหมู่โลหิต"), - IsActive = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน"), - CreatedUserId = table.Column(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"), - CreatedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), - CreatedDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), - ModifiedUserId = table.Column(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"), - ModifiedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"), - ModifiedDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ") - }, - constraints: table => - { - table.PrimaryKey("PK_MD_BloodGroups", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "MD_Prefix_Drafts", - columns: table => new - { - Id = table.Column(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"), - Name = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "รายละเอียดคำนำหน้า"), - IsPublished = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการเผยแพร่ข้อมูล"), - IsActive = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน"), - CreatedUserId = table.Column(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"), - CreatedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), - CreatedDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), - ModifiedUserId = table.Column(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"), - ModifiedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"), - ModifiedDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ") - }, - constraints: table => - { - table.PrimaryKey("PK_MD_Prefix_Drafts", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "MD_Prefix_Histories", - columns: table => new - { - Id = table.Column(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"), - Detail = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "รายละเอียดการแก้ไข"), - ObjectValue = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "เก็บ Object ที่มีการอัพเดตในระบบ"), - CreatedUserId = table.Column(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"), - CreatedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), - CreatedDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), - ModifiedUserId = table.Column(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"), - ModifiedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"), - ModifiedDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ") - }, - constraints: table => - { - table.PrimaryKey("PK_MD_Prefix_Histories", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "MD_Prefixes", - columns: table => new - { - Id = table.Column(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"), - Name = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "รายละเอียดคำนำหน้า"), - IsActive = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน"), - CreatedUserId = table.Column(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"), - CreatedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"), - CreatedDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), - ModifiedUserId = table.Column(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"), - ModifiedUserFullName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"), - ModifiedDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ") - }, - constraints: table => - { - table.PrimaryKey("PK_MD_Prefixes", x => x.Id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "MD_BloodGroup_Drafts"); - - migrationBuilder.DropTable( - name: "MD_BloodGroup_Histories"); - - migrationBuilder.DropTable( - name: "MD_BloodGroups"); - - migrationBuilder.DropTable( - name: "MD_Prefix_Drafts"); - - migrationBuilder.DropTable( - name: "MD_Prefix_Histories"); - - migrationBuilder.DropTable( - name: "MD_Prefixes"); - } - } -} diff --git a/BMA.EHR.Infrastructure/Migrations/20230626063110_Init MetaData Table.Designer.cs b/BMA.EHR.Infrastructure/Migrations/20230626063110_Init MetaData Table.Designer.cs new file mode 100644 index 00000000..bcbc5a00 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/20230626063110_Init MetaData Table.Designer.cs @@ -0,0 +1,26 @@ +// +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("20230626063110_Init MetaData Table")] + partial class InitMetaDataTable + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 64); +#pragma warning restore 612, 618 + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/20230626063110_Init MetaData Table.cs b/BMA.EHR.Infrastructure/Migrations/20230626063110_Init MetaData Table.cs new file mode 100644 index 00000000..6bcb50c6 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/20230626063110_Init MetaData Table.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations +{ + /// + public partial class InitMetaDataTable : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/ApplicationDBContextModelSnapshot.cs b/BMA.EHR.Infrastructure/Migrations/ApplicationDBContextModelSnapshot.cs index da25c63a..7becff77 100644 --- a/BMA.EHR.Infrastructure/Migrations/ApplicationDBContextModelSnapshot.cs +++ b/BMA.EHR.Infrastructure/Migrations/ApplicationDBContextModelSnapshot.cs @@ -1,10 +1,8 @@ // -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 @@ -18,355 +16,7 @@ namespace BMA.EHR.Infrastructure.Migrations #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.BloodGroup.BloodGroupDraftEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(990) - .HasComment("สถานะการใช้งาน"); - - b.Property("IsPublished") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(899) - .HasComment("สถานะการเผยแพร่ข้อมูล"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("NVARCHAR2(2)") - .HasColumnOrder(1) - .HasComment("ชื่อหมู่โลหิต"); - - b.HasKey("Id"); - - b.ToTable("MD_BloodGroup_Drafts"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.BloodGroup.BloodGroupEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(990) - .HasComment("สถานะการใช้งาน"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("NVARCHAR2(2)") - .HasColumnOrder(1) - .HasComment("ชื่อหมู่โลหิต"); - - b.HasKey("Id"); - - b.ToTable("MD_BloodGroups"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.BloodGroup.BloodGroupPublishHistoryEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Detail") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(1) - .HasComment("รายละเอียดการแก้ไข"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("ObjectValue") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(2) - .HasComment("เก็บ Object ที่มีการอัพเดตในระบบ"); - - b.HasKey("Id"); - - b.ToTable("MD_BloodGroup_Histories"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.Prefix.PrefixDraftEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(990) - .HasComment("สถานะการใช้งาน"); - - b.Property("IsPublished") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(899) - .HasComment("สถานะการเผยแพร่ข้อมูล"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("NVARCHAR2(100)") - .HasColumnOrder(1) - .HasComment("รายละเอียดคำนำหน้า"); - - b.HasKey("Id"); - - b.ToTable("MD_Prefix_Drafts"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.Prefix.PrefixEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("IsActive") - .HasColumnType("NUMBER(1)") - .HasColumnOrder(990) - .HasComment("สถานะการใช้งาน"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("NVARCHAR2(100)") - .HasColumnOrder(1) - .HasComment("รายละเอียดคำนำหน้า"); - - b.HasKey("Id"); - - b.ToTable("MD_Prefixes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Entities.MetaData.Prefix.PrefixPublishHistoryEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("RAW(16)") - .HasColumnOrder(0) - .HasComment("คีย์หลัก"); - - b.Property("CreatedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(993) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedUserFullName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(992) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(991) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Detail") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(1) - .HasComment("รายละเอียดการแก้ไข"); - - b.Property("ModifiedDate") - .HasColumnType("TIMESTAMP(7)") - .HasColumnOrder(996) - .HasComment("แก้ไขข้อมูลเมื่อ"); - - b.Property("ModifiedUserFullName") - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(995) - .HasComment("ชื่อ User ที่แก้ไขข้อมูล"); - - b.Property("ModifiedUserId") - .HasColumnType("RAW(16)") - .HasColumnOrder(994) - .HasComment("User Id ที่แก้ไขข้อมูล"); - - b.Property("ObjectValue") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnOrder(2) - .HasComment("เก็บ Object ที่มีการอัพเดตในระบบ"); - - b.HasKey("Id"); - - b.ToTable("MD_Prefix_Histories"); - }); + .HasAnnotation("Relational:MaxIdentifierLength", 64); #pragma warning restore 612, 618 } } diff --git a/BMA.EHR.Infrastructure/Persistence/ApplicationDBContext.cs b/BMA.EHR.Infrastructure/Persistence/ApplicationDBContext.cs index 69c79f30..6fbdab9e 100644 --- a/BMA.EHR.Infrastructure/Persistence/ApplicationDBContext.cs +++ b/BMA.EHR.Infrastructure/Persistence/ApplicationDBContext.cs @@ -1,35 +1,159 @@ using BMA.EHR.Application.Common.Interfaces; -using BMA.EHR.Domain.Entities.MetaData.BloodGroup; -using BMA.EHR.Domain.Entities.MetaData.Prefix; +using BMA.EHR.Domain.Models.MetaData; using Microsoft.EntityFrameworkCore; namespace BMA.EHR.Infrastructure.Persistence { public class ApplicationDBContext : DbContext, IApplicationDBContext { + #region " From Existing Database " + + #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 + + #endregion + public ApplicationDBContext(DbContextOptions options) : base(options) { } - #region " Prefix " + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + - public DbSet MD_Prefixes { get; set; } + //Ignore Existing table from other service + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); - public DbSet MD_Prefix_Drafts { get; set; } + base.OnModelCreating(modelBuilder); + } - public DbSet MD_Prefix_Histories { get; set; } - - #endregion - - #region " BloodGroups " - - public DbSet MD_BloodGroups { get; set; } - - public DbSet MD_BloodGroup_Drafts { get; set; } - - public DbSet MD_BloodGroup_Histories { get; set; } - - #endregion + public override DbSet Set() where TEntity : class + { + return base.Set(); + } public Task SaveChangesAsync() { diff --git a/BMA.EHR.MetaData.Service/Controllers/PrefixController.cs b/BMA.EHR.MetaData.Service/Controllers/PrefixController.cs index a8d0db8e..82e3663e 100644 --- a/BMA.EHR.MetaData.Service/Controllers/PrefixController.cs +++ b/BMA.EHR.MetaData.Service/Controllers/PrefixController.cs @@ -1,33 +1,27 @@ -using BMA.EHR.Application.Repositories.Prefix; +using BMA.EHR.Application.Repositories; using BMA.EHR.Domain.Common; -using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace BMA.EHR.MetaData.Service.Controllers { - [Route("api/prefix")] + [Route("api/[controller]")] [ApiController] - [Authorize] public class PrefixController : BaseController { - private readonly PrefixRepository _prefixRepository; - private readonly IHttpContextAccessor _httpContextAccessor; + private readonly PrefixRepository _repository; - public PrefixController(PrefixRepository prefixRepository, - IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) + public PrefixController(PrefixRepository repository) { - _prefixRepository = prefixRepository; - _httpContextAccessor = httpContextAccessor; + _repository = repository; } [HttpGet] - public async Task> GetAllAsync() + public async Task> Get() { - var data = await _prefixRepository.GetAllAsync(); + var data = await _repository.GetAllAsync(); + return Success(data); } - - //[HttpGet("user")] - //public } } diff --git a/BMA.EHR.MetaData.Service/Program.cs b/BMA.EHR.MetaData.Service/Program.cs index fcf9d63d..8ffee1d7 100644 --- a/BMA.EHR.MetaData.Service/Program.cs +++ b/BMA.EHR.MetaData.Service/Program.cs @@ -46,18 +46,18 @@ var builder = WebApplication.CreateBuilder(args); // Authorization builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(opt => { - opt.RequireHttpsMetadata = false; //false for dev - opt.Authority = issuer; - opt.TokenValidationParameters = new() - { - ValidateIssuer = false, //false for dev - ValidateAudience = false, //false for dev - ValidateLifetime = false, //false for dev - ValidateIssuerSigningKey = true, - ValidIssuer = issuer, - IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key)) - }; - }); + opt.RequireHttpsMetadata = false; //false for dev + opt.Authority = issuer; + opt.TokenValidationParameters = new() + { + ValidateIssuer = true, + ValidateAudience = false, + ValidateLifetime = true, + ValidateIssuerSigningKey = true, + ValidIssuer = issuer, + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key)) + }; + }); builder.Services.AddAuthorization(); // use serilog @@ -79,8 +79,6 @@ var builder = WebApplication.CreateBuilder(args); builder.Services.AddApplication(); builder.Services.AddPersistence(builder.Configuration); - builder.Services.AddEmailSender(builder.Configuration); - builder.Services.AddControllers(options => { options.SuppressAsyncSuffixInActionNames = false; @@ -112,7 +110,7 @@ var app = builder.Build(); app.MapHealthChecks("/health"); - app.UseMiddleware(); + //app.UseMiddleware(); app.UseHttpsRedirection(); app.UseCors(); app.UseAuthentication(); diff --git a/BMA.EHR.MetaData.Service/appsettings.json b/BMA.EHR.MetaData.Service/appsettings.json index 960edc1d..b2be50ae 100644 --- a/BMA.EHR.MetaData.Service/appsettings.json +++ b/BMA.EHR.MetaData.Service/appsettings.json @@ -13,7 +13,8 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB" + //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", + "DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",