Merge branch 'develop' into working

This commit is contained in:
Suphonchai Phoonsawat 2024-06-27 19:31:42 +07:00
commit def2b8f7fe
11 changed files with 1650 additions and 1056 deletions

View file

@ -92,7 +92,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Oc = p.root == null ? "" : p.root,
PositionName = p.positionName == null ? "" : p.positionName,
@ -151,7 +151,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Oc = p.root == null ? "" : p.root,
PositionName = p.positionName == null ? "" : p.positionName,
@ -215,7 +215,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = pf.Oc == null ? "" : pf.Oc.Replace("/", " "),
Probation = pf.IsProbation ? "(อยู่ระหว่างปฏิบัติหน้าที่ราชการ)" : "",
@ -285,7 +285,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = pf.Oc == null ? "" : pf.Oc.Replace("/", " "),
OldPositionName = pf.Position == null ? "" : pf.Position.Name,
@ -351,13 +351,13 @@ namespace BMA.EHR.Application.Repositories.Commands
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
@ -421,13 +421,13 @@ namespace BMA.EHR.Application.Repositories.Commands
// pf.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
@ -475,20 +475,20 @@ namespace BMA.EHR.Application.Repositories.Commands
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.rootOld == null ? "" : p.rootOld,
NewPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
LeaveDate = p.LeaveDate == null ? "" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
@ -525,20 +525,20 @@ namespace BMA.EHR.Application.Repositories.Commands
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.rootOld == null ? "" : p.rootOld,
NewPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
LeaveDate = p.LeaveDate == null ? "" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
@ -570,7 +570,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PlacementCommandIssuer = r.Command.PlacementCommandIssuer ?? "",
PlacementCommandNo = r.Command.PlacementCommandNo == null ? "" : r.Command.PlacementCommandNo.ToThaiNumber(),
@ -606,7 +606,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PlacementCommandIssuer = r.Command.PlacementCommandIssuer ?? "",
PlacementCommandNo = r.Command.PlacementCommandNo == null ? "" : r.Command.PlacementCommandNo.ToThaiNumber(),
@ -647,13 +647,13 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType13Response
{
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
PositionName = p.PositionOld == null ? "" : p.PositionOld,
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
//Salary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
ActiveDate = p.Date == null ? "" : p.Date.Value.ToThaiShortDate2().ToThaiNumber(),
@ -695,7 +695,7 @@ namespace BMA.EHR.Application.Repositories.Commands
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.OrganizationPositionOld ?? "",
OldPositionName = p.OrganizationPositionOld ?? "",
@ -744,7 +744,7 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType15Response
{
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
// PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
@ -836,7 +836,7 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType17Response
{
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PositionName = p.PositionOld ?? "",
Organization = p.OrganizationPositionOld ?? "",
@ -888,7 +888,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
// PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
Organization = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
@ -943,7 +943,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
Organization = p.OrganizationPositionOld ?? "",
@ -997,7 +997,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId,
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
Organization = p.OrganizationPositionOld ?? "",
@ -1060,7 +1060,7 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType21Response
{
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId.ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = r.Organization == null ? "" : r.Organization.ToThaiNumber(),
PositionName = r.PositionName == null ? "" : r.PositionName.ToThaiNumber(),
@ -1192,7 +1192,7 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType21Response
{
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId.ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = p.OrganizationPositionOld ?? "",
PositionName = p.PositionOld ?? "",
@ -1311,7 +1311,7 @@ namespace BMA.EHR.Application.Repositories.Commands
{
fullName = $"{org.result.prefix}{org.result.firstName} {org.result.lastName}",
positionname = org.result.position,
positionno = org.result.posNo,
positionno = org.result.posNo == null ? null : org.result.posNo.ToThaiNumber(),
organizationname = org.result.organization,
salary = org.result.salary == null ? null : org.result.salary.Value.ToNumericNoDecimalText().ToString(),
};

View file

@ -2764,7 +2764,7 @@ namespace BMA.EHR.Application.Repositories.Commands
isProbation = true,
isLeave = false,
dateRetire = (DateTime?)null,
dateAppoint = placementProfile.RecruitDate == null ? (DateTime?)null : placementProfile.RecruitDate,
dateAppoint = command.CommandAffectDate == null ? null : command.CommandAffectDate,
dateStart = command.CommandAffectDate == null ? null : command.CommandAffectDate,
govAgeAbsent = 0,
govAgePlus = 0,
@ -5562,6 +5562,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
});
var _baseAPI = _configuration["API"];
@ -5710,6 +5714,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
});
var _baseAPI = _configuration["API"];
@ -6346,6 +6354,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
});
var baseAPI = _configuration["API"];
@ -6475,6 +6487,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
});
var baseAPI = _configuration["API"];
@ -6605,6 +6621,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
});
var baseAPI = _configuration["API"];
@ -6735,6 +6755,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
});
var baseAPI = _configuration["API"];
@ -6865,6 +6889,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ลดขั้นเงินเดือน"
});
var baseAPI = _configuration["API"];
@ -6995,6 +7023,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งเพิ่มโทษ"
});
var baseAPI = _configuration["API"];
@ -7125,6 +7157,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งงดโทษ"
});
var baseAPI = _configuration["API"];
@ -7255,6 +7291,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{
PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งยุติเรื่อง"
});
var baseAPI = _configuration["API"];

View file

@ -1,4 +1,6 @@
using System.Drawing;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Messaging;
using BMA.EHR.Domain.Models.HR;
@ -404,7 +406,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
throw new Exception("คำขอนี้ยังไม่ได้รับการอนุมัติจากผู้บังคับบัญชา ไม่สามารถทำรายการได้");
}
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(rawData.KeycloakUserId,AccessToken);
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(rawData.KeycloakUserId, AccessToken);
if (profile == null)
{
throw new Exception(GlobalMessages.DataNotFound);
@ -421,19 +423,38 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
// insert to profile leave
var profileLeave = new ProfileLeave
// var profileLeave = new ProfileLeave
// {
// DateStartLeave = rawData.LeaveStartDate,
// DateEndLeave = rawData.LeaveEndDate,
// TotalLeave = rawData.LeaveTotal,
// Status = "approve",
// Reason = rawData.LeaveDetail,
// ProfileId = profile.Id, // change from profile object to id
// TypeLeave = leaveType
// };
// _appDbContext.Set<ProfileLeave>().Add(profileLeave);
var _baseAPI = _configuration["API"];
var apiUrlSalary = $"{_baseAPI}/org/profile/leave";
using (var client = new HttpClient())
{
DateStartLeave = rawData.LeaveStartDate,
DateEndLeave = rawData.LeaveEndDate,
TotalLeave = rawData.LeaveTotal,
Status = "approve",
Reason = rawData.LeaveDetail,
ProfileId = profile.Id, // change from profile object to id
TypeLeave = leaveType
};
_appDbContext.Set<ProfileLeave>().Add(profileLeave);
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
profileId = profile.Id,
leaveTypeId = leaveType?.Id ?? null,
dateLeaveStart = rawData.LeaveStartDate,
dateLeaveEnd = rawData.LeaveEndDate,
leaveDays = 0,//หน้า fe ไม่ได้ใช้
leaveCount = 0,//หน้า fe ไม่ได้ใช้
totalLeave = rawData.LeaveTotal,
status = "approve",
reason = rawData.LeaveDetail,
});
// var _result = await _res.Content.ReadAsStringAsync();
}
await _appDbContext.SaveChangesAsync();
// insert to process timestamp