diff --git a/forms-flow-web/src/actions/FOI/foiActionConstants.js b/forms-flow-web/src/actions/FOI/foiActionConstants.js index 8a94f7f00..f9acfee86 100644 --- a/forms-flow-web/src/actions/FOI/foiActionConstants.js +++ b/forms-flow-web/src/actions/FOI/foiActionConstants.js @@ -89,7 +89,11 @@ const FOI_ACTION_CONSTANTS = { "FOI_PDF_STITCHED_STATUS_FOR_RESPONSEPACKAGE", FOI_PDF_STITCHED_RECORD_FOR_RESPONSEPACKAGE: "FOI_PDF_STITCHED_RECORD_FOR_RESPONSEPACKAGE", - + FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINEREVIEW: "FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINEREVIEW", + FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINEREVIEW: "FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINEREVIEW", + FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINE: "FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINE", + FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINE: "FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINE", + OIPC_OUTCOMES: "OIPC_OUTCOMES", OIPC_STATUSES: "OIPC_STATUSES", OIPC_REVIEWTYPES: "OIPC_REVIEWTYPES", diff --git a/forms-flow-web/src/actions/FOI/foiRequestActions.js b/forms-flow-web/src/actions/FOI/foiRequestActions.js index ad9a7beb7..55d3aca7b 100644 --- a/forms-flow-web/src/actions/FOI/foiRequestActions.js +++ b/forms-flow-web/src/actions/FOI/foiRequestActions.js @@ -147,6 +147,18 @@ export const setFOIPDFStitchedRecordForResponsePackage = payload: data, }); }; +export const setFOIPDFStitchedRecordForOipcRedlineReview = (data) => (dispatch) => { + dispatch({ + type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINEREVIEW, + payload: data, + }); +} +export const setFOIPDFStitchedRecordForOipcRedline = (data) => (dispatch) => { + dispatch({ + type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINE, + payload: data, + }); +} export const setFOIPDFStitchStatusForHarms = (data) => (dispatch) => { dispatch({ type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_HARMS, @@ -166,6 +178,18 @@ export const setFOIPDFStitchStatusForResponsePackage = (data) => (dispatch) => { payload: data, }); }; +export const setFOIPDFStitchStatusForOipcRedlineReview = (data) => (dispatch) => { + dispatch({ + type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINEREVIEW, + payload: data, + }); +}; +export const setFOIPDFStitchStatusForOipcRedline = (data) => (dispatch) => { + dispatch({ + type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINE, + payload: data, + }); +}; export const serviceActionError = (_data) => (dispatch) => { //TODO update to a common file diff --git a/forms-flow-web/src/apiManager/endpoints/index.js b/forms-flow-web/src/apiManager/endpoints/index.js index fd9939a87..4a03e6cc0 100644 --- a/forms-flow-web/src/apiManager/endpoints/index.js +++ b/forms-flow-web/src/apiManager/endpoints/index.js @@ -135,6 +135,11 @@ const API = { FOI_DOWNLOAD_RECORDS_FOR_RESPONSEPACKAGE: `${FOI_BASE_API_URL}/api/foirecord//ministryrequest//download/responsepackage`, FOI_PDF_STITCH_STATUS_FOR_RESPONSEPACKAGE: `${FOI_BASE_API_URL}/api/foirecord//ministryrequest//responsepackage/pdfstitchjobstatus`, + FOI_DOWNLOAD_RECORDS_FOR_OIPCREDLINEREVIEW: `${FOI_BASE_API_URL}/api/foirecord//ministryrequest//download/oipcreviewredline`, + FOI_PDF_STITCH_STATUS_FOR_OIPCREDLINEREVIEW: `${FOI_BASE_API_URL}/api/foirecord//ministryrequest//oipcreviewredline/pdfstitchjobstatus`, + FOI_DOWNLOAD_RECORDS_FOR_OIPCREDLINE: `${FOI_BASE_API_URL}/api/foirecord//ministryrequest//download/oipcredline`, + FOI_PDF_STITCH_STATUS_FOR_OIPCREDLINE: `${FOI_BASE_API_URL}/api/foirecord//ministryrequest//oipcredline/pdfstitchjobstatus`, + FOI_GET_OIPC_OUTCOMES: `${FOI_BASE_API_URL}/api/foiflow/oipc/outcomes`, FOI_GET_OIPC_STATUSES: `${FOI_BASE_API_URL}/api/foiflow/oipc/statuses`, FOI_GET_OIPC_REVIEWTYPES: `${FOI_BASE_API_URL}/api/foiflow/oipc/reviewtypes`, diff --git a/forms-flow-web/src/apiManager/services/FOI/foiRecordServices.js b/forms-flow-web/src/apiManager/services/FOI/foiRecordServices.js index b729be708..8c2d48a61 100644 --- a/forms-flow-web/src/apiManager/services/FOI/foiRecordServices.js +++ b/forms-flow-web/src/apiManager/services/FOI/foiRecordServices.js @@ -17,6 +17,10 @@ import { setFOIPDFStitchedRecordForRedlines, setFOIPDFStitchStatusForResponsePackage, setFOIPDFStitchedRecordForResponsePackage, + setFOIPDFStitchedRecordForOipcRedlineReview, + setFOIPDFStitchStatusForOipcRedlineReview, + setFOIPDFStitchStatusForOipcRedline, + setFOIPDFStitchedRecordForOipcRedline, } from "../../../actions/FOI/foiRequestActions"; import { fnDone } from "./foiServicesUtil"; import UserService from "../../../services/UserService"; @@ -479,3 +483,141 @@ export const fetchPDFStitchedRecordForResponsePackage = ( }); }; }; + +export const fetchPDFStitchedStatusForOIPCRedline = ( + requestId, + ministryId, + ...rest) => { + if (!ministryId) { + return () => {}; + } + const done = fnDone(rest); + let apiUrl = replaceUrl( + replaceUrl( + API.FOI_PDF_STITCH_STATUS_FOR_OIPCREDLINE, + "", + ministryId + ), + "", + requestId + ); + return (dispatch) => { + httpGETRequest(apiUrl, {}, UserService.getToken()) + .then((res) => { + if (res.data) { + dispatch(setFOIPDFStitchStatusForOipcRedline(res.data)); + done(null, res.data); + } + }) + .catch((error) => { + console.log("Error in fetching pdfstitch job status", error); + dispatch(serviceActionError(error)); + done(error); + }); + }; + } + +export const fetchPDFStitchedRecordForOIPCRedline = ( + requestId, + ministryId, + ...rest) => { + if (!ministryId) { + return () => {}; + } + const done = fnDone(rest); + let apiUrl = replaceUrl( + replaceUrl( + API.FOI_DOWNLOAD_RECORDS_FOR_OIPCREDLINE, + "", + ministryId + ), + "", + requestId + ); + return (dispatch) => { + httpGETRequest(apiUrl, {}, UserService.getToken()) + .then((res) => { + if (res.data) { + dispatch(setFOIPDFStitchedRecordForOipcRedline(res.data)); + done(null, res.data); + } else { + console.log("Error in fetching records for redlines", res); + dispatch(serviceActionError(res)); + } + }) + .catch((error) => { + console.log("Error in fetching records for redlines", error); + dispatch(serviceActionError(error)); + done(error); + }); + }; + } + +export const fetchPDFStitchedStatusForOIPCRedlineReview = ( + requestId, + ministryId, + ...rest) => { + if (!ministryId) { + return () => {}; + } + const done = fnDone(rest); + let apiUrl = replaceUrl( + replaceUrl( + API.FOI_PDF_STITCH_STATUS_FOR_OIPCREDLINEREVIEW, + "", + ministryId + ), + "", + requestId + ); + return (dispatch) => { + httpGETRequest(apiUrl, {}, UserService.getToken()) + .then((res) => { + if (res.data) { + dispatch(setFOIPDFStitchStatusForOipcRedlineReview(res.data)); + done(null, res.data); + } + }) + .catch((error) => { + console.log("Error in fetching pdfstitch job status", error); + dispatch(serviceActionError(error)); + done(error); + }); + }; + } + +export const fetchPDFStitchedRecordForOIPCRedlineReview = ( + requestId, + ministryId, + ...rest) => { + if (!ministryId) { + return () => {}; + } + const done = fnDone(rest); + let apiUrl = replaceUrl( + replaceUrl( + API.FOI_DOWNLOAD_RECORDS_FOR_OIPCREDLINEREVIEW, + "", + ministryId + ), + "", + requestId + ); + return (dispatch) => { + httpGETRequest(apiUrl, {}, UserService.getToken()) + .then((res) => { + if (res.data) { + dispatch(setFOIPDFStitchedRecordForOipcRedlineReview(res.data)); + done(null, res.data); + } else { + console.log("Error in fetching records for redlines", res); + dispatch(serviceActionError(res)); + } + }) + .catch((error) => { + console.log("Error in fetching records for redlines", error); + dispatch(serviceActionError(error)); + done(error); + }); + }; + } \ No newline at end of file diff --git a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js index 0f559f581..5c7d8db01 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js @@ -49,6 +49,8 @@ import { fetchRedactedSections, fetchPDFStitchStatusForRedlines, fetchPDFStitchStatusForResponsePackage, + fetchPDFStitchedStatusForOIPCRedlineReview, + fetchPDFStitchedStatusForOIPCRedline, } from "../../../apiManager/services/FOI/foiRecordServices"; import { makeStyles } from "@material-ui/core/styles"; import FOI_COMPONENT_CONSTANTS from "../../../constants/FOI/foiComponentConstants"; @@ -301,6 +303,8 @@ const FOIRequest = React.memo(({ userDetail }) => { dispatch(fetchPDFStitchStatusForHarms(requestId, ministryId)); dispatch(fetchPDFStitchStatusForRedlines(requestId, ministryId)); dispatch(fetchPDFStitchStatusForResponsePackage(requestId, ministryId)); + dispatch(fetchPDFStitchedStatusForOIPCRedline(requestId, ministryId)); + dispatch(fetchPDFStitchedStatusForOIPCRedlineReview(requestId, ministryId)); fetchCFRForm(ministryId, dispatch); dispatch(fetchApplicantCorrespondence(requestId, ministryId)); dispatch(fetchApplicantCorrespondenceTemplates()); 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 d3b9cccdf..0bcde8b35 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js @@ -29,6 +29,8 @@ import { fetchPDFStitchStatusForHarms, fetchPDFStitchStatusForRedlines, fetchPDFStitchStatusForResponsePackage, + fetchPDFStitchedStatusForOIPCRedlineReview, + fetchPDFStitchedStatusForOIPCRedline, } from "../../../../apiManager/services/FOI/foiRecordServices"; import { fetchCFRForm } from "../../../../apiManager/services/FOI/foiCFRFormServices"; @@ -213,6 +215,8 @@ const MinistryReview = React.memo(({ userDetail }) => { dispatch(fetchPDFStitchStatusForHarms(requestId, ministryId)); dispatch(fetchPDFStitchStatusForRedlines(requestId, ministryId)); dispatch(fetchPDFStitchStatusForResponsePackage(requestId, ministryId)); + dispatch(fetchPDFStitchedStatusForOIPCRedline(requestId, ministryId)); + dispatch(fetchPDFStitchedStatusForOIPCRedlineReview(requestId, ministryId)); fetchCFRForm(ministryId, dispatch); if (bcgovcode) dispatch(fetchFOIMinistryAssignedToList(bcgovcode)); } @@ -345,6 +349,8 @@ const MinistryReview = React.memo(({ userDetail }) => { dispatch(fetchPDFStitchStatusForHarms(requestId, ministryId)); dispatch(fetchPDFStitchStatusForRedlines(requestId, ministryId)); dispatch(fetchPDFStitchStatusForResponsePackage(requestId, ministryId)); + dispatch(fetchPDFStitchedStatusForOIPCRedline(requestId, ministryId)); + dispatch(fetchPDFStitchedStatusForOIPCRedlineReview(requestId, ministryId)); fetchCFRForm(ministryId, dispatch); setStateChanged(false); setcurrentrequestStatus(_state); diff --git a/forms-flow-web/src/components/FOI/customComponents/Records/index.js b/forms-flow-web/src/components/FOI/customComponents/Records/index.js index 764b4ec1f..85373fdac 100644 --- a/forms-flow-web/src/components/FOI/customComponents/Records/index.js +++ b/forms-flow-web/src/components/FOI/customComponents/Records/index.js @@ -30,6 +30,8 @@ import { fetchPDFStitchedRecordForHarms, fetchPDFStitchedRecordForRedlines, fetchPDFStitchedRecordForResponsePackage, + fetchPDFStitchedRecordForOIPCRedline, + fetchPDFStitchedRecordForOIPCRedlineReview, checkForRecordsChange, } from "../../../../apiManager/services/FOI/foiRecordServices"; import { @@ -62,14 +64,6 @@ import TextField from "@mui/material/TextField"; import { saveAs } from "file-saver"; import { downloadZip } from "client-zip"; import { ClickableChip } from "../../Dashboard/utils"; -import CircularProgress from "@mui/material/CircularProgress"; -import AttachmentFilter from "../Attachments/AttachmentFilter"; -import Accordion from "@material-ui/core/Accordion"; -import Stack from "@mui/material/Stack"; -import AccordionSummary from "@material-ui/core/AccordionSummary"; -import AccordionDetails from "@material-ui/core/AccordionDetails"; -import Typography from "@material-ui/core/Typography"; -import ExpandMoreIcon from "@material-ui/icons/ExpandMore"; import SearchIcon from "@material-ui/icons/Search"; import InputAdornment from "@mui/material/InputAdornment"; import InputBase from "@mui/material/InputBase"; @@ -80,15 +74,12 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCheckCircle, faClone, - faTrashAlt, - faTrashCan, } from "@fortawesome/free-regular-svg-icons"; import { faSpinner, faExclamationCircle, faBan, faArrowTurnUp, - faHistory, faTrash, faPenToSquare, faLinkSlash, @@ -237,6 +228,12 @@ export const RecordsLog = ({ let redlinePdfStitchStatus = useSelector( (state) => state.foiRequests.foiPDFStitchStatusForRedlines ); + let oipcRedlineReviewPdfStitchedStatus = useSelector( + (state) => state.foiRequests.foiPDFStitchStatusForOipcRedlineReview + ); + let oipcRedlinePdfStitchedStatus = useSelector( + (state) => state.foiRequests.foiPDFStitchStatusForOipcRedline + ); let responsePackagePdfStitchStatus = useSelector( (state) => state.foiRequests.foiPDFStitchStatusForResponsePackage ); @@ -247,6 +244,12 @@ export const RecordsLog = ({ let redlinePdfStitchedRecord = useSelector( (state) => state.foiRequests.foiPDFStitchedRecordForRedlines ); + let oipcRedlineReviewPdfStitchedRecord = useSelector( + (state) => state.foiRequests.foiPDFStitchedRecordForOipcRedlineReview + ); + let oipcRedlinePdfStitchedRecord = useSelector( + (state) => state.foiRequests.foiPDFStitchedRecordForOipcRedline + ); let responsePackagePdfStitchedRecord = useSelector( (state) => state.foiRequests.foiPDFStitchedRecordForResponsePackage ); @@ -375,6 +378,18 @@ export const RecordsLog = ({ useState(false); const [isResponsePackageDownloadFailed, setIsResponsePackageDownloadFailed] = useState(false); + const [isOIPCRedlineReviewReady, setIsOIPCRedlineReviewReady] = + useState(false); + const [isOIPCRedlineReviewFailed, setIsOIPCRedlineReviewFailed] = + useState(false); + const [isOIPCRedlineReviewInProgress, setIsOIPCRedlineReviewInProgress] = + useState(false); + const [isOIPCRedlineReady, setIsOIPCRedlineReady] = + useState(false); + const [isOIPCRedlineFailed, setIsOIPCRedlineFailed] = + useState(false); + const [isOIPCRedlineInProgress, setIsOIPCRedlineInProgress] = + useState(false); const [isAllSelected, setIsAllSelected] = useState(false); useEffect(() => { @@ -438,10 +453,29 @@ export const RecordsLog = ({ setIsResponsePackageDownloadFailed, fetchPDFStitchedRecordForResponsePackage ); + + // Update OIPC Review Package PDF Stitch Status + updateStatus( + oipcRedlineReviewPdfStitchedStatus, + setIsOIPCRedlineReviewInProgress, + setIsOIPCRedlineReviewReady, + setIsOIPCRedlineReviewFailed, + fetchPDFStitchedRecordForOIPCRedlineReview + ); + // Update Redline OIPC PDF Stitch Status + updateStatus( + oipcRedlinePdfStitchedStatus, + setIsOIPCRedlineInProgress, + setIsOIPCRedlineReady, + setIsOIPCRedlineFailed, + fetchPDFStitchedRecordForOIPCRedline + ); }, [ pdfStitchStatus, redlinePdfStitchStatus, responsePackagePdfStitchStatus, + oipcRedlinePdfStitchedStatus, + oipcRedlineReviewPdfStitchedStatus, requestId, ministryId, ]); @@ -454,8 +488,14 @@ export const RecordsLog = ({ if (item.id === 3 && isResponsePackageDownloadReady) { item.disabled = false; } + if (item.id === 4 && isOIPCRedlineReady) { + item.disabled = false; + } + if (item.id === 5 && isOIPCRedlineReviewReady) { + item.disabled = false; + } }); - }, [isRedlineDownloadReady, isResponsePackageDownloadReady]); + }, [isRedlineDownloadReady, isResponsePackageDownloadReady, isOIPCRedlineReady, isOIPCRedlineReviewReady]); const addAttachments = () => { setModalFor("add"); @@ -832,6 +872,12 @@ export const RecordsLog = ({ } else if (e.target.value === 3 && isResponsePackageDownloadReady) { const s3filepath = responsePackagePdfStitchedRecord?.finalpackagepath; handleDownloadZipFile(s3filepath, e.target.value); + } else if (e.target.value === 4 && isOIPCRedlineReady) { + const s3filepath = oipcRedlinePdfStitchedRecord?.finalpackagepath; + handleDownloadZipFile(s3filepath, e.target.value); + } else if (e.target.value === 5 && isOIPCRedlineReviewReady) { + const s3filepath = oipcRedlineReviewPdfStitchedRecord?.finalpackagepath; + handleDownloadZipFile(s3filepath, e.target.value); } setCurrentDownload(e.target.value); @@ -1006,6 +1052,14 @@ export const RecordsLog = ({ setIsResponsePackageDownloadInProgress(false); setIsResponsePackageDownloadReady(false); setIsResponsePackageDownloadFailed(true); + } else if (itemid === 4) { + setIsOIPCRedlineInProgress(false); + setIsOIPCRedlineReady(false); + setIsOIPCRedlineFailed(true); + } else if (itemid === 5) { + setIsOIPCRedlineReviewInProgress(false); + setIsOIPCRedlineReviewReady(false); + setIsOIPCRedlineReviewFailed(true); } }; @@ -1013,7 +1067,9 @@ export const RecordsLog = ({ return ( (itemid === 1 && isDownloadReady) || (itemid === 2 && isRedlineDownloadReady) || - (itemid === 3 && isResponsePackageDownloadReady) + (itemid === 3 && isResponsePackageDownloadReady) || + (itemid === 4 && isOIPCRedlineReady) || + (itemid === 5 && isOIPCRedlineReviewReady) ); }; @@ -1021,7 +1077,9 @@ export const RecordsLog = ({ return ( (itemid === 1 && isDownloadFailed) || (itemid === 2 && isRedlineDownloadFailed) || - (itemid === 3 && isResponsePackageDownloadFailed) + (itemid === 3 && isResponsePackageDownloadFailed) || + (itemid === 4 && isOIPCRedlineFailed) || + (itemid === 5 && isOIPCRedlineReviewFailed) ); }; @@ -1029,7 +1087,9 @@ export const RecordsLog = ({ return ( (itemid === 1 && isDownloadInProgress) || (itemid === 2 && isRedlineDownloadInProgress) || - (itemid === 3 && isResponsePackageDownloadInProgress) + (itemid === 3 && isResponsePackageDownloadInProgress) || + (itemid === 4 && isOIPCRedlineInProgress) || + (itemid === 5 && isOIPCRedlineReviewInProgress) ); }; diff --git a/forms-flow-web/src/constants/FOI/enum.js b/forms-flow-web/src/constants/FOI/enum.js index ce2622e6e..ec0ea2aac 100644 --- a/forms-flow-web/src/constants/FOI/enum.js +++ b/forms-flow-web/src/constants/FOI/enum.js @@ -170,6 +170,8 @@ const RecordsDownloadList = [ { id: 1, label: "Download for Harms", disabled: true }, { id: 2, label: "Download Redline for Sign Off", disabled: true }, { id: 3, label: "Download Final Package", disabled: true }, + { id: 4, label: "Download OIPC Redline for Sign Off", disabled: true }, + { id: 5, label: "Download OIPC Redline for OIPC Review", disabled: true }, ]; const RecordDownloadCategory = Object.freeze({ diff --git a/forms-flow-web/src/modules/FOI/foiRequestsReducer.js b/forms-flow-web/src/modules/FOI/foiRequestsReducer.js index 9edb8ab4e..4da4d7096 100644 --- a/forms-flow-web/src/modules/FOI/foiRequestsReducer.js +++ b/forms-flow-web/src/modules/FOI/foiRequestsReducer.js @@ -57,10 +57,14 @@ const initialState = { }, foiPDFStitchedRecordForHarms: {}, foiPDFStitchedRecordForRedlines: {}, + foiPDFStitchedRecordForOipcRedlineReview: {}, + foiPDFStitchedRecordForOipcRedline: {}, foiPDFStitchedRecordForResponsePackage: {}, foiPDFStitchStatusForHarms: "not started", foiPDFStitchStatusForRedlines: "not started", foiPDFStitchStatusForResponsePackage: "not started", + foiPDFStitchStatusForOipcRedlineReview: "not started", + foiPDFStitchStatusForOipcRedline: "not started", foiRequestCFRForm: { overallsuggestions: "", status: "init", @@ -268,12 +272,26 @@ const foiRequests = (state = initialState, action) => { ...state, foiPDFStitchedRecordForResponsePackage: action.payload, }; + case FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINEREVIEW: + return { + ...state, + foiPDFStitchedRecordForOipcRedlineReview: action.payload, + }; + case FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINE: + return { + ...state, + foiPDFStitchedRecordForOipcRedline: action.payload, + }; case FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_HARMS: return { ...state, foiPDFStitchStatusForHarms: action.payload }; case FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_REDLINES: return { ...state, foiPDFStitchStatusForRedlines: action.payload }; case FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_RESPONSEPACKAGE: return { ...state, foiPDFStitchStatusForResponsePackage: action.payload }; + case FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINEREVIEW: + return { ...state, foiPDFStitchStatusForOipcRedlineReview: action.payload }; + case FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINE: + return { ...state, foiPDFStitchStatusForOipcRedline: action.payload }; case FOI_ACTION_CONSTANTS.FOI_REQUEST_CFR_FORM: return { ...state, diff --git a/request-management-api/request_api/models/FOIMinistryRequests.py b/request-management-api/request_api/models/FOIMinistryRequests.py index 8f127614a..acf0f870f 100644 --- a/request-management-api/request_api/models/FOIMinistryRequests.py +++ b/request-management-api/request_api/models/FOIMinistryRequests.py @@ -808,7 +808,10 @@ def getupcomingoipcduerecords(cls): from "FOIMinistryRequests" fpa order by fpa.foiministryrequestid , fpa.version desc) fma on frd.foiministryrequest_id = fma.foiministryrequestid and frd.foiministryrequestversion_id = fma.foiministryrequestversion and fma.requeststatusid not in (5,6,4,11,3,15) + and inquiryattributes is not null + and frd.inquiryattributes ->> 'inquirydate' not in ('','null') and (frd.inquiryattributes ->> 'inquirydate')::date between NOW() - INTERVAL '7 DAY' AND NOW() + INTERVAL '7 DAY' + and frd.outcomeid is null order by frd.foiministryrequest_id , frd.foiministryrequestversion_id desc;""" rs = db.session.execute(text(sql)) for row in rs: diff --git a/request-management-api/request_api/services/foirequest/requestservicebuilder.py b/request-management-api/request_api/services/foirequest/requestservicebuilder.py index dd1a0516b..eef873754 100644 --- a/request-management-api/request_api/services/foirequest/requestservicebuilder.py +++ b/request-management-api/request_api/services/foirequest/requestservicebuilder.py @@ -152,11 +152,16 @@ def prepareoipc(self, requestschema, ministryrequestid, version, userid): oipcreview.receiveddate = oipc["receiveddate"] if oipc["receiveddate"] not in (None, "") else None oipcreview.closeddate = oipc["closeddate"] if oipc["closeddate"] not in (None, "") else None if oipc["isinquiry"] == True: - oipcreview.inquiryattributes = oipc["inquiryattributes"] + oipcreview.inquiryattributes = self.__formatoipcattributes(oipc["inquiryattributes"]) oipcreview.createdby=userid oipcreview.created_at= datetime2.now().isoformat() oipcarr.append(oipcreview) return oipcarr + + def __formatoipcattributes(self, inquiryattributes): + if inquiryattributes not in (None, "") and inquiryattributes["inquirydate"] in ("","null"): + inquiryattributes["inquirydate"] = None + return inquiryattributes def isNotBlankorNone(self, dataschema, key, location):