Update leave calculations to use DateAppoint and adjust leave limits based on government age #2266
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m35s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m35s
This commit is contained in:
parent
659e06a08d
commit
c25bef0672
3 changed files with 21 additions and 8 deletions
|
|
@ -108,7 +108,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
}
|
||||
|
||||
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
var govAge = (pf?.DateAppoint?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
|
||||
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
|
||||
public async Task<LeaveBeginning?> GetByYearAndTypeIdForUser(int year, Guid typeId, GetProfileByKeycloakIdDto? pf)
|
||||
{
|
||||
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
var govAge = (pf?.DateAppoint?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
|
||||
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return null;
|
||||
}
|
||||
|
||||
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
var govAge = (pf?.DateAppoint?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
|
||||
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return null;
|
||||
}
|
||||
|
||||
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
var govAge = (pf?.DateAppoint?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
|
||||
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
|
||||
|
||||
|
|
@ -416,5 +416,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
public string LastName { get; set; } = string.Empty;
|
||||
|
||||
public DateTime? DateStart { get; set; } = null;
|
||||
|
||||
public DateTime? DateAppoint { get; set; } = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue