diff --git a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs index 6cab8145..67679328 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs @@ -248,10 +248,31 @@ namespace BMA.EHR.Application.Repositories.Commands PositionLineId = placementProfile.PositionLine == null ? Guid.Empty : placementProfile.PositionLine.Id, IsVerified = true, IsProbation = true, + Physical = "", + Ability = "", + AvatarRef = "", + GovAgeAbsent = 0, + GovAgePlus = 0, + EntryStatus = "", + IsTransfer = false, + IsActive = true, + IsLeave = false, + VerifiedUser = "", + FirstNameOld = "", + LastNameOld = "", + CoupleLive = false, + FatherLive = false, + MotherLive = false, Educations = new List(), Certificates = new List(), - Salaries = new List() + Salaries = new List(), + CreatedAt = DateTime.Now, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", }; // add profile education @@ -272,6 +293,13 @@ namespace BMA.EHR.Application.Repositories.Commands FundName = edu.FundName, Gpa = edu.Gpa, Institute = edu.Institute, + IsActive = true, + CreatedAt = DateTime.Now, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", }); } @@ -285,6 +313,13 @@ namespace BMA.EHR.Application.Repositories.Commands Issuer = cert.Issuer, CertificateType = cert.CertificateType, ExpireDate = cert.ExpireDate, + IsActive = true, + CreatedAt = DateTime.Now, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", }); } @@ -336,13 +371,14 @@ namespace BMA.EHR.Application.Repositories.Commands PositionExecutiveId = placementProfile.OrganizationPosition!.PositionMaster!.PositionExecutive! == null ? null : placementProfile.OrganizationPosition!.PositionMaster!.PositionExecutive!.Id, PositionExecutiveSideId = placementProfile.OrganizationPosition!.PositionMaster!.PositionExecutiveSide! == null ? null : placementProfile.OrganizationPosition!.PositionMaster!.PositionExecutiveSide!.Id, + IsActive = true, CreatedAt = DateTime.Now, - CreatedFullName = FullName, - CreatedUserId = UserId, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, - LastUpdateFullName = FullName, - LastUpdateUserId = UserId, - + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + }; //if (placementProfile.PositionPathSide! != null) @@ -366,6 +402,8 @@ namespace BMA.EHR.Application.Repositories.Commands { Profile = profile, OrganizationPosition = placementProfile.OrganizationPosition, + IsActive = true, + IsPublished = true, }; _dbContext.Set().Add(profilePosition); @@ -384,6 +422,7 @@ namespace BMA.EHR.Application.Repositories.Commands Subject = $"คุณได้รับคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", Body = $"คุณได้รับบรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ ตามคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = profile.Id, + Payload = "", }; _dbContext.Set().Add(inbox); @@ -391,6 +430,8 @@ namespace BMA.EHR.Application.Repositories.Commands { Body = $"คุณได้รับบรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ ตามคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = profile.Id, + Type = "", + Payload = "", }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -407,6 +448,7 @@ namespace BMA.EHR.Application.Repositories.Commands Subject = $"คุณได้รับสำเนาคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", Body = $"คำสั่งบบรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = pf.Id, + Payload = "", }; _dbContext.Set().Add(inbox); @@ -414,6 +456,8 @@ namespace BMA.EHR.Application.Repositories.Commands { Body = $"คำสั่งบบรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = pf.Id, + Type = "", + Payload = "", }; _dbContext.Set().Add(noti); } diff --git a/BMA.EHR.Domain/Models/HR/Profile.cs b/BMA.EHR.Domain/Models/HR/Profile.cs index 86823202..a0632e09 100644 --- a/BMA.EHR.Domain/Models/HR/Profile.cs +++ b/BMA.EHR.Domain/Models/HR/Profile.cs @@ -61,6 +61,11 @@ namespace BMA.EHR.Domain.Models.HR public string? CoupleLastNameOld { get; set; } [MaxLength(100), Comment("อาชีพคู่สมรส")] public string? CoupleCareer { get; set; } + [MaxLength(20), Comment("เลขที่บัตรประชาชนคู่สมรส")] + public string? CoupleCitizenId { get; set; } + + [Comment("มีชีวิตคู่สมรส")] + public bool CoupleLive { get; set; } = true; [Comment("Id คำนำหน้าบิดา")] public Guid? FatherPrefixId { get; set; } [MaxLength(100), Comment("ชื่อบิดา")] @@ -71,6 +76,11 @@ namespace BMA.EHR.Domain.Models.HR [MaxLength(100), Comment("อาชีพบิดา")] public string? FatherCareer { get; set; } + [MaxLength(20), Comment("เลขที่บัตรประชาชนบิดา")] + public string? FatherCitizenId { get; set; } + + [Comment("มีชีวิตบิดา")] + public bool FatherLive { get; set; } = true; [Comment("Id คำนำหน้ามารดา")] public Guid? MotherPrefixId { get; set; } @@ -82,6 +92,11 @@ namespace BMA.EHR.Domain.Models.HR [MaxLength(100), Comment("อาชีพมารดา")] public string? MotherCareer { get; set; } + [MaxLength(20), Comment("เลขที่บัตรประชาชนมารดา")] + public string? MotherCitizenId { get; set; } + + [Comment("มีชีวิตมารดา")] + public bool MotherLive { get; set; } = true; [MaxLength(200), Comment("ที่อยู่ปัจจุบัน")] public string? CurrentAddress { get; set; } [Comment("Id แขวงปัจจุบัน")] diff --git a/BMA.EHR.Domain/Models/HR/ProfileCertificate.cs b/BMA.EHR.Domain/Models/HR/ProfileCertificate.cs index 48892495..6b814090 100644 --- a/BMA.EHR.Domain/Models/HR/ProfileCertificate.cs +++ b/BMA.EHR.Domain/Models/HR/ProfileCertificate.cs @@ -25,6 +25,7 @@ namespace BMA.EHR.Domain.Models.HR // public string? CertiNumber { get; set; } // public DateTime? Start { get; set; } // public DateTime? End { get; set; } + public bool IsActive { get; set; } = true; public virtual List ProfileCertificateHistorys { get; set; } = new List(); public virtual Profile? Profile { get; set; } } diff --git a/BMA.EHR.Domain/Models/HR/ProfileEducation.cs b/BMA.EHR.Domain/Models/HR/ProfileEducation.cs index ba77f9e7..3f1bd61a 100644 --- a/BMA.EHR.Domain/Models/HR/ProfileEducation.cs +++ b/BMA.EHR.Domain/Models/HR/ProfileEducation.cs @@ -42,6 +42,7 @@ namespace BMA.EHR.Domain.Models.HR public string? PositionPath { get; set; } [Comment("Id เป็นวุฒิการศึกษาในตำแหน่ง")] public Guid? PositionPathId { get; set; } + public bool IsActive { get; set; } = true; public virtual List ProfileEducationHistorys { get; set; } = new List(); public virtual Profile? Profile { get; set; } diff --git a/BMA.EHR.Domain/Models/HR/ProfileSalary.cs b/BMA.EHR.Domain/Models/HR/ProfileSalary.cs index 2716647b..1786ad06 100644 --- a/BMA.EHR.Domain/Models/HR/ProfileSalary.cs +++ b/BMA.EHR.Domain/Models/HR/ProfileSalary.cs @@ -60,5 +60,6 @@ namespace BMA.EHR.Domain.Models.HR [Comment("ประเภทคำสั่ง")] public string CommandTypeName { get; set; } + public bool IsActive { get; set; } = true; } } diff --git a/BMA.EHR.Domain/Models/Organizations/ProfilePosition.cs b/BMA.EHR.Domain/Models/Organizations/ProfilePosition.cs index ae4735f1..92261404 100644 --- a/BMA.EHR.Domain/Models/Organizations/ProfilePosition.cs +++ b/BMA.EHR.Domain/Models/Organizations/ProfilePosition.cs @@ -11,5 +11,7 @@ namespace BMA.EHR.Domain.Models.Organizations public OrganizationPositionEntity? OrganizationPosition { get; set; } public Profile? Profile { get; set; } + public bool IsActive { get; set; } = true; + public bool IsPublished { get; set; } = true; } } diff --git a/BMA.EHR.Infrastructure/Migrations/ApplicationDBContextModelSnapshot.cs b/BMA.EHR.Infrastructure/Migrations/ApplicationDBContextModelSnapshot.cs index dab6faec..17fca868 100644 --- a/BMA.EHR.Infrastructure/Migrations/ApplicationDBContextModelSnapshot.cs +++ b/BMA.EHR.Infrastructure/Migrations/ApplicationDBContextModelSnapshot.cs @@ -829,6 +829,11 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnType("varchar(100)") .HasComment("อาชีพคู่สมรส"); + b.Property("CoupleCitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่บัตรประชาชนคู่สมรส"); + b.Property("CoupleFirstName") .HasMaxLength(100) .HasColumnType("varchar(100)") @@ -844,6 +849,10 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnType("varchar(100)") .HasComment("นามสกุลคู่สมรส(เดิม)"); + b.Property("CoupleLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตคู่สมรส"); + b.Property("CouplePrefixId") .HasColumnType("char(36)") .HasComment("Id คำนำหน้าคู่สมรส"); @@ -926,6 +935,11 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnType("varchar(100)") .HasComment("อาชีพบิดา"); + b.Property("FatherCitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่บัตรประชาชนบิดา"); + b.Property("FatherFirstName") .HasMaxLength(100) .HasColumnType("varchar(100)") @@ -936,6 +950,10 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnType("varchar(100)") .HasComment("นามสกุลบิดา"); + b.Property("FatherLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตบิดา"); + b.Property("FatherPrefixId") .HasColumnType("char(36)") .HasComment("Id คำนำหน้าบิดา"); @@ -1040,6 +1058,11 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnType("varchar(100)") .HasComment("อาชีพมารดา"); + b.Property("MotherCitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่บัตรประชาชนมารดา"); + b.Property("MotherFirstName") .HasMaxLength(100) .HasColumnType("varchar(100)") @@ -1050,6 +1073,10 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnType("varchar(100)") .HasComment("นามสกุลมารดา"); + b.Property("MotherLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตมารดา"); + b.Property("MotherPrefixId") .HasColumnType("char(36)") .HasComment("Id คำนำหน้ามารดา"); @@ -1828,6 +1855,9 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnType("datetime(6)") .HasComment("วันที่หมดอายุ"); + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + b.Property("IssueDate") .HasColumnType("datetime(6)") .HasComment("วันที่ออกใบอนุญาต"); @@ -2737,6 +2767,9 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnType("varchar(1000)") .HasComment("สถานศึกษา"); + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -4436,6 +4469,9 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnType("datetime(6)") .HasComment("วัน เดือน ปี รับตำแหน่ง"); + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -9384,6 +9420,12 @@ namespace BMA.EHR.Infrastructure.Migrations .HasColumnOrder(101) .HasComment("User Id ที่สร้างข้อมูล"); + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200)