From a5db0160269c4dddc951164da68e85e8eb8e816f Mon Sep 17 00:00:00 2001 From: roblo-cgi Date: Mon, 23 Oct 2023 19:22:27 -0700 Subject: [PATCH 1/4] updates to user profile so that we don't update ccfri status with change request status when the facility is approved --- backend/src/components/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/components/user.js b/backend/src/components/user.js index c8224e92..e4c4728e 100644 --- a/backend/src/components/user.js +++ b/backend/src/components/user.js @@ -158,11 +158,11 @@ 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) { + //RLO - if facilityAccountNumber exists, then then don't update the facility statuses, since this is now part of the PCF + if (result && !returnValue.facilityAccountNumber) { returnValue.changeRequestId = changeRequest?.ccof_change_requestid; returnValue.unlockCcfri = result?.ccof_unlock_ccfri; returnValue.unlockNmf = result?.ccof_unlock_nmf_rfi; From 9e48351921b41501c11559c39b41aedb21553900 Mon Sep 17 00:00:00 2001 From: roblo-cgi Date: Mon, 23 Oct 2023 19:30:09 -0700 Subject: [PATCH 2/4] still retained changeRequestID in the facility list to keep code change impact as low as possible --- backend/src/components/user.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/components/user.js b/backend/src/components/user.js index e4c4728e..2326832b 100644 --- a/backend/src/components/user.js +++ b/backend/src/components/user.js @@ -162,12 +162,14 @@ function updateFacilityWithChangeRequestDetails(changeRequestList, returnValue, for (const changeActionNewFacility of changeActionNewFacilityList) { let result = changeActionNewFacility?.ccof_change_request_new_facility_change_act.find(item => item['_ccof_facility_value'] === facilityId); //RLO - if facilityAccountNumber exists, then then don't update the facility statuses, since this is now part of the PCF - if (result && !returnValue.facilityAccountNumber) { + 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; + } } } } From 8b9a694fb028f658215031a2e0f81b06dc50e335 Mon Sep 17 00:00:00 2001 From: roblo-cgi Date: Mon, 23 Oct 2023 19:31:06 -0700 Subject: [PATCH 3/4] still retained changeRequestID in the facility list to keep code change impact as low as possible --- backend/src/components/user.js | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/src/components/user.js b/backend/src/components/user.js index 2326832b..0b0eb350 100644 --- a/backend/src/components/user.js +++ b/backend/src/components/user.js @@ -161,7 +161,6 @@ function updateFacilityWithChangeRequestDetails(changeRequestList, returnValue, 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); - //RLO - if facilityAccountNumber exists, then then don't update the facility statuses, since this is now part of the PCF if (result) { returnValue.changeRequestId = changeRequest?.ccof_change_requestid; //RLO - if facilityAccountNumber exists, then then don't update the facility statuses, since this is now part of the PCF From 65865309750a6e97e8a1cc59f8ab160f2c427e33 Mon Sep 17 00:00:00 2001 From: roblo-cgi Date: Mon, 23 Oct 2023 22:23:58 -0700 Subject: [PATCH 4/4] removed changeRequestId once the change request is approved for new facility --- backend/src/components/user.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/backend/src/components/user.js b/backend/src/components/user.js index 0b0eb350..fb72100c 100644 --- a/backend/src/components/user.js +++ b/backend/src/components/user.js @@ -161,14 +161,12 @@ function updateFacilityWithChangeRequestDetails(changeRequestList, returnValue, 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) { + //RLO - if facilityAccountNumber exists, then then don't update the facility statuses, since this is now part of the PCF + if (result && !returnValue.facilityAccountNumber) { returnValue.changeRequestId = changeRequest?.ccof_change_requestid; - //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; - } + returnValue.unlockCcfri = result?.ccof_unlock_ccfri; + returnValue.unlockNmf = result?.ccof_unlock_nmf_rfi; + returnValue.unlockRfi = result?.ccof_unlock_rfi; } } }