Compare commits

..

No commits in common. "98adc747928c7478837b1618bdffc29e53f318b7" and "a739d52c4634974b1002d3e815be74483b78d2da" have entirely different histories.

View file

@ -2247,47 +2247,46 @@ namespace BMA.EHR.Leave.Service.Controllers
{
await _leaveRequestRepository.SendToOfficerAsync(id);
// 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}"
// });
// }
// }
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();
}