update LeaveController to determine status based on leave request and range
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
#2187
This commit is contained in:
parent
398679cbcc
commit
1c3ce46bcb
1 changed files with 17 additions and 1 deletions
|
|
@ -2437,7 +2437,23 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
if (time < endTime)
|
||||
{
|
||||
status = "ABSENT";
|
||||
|
||||
//string checkOutStatus = "NORMAL";
|
||||
var leaveReq = await _leaveRequestRepository.GetLeavePeriodAsync(userId, time.Date);
|
||||
if (leaveReq != null)
|
||||
{
|
||||
var leaveRange = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
|
||||
if (leaveRange == "AFTERNOON" || leaveRange == "ALL")
|
||||
status = "NORMAL";
|
||||
else
|
||||
{
|
||||
status = "ABSENT";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = "ABSENT";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue