diff --git a/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js b/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js index ee57d2c08..8e8cc00c1 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js @@ -18,6 +18,10 @@ import { import { fetchFOIMinistryAssignedToList, fetchFOIPersonalDivisionsAndSections, + fetchOIPCInquiryoutcomes, + fetchOIPCOutcomes, + fetchOIPCReviewtypes, + fetchOIPCStatuses, } from "../../../../apiManager/services/FOI/foiMasterDataServices"; import { fetchFOIRequestAttachmentsList } from "../../../../apiManager/services/FOI/foiAttachmentServices"; @@ -214,6 +218,12 @@ const MinistryReview = React.memo(({ userDetail }) => { dispatch(fetchPDFStitchStatusForHarms(requestId, ministryId)); dispatch(fetchPDFStitchStatusForRedlines(requestId, ministryId)); dispatch(fetchPDFStitchStatusForResponsePackage(requestId, ministryId)); + + dispatch(fetchOIPCOutcomes()); + dispatch(fetchOIPCStatuses()); + dispatch(fetchOIPCReviewtypes()); + dispatch(fetchOIPCInquiryoutcomes()); + fetchCFRForm(ministryId, dispatch); if (bcgovcode) dispatch(fetchFOIMinistryAssignedToList(bcgovcode)); } @@ -322,6 +332,11 @@ const MinistryReview = React.memo(({ userDetail }) => { hasincompleteDivstage || !hasReceivedDate; + const isOipcReviewValidationError = (oipcData?.length > 0 && requestDetails.isoipcreview && oipcData?.some((oipc) => { + return oipc.oipcno === "" || oipc.receiveddate === null || oipc.receiveddate === "" || oipc.reviewtypeid === null || oipc.reasonid === null || oipc.statusid === null || + oipc.inquiryattributes?.orderno === "" || oipc.inquiryattributes?.inquiryoutcome === null || oipc.inquiryattributes?.inquirydate === null || oipc.inquiryattributes?.inquirydate === ""; + })) + const createMinistrySaveRequestObject = (_propName, _value, _value2) => { const requestObject = { ...saveMinistryRequestObject }; setUnSavedRequest(true); @@ -798,7 +813,7 @@ const MinistryReview = React.memo(({ userDetail }) => { requestState={requestState} stateChanged={stateChanged} attachmentsArray={requestAttachments} - isValidationError={isValidationError} + isValidationError={isValidationError || isOipcReviewValidationError} saveMinistryRequestObject={saveMinistryRequestObject} unSavedRequest={unSavedRequest} recordsUploading={recordsUploading}