Revert "Revert "TP-19186 | LHS Migration 12 Dec (#1255)" (#1262)" (#1263)

This reverts commit 3a54fbf46a.

Co-authored-by: Ashish Deo <ashish.deo@navi.com>
This commit is contained in:
Varnit Goyal
2024-12-18 14:00:11 +05:30
committed by GitHub
parent 7fe3db5e01
commit 8273511a38
29 changed files with 392 additions and 146 deletions

View File

@@ -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]);
}

View File

@@ -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]);
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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,

View File

@@ -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(

View File

@@ -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 => {

View File

@@ -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]);

View File

@@ -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 (

View File

@@ -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<string>;
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
}
}

View File

@@ -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<boolean>(false);
const [statusFailed, setStatusFailed] = useState<boolean>(false);
const [isExisting, setIsExisting] = useState<boolean>(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 }));
}
})

View File

@@ -21,7 +21,12 @@ const NumberDropDown: React.FC<INumberDropdown> = 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<INumberDropdown> = props => {
getPhoneNumberStatus({
lan: loanId,
customerId: customerId,
phoneNumbers: allIdentifiers
phoneNumbers: allIdentifiers,
caseReferenceId,
caseBusinessVertical
}).then(response => {
setAllNumberStatus(response);
});

View File

@@ -10,7 +10,9 @@ import { toast } from '@primitives/Toast';
export const getDocuments = async (
dispatch: Dispatch<GenericObject>,
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
}
});

View File

@@ -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

View File

@@ -178,14 +178,14 @@ const CaseDetail: React.FC<React.PropsWithChildren> = () => {
}, [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(

View File

@@ -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]);

View File

@@ -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]);

View File

@@ -23,7 +23,13 @@ const failureStatuses = [
const MAX_ENACH_PRESENT = 3;
const HeaderSection: React.FC<React.PropsWithChildren> = () => {
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<React.PropsWithChildren> = () => {
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;

View File

@@ -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(

View File

@@ -23,7 +23,12 @@ const STRING_PATTERN = /^\d{2}$/;
const PresentEnachDrawer: React.FC<IPresentEnachDrawerProps> = 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<IPresentEnachDrawerProps> = props => {
};
const successCallback = () => {
onClose();
dispatch(getEnachPresentDetails(customerId, loanId));
dispatch(getEnachPresentDetails(customerId, loanId, caseReferenceId, caseBusinessVertical));
};
const submit = (data: IPresentEnachDrawerFromValues) => {
const payload = {

View File

@@ -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,

View File

@@ -36,7 +36,13 @@ const WaiveFeeDrawerV2: React.FC<IWaiveFeeDrawerV2> = ({ 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<IWaiveFeeDrawerV2> = ({ 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' });
}

View File

@@ -60,7 +60,12 @@ const addNewEmailReducer = (state: IAddNewEmail, action: IAddNewEmailAction) =>
};
const AddNewEmailModal: React.FC<React.PropsWithChildren> = () => {
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<React.PropsWithChildren> = () => {
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(() => {

View File

@@ -38,7 +38,12 @@ export interface AddNumberProps {
}
const AddNewNumberOverlay: React.FC<React.PropsWithChildren> = () => {
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<React.PropsWithChildren> = () => {
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<React.PropsWithChildren> = () => {
};
const successCallback = useCallback(() => {
dispatch(getTelephonesV2(loanId, customerId));
dispatch(getTelephonesV2(loanId, customerId, caseReferenceId, caseBusinessVertical));
reset();
}, []);

View File

@@ -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]);

View File

@@ -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]);

View File

@@ -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 (

View File

@@ -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]);

View File

@@ -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);