change LeaveTotal to Double
This commit is contained in:
parent
d7be2da281
commit
7ce1b11244
8 changed files with 1085 additions and 24 deletions
|
|
@ -119,6 +119,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
.Include(x => x.Type)
|
||||
.Where(x => x.LeaveStartDate.Year == year)
|
||||
.Where(x => x.LeaveStatus != "REJECT" || x.LeaveStatus != "DELETE")
|
||||
.ToListAsync();
|
||||
|
||||
return data;
|
||||
|
|
@ -162,7 +163,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return await rawData.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<int> GetRestDayTotalByYearForUserAsync(Guid keycloakUserId, int year)
|
||||
public async Task<double> GetRestDayTotalByYearForUserAsync(Guid keycloakUserId, int year)
|
||||
{
|
||||
var leaveType = await _dbContext.Set<LeaveType>().AsQueryable().FirstOrDefaultAsync(l => l.Code.Trim().ToUpper() == "LV-005");
|
||||
|
||||
|
|
@ -181,13 +182,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return data;
|
||||
}
|
||||
|
||||
public async Task<int> GetSumLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
public async Task<double> GetSumLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
.Include(x => x.Type)
|
||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||
.Where(x => x.Type.Id == leaveTypeId)
|
||||
.Where(x => x.LeaveStartDate.Year == year)
|
||||
.Where(x => x.LeaveStatus != "REJECT" || x.LeaveStatus != "DELETE")
|
||||
.ToListAsync();
|
||||
|
||||
return data.Sum(x => x.LeaveTotal);
|
||||
|
|
@ -199,6 +201,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
.Include(x => x.Type)
|
||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||
.Where(x => x.Type.Id == leaveTypeId)
|
||||
.Where(x => x.LeaveStatus != "REJECT" || x.LeaveStatus != "DELETE")
|
||||
.OrderByDescending(x => x.LeaveStartDate.Date)
|
||||
.Select(x => x.LeaveStartDate.Date)
|
||||
.FirstOrDefaultAsync();
|
||||
|
|
@ -212,6 +215,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
.Include(x => x.Type)
|
||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||
.Where(x => x.Type.Id == leaveTypeId)
|
||||
.Where(x => x.LeaveStatus != "REJECT" || x.LeaveStatus != "DELETE")
|
||||
.OrderByDescending(x => x.LeaveStartDate.Date)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
|
|
@ -411,7 +415,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
await _appDbContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<int> GetSumSendLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
public async Task<double> GetSumSendLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
.Include(x => x.Type)
|
||||
|
|
@ -423,7 +427,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return data.Sum(x => x.LeaveTotal);
|
||||
}
|
||||
|
||||
public async Task<int> GetSumApproveLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
public async Task<double> GetSumApproveLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
.Include(x => x.Type)
|
||||
|
|
@ -436,10 +440,10 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
if (data.Count > 0)
|
||||
return data.Sum(x => x.LeaveTotal);
|
||||
else
|
||||
return 0;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public async Task<int> GetSumApproveLeaveByTypeAndRangeForUser(Guid keycloakUserId, Guid leaveTypeId, DateTime startDate, DateTime endDate)
|
||||
public async Task<double> GetSumApproveLeaveByTypeAndRangeForUser(Guid keycloakUserId, Guid leaveTypeId, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
.Include(x => x.Type)
|
||||
|
|
@ -468,7 +472,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return data.Count;
|
||||
}
|
||||
|
||||
public async Task<int> GetSumRejectLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
public async Task<double> GetSumRejectLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
.Include(x => x.Type)
|
||||
|
|
@ -484,7 +488,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return 0;
|
||||
}
|
||||
|
||||
public async Task<int> GetSumDeleteLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
public async Task<double> GetSumDeleteLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
.Include(x => x.Type)
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ namespace BMA.EHR.Domain.Models.Leave.Requests
|
|||
|
||||
public string WifeDayDateBorn { get; set; } = string.Empty;
|
||||
|
||||
public int RestDayOldTotal { get; set; } = 0;
|
||||
public double RestDayOldTotal { get; set; } = 0;
|
||||
|
||||
public int RestDayCurrentTotal { get; set; } = 0;
|
||||
public double RestDayCurrentTotal { get; set; } = 0;
|
||||
|
||||
public bool OrdainDayStatus { get; set; } = false;
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ namespace BMA.EHR.Domain.Models.Leave.Requests
|
|||
[Comment("ความเห็นของผู้อำนวยการสำนัก")]
|
||||
public string? LeaveDirectorComment { get; set; } = string.Empty;
|
||||
|
||||
public int LeaveTotal { get; set; } = 0;
|
||||
public double LeaveTotal { get; set; } = 0;
|
||||
|
||||
public DateTime? LeaveLast { get; set; }
|
||||
|
||||
|
|
|
|||
960
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231221062756_Change LeaveTotal to Double.Designer.cs
generated
Normal file
960
BMA.EHR.Infrastructure/Migrations/LeaveDb/20231221062756_Change LeaveTotal to Double.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,960 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using BMA.EHR.Infrastructure.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||
{
|
||||
[DbContext(typeof(LeaveDbContext))]
|
||||
[Migration("20231221062756_Change LeaveTotal to Double")]
|
||||
partial class ChangeLeaveTotaltoDouble
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Documents.Document", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("CreatedDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Detail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<int>("FileSize")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("varchar(128)");
|
||||
|
||||
b.Property<Guid>("ObjectRefId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Document");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Commons.LeaveType", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รหัสประเภทการลา");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<int>("Limit")
|
||||
.HasColumnType("int")
|
||||
.HasComment("จำนวนวันลาสูงสุดประจำปี");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อประเภทการลา");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("LeaveTypes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<string>("AbsentDayAt")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("AbsentDayGetIn")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("AbsentDayLocation")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("AbsentDayRegistorDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("AbsentDaySummon")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ApproveStep")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("step การอนุมัติ st1 = จทน.อนุมัตื,st2 = ผู้บังคับบัญชา อนุมัติ ");
|
||||
|
||||
b.Property<string>("CancelLeaveWrote")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เขียนที่ (ขอยกเลิก)");
|
||||
|
||||
b.Property<string>("CoupleDayCountryHistory")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("CoupleDayEndDateHistory")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("CoupleDayLevel")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("CoupleDayLevelCountry")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("CoupleDayName")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("CoupleDayPosition")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("CoupleDayStartDateHistory")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("CoupleDaySumTotalHistory")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("CoupleDayTotalHistory")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("HajjDayStatus")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<Guid>("KeycloakUserId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("LeaveAddress")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สถานที่ติดต่อขณะลา");
|
||||
|
||||
b.Property<DateTime?>("LeaveBirthDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("LeaveCancelComment")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เหตุผลในการขอยกเลิก");
|
||||
|
||||
b.Property<Guid?>("LeaveCancelDocumentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("LeaveCancelStatus")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะของคำขอยกเลิก");
|
||||
|
||||
b.Property<string>("LeaveComment")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ความเห็นของผู้บังคับบัญชา");
|
||||
|
||||
b.Property<string>("LeaveDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รายละเอียดการลา");
|
||||
|
||||
b.Property<string>("LeaveDirectorComment")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ความเห็นของผู้อำนวยการสำนัก");
|
||||
|
||||
b.Property<Guid?>("LeaveDocumentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid?>("LeaveDraftDocumentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("LeaveEndDate")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วัน เดือน ปีสิ้นสุดลา");
|
||||
|
||||
b.Property<DateTime?>("LeaveGovernmentDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime?>("LeaveLast")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("LeaveNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("หมายเลขที่ติดต่อขณะลา");
|
||||
|
||||
b.Property<string>("LeaveRange")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ช่วงของการลา เช่น ลาทั้งวัน ครึ่งวันเช้า ครึ่งวันบ่าย");
|
||||
|
||||
b.Property<int?>("LeaveSalary")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("LeaveSalaryText")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("LeaveStartDate")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วัน เดือน ปีเริ่มต้นลา");
|
||||
|
||||
b.Property<string>("LeaveStatus")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะของคำร้อง");
|
||||
|
||||
b.Property<double>("LeaveTotal")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("LeaveWrote")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เขียนที่");
|
||||
|
||||
b.Property<string>("OrdainDayBuddhistLentAddress")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("OrdainDayBuddhistLentName")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("OrdainDayLocationAddress")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("OrdainDayLocationName")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("OrdainDayLocationNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("OrdainDayOrdination")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("OrdainDayStatus")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<double>("RestDayCurrentTotal")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<double>("RestDayOldTotal")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("StudyDayCountry")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("StudyDayDegreeLevel")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("StudyDayScholarship")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("StudyDaySubject")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("StudyDayTrainingName")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("StudyDayTrainingSubject")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("StudyDayUniversityName")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid>("TypeId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("WifeDayDateBorn")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("WifeDayName")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LeaveCancelDocumentId");
|
||||
|
||||
b.HasIndex("LeaveDocumentId");
|
||||
|
||||
b.HasIndex("LeaveDraftDocumentId");
|
||||
|
||||
b.HasIndex("TypeId");
|
||||
|
||||
b.ToTable("LeaveRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.AdditionalCheckRequest", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CheckDate")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("*วันที่ลงเวลา");
|
||||
|
||||
b.Property<bool>("CheckInEdit")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("*ขอลงเวลาช่วงเช้า");
|
||||
|
||||
b.Property<bool>("CheckOutEdit")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("*ขอลงเวลาช่วงบ่าย");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("หมายเหตุในการการอนุมัติ/ไม่อนุมัติ");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("*หมายเหตุขอลงเวลาพิเศษ");
|
||||
|
||||
b.Property<Guid>("KeycloakUserId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("รหัส User ของ Keycloak ที่ร้องขอ");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะการอนุมัติ");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("AdditionalCheckRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("คำอธิบาย");
|
||||
|
||||
b.Property<string>("EndTimeAfternoon")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เวลาออกงานช่วงบ่าย");
|
||||
|
||||
b.Property<string>("EndTimeMorning")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เวลาออกงานช่วงเช้า");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)");
|
||||
|
||||
b.Property<bool>("IsDefault")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("StartTimeAfternoon")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เวลาเข้างานช่วงบ่าย");
|
||||
|
||||
b.Property<string>("StartTimeMorning")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เวลาเข้างานช่วงเช้า");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("DutyTimes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CheckIn")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วัน เวลา เข้างาน");
|
||||
|
||||
b.Property<string>("CheckInImageUrl")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||
|
||||
b.Property<double>("CheckInLat")
|
||||
.HasColumnType("double")
|
||||
.HasComment("พิกัดละติจูด Check-In");
|
||||
|
||||
b.Property<string>("CheckInLocationName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||
|
||||
b.Property<double>("CheckInLon")
|
||||
.HasColumnType("double")
|
||||
.HasComment("พิกัดลองจิจูด Check-In");
|
||||
|
||||
b.Property<string>("CheckInPOI")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||
|
||||
b.Property<string>("CheckInRemark")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||
|
||||
b.Property<string>("CheckInStatus")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะ Check-In");
|
||||
|
||||
b.Property<DateTime?>("CheckOut")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วัน เวลา ออกงาน");
|
||||
|
||||
b.Property<string>("CheckOutImageUrl")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||
|
||||
b.Property<double>("CheckOutLat")
|
||||
.HasColumnType("double")
|
||||
.HasComment("พิกัดละติจูด Check-Out");
|
||||
|
||||
b.Property<string>("CheckOutLocationName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||
|
||||
b.Property<double>("CheckOutLon")
|
||||
.HasColumnType("double")
|
||||
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||
|
||||
b.Property<string>("CheckOutPOI")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||
|
||||
b.Property<string>("CheckOutRemark")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||
|
||||
b.Property<string>("CheckOutStatus")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะ Check-Out");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("EditReason")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เหตุผลการอนุมัติ/ไม่อนุมัติขอลงเวลาพิเศษ");
|
||||
|
||||
b.Property<string>("EditStatus")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะการของลงเวลาพิเศษ");
|
||||
|
||||
b.Property<bool>("IsLocationCheckIn")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||
|
||||
b.Property<bool>("IsLocationCheckOut")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||
|
||||
b.Property<bool>("IsProcess")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||
|
||||
b.Property<Guid>("KeycloakUserId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("รหัส User ของ Keycloak");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ProcessUserTimeStamps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<Guid>("DutyTimeId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("รหัสรอบการลงเวลา");
|
||||
|
||||
b.Property<DateTime?>("EffectiveDate")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่มีผล");
|
||||
|
||||
b.Property<bool>("IsProcess")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("ทำการประมวลผลแล้วหรือยัง");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<Guid>("ProfileId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||
|
||||
b.Property<string>("Remark")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("หมายเหตุ");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DutyTimeId");
|
||||
|
||||
b.ToTable("UserDutyTimes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CheckIn")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วัน เวลา เข้างาน");
|
||||
|
||||
b.Property<string>("CheckInImageUrl")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รูปถ่ายสถานที่ Check-In");
|
||||
|
||||
b.Property<double>("CheckInLat")
|
||||
.HasColumnType("double")
|
||||
.HasComment("พิกัดละติจูด Check-In");
|
||||
|
||||
b.Property<string>("CheckInLocationName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In");
|
||||
|
||||
b.Property<double>("CheckInLon")
|
||||
.HasColumnType("double")
|
||||
.HasComment("พิกัดลองจิจูด Check-In");
|
||||
|
||||
b.Property<string>("CheckInPOI")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In");
|
||||
|
||||
b.Property<string>("CheckInRemark")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In");
|
||||
|
||||
b.Property<DateTime?>("CheckOut")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วัน เวลา ออกงาน");
|
||||
|
||||
b.Property<string>("CheckOutImageUrl")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รูปถ่ายสถานที่ Check-Out");
|
||||
|
||||
b.Property<double>("CheckOutLat")
|
||||
.HasColumnType("double")
|
||||
.HasComment("พิกัดละติจูด Check-Out");
|
||||
|
||||
b.Property<string>("CheckOutLocationName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out");
|
||||
|
||||
b.Property<double>("CheckOutLon")
|
||||
.HasColumnType("double")
|
||||
.HasComment("พิกัดลองจิจูด Check-Out");
|
||||
|
||||
b.Property<string>("CheckOutPOI")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out");
|
||||
|
||||
b.Property<string>("CheckOutRemark")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsLocationCheckIn")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||
|
||||
b.Property<bool>("IsLocationCheckOut")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out");
|
||||
|
||||
b.Property<bool>("IsProcess")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("นำไปประมวลผลแล้วหรือยัง");
|
||||
|
||||
b.Property<Guid>("KeycloakUserId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("รหัส User ของ Keycloak");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("UserTimeStamps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "LeaveCancelDocument")
|
||||
.WithMany()
|
||||
.HasForeignKey("LeaveCancelDocumentId");
|
||||
|
||||
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "LeaveDocument")
|
||||
.WithMany()
|
||||
.HasForeignKey("LeaveDocumentId");
|
||||
|
||||
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "LeaveDraftDocument")
|
||||
.WithMany()
|
||||
.HasForeignKey("LeaveDraftDocumentId");
|
||||
|
||||
b.HasOne("BMA.EHR.Domain.Models.Leave.Commons.LeaveType", "Type")
|
||||
.WithMany()
|
||||
.HasForeignKey("TypeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LeaveCancelDocument");
|
||||
|
||||
b.Navigation("LeaveDocument");
|
||||
|
||||
b.Navigation("LeaveDraftDocument");
|
||||
|
||||
b.Navigation("Type");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", "DutyTime")
|
||||
.WithMany()
|
||||
.HasForeignKey("DutyTimeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DutyTime");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ChangeLeaveTotaltoDouble : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<double>(
|
||||
name: "RestDayOldTotal",
|
||||
table: "LeaveRequests",
|
||||
type: "double",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int");
|
||||
|
||||
migrationBuilder.AlterColumn<double>(
|
||||
name: "RestDayCurrentTotal",
|
||||
table: "LeaveRequests",
|
||||
type: "double",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int");
|
||||
|
||||
migrationBuilder.AlterColumn<double>(
|
||||
name: "LeaveTotal",
|
||||
table: "LeaveRequests",
|
||||
type: "double",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "RestDayOldTotal",
|
||||
table: "LeaveRequests",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(double),
|
||||
oldType: "double");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "RestDayCurrentTotal",
|
||||
table: "LeaveRequests",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(double),
|
||||
oldType: "double");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "LeaveTotal",
|
||||
table: "LeaveRequests",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(double),
|
||||
oldType: "double");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -306,8 +306,8 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะของคำร้อง");
|
||||
|
||||
b.Property<int>("LeaveTotal")
|
||||
.HasColumnType("int");
|
||||
b.Property<double>("LeaveTotal")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("LeaveWrote")
|
||||
.IsRequired()
|
||||
|
|
@ -340,11 +340,11 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
b.Property<bool>("OrdainDayStatus")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("RestDayCurrentTotal")
|
||||
.HasColumnType("int");
|
||||
b.Property<double>("RestDayCurrentTotal")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("RestDayOldTotal")
|
||||
.HasColumnType("int");
|
||||
b.Property<double>("RestDayOldTotal")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("StudyDayCountry")
|
||||
.IsRequired()
|
||||
|
|
|
|||
|
|
@ -124,6 +124,18 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||
}
|
||||
|
||||
var sumLeave = req.LeaveStartDate.DiffDay(req.LeaveEndDate);
|
||||
var sumHoliday = await _holidayRepository.GetHolidayCountAsync(req.LeaveStartDate, req.LeaveEndDate);
|
||||
var sumWeekend = _holidayRepository.GetWeekEndCount(req.LeaveStartDate, req.LeaveEndDate);
|
||||
|
||||
var leaveTotal = 0.0;
|
||||
if (req.LeaveRange != "ALL")
|
||||
leaveTotal = 0.5;
|
||||
else
|
||||
leaveTotal = sumLeave - sumHoliday - sumWeekend;
|
||||
|
||||
|
||||
|
||||
var leaveRequest = new LeaveRequest
|
||||
{
|
||||
Type = leaveType,
|
||||
|
|
@ -134,7 +146,10 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
LeaveDetail = req.LeaveDetail ?? "",
|
||||
LeaveAddress = req.LeaveAddress ?? "",
|
||||
LeaveNumber = req.LeaveNumber ?? "",
|
||||
LeaveTotal = req.LeaveStartDate.DiffDay(req.LeaveEndDate),
|
||||
//LeaveTotal = req.LeaveStartDate.DiffDay(req.LeaveEndDate),
|
||||
LeaveTotal = leaveTotal,
|
||||
|
||||
|
||||
LeaveSalaryText = req.LeaveSalaryText ?? "",
|
||||
LeaveStatus = "NEW",
|
||||
KeycloakUserId = userId,
|
||||
|
|
@ -504,6 +519,10 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
await _leaveRequestRepository.GetLastLeaveRequestByTypeForUserAsync(rawData.KeycloakUserId,
|
||||
rawData.Type.Id);
|
||||
|
||||
var sumLeave = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate);
|
||||
var sumHoliday = await _holidayRepository.GetHolidayCountAsync(rawData.LeaveStartDate, rawData.LeaveEndDate);
|
||||
var sumWeekend = _holidayRepository.GetWeekEndCount(rawData.LeaveStartDate, rawData.LeaveEndDate);
|
||||
|
||||
var result = new GetLeaveRequestByIdDto
|
||||
{
|
||||
Id = rawData.Id,
|
||||
|
|
@ -524,7 +543,11 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
LeaveLastStart = lastLeaveRequest == null ? null : lastLeaveRequest.LeaveStartDate,
|
||||
LeaveLastEnd = lastLeaveRequest == null ? null : lastLeaveRequest.LeaveEndDate,
|
||||
LeaveTotal = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate),
|
||||
|
||||
//LeaveTotal = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate),
|
||||
LeaveTotal = sumLeave - (sumWeekend + sumHoliday),
|
||||
|
||||
|
||||
LeaveBirthDate = profile.BirthDate,
|
||||
LeaveGovernmentDate = profile.DateAppoint == null ? null : profile.DateAppoint.Value,
|
||||
|
||||
|
|
@ -937,6 +960,10 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
var leaveSummary = await _leaveRequestRepository.GetSumApproveLeaveByTypeForUserAsync(userId, rawData.Type.Id, thisYear);
|
||||
|
||||
var sumLeave = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate);
|
||||
var sumHoliday = await _holidayRepository.GetHolidayCountAsync(rawData.LeaveStartDate, rawData.LeaveEndDate);
|
||||
var sumWeekend = _holidayRepository.GetWeekEndCount(rawData.LeaveStartDate, rawData.LeaveEndDate);
|
||||
|
||||
var result = new GetLeaveRequestForAdminByIdDto
|
||||
{
|
||||
Id = rawData.Id,
|
||||
|
|
@ -961,7 +988,11 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
LeaveLastStart = lastLeaveRequest == null ? null : lastLeaveRequest.LeaveStartDate,
|
||||
LeaveLastEnd = lastLeaveRequest == null ? null : lastLeaveRequest.LeaveEndDate,
|
||||
LeaveTotal = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate),
|
||||
|
||||
|
||||
//LeaveTotal = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate),
|
||||
LeaveTotal = sumLeave - (sumHoliday + sumWeekend),
|
||||
|
||||
LeaveBirthDate = profile.BirthDate,
|
||||
LeaveGovernmentDate = profile.DateAppoint == null ? null : profile.DateAppoint.Value,
|
||||
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveRequest
|
|||
|
||||
public string WifeDayDateBorn { get; set; } = string.Empty;
|
||||
|
||||
public int RestDayOldTotal { get; set; } = 0;
|
||||
public double RestDayOldTotal { get; set; } = 0;
|
||||
|
||||
public int RestDayCurrentTotal { get; set; } = 0;
|
||||
public double RestDayCurrentTotal { get; set; } = 0;
|
||||
|
||||
public bool OrdainDayStatus { get; set; } = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveRequest
|
|||
|
||||
public string WifeDayDateBorn { get; set; } = string.Empty;
|
||||
|
||||
public int RestDayOldTotal { get; set; } = 0;
|
||||
public double RestDayOldTotal { get; set; } = 0;
|
||||
|
||||
public int RestDayCurrentTotal { get; set; } = 0;
|
||||
public double RestDayCurrentTotal { get; set; } = 0;
|
||||
|
||||
public bool OrdainDayStatus { get; set; } = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue