diff --git a/src/components/Ameyo/AmeyoCollapsibleToolbarV3.tsx b/src/components/Ameyo/AmeyoCollapsibleToolbarV3.tsx index b24e0d56..3804e95f 100644 --- a/src/components/Ameyo/AmeyoCollapsibleToolbarV3.tsx +++ b/src/components/Ameyo/AmeyoCollapsibleToolbarV3.tsx @@ -762,7 +762,14 @@ export const AmeyoCollapsibleToolbarV3 = (props: { lan, (loanAccountNumber: string, customerDetails: AllCasesSummary) => { if (loanAccountNumber && customerDetails?.customerId) { - dispatch(getCustomerDetails(loanAccountNumber, customerDetails.customerId)); + dispatch( + getCustomerDetails( + loanAccountNumber, + customerDetails.customerId, + customerDetails?.caseReferenceId || '', + customerDetails?.businessVertical || '' + ) + ); dispatch( setConnectedCustomerData({ lan, @@ -778,15 +785,21 @@ export const AmeyoCollapsibleToolbarV3 = (props: { ); // checked on BE customerId is not null // Also it is not required to check for phoneNumber - getTelephonesPromise = getTelephones(lan, '', (telephones: ITelePhoneData[]) => { - const source = - telephones?.find(telephone => telephone.number === phoneNumber)?.source || ''; - dispatch( - setTelephoneSource( - PhoneNumberSources?.[source as keyof typeof PhoneNumberSources] ?? source - ) - ); - }); + getTelephonesPromise = getTelephones( + lan, + '', + connectedCustomerData?.caseReferenceId || '', + connectedCustomerData?.businessVertical || '', + (telephones: ITelePhoneData[]) => { + const source = + telephones?.find(telephone => telephone.number === phoneNumber)?.source || ''; + dispatch( + setTelephoneSource( + PhoneNumberSources?.[source as keyof typeof PhoneNumberSources] ?? source + ) + ); + } + ); } return Promise.all([getCustomerReferenceIdPromise, getTelephonesPromise]); } diff --git a/src/components/Ameyo/AmeyoCollapsibleToolbarV4.tsx b/src/components/Ameyo/AmeyoCollapsibleToolbarV4.tsx index e113039e..b162cd6d 100644 --- a/src/components/Ameyo/AmeyoCollapsibleToolbarV4.tsx +++ b/src/components/Ameyo/AmeyoCollapsibleToolbarV4.tsx @@ -734,7 +734,14 @@ export const AmeyoCollapsibleToolbarV4 = (props: { lan, (loanAccountNumber: string, customerDetails: AllCasesSummary) => { if (loanAccountNumber && customerDetails?.customerId) { - dispatch(getCustomerDetails(loanAccountNumber, customerDetails.customerId)); + dispatch( + getCustomerDetails( + loanAccountNumber, + customerDetails.customerId, + customerDetails?.caseReferenceId || '', + customerDetails?.businessVertical || '' + ) + ); dispatch( setConnectedCustomerData({ lan, @@ -750,15 +757,21 @@ export const AmeyoCollapsibleToolbarV4 = (props: { ); // checked on BE customerId is not null // Also it is not required to check for phoneNumber - getTelephonesPromise = getTelephones(lan, '', (telephones: ITelePhoneData[]) => { - const source = - telephones?.find(telephone => telephone.number === phoneNumber)?.source || ''; - dispatch( - setTelephoneSource( - PhoneNumberSources?.[source as keyof typeof PhoneNumberSources] ?? source - ) - ); - }); + getTelephonesPromise = getTelephones( + lan, + '', + connectedCustomerData?.caseReferenceId || '', + connectedCustomerData?.businessVertical || '', + (telephones: ITelePhoneData[]) => { + const source = + telephones?.find(telephone => telephone.number === phoneNumber)?.source || ''; + dispatch( + setTelephoneSource( + PhoneNumberSources?.[source as keyof typeof PhoneNumberSources] ?? source + ) + ); + } + ); } return Promise.all([getCustomerReferenceIdPromise, getTelephonesPromise]); } diff --git a/src/components/Ameyo/ameyoActions.ts b/src/components/Ameyo/ameyoActions.ts index 8b92f6a7..9be8cc5c 100644 --- a/src/components/Ameyo/ameyoActions.ts +++ b/src/components/Ameyo/ameyoActions.ts @@ -31,10 +31,14 @@ export const getCustomerReferenceIdFromLAN = (loanId: string, successCallback: a export const getTelephones = ( loanAccountNumber: string, customerReferenceId: string, + caseReferenceId: string, + caseBusinessVertical: string, successCallback: any ) => { return axiosInstance - .get(getApiUrl(ApiKeys.TELEPHONES), { headers: { customerReferenceId, loanAccountNumber } }) + .get(getApiUrl(ApiKeys.TELEPHONES), { + headers: { customerReferenceId, loanAccountNumber, caseReferenceId, caseBusinessVertical } + }) .then(res => { if (res.data) { successCallback(res.data); diff --git a/src/pages/CaseDetails/actions/EmiScheduleActions.ts b/src/pages/CaseDetails/actions/EmiScheduleActions.ts index 64dd5c18..2d610589 100644 --- a/src/pages/CaseDetails/actions/EmiScheduleActions.ts +++ b/src/pages/CaseDetails/actions/EmiScheduleActions.ts @@ -52,6 +52,8 @@ export const fetchPendingFeeComponents = export const submitWaiveFee = ( lan: string, customerReferenceId: string, + caseReferenceId: string, + caseBusinessVertical: string, payload: { [key: string]: ComponentAdjustment }, dueDetails: Due, phoneNumber: string, @@ -106,6 +108,8 @@ export const submitWaiveFee = ( getDetailsAndSendPaymentLink( lan, customerReferenceId, + caseReferenceId, + caseBusinessVertical, dueDetails, paymentRequests, paymentCallback, @@ -246,6 +250,8 @@ const getCompleteSendPaymentLinkRequestFromBasicRequest = ( export const getDetailsAndSendPaymentLink = ( lan: string, customerRefrenceId: string, + caseReferenceId: string, + caseBusinessVertical: string, dueDetails: Due | undefined, sendPaymentLinkRequest: SendPaymentLinkRequest[], successCallback: (text: string, type: TypeOptions) => void, @@ -263,7 +269,12 @@ export const getDetailsAndSendPaymentLink = ( }) ); const detailsPromise = axiosInstance.get(getApiUrl(ApiKeys.DETAILS), { - headers: { customerreferenceid: customerRefrenceId, loanaccountnumber: lan } + headers: { + customerreferenceid: customerRefrenceId, + loanaccountnumber: lan, + caseReferenceId, + caseBusinessVertical + } }); const pendingFeeUrl = getApiUrl(ApiKeys.PENDING_FEE_COMPONENTS, { lan }); const pendingFeePromise = axiosInstance.get(pendingFeeUrl); @@ -359,10 +370,16 @@ const sendPaymentLink = ( }; export const getEnachPresentDetails = - (customerReferenceId: string, loanAccountNumber: string) => (dispatch: Dispatch) => { + ( + customerReferenceId: string, + loanAccountNumber: string, + caseReferenceId: string, + caseBusinessVertical: string + ) => + (dispatch: Dispatch) => { axiosInstance .get(getApiUrl(ApiKeys.MONTHLTY_ENACH_REQUEST), { - headers: { customerReferenceId, loanAccountNumber } + headers: { customerReferenceId, loanAccountNumber, caseReferenceId, caseBusinessVertical } }) .then(res => dispatch( @@ -397,35 +414,39 @@ export const fetchFeeWaiverHistory = (lan: string, customerId: string) => (dispa }); }; -export const fetchCustomerDocs = (lan: string, customerId: string) => (dispatch: Dispatch) => { - const url = getApiUrl(ApiKeys.CUSTOMER_DOCS); - dispatch( - setCaseDetailLoading({ - lan, - customerRefrenceId: customerId, - key: STORE_KEYS.CUSTOMER_DOCS, - loading: true - }) - ); - axiosInstance - .get(url, { - headers: { - customerreferenceid: customerId, - loanaccountnumber: lan - } - }) - .then(response => { - dispatch( - setCaseDetail({ - lan, - customerRefrenceId: customerId, - key: STORE_KEYS.CUSTOMER_DOCS, - data: response.data.documents, - loading: false - }) - ); - }); -}; +export const fetchCustomerDocs = + (lan: string, customerId: string, caseReferenceId: string, caseBusinessVertical: string) => + (dispatch: Dispatch) => { + const url = getApiUrl(ApiKeys.CUSTOMER_DOCS); + dispatch( + setCaseDetailLoading({ + lan, + customerRefrenceId: customerId, + key: STORE_KEYS.CUSTOMER_DOCS, + loading: true + }) + ); + axiosInstance + .get(url, { + headers: { + customerreferenceid: customerId, + loanaccountnumber: lan, + caseReferenceId, + caseBusinessVertical + } + }) + .then(response => { + dispatch( + setCaseDetail({ + lan, + customerRefrenceId: customerId, + key: STORE_KEYS.CUSTOMER_DOCS, + data: response.data.documents, + loading: false + }) + ); + }); + }; export const fetchLegalDocs = (lan: string, customerId: string) => (dispatch: Dispatch) => { const url = getApiUrl(ApiKeys.LEGAL_DOCS); diff --git a/src/pages/CaseDetails/actions/addressesActions.ts b/src/pages/CaseDetails/actions/addressesActions.ts index 66600ab8..ecf9de85 100644 --- a/src/pages/CaseDetails/actions/addressesActions.ts +++ b/src/pages/CaseDetails/actions/addressesActions.ts @@ -8,42 +8,62 @@ import { } from '../reducers/caseDetailSlice'; import { ISimilarGeoLocationsPayload } from '@cp/pages/CaseDetails/interfaces/MoreDetails.type'; -export const fetchAddresses = (lan: string, customerRefrenceId: string) => (dispatch: Dispatch) => { - const url = getApiUrl(ApiKeys.ADDRESSES); - dispatch( - setCaseDetailLoading({ - lan, - customerRefrenceId, - key: STORE_KEYS.ADDRESSES, - loading: true - }) - ); - axiosInstance - .get(url, { headers: { customerreferenceid: customerRefrenceId, loanaccountnumber: lan } }) - .then(response => { - dispatch( - setCaseDetail({ - lan, - customerRefrenceId, - key: STORE_KEYS.ADDRESSES, - data: response.data - }) - ); - }) - .catch(err => { - dispatch( - setCaseDetailError({ - lan, - customerRefrenceId, - key: STORE_KEYS.ADDRESSES, - error: err - }) - ); - }); -}; +export const fetchAddresses = + ( + lan: string, + customerRefrenceId: string, + caseReferenceId: string, + caseBusinessVertical: string + ) => + (dispatch: Dispatch) => { + const url = getApiUrl(ApiKeys.ADDRESSES); + dispatch( + setCaseDetailLoading({ + lan, + customerRefrenceId, + key: STORE_KEYS.ADDRESSES, + loading: true + }) + ); + axiosInstance + .get(url, { + headers: { + customerreferenceid: customerRefrenceId, + loanaccountnumber: lan, + caseReferenceId, + caseBusinessVertical + } + }) + .then(response => { + dispatch( + setCaseDetail({ + lan, + customerRefrenceId, + key: STORE_KEYS.ADDRESSES, + data: response.data + }) + ); + }) + .catch(err => { + dispatch( + setCaseDetailError({ + lan, + customerRefrenceId, + key: STORE_KEYS.ADDRESSES, + error: err + }) + ); + }); + }; export const fetchGeolocations = - (lan: string, customerRefrenceId: string) => (dispatch: Dispatch) => { + ( + lan: string, + customerRefrenceId: string, + caseReferenceId: string, + caseBusinessVertical: string + ) => + (dispatch: Dispatch) => { const url = getApiUrl(ApiKeys.GEOLOCATIONS); dispatch( setCaseDetailLoading({ @@ -55,7 +75,12 @@ export const fetchGeolocations = ); axiosInstance .get(url, { - headers: { customerreferenceid: customerRefrenceId, loanaccountnumber: lan }, + headers: { + customerreferenceid: customerRefrenceId, + loanaccountnumber: lan, + caseReferenceId, + caseBusinessVertical + }, params: { includeGroupedAddressesAndGeoLocations: true, includeAddressFeedback: true, diff --git a/src/pages/CaseDetails/actions/casesDetailsActions.ts b/src/pages/CaseDetails/actions/casesDetailsActions.ts index c0036713..1582c785 100644 --- a/src/pages/CaseDetails/actions/casesDetailsActions.ts +++ b/src/pages/CaseDetails/actions/casesDetailsActions.ts @@ -16,7 +16,13 @@ import { toast } from '@navi/web-ui/lib/primitives/Toast'; import { OverdueResponse } from '../interfaces/EmiSchedule.type'; export const getCustomerDetails = - (loanaccountnumber: string, customerreferenceid: string) => (dispatch: Dispatch) => { + ( + loanaccountnumber: string, + customerreferenceid: string, + caseReferenceId: string, + caseBusinessVertical: string + ) => + (dispatch: Dispatch) => { dispatch( setCaseDetailLoading({ lan: loanaccountnumber, @@ -29,7 +35,9 @@ export const getCustomerDetails = .get(getApiUrl(ApiKeys.DETAILS), { headers: { customerreferenceid, - loanaccountnumber + loanaccountnumber, + caseReferenceId, + caseBusinessVertical } }) .then(res => { @@ -45,7 +53,13 @@ export const getCustomerDetails = }; export const getTelephones = - (loanaccountnumber: string, customerreferenceid: string) => (dispatch: Dispatch) => { + ( + loanaccountnumber: string, + customerreferenceid: string, + caseReferenceId: string, + caseBusinessVertical: string + ) => + (dispatch: Dispatch) => { dispatch( setCaseDetailLoading({ lan: loanaccountnumber, @@ -55,7 +69,9 @@ export const getTelephones = }) ); axiosInstance - .get(getApiUrl(ApiKeys.TELEPHONES), { headers: { customerreferenceid, loanaccountnumber } }) + .get(getApiUrl(ApiKeys.TELEPHONES), { + headers: { customerreferenceid, loanaccountnumber, caseReferenceId, caseBusinessVertical } + }) .then(res => { dispatch( setTelephones({ @@ -112,13 +128,20 @@ export const getCustomerInfo = (lan: string, customerRefId: string) => (dispatch }; export const shareEnachLink = - (loanaccountnumber: string, customerreferenceid: string, successCallback: () => void) => () => { + ( + loanaccountnumber: string, + customerreferenceid: string, + successCallback: () => void, + caseReferenceId: string, + caseBusinessVertical: string + ) => + () => { axiosInstance .post( getApiUrl(ApiKeys.REGISTER_ENACH_LINK), {}, { - headers: { customerreferenceid, loanaccountnumber } + headers: { customerreferenceid, loanaccountnumber, caseReferenceId, caseBusinessVertical } } ) .then(() => { @@ -177,7 +200,13 @@ export const calculateOverDue = }; export const getTelephonesV2 = - (loanaccountnumber: string, customerreferenceid: string, successCallBack?: () => void) => + ( + loanaccountnumber: string, + customerreferenceid: string, + caseReferenceId: string, + caseBusinessVertical: string, + successCallBack?: () => void + ) => (dispatch: Dispatch) => { dispatch( setCaseDetailLoading({ @@ -189,7 +218,7 @@ export const getTelephonesV2 = ); axiosInstance .get(getApiUrl(ApiKeys.TELEPHONES_V2), { - headers: { customerreferenceid, loanaccountnumber } + headers: { customerreferenceid, loanaccountnumber, caseReferenceId, caseBusinessVertical } }) .then(res => { dispatch( diff --git a/src/pages/CaseDetails/actions/moreDetailsActions.ts b/src/pages/CaseDetails/actions/moreDetailsActions.ts index bb69fd27..425a64f0 100644 --- a/src/pages/CaseDetails/actions/moreDetailsActions.ts +++ b/src/pages/CaseDetails/actions/moreDetailsActions.ts @@ -13,7 +13,12 @@ interface dispatchProps { payload: any; type: string; } -export const fetchAddresses = (lan: string, customerRefrenceId: string) => { +export const fetchAddresses = ( + lan: string, + customerRefrenceId: string, + caseReferenceId: string, + caseBusinessVertical: string +) => { const url = getApiUrl(ApiKeys.ADDRESSES); return function (dispatch: ({ payload, type }: dispatchProps) => void) { dispatch( @@ -25,7 +30,14 @@ export const fetchAddresses = (lan: string, customerRefrenceId: string) => { }) ); axiosInstance - .get(url, { headers: { customerreferenceid: customerRefrenceId, loanaccountnumber: lan } }) + .get(url, { + headers: { + customerreferenceid: customerRefrenceId, + loanaccountnumber: lan, + caseReferenceId, + caseBusinessVertical + } + }) .then(response => { dispatch( setCaseDetail({ @@ -53,6 +65,8 @@ export const postAlternateNumber = ({ loanaccountnumber, customerreferenceid, + caseReferenceId, + caseBusinessVertical, alternateNumber, source, successCallback, @@ -63,6 +77,8 @@ export const postAlternateNumber = }: { loanaccountnumber: string; customerreferenceid: string; + caseReferenceId: string; + caseBusinessVertical: string; alternateNumber: string; source: string; successCallback?: () => void; @@ -86,7 +102,7 @@ export const postAlternateNumber = } ], { - headers: { customerreferenceid, loanaccountnumber } + headers: { customerreferenceid, loanaccountnumber, caseReferenceId, caseBusinessVertical } } ) .then(response => { diff --git a/src/pages/CaseDetails/components/Addresses/AddressesTab.tsx b/src/pages/CaseDetails/components/Addresses/AddressesTab.tsx index 5d6cadaf..94c39053 100644 --- a/src/pages/CaseDetails/components/Addresses/AddressesTab.tsx +++ b/src/pages/CaseDetails/components/Addresses/AddressesTab.tsx @@ -16,7 +16,12 @@ import { addClickstreamEvent } from '../../../../service/clickStreamEventService import { CLICKSTREAM_EVENT_NAMES } from '../../../../service/clickStream.constant'; const AddressesTab = () => { - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const dispatch = useDispatch(); const pageData = useSelector( (state: RootState) => state.caseDetail.pageData?.[createKey(loanId, customerId)] @@ -53,7 +58,7 @@ const AddressesTab = () => { useEffect(() => { if (!pageData?.addresses) { - dispatch(fetchAddresses(loanId, customerId)); + dispatch(fetchAddresses(loanId, customerId, caseReferenceId, caseBusinessVertical)); } }, [pageData?.addresses]); diff --git a/src/pages/CaseDetails/components/Addresses/GeolocationsTab.tsx b/src/pages/CaseDetails/components/Addresses/GeolocationsTab.tsx index 6fb9311e..4a70d0bc 100644 --- a/src/pages/CaseDetails/components/Addresses/GeolocationsTab.tsx +++ b/src/pages/CaseDetails/components/Addresses/GeolocationsTab.tsx @@ -14,7 +14,12 @@ import { fetchGeolocations } from '../../actions/addressesActions'; import GeolocationDrawer from '@cp/pages/CaseDetails/components/Addresses/Geolocations.Drawer'; const Geolocations = () => { - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const dispatch = useDispatch(); const pageData = useSelector( (state: RootState) => state.caseDetail.pageData?.[createKey(loanId, customerId)] @@ -32,7 +37,7 @@ const Geolocations = () => { useEffect(() => { if (!geoLocations) { - dispatch(fetchGeolocations(loanId, customerId)); + dispatch(fetchGeolocations(loanId, customerId, caseReferenceId, caseBusinessVertical)); } }, [geoLocations]); return ( diff --git a/src/pages/CaseDetails/components/AllDocuments/actions.ts b/src/pages/CaseDetails/components/AllDocuments/actions.ts index 906eb7d7..f7e37a38 100644 --- a/src/pages/CaseDetails/components/AllDocuments/actions.ts +++ b/src/pages/CaseDetails/components/AllDocuments/actions.ts @@ -59,11 +59,15 @@ export const getBankStatementStatus = (lan: string, customerId: string) => (disp export const getPhoneNumberStatus = async ({ lan, customerId, - phoneNumbers + phoneNumbers, + caseReferenceId, + caseBusinessVertical }: { lan: string; customerId: string; phoneNumbers: Array; + caseReferenceId: string; + caseBusinessVertical: string; }) => { const url = getApiUrl(ApiKeys.GET_PHONE_NUMBER_STATUS); const response = await axiosInstance.post( @@ -75,6 +79,8 @@ export const getPhoneNumberStatus = async ({ headers: { customerreferenceid: customerId, loanaccountnumber: lan, + caseReferenceId, + caseBusinessVertical, donotHandleError: true } } diff --git a/src/pages/CaseDetails/components/AllDocuments/bankStatement/AddNumberPopper.tsx b/src/pages/CaseDetails/components/AllDocuments/bankStatement/AddNumberPopper.tsx index 31f29c39..a5a1eb26 100644 --- a/src/pages/CaseDetails/components/AllDocuments/bankStatement/AddNumberPopper.tsx +++ b/src/pages/CaseDetails/components/AllDocuments/bankStatement/AddNumberPopper.tsx @@ -28,7 +28,13 @@ import { const AddNumberPopper = (props: IAddNumberPopperProps) => { const { data, children } = props; const dispatch = useDispatch(); - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); + const [numberStatusData, setNumberStatusData] = useState(false); const [statusFailed, setStatusFailed] = useState(false); const [isExisting, setIsExisting] = useState(false); @@ -46,7 +52,13 @@ const AddNumberPopper = (props: IAddNumberPopperProps) => { const handleFetchStatus = () => { setNumberStatusData(true); setStatusFailed(false); - getPhoneNumberStatus({ lan: loanId, customerId: customerId, phoneNumbers: [identifier] }) + getPhoneNumberStatus({ + lan: loanId, + customerId: customerId, + phoneNumbers: [identifier], + caseReferenceId, + caseBusinessVertical + }) .then(response => { if (response) { const status = response[0].validity; @@ -69,11 +81,13 @@ const AddNumberPopper = (props: IAddNumberPopperProps) => { postAlternateNumber({ loanaccountnumber: loanId, customerreferenceid: customerId, + caseReferenceId, + caseBusinessVertical, alternateNumber: phoneNumber, source: BANK_STATEMENT_SOURCE, identifier: identifier, successCallback: () => { - dispatch(getTelephonesV2(loanId, customerId)); + dispatch(getTelephonesV2(loanId, customerId, caseReferenceId, caseBusinessVertical)); } }) ); @@ -92,12 +106,16 @@ const AddNumberPopper = (props: IAddNumberPopperProps) => { postAlternateNumber({ loanaccountnumber: loanId, customerreferenceid: customerId, + caseReferenceId, + caseBusinessVertical, alternateNumber: phoneNumber, source: BANK_STATEMENT_SOURCE, identifier: identifier, successToastMessage: ADD_NUMBER_AND_INITIATE_CALL_SUCCESS_TOAST_MESSAGE, successCallback: async () => { - await dispatch(getTelephonesV2(loanId, customerId)); + await dispatch( + getTelephonesV2(loanId, customerId, caseReferenceId, caseBusinessVertical) + ); dispatch(setAddedPhoneNumber({ phoneNumber, identifier })); } }) diff --git a/src/pages/CaseDetails/components/AllDocuments/bankStatement/NumberDropDown.tsx b/src/pages/CaseDetails/components/AllDocuments/bankStatement/NumberDropDown.tsx index 1f7df00d..ffe3563a 100644 --- a/src/pages/CaseDetails/components/AllDocuments/bankStatement/NumberDropDown.tsx +++ b/src/pages/CaseDetails/components/AllDocuments/bankStatement/NumberDropDown.tsx @@ -21,7 +21,12 @@ const NumberDropDown: React.FC = props => { let allNumbersList: IPhoneNumber[] = []; let allIdentifiers: string[] = []; - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const aggregationNumbers = useSelector( (state: RootState) => state.bankStatementSlice.bankStatementNumbers @@ -32,7 +37,9 @@ const NumberDropDown: React.FC = props => { getPhoneNumberStatus({ lan: loanId, customerId: customerId, - phoneNumbers: allIdentifiers + phoneNumbers: allIdentifiers, + caseReferenceId, + caseBusinessVertical }).then(response => { setAllNumberStatus(response); }); diff --git a/src/pages/CaseDetails/components/AllDocumentsV2/actions.ts b/src/pages/CaseDetails/components/AllDocumentsV2/actions.ts index 1a04117f..60f4de8d 100644 --- a/src/pages/CaseDetails/components/AllDocumentsV2/actions.ts +++ b/src/pages/CaseDetails/components/AllDocumentsV2/actions.ts @@ -10,7 +10,9 @@ import { toast } from '@primitives/Toast'; export const getDocuments = async ( dispatch: Dispatch, lan: string, - customerId: string + customerId: string, + caseReferenceId: string, + caseBusinessVertical: string ) => { try { const url = getApiUrl(ApiKeys.CUSTOMER_DOCS); @@ -19,6 +21,8 @@ export const getDocuments = async ( headers: { customerreferenceid: customerId, loanaccountnumber: lan, + caseReferenceId, + caseBusinessVertical, donotHandleError: true } }); diff --git a/src/pages/CaseDetails/components/AllDocumentsV2/index.tsx b/src/pages/CaseDetails/components/AllDocumentsV2/index.tsx index 0710bc3e..b72b137d 100644 --- a/src/pages/CaseDetails/components/AllDocumentsV2/index.tsx +++ b/src/pages/CaseDetails/components/AllDocumentsV2/index.tsx @@ -31,7 +31,12 @@ function AllDocumentsV2() { const isDocumentLoading = useSelector( (state: RootState) => state?.documentSlice?.isDocumentsLoading ); - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const tabs = createDynamicTabs(documents || { documentDetails: {} }) || []; @@ -66,7 +71,7 @@ function AllDocumentsV2() { mergedTabs.push(...staticTabs); } useEffect(() => { - getDocuments(dispatch, loanId, customerId); + getDocuments(dispatch, loanId, customerId, caseReferenceId, caseBusinessVertical); }, []); //select first tab on tab load diff --git a/src/pages/CaseDetails/components/CaseDetail.tsx b/src/pages/CaseDetails/components/CaseDetail.tsx index 757ff9c6..a12f177a 100644 --- a/src/pages/CaseDetails/components/CaseDetail.tsx +++ b/src/pages/CaseDetails/components/CaseDetail.tsx @@ -178,14 +178,14 @@ const CaseDetail: React.FC = () => { }, [loanId, customerId, pageDetail]); useEffect(() => { - dispatch(getTelephones(loanId, customerId)); - dispatch(getTelephonesV2(loanId, customerId)); + dispatch(getTelephones(loanId, customerId, caseReferenceId, caseBusinessVertical)); + dispatch(getTelephonesV2(loanId, customerId, caseReferenceId, caseBusinessVertical)); dispatch(fetchSherlockData(loanId, customerId, setLoading => {})); dispatch(getBankStatementStatus(loanId, customerId)); }, [loanId, customerId]); useEffect(() => { - dispatch(getCustomerDetails(loanId, customerId)); + dispatch(getCustomerDetails(loanId, customerId, caseReferenceId, caseBusinessVertical)); }, [loanId, customerId]); const handleTabChange = useCallback( diff --git a/src/pages/CaseDetails/components/Contact/EmailIds.tsx b/src/pages/CaseDetails/components/Contact/EmailIds.tsx index 04eb1b8b..7073f746 100644 --- a/src/pages/CaseDetails/components/Contact/EmailIds.tsx +++ b/src/pages/CaseDetails/components/Contact/EmailIds.tsx @@ -16,7 +16,12 @@ import { addClickstreamEvent } from '@cp/src/service/clickStreamEventService'; import { CLICKSTREAM_EVENT_NAMES } from '@cp/src/service/clickStream.constant'; function EmailIds() { - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const dispatch = useDispatch(); const details = useSelector( (state: RootState) => state.caseDetail.pageData?.[createKey(loanId, customerId)]?.details?.data @@ -27,7 +32,8 @@ function EmailIds() { window.open(gmeetLink, '_blank'); }; useEffect(() => { - if (!details) dispatch(getTelephonesV2(loanId, customerId)); + if (!details) + dispatch(getTelephonesV2(loanId, customerId, caseBusinessVertical, caseReferenceId)); addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.LH_Email_PageLand); }, [loanId, customerId]); diff --git a/src/pages/CaseDetails/components/Documents/index.tsx b/src/pages/CaseDetails/components/Documents/index.tsx index cfb2487d..fd2cd697 100644 --- a/src/pages/CaseDetails/components/Documents/index.tsx +++ b/src/pages/CaseDetails/components/Documents/index.tsx @@ -64,7 +64,12 @@ const getPDFAndImageDocuments = (customerDocs: CustomerDocument[]) => { const Document: React.FC = () => { const dispatch = useDispatch(); - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const pageData = useSelector( (state: RootState) => state.caseDetail.pageData?.[createKey(loanId, customerId)] @@ -84,7 +89,7 @@ const Document: React.FC = () => { useEffect(() => { if (!customerDocs) { - dispatch(fetchCustomerDocs(loanId, customerId)); + dispatch(fetchCustomerDocs(loanId, customerId, caseReferenceId, caseBusinessVertical)); } }, [customerDocs]); diff --git a/src/pages/CaseDetails/components/EmiSchedule/HeaderSection.tsx b/src/pages/CaseDetails/components/EmiSchedule/HeaderSection.tsx index e813f53e..2a09f5f5 100644 --- a/src/pages/CaseDetails/components/EmiSchedule/HeaderSection.tsx +++ b/src/pages/CaseDetails/components/EmiSchedule/HeaderSection.tsx @@ -23,7 +23,13 @@ const failureStatuses = [ const MAX_ENACH_PRESENT = 3; const HeaderSection: React.FC = () => { - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); + const dispatch = useDispatch(); const details = useSelector( (state: RootState) => state.caseDetail.pageData?.[createKey(loanId, customerId)]?.details?.data @@ -33,7 +39,8 @@ const HeaderSection: React.FC = () => { state.caseDetail.pageData?.[createKey(loanId, customerId)]?.monthlyEnach?.data ); useEffect(() => { - if (!monthlyEnach) dispatch(getEnachPresentDetails(customerId, loanId)); + if (!monthlyEnach) + dispatch(getEnachPresentDetails(customerId, loanId, caseReferenceId, caseBusinessVertical)); }, [loanId, customerId]); const enachPresented = monthlyEnach?.enachHistory?.length || 0; diff --git a/src/pages/CaseDetails/components/EmiSchedule/PresentEnachCard.tsx b/src/pages/CaseDetails/components/EmiSchedule/PresentEnachCard.tsx index 8fdf1587..aeb8965a 100644 --- a/src/pages/CaseDetails/components/EmiSchedule/PresentEnachCard.tsx +++ b/src/pages/CaseDetails/components/EmiSchedule/PresentEnachCard.tsx @@ -1,12 +1,10 @@ -import CloseIcon from '@navi/web-ui/lib/icons/CloseIcon/index'; import Chip from '@navi/web-ui/lib/primitives/Chip/index'; import Button from '@navi/web-ui/lib/primitives/Button/index'; import Typography from '@navi/web-ui/lib/primitives/Typography/index'; import cx from 'classnames'; -import { useCallback, useEffect, useMemo, useReducer } from 'react'; +import { useCallback, useMemo, useReducer } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useParams } from 'react-router-dom'; -import Overlay from 'src/components/Overlay/Overlay'; import { RootState } from 'src/store'; import { createKey } from 'src/utils/CaseDetail.utils'; import { shareEnachLink } from '../../actions/casesDetailsActions'; @@ -59,7 +57,12 @@ function enachSetupReducer(state: IsetupEnach, action: EnachSetupAction) { } const PresentEnachCard = () => { - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const dispatch = useDispatch(); const telephones = useSelector( (state: RootState) => state.caseDetail.pageData?.[createKey(loanId, customerId)]?.telephones @@ -83,7 +86,7 @@ const PresentEnachCard = () => { }, []); const shareLink = () => { dispatchEnach({ type: EnachSetupKinds.BEFORE_API_CALL }); - dispatch(shareEnachLink(loanId, customerId, onSuccess)); + dispatch(shareEnachLink(loanId, customerId, onSuccess, caseReferenceId, caseBusinessVertical)); }; const openDialog = useCallback( diff --git a/src/pages/CaseDetails/components/EmiSchedule/PresentEnachDrawer.tsx b/src/pages/CaseDetails/components/EmiSchedule/PresentEnachDrawer.tsx index e965138d..1faaf2dc 100644 --- a/src/pages/CaseDetails/components/EmiSchedule/PresentEnachDrawer.tsx +++ b/src/pages/CaseDetails/components/EmiSchedule/PresentEnachDrawer.tsx @@ -23,7 +23,12 @@ const STRING_PATTERN = /^\d{2}$/; const PresentEnachDrawer: React.FC = props => { const { open, onClose } = props; - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const dispatch = useDispatch(); const overDue = useSelector( (state: RootState) => @@ -84,7 +89,7 @@ const PresentEnachDrawer: React.FC = props => { }; const successCallback = () => { onClose(); - dispatch(getEnachPresentDetails(customerId, loanId)); + dispatch(getEnachPresentDetails(customerId, loanId, caseReferenceId, caseBusinessVertical)); }; const submit = (data: IPresentEnachDrawerFromValues) => { const payload = { diff --git a/src/pages/CaseDetails/components/EmiSchedule/WaiveFeeDrawer.tsx b/src/pages/CaseDetails/components/EmiSchedule/WaiveFeeDrawer.tsx index c0e29f57..63aed833 100644 --- a/src/pages/CaseDetails/components/EmiSchedule/WaiveFeeDrawer.tsx +++ b/src/pages/CaseDetails/components/EmiSchedule/WaiveFeeDrawer.tsx @@ -24,7 +24,13 @@ const WaiveFeeDrawer = ({ phoneNumberCustomId = '' }: WaiveFeeDrawerProps) => { const dispatch = useDispatch(); - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); + const { register, handleSubmit, @@ -82,6 +88,8 @@ const WaiveFeeDrawer = ({ submitWaiveFee( loanId, customerId, + caseReferenceId, + caseBusinessVertical, data.componentAdjustments, dueDetails, phoneNumber, diff --git a/src/pages/CaseDetails/components/EmiSchedule/WaiveFeeDrawerV2.tsx b/src/pages/CaseDetails/components/EmiSchedule/WaiveFeeDrawerV2.tsx index 5c8863f6..cea97374 100644 --- a/src/pages/CaseDetails/components/EmiSchedule/WaiveFeeDrawerV2.tsx +++ b/src/pages/CaseDetails/components/EmiSchedule/WaiveFeeDrawerV2.tsx @@ -36,7 +36,13 @@ const WaiveFeeDrawerV2: React.FC = ({ emiItem, isOpen, closeD waivedAmount, isColendingFlow } = emiItem || {}; - const { loanId = '', customerId = '' } = useParams(); + + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const { maxWaivableAmount } = additionalWaiverInfo || {}; const { @@ -82,7 +88,7 @@ const WaiveFeeDrawerV2: React.FC = ({ emiItem, isOpen, closeD action: Number(waivedAmount) >= unpaidDueAmount ? 'Waive' : 'Hold' }); closeDrawer(); - dispatch(getCustomerDetails(loanId, customerId)); + dispatch(getCustomerDetails(loanId, customerId, caseReferenceId, caseBusinessVertical)); } catch (error) { toast(error as string, { type: 'error' }); } diff --git a/src/pages/CaseDetails/components/MoreDetails/AddNewEmailModal.tsx b/src/pages/CaseDetails/components/MoreDetails/AddNewEmailModal.tsx index db1721f4..9f251ee2 100644 --- a/src/pages/CaseDetails/components/MoreDetails/AddNewEmailModal.tsx +++ b/src/pages/CaseDetails/components/MoreDetails/AddNewEmailModal.tsx @@ -60,7 +60,12 @@ const addNewEmailReducer = (state: IAddNewEmail, action: IAddNewEmailAction) => }; const AddNewEmailModal: React.FC = () => { - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const dispatch = useDispatch(); const [addNewEmail, dispatchAddNewEmail] = useReducer(addNewEmailReducer, { open: false, @@ -101,8 +106,8 @@ const AddNewEmailModal: React.FC = () => { const successCallback = useCallback(() => { dispatchAddNewEmail({ type: AddNewEmailKind.API_CALL_SUCCESS }); - dispatch(getTelephonesV2(loanId, customerId)); - dispatch(getCustomerDetails(loanId, customerId)); + dispatch(getTelephonesV2(loanId, customerId, caseReferenceId, caseBusinessVertical)); + dispatch(getCustomerDetails(loanId, customerId, caseReferenceId, caseBusinessVertical)); }, []); const failureCallback = useCallback(() => { diff --git a/src/pages/CaseDetails/components/MoreDetails/AddNewNumberOverlay.tsx b/src/pages/CaseDetails/components/MoreDetails/AddNewNumberOverlay.tsx index 830b0e76..9f606513 100644 --- a/src/pages/CaseDetails/components/MoreDetails/AddNewNumberOverlay.tsx +++ b/src/pages/CaseDetails/components/MoreDetails/AddNewNumberOverlay.tsx @@ -38,7 +38,12 @@ export interface AddNumberProps { } const AddNewNumberOverlay: React.FC = () => { - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const editAccessFlag = useSelector( (state: RootState) => state?.caseDetail?.pageData?.[createKey(loanId, customerId)]?.details?.data?.editAccessFlag @@ -89,6 +94,8 @@ const AddNewNumberOverlay: React.FC = () => { postAlternateNumber({ loanaccountnumber: loanId, customerreferenceid: customerId, + caseReferenceId, + caseBusinessVertical, alternateNumber: getValues(PHONE_NUMBER), source: getValues(SOURCE).value, successCallback: successCallback, @@ -103,7 +110,7 @@ const AddNewNumberOverlay: React.FC = () => { }; const successCallback = useCallback(() => { - dispatch(getTelephonesV2(loanId, customerId)); + dispatch(getTelephonesV2(loanId, customerId, caseReferenceId, caseBusinessVertical)); reset(); }, []); diff --git a/src/pages/CaseDetails/components/MoreDetails/AlternateAddresses.tsx b/src/pages/CaseDetails/components/MoreDetails/AlternateAddresses.tsx index 4ac5b3af..6a3849bc 100644 --- a/src/pages/CaseDetails/components/MoreDetails/AlternateAddresses.tsx +++ b/src/pages/CaseDetails/components/MoreDetails/AlternateAddresses.tsx @@ -19,7 +19,12 @@ import SuspenseLoader from 'src/components/SkeletonLoader/SuspenseLoader'; import TableLoader from 'src/components/TableLoader/TableLoader'; const AlternateAddresses = () => { - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const dispatch = useDispatch(); const pageData = useSelector( (state: RootState) => state.caseDetail.pageData?.[createKey(loanId, customerId)] @@ -28,7 +33,7 @@ const AlternateAddresses = () => { useEffect(() => { if (!pageData?.addresses) { - dispatch(fetchAddresses(loanId, customerId)); + dispatch(fetchAddresses(loanId, customerId, caseReferenceId, caseBusinessVertical)); } }, [pageData?.addresses]); diff --git a/src/pages/CaseDetails/components/MoreDetails/LoanAccountDetails.tsx b/src/pages/CaseDetails/components/MoreDetails/LoanAccountDetails.tsx index 723ba632..a0228d16 100644 --- a/src/pages/CaseDetails/components/MoreDetails/LoanAccountDetails.tsx +++ b/src/pages/CaseDetails/components/MoreDetails/LoanAccountDetails.tsx @@ -29,7 +29,12 @@ import styles from './index.module.scss'; const LoanAccountDetails = () => { const dispatch = useDispatch(); - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const { isOpen, toggle } = useOverlay(); const handleDrawerToggle = () => toggle(); const pageData = useSelector( @@ -40,7 +45,7 @@ const LoanAccountDetails = () => { useEffect(() => { if (!customerDocs) { - dispatch(fetchCustomerDocs(loanId, customerId)); + dispatch(fetchCustomerDocs(loanId, customerId, caseReferenceId, caseBusinessVertical)); } }, [customerDocs]); diff --git a/src/pages/CaseDetails/components/PhoneNumber/RemoveNumberModal.tsx b/src/pages/CaseDetails/components/PhoneNumber/RemoveNumberModal.tsx index 9969caf1..f72d0f4e 100644 --- a/src/pages/CaseDetails/components/PhoneNumber/RemoveNumberModal.tsx +++ b/src/pages/CaseDetails/components/PhoneNumber/RemoveNumberModal.tsx @@ -11,13 +11,18 @@ import { IRemoveNumberModalProps } from './interface'; const RemoveNumberModal = (props: IRemoveNumberModalProps) => { const { isModalOpen, setIsModalOpen, callData } = props; const dispatch = useDispatch(); - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const handleDeleteNumber = (number: string) => () => { dispatch(removeContact(customerId, number, setIsModalOpen, successCallback)); }; const successCallback = useCallback(() => { - dispatch(getTelephonesV2(loanId, customerId)); + dispatch(getTelephonesV2(loanId, customerId, caseReferenceId, caseBusinessVertical)); }, []); return ( diff --git a/src/pages/CaseDetails/components/PhoneNumber/index.tsx b/src/pages/CaseDetails/components/PhoneNumber/index.tsx index eccfd2bc..8fefb6e3 100644 --- a/src/pages/CaseDetails/components/PhoneNumber/index.tsx +++ b/src/pages/CaseDetails/components/PhoneNumber/index.tsx @@ -12,14 +12,20 @@ import styles from './index.module.scss'; import cx from 'classnames'; function PhoneNumberDetails() { - const { loanId = '', customerId = '' } = useParams(); + const { + loanId = '', + customerId = '', + caseBusinessVertical = '', + caseReferenceId = '' + } = useParams(); const dispatch = useDispatch(); const telephones = useSelector( (state: RootState) => state.caseDetail.pageData?.[createKey(loanId, customerId)]?.telephonesv2?.data ); useEffect(() => { - if (!telephones) dispatch(getTelephonesV2(loanId, customerId)); + if (!telephones) + dispatch(getTelephonesV2(loanId, customerId, caseReferenceId, caseBusinessVertical)); addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.LH_Phone_PageLand); }, [loanId, customerId]); diff --git a/src/pages/CaseDetails/feedbackForm/index.tsx b/src/pages/CaseDetails/feedbackForm/index.tsx index cca9d15e..b1f5a43d 100644 --- a/src/pages/CaseDetails/feedbackForm/index.tsx +++ b/src/pages/CaseDetails/feedbackForm/index.tsx @@ -670,7 +670,9 @@ const FeedbackFrom = (props: FeedbackFromProps) => { dispatch(fetchFeedbackHistory(loanId, customerId, payload)); dispatch(resetFeedbackQuestionTypes()); dispatch(setSkipTracingInitialQuestions([])); - dispatch(getTelephonesV2(loanId, customerId, successCallBack)); + dispatch( + getTelephonesV2(loanId, customerId, caseReferenceId, caseBusinessVertical, successCallBack) + ); setSkipTracingType(null); localStorage.removeItem(LOCAL_STORAGE_KEYS.AMEYO_INTERACTION_ID); sessionStorage.removeItem(SESSION_STORAGE_KEYS.INTERACTION_ID);