This commit is contained in:
Suphonchai Phoonsawat 2025-03-19 15:58:11 +07:00
parent b812fab46a
commit de85a8f369
3 changed files with 26 additions and 21 deletions

View file

@ -1808,22 +1808,22 @@ namespace BMA.EHR.Leave.Service.Controllers
foreach (var data in rawData)
{
// var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(data.KeycloakUserId, AccessToken);
// if (profile == null)
// {
// return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
// }
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(data.KeycloakUserId, AccessToken);
if (profile == null)
{
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
}
//var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty);
//var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(profile.Id);
//var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
//var userRound = await _dutyTimeRepository.GetByIdAsync(roundId);
var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(profile.Id);
var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
var userRound = await _dutyTimeRepository.GetByIdAsync(roundId);
var checkInData = await _userTimeStampRepository.GetTimestampByDateAsync(data.KeycloakUserId, data.CheckDate);
//var duty = userRound ?? getDefaultRound;
var duty = userRound ?? getDefaultRound;
var duty = getDefaultRound;
//var duty = getDefaultRound;
// create result object to return
var resObj = new GetAdditionalCheckRequestDto