NTP-67485| CaseReferenceId fixing in Interactions | varshitha (#1456)
This commit is contained in:
@@ -63,7 +63,8 @@ const CallInteractions = () => {
|
||||
customerId = '',
|
||||
selectedTab = '',
|
||||
caseReferenceId = '',
|
||||
caseBusinessVertical = ''
|
||||
caseBusinessVertical = '',
|
||||
previousCaseReferenceId = ''
|
||||
} = useParams();
|
||||
const isPreviousLoanInteraction = selectedTab === TAB_KEYS.PREV_LOAN_INTERACTIONS;
|
||||
const maxInputDate = incrementDateByMins(utcToIST(getTodayDate()), 1).toISOString().slice(0, 16);
|
||||
@@ -90,7 +91,7 @@ const CallInteractions = () => {
|
||||
} = readQueryParams();
|
||||
const dispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
const createCommonPayload = (loanAccount: string) => {
|
||||
const createCommonPayload = (loanAccount: string, caseReferenceId: string) => {
|
||||
return {
|
||||
page_no: queryParams?.page || 0,
|
||||
page_size: queryParams?.size || defaultPageSize,
|
||||
@@ -105,10 +106,13 @@ const CallInteractions = () => {
|
||||
|
||||
const createPayloadForCallInteractions = () => {
|
||||
if (isPreviousLoanInteraction) {
|
||||
return createCommonPayload(previousLoanAccountParams?.previousLoanAccount);
|
||||
return createCommonPayload(
|
||||
previousLoanAccountParams?.previousLoanAccount,
|
||||
previousLoanAccountParams?.previousCaseReferenceId
|
||||
);
|
||||
}
|
||||
return {
|
||||
...createCommonPayload(loanId),
|
||||
...createCommonPayload(loanId, caseReferenceId),
|
||||
from: queryParams?.[FROM_TIME] || defaultLastMonthDate,
|
||||
to: queryParams?.[TO_TIME] || maxInputDate,
|
||||
role: roles?.join()
|
||||
|
||||
@@ -64,7 +64,8 @@ const SystemInteractions = (props: ISystemInteractionsProps) => {
|
||||
customerId = '',
|
||||
selectedTab = '',
|
||||
caseReferenceId = '',
|
||||
caseBusinessVertical = ''
|
||||
caseBusinessVertical = '',
|
||||
previousCaseReferenceId = ''
|
||||
} = useParams();
|
||||
const isPreviousLoanInteraction = selectedTab === TAB_KEYS.PREV_LOAN_INTERACTIONS;
|
||||
const maxInputDate = incrementDateByMins(utcToIST(getTodayDate()), 1).toISOString().slice(0, 16);
|
||||
@@ -97,7 +98,6 @@ const SystemInteractions = (props: ISystemInteractionsProps) => {
|
||||
page_no: queryParams?.page || 0,
|
||||
page_size: queryParams?.size || defaultPageSize,
|
||||
customer_reachable: queryParams?.contactable,
|
||||
caseReferenceId: caseReferenceId,
|
||||
caseBusinessVertical: caseBusinessVertical
|
||||
};
|
||||
};
|
||||
@@ -126,10 +126,11 @@ const SystemInteractions = (props: ISystemInteractionsProps) => {
|
||||
});
|
||||
};
|
||||
|
||||
const createCommonPayload = (loanAccount: string) => {
|
||||
const createCommonPayload = (loanAccount: string, caseReferenceId: string) => {
|
||||
return {
|
||||
...defaultPayload(),
|
||||
loan_account_number: loanAccount,
|
||||
caseReferenceId: caseReferenceId,
|
||||
from: defaultPreviousLoanInteractionsFromDate,
|
||||
types: `${InteractionType.INHOUSE_FIELD_VISIT},${InteractionType.FIELD_VISIT}`
|
||||
};
|
||||
@@ -138,10 +139,13 @@ const SystemInteractions = (props: ISystemInteractionsProps) => {
|
||||
const createPayloadForSystemInteraction = () => {
|
||||
const PrevCaseRefIds = pageData?.details?.data?.closedLoanAccountViews;
|
||||
if (isTypeFieldVisit && isPreviousLoanInteraction) {
|
||||
return createCommonPayload(previousLoanAccountParams?.previousLoanAccount);
|
||||
return createCommonPayload(
|
||||
previousLoanAccountParams?.previousLoanAccount,
|
||||
previousLoanAccountParams?.previousCaseReferenceId
|
||||
);
|
||||
} else if (isTypeFieldVisit) {
|
||||
return {
|
||||
...createCommonPayload(loanId),
|
||||
...createCommonPayload(loanId, caseReferenceId),
|
||||
from: queryParams?.[FROM_TIME] || defaultLastMonthDate,
|
||||
to: queryParams?.[TO_TIME] || maxInputDate
|
||||
};
|
||||
@@ -149,7 +153,7 @@ const SystemInteractions = (props: ISystemInteractionsProps) => {
|
||||
return {
|
||||
...defaultPayload(),
|
||||
status: 'CLOSED',
|
||||
case_reference_ids:
|
||||
caseReferenceId:
|
||||
PrevCaseRefIds?.find(
|
||||
item => item.accountNumber == previousLoanAccountParams?.previousLoanAccount
|
||||
)?.caseReferenceId || '',
|
||||
@@ -160,7 +164,7 @@ const SystemInteractions = (props: ISystemInteractionsProps) => {
|
||||
return {
|
||||
...defaultPayload(),
|
||||
status: 'ACTIVE',
|
||||
case_reference_ids: pageData?.details?.data?.caseReferenceId,
|
||||
caseReferenceId: pageData?.details?.data?.caseReferenceId,
|
||||
communication_type: type,
|
||||
customer_reference_id: customerId
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@ import { IPreviousLoanAccount } from '../../interfaces/CaseDetail.type';
|
||||
|
||||
export interface ILanGroup {
|
||||
lan: IPreviousLoanAccount;
|
||||
onChipSelect: (lanValue: string) => void;
|
||||
onChipSelect: (lanValue: string, caseReferenceId: string) => void;
|
||||
selectedLAN: string;
|
||||
}
|
||||
const LanGroup: React.FC<ILanGroup> = props => {
|
||||
@@ -27,7 +27,7 @@ const LanGroup: React.FC<ILanGroup> = props => {
|
||||
labelClasses={cx(styles.chipText, {
|
||||
[styles.selectedChipText]: lan.accountNumber === selectedLAN
|
||||
})}
|
||||
onChipClick={() => onChipSelect(lan.accountNumber)}
|
||||
onChipClick={() => onChipSelect(lan.accountNumber, lan.caseReferenceId)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -49,13 +49,18 @@ const PreviousLoanCommunicationHistory = () => {
|
||||
if (closedLoanAccountViews?.length) {
|
||||
updateQueryParamsAndNavigate({
|
||||
previousLoanAccount:
|
||||
queryParams?.previousLoanAccount || closedLoanAccountViews[0]?.accountNumber
|
||||
queryParams?.previousLoanAccount || closedLoanAccountViews[0]?.accountNumber,
|
||||
previousCaseReferenceId:
|
||||
queryParams?.previousCaseReferenceId || closedLoanAccountViews[0]?.caseReferenceId
|
||||
});
|
||||
}
|
||||
}, [closedLoanAccountViews]);
|
||||
|
||||
const onChipSelect = (lanValue: string) => {
|
||||
updateQueryParamsAndNavigate({ previousLoanAccount: lanValue });
|
||||
const onChipSelect = (lanValue: string, caseReferenceId: string) => {
|
||||
updateQueryParamsAndNavigate({
|
||||
previousLoanAccount: lanValue,
|
||||
previousCaseReferenceId: caseReferenceId
|
||||
});
|
||||
};
|
||||
|
||||
const isPaused = useSelector(
|
||||
|
||||
Reference in New Issue
Block a user