diff --git a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs index 09addc23..9233b374 100644 --- a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs @@ -2247,46 +2247,47 @@ namespace BMA.EHR.Leave.Service.Controllers { await _leaveRequestRepository.SendToOfficerAsync(id); - var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId); - var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken); - if (profile == null) - { - return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); - } - var baseAPIOrg = _configuration["API"]; - var apiUrlOrg = $"{baseAPIOrg}/org/workflow/add-workflow"; - if (profile.ProfileType == "OFFICER") - { - using (var client = new HttpClient()) - { - client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); - client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]); - var _res = await client.PostAsJsonAsync(apiUrlOrg, new - { - refId = id, - sysName = "SYS_LEAVE_LIST", - posLevelName = profile.PosLevel ?? "", - posTypeName = profile.PosType ?? "", - fullName = $"{profile.Prefix}{profile.FirstName} {profile.LastName}" - }); - } - } - else - { - using (var client = new HttpClient()) - { - client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); - client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]); - var _res = await client.PostAsJsonAsync(apiUrlOrg, new - { - refId = id, - sysName = "SYS_LEAVE_LIST_EMP", - posLevelName = profile.PosLevel ?? "", - posTypeName = profile.PosType ?? "", - fullName = $"{profile.Prefix}{profile.FirstName} {profile.LastName}" - }); - } - } + // Remove Workflow Integration + // var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId); + // var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken); + // if (profile == null) + // { + // return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); + // } + // var baseAPIOrg = _configuration["API"]; + // var apiUrlOrg = $"{baseAPIOrg}/org/workflow/add-workflow"; + // if (profile.ProfileType == "OFFICER") + // { + // using (var client = new HttpClient()) + // { + // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); + // client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]); + // var _res = await client.PostAsJsonAsync(apiUrlOrg, new + // { + // refId = id, + // sysName = "SYS_LEAVE_LIST", + // posLevelName = profile.PosLevel ?? "", + // posTypeName = profile.PosType ?? "", + // fullName = $"{profile.Prefix}{profile.FirstName} {profile.LastName}" + // }); + // } + // } + // else + // { + // using (var client = new HttpClient()) + // { + // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); + // client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]); + // var _res = await client.PostAsJsonAsync(apiUrlOrg, new + // { + // refId = id, + // sysName = "SYS_LEAVE_LIST_EMP", + // posLevelName = profile.PosLevel ?? "", + // posTypeName = profile.PosType ?? "", + // fullName = $"{profile.Prefix}{profile.FirstName} {profile.LastName}" + // }); + // } + // } return Success(); }