Skip to content

Commit

Permalink
updates to user profile so that we don't update ccfri status with cha… (
Browse files Browse the repository at this point in the history
#456)

* updates to user profile so that we don't update ccfri status with change request status when the facility is approved
  • Loading branch information
roblo-cgi authored Oct 24, 2023
1 parent e46a278 commit 73e6278
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions backend/src/components/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,17 @@ async function getUserProfile(userGuid, userName) {

function updateFacilityWithChangeRequestDetails(changeRequestList, returnValue, facilityId) {
for (const changeRequest of changeRequestList) {
//todo -mk check statuscode
let changeActionNewFacilityList = changeRequest?.ccof_change_action_change_request?.filter(item =>item.ccof_changetype === CHANGE_REQUEST_TYPES.NEW_FACILITY);
for (const changeActionNewFacility of changeActionNewFacilityList) {
let result = changeActionNewFacility?.ccof_change_request_new_facility_change_act.find(item => item['_ccof_facility_value'] === facilityId);
if (result) {
returnValue.changeRequestId = changeRequest?.ccof_change_requestid;
returnValue.unlockCcfri = result?.ccof_unlock_ccfri;
returnValue.unlockNmf = result?.ccof_unlock_nmf_rfi;
returnValue.unlockRfi = result?.ccof_unlock_rfi;

//RLO - if facilityAccountNumber exists, then then don't update the facility statuses, since this is now part of the PCF
if (!returnValue.facilityAccountNumber) {
returnValue.unlockCcfri = result?.ccof_unlock_ccfri;
returnValue.unlockNmf = result?.ccof_unlock_nmf_rfi;
returnValue.unlockRfi = result?.ccof_unlock_rfi;
}
}
}
}
Expand Down

0 comments on commit 73e6278

Please sign in to comment.