fix: improve approval step validation by checking for commanders
Some checks failed
release-dev / release-dev (push) Failing after 12s
Some checks failed
release-dev / release-dev (push) Failing after 12s
This commit is contained in:
parent
88a48577e9
commit
328f54b4e3
1 changed files with 10 additions and 2 deletions
|
|
@ -1318,9 +1318,17 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
throw new Exception(GlobalMessages.DataNotFound);
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rawData.ApproveStep != "st3")
|
// ถ้าไม่มี commander ข้ามไปเช็ค approver ได้เลย
|
||||||
|
var commanders = rawData.Approvers
|
||||||
|
.Where(x => x.ApproveType!.ToUpper() == "COMMANDER")
|
||||||
|
.OrderBy(x => x.Seq)
|
||||||
|
.ToList();
|
||||||
|
if (commanders.Count > 0 && commanders != null)
|
||||||
{
|
{
|
||||||
throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
|
if (rawData.ApproveStep != "st3")
|
||||||
|
{
|
||||||
|
throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check commander approve
|
// check commander approve
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue