feat: add DNA update functionality and enrich leave beginning data with profile details
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
6b9767449c
commit
fc68cb0101
2 changed files with 55 additions and 2 deletions
|
|
@ -293,7 +293,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
FirstName = pf.FirstName,
|
||||
LastName = pf.LastName,
|
||||
LeaveDaysUsed = 0,
|
||||
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0
|
||||
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0,
|
||||
RootDnaId = pf.RootDnaId,
|
||||
Child1DnaId = pf.Child1DnaId,
|
||||
Child2DnaId = pf.Child2DnaId,
|
||||
Child3DnaId = pf.Child3DnaId,
|
||||
Child4DnaId = pf.Child4DnaId
|
||||
};
|
||||
|
||||
_dbContext.Set<LeaveBeginning>().Add(data);
|
||||
|
|
@ -305,6 +310,8 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
|
||||
public async Task<List<LeaveBeginning>> GetAllByYearAndTypeAsync(int year, Guid typeId, List<ProfileData> userIdList)
|
||||
{
|
||||
|
||||
|
||||
var updateList = new List<LeaveBeginning>();
|
||||
var result = new List<LeaveBeginning>();
|
||||
|
||||
|
|
@ -321,6 +328,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
// continue; // Goto Next Id
|
||||
//}
|
||||
|
||||
var profile = await _userProfileRepository.GetProfileByProfileIdAsync(pf.Id, AccessToken);
|
||||
if (profile == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
|
||||
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
|
||||
|
|
@ -368,7 +381,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
FirstName = pf.FirstName,
|
||||
LastName = pf.LastName,
|
||||
LeaveDaysUsed = 0,
|
||||
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0
|
||||
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0,
|
||||
RootDnaId = profile.RootDnaId,
|
||||
Child1DnaId = profile.Child1DnaId,
|
||||
Child2DnaId = profile.Child2DnaId,
|
||||
Child3DnaId = profile.Child3DnaId,
|
||||
Child4DnaId = profile.Child4DnaId
|
||||
};
|
||||
|
||||
updateList.Add(data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue