update status approve
Some checks failed
release-dev / release-dev (push) Failing after 14s

This commit is contained in:
moss 2025-05-23 17:01:05 +07:00
parent 7bfa69e19e
commit a2efb8d9af

View file

@ -125,6 +125,20 @@ namespace BMA.EHR.Application.Repositories
else if (rawData.ApproveStep == "st3")
{
rawData.ApproveStep = "st4";
// TODO: Send notification to 1st Approver
var _firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var _noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = _firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(_noti1);
}
// TODO: Send notification to 1st Commander
@ -206,26 +220,26 @@ namespace BMA.EHR.Application.Repositories
else
{
rawData.Status = "PENDING";
// if (rawData.Group != "1.1")
// {
rawData.ApproveStep = "st3";
// }
// TODO: Send notification to 1st Approver
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
if (rawData.Group == "1.1")
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(noti1);
// TODO: Send notification to 1st Approver
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(noti1);
}
await _dbContext.SaveChangesAsync();
}
}
@ -301,20 +315,23 @@ namespace BMA.EHR.Application.Repositories
rawData.ApproveStep = "st3";
// }
// TODO: Send notification to 1st Approver
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
if (rawData.Group == "1.1")
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(noti1);
// TODO: Send notification to 1st Approver
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(noti1);
}
await _dbContext.SaveChangesAsync();
}