diff --git a/components/case/representation/index.js b/components/case/representation/index.js index 32609c1a..ae3fe379 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -312,133 +312,6 @@ let MakeRepresentation = (props) => { const safeDetailsObj = detailsObj || {}; const safeResultsObj = resultsObj || {}; - // blocked out build reps arr for refactoring - // const buildRepsArr = (detailsObj) => { - // const buildArr = []; - // const todaysDate = new Date(); - - // const isDNS = appealType === 846040011; - // const isSIPS = appealType === 846040002; - // const isIP = true; - - // const isAppellant = - // props.props.accountDetails.accountDetails - // .pinswg_typeofinvolvement === 846040001; - - // // Determine key dates based on appeal type - // const startDate = new Date( - // isDNS - // ? detailsObj.pinswg_applicationacceptedasvalid - // : detailsObj.pinswg_startdate || detailsObj.pinswg_startdates - // ); - - // const questionnaireDate = new Date( - // isDNS - // ? detailsObj.pinswg_endofrepresentationperiod - // : detailsObj.pinswg_questionnaireduedate - // ); - // questionnaireDate.setHours(23, 59, 59, 999); - - // const finalCommentsDate = new Date( - // isDNS - // ? detailsObj.pinswg_endofrepresentationperiod - // : detailsObj.pinswg_finalcommentsduedate - // ); - // finalCommentsDate.setHours(23, 59, 59, 999); - - // const statementDueDate = new Date( - // isDNS - // ? detailsObj.pinswg_endofrepresentationperiod - // : detailsObj.pinswg_statementduedate || - // detailsObj.pinswg_statementsduedate - // ); - // statementDueDate.setHours(23, 59, 59, 999); - - // // Shared condition - // const isWithin = (start, end) => - // todaysDate >= start && todaysDate <= end; - // const notAppeal = (...types) => !types.includes(appealType); - - // // Questionnaire - // if ( - // isLPA && - // notAppeal(846040019, 846040011, 846040015, 846040016) && - // isWithin(startDate, finalCommentsDate) - // ) { - // buildArr.push("Questionnaire"); - // } - - // // DNS LPA Documents - // if ( - // isLPA && - // isDNS && - // appealType !== 846040019 && - // isWithin(startDate, finalCommentsDate) - // ) { - // buildArr.push("Local Impact Report", "Statement"); - // } - - // // Non-DNS Statement - // if ( - // !isDNS && - // appealType !== 846040004 && - // isWithin(startDate, statementDueDate) - // ) { - // buildArr.push("Statement"); - // } - - // // DNS Non-LPA Statement - // if (isDNS && !isLPA && isWithin(startDate, statementDueDate)) { - // buildArr.push("Statement"); - // } - - // // Final Comments - // const isSpecialistNonHearing = - // currentView.caseReference.specialistProcess !== 846040001; - - // if ( - // (appealType !== 846040004 || - // (appealType === 846040015 && isSpecialistNonHearing)) && - // isWithin(statementDueDate, finalCommentsDate) - // ) { - // buildArr.push("Final comments"); - // } - - // if ( - // appealType === 846040004 && - // isSpecialistNonHearing && - // isWithin(statementDueDate, finalCommentsDate) - // ) { - // buildArr.push("Final comments"); - // } - - // // Remove "Statement" for LPA Advert Part 3 (no statement) - // if ( - // isLPA && - // appealType === 846040018 && - // currentView.caseReference.specialistProcess === 846040000 - // ) { - // const index = buildArr.indexOf("Statement"); - // if (index !== -1) buildArr.splice(index, 1); - // } - - // // SIPS-related documents - // if (isSIPS) { - // const capacity = repCapacityType(); - // if (capacity === "appellant") { - // buildArr.push("Consultation Response"); - // } else { - // buildArr.push("Consultation Response", "Local Impact Report"); - // } - - // if (isNRW) { - // buildArr.push("Marine Impact Report"); - // } - // } - - // return buildArr; - // }; - const buildRepsArr = (detailsObj) => { const buildArr = []; const todaysDate = new Date(); @@ -453,7 +326,13 @@ let MakeRepresentation = (props) => { props.props?.accountDetails?.accountDetails ?.pinswg_typeofinvolvement; - const isAppellant = involvementType === 846040001; + //const isAppellant = involvementType === 846040001; + + const isAppellant = + props.props.accountDetails.accountDetails.emailaddress1 == + props.searchResultsObj?.searchResultsObj?.value[0] + .customerid_contact.emailaddress1; + const isAgent = involvementType === 846040000; const isIP = involvementType === 846040061; //const isLPA = involvementType === 846040000;