diff --git a/src/action/callRecordingActions.tsx b/src/action/callRecordingActions.tsx index c021ddd6..40571de7 100644 --- a/src/action/callRecordingActions.tsx +++ b/src/action/callRecordingActions.tsx @@ -29,10 +29,15 @@ const redirectionHandlerOnCallFailed = (caseId: string) => { export const makeACallToCustomer = (payload: IMakeACallToCustomerPayload, details: IMakeACallToCustomerDetails) => (dispatch: AppDispatch) => { - const url = getApiUrl(ApiKeys.CALL_CUSTOMER, { - telephoneReferenceId: payload?.referenceId, - loanAccountNumber: payload?.loanAccountNumber, - }); + const url = getApiUrl( + ApiKeys.CALL_CUSTOMER, + {}, + { + caseReferenceId: details?.caseId, + caseBusinessVertical: details?.caseBusinessVertical, + telephoneReferenceId: payload?.referenceId, + } + ); dispatch(setIsCallCreationLoading(true)); dispatch(setConnectingToCustomerBottomSheet(true)); axiosInstance diff --git a/src/action/fetchTelephoneNumber.ts b/src/action/fetchTelephoneNumber.ts index 39e8edc3..9aad0e01 100644 --- a/src/action/fetchTelephoneNumber.ts +++ b/src/action/fetchTelephoneNumber.ts @@ -1,5 +1,5 @@ import axiosInstance, { ApiKeys, getApiUrl } from '../components/utlis/apiHelper'; -import { AppDispatch } from '../store/store'; +import store, { AppDispatch } from '../store/store'; import { logError } from '../components/utlis/errorUtils'; import { ITelephoneNumbers, @@ -36,7 +36,15 @@ export const fetchTelephoneNumber = export const fetchCallHistory = ({ caseId, loanAccountNumber, setLoading }: FetchTelephoneNumbersParams) => (dispatch: AppDispatch) => { - const url = getApiUrl(ApiKeys.GET_CALL_HISTORY, { loanAccountNumber }); + const caseDetail = store?.getState()?.allCases?.caseDetails?.[caseId] || {}; + const url = getApiUrl( + ApiKeys.GET_CALL_HISTORY, + {}, + { + caseReferenceId: caseDetail?.caseReferenceId, + caseBusinessVertical: caseDetail?.businessVertical, + } + ); const isSetLoadingFunction = isFunction(setLoading); if (isSetLoadingFunction) setLoading(true); axiosInstance diff --git a/src/components/utlis/apiHelper.ts b/src/components/utlis/apiHelper.ts index 2a82052b..1ef885ac 100644 --- a/src/components/utlis/apiHelper.ts +++ b/src/components/utlis/apiHelper.ts @@ -196,10 +196,9 @@ API_URLS[ApiKeys.DUE_AMOUNT_SUMMARY] = '/collection-cases/{loanAccountNumber}/am API_URLS[ApiKeys.FEE_WAIVER_HISTORY] = '/collection-cases/{loanAccountNumber}/waiver-history'; API_URLS[ApiKeys.FEE_WAIVER_V2] = '/loan/request/{loanAccountNumber}/adjust-component/v2'; API_URLS[ApiKeys.GET_PIN_CODES_DETAILS] = '/api/v1/pincodes/{pinCode}'; -API_URLS[ApiKeys.CALL_CUSTOMER] = - '/call-recording/call-request/{loanAccountNumber}/{telephoneReferenceId}'; +API_URLS[ApiKeys.CALL_CUSTOMER] = '/call-recording/v2/call-request'; API_URLS[ApiKeys.SYNC_ACTIVE_CALL_DETAILS] = '/call-recording/call-status'; -API_URLS[ApiKeys.GET_CALL_HISTORY] = '/call-recording/call-history/{loanAccountNumber}'; +API_URLS[ApiKeys.GET_CALL_HISTORY] = '/call-recording/v2/call-history'; API_URLS[ApiKeys.SYNC_CALL_FEEDBACK_NUDGE_DETAILS] = '/call-recording/acknowledge-feedback-nudge/{callId}'; API_URLS[ApiKeys.FETCH_CUSTOMER_DOCUMENTS] = '/documents/{loanAccountNumber}'; diff --git a/src/screens/allCases/CaseItem/FeedbackStatus.tsx b/src/screens/allCases/CaseItem/FeedbackStatus.tsx index 7dc242e0..a152e90b 100644 --- a/src/screens/allCases/CaseItem/FeedbackStatus.tsx +++ b/src/screens/allCases/CaseItem/FeedbackStatus.tsx @@ -65,20 +65,20 @@ const FeedbackStatus = (props: IFeedbackStatus) => { }; const styles = StyleSheet.create({ + dashedBorder: { + borderColor: COLORS.BORDER.PRIMARY, + borderStyle: 'dashed', + borderTopWidth: 1, + }, feedbackStatus: { - lineHeight: 18, - marginTop: 4, color: COLORS.TEXT.BLACK, fontWeight: '500', + lineHeight: 18, + marginTop: 4, }, rightAlign: { textAlign: 'right', }, - dashedBorder: { - borderTopWidth: 1, - borderColor: COLORS.BORDER.PRIMARY, - borderStyle: 'dashed', - }, }); export default FeedbackStatus; diff --git a/src/screens/caseDetails/CallingFlow/CallHistory/CallHistoryItem.tsx b/src/screens/caseDetails/CallingFlow/CallHistory/CallHistoryItem.tsx index 811e0fbe..58e1608a 100644 --- a/src/screens/caseDetails/CallingFlow/CallHistory/CallHistoryItem.tsx +++ b/src/screens/caseDetails/CallingFlow/CallHistory/CallHistoryItem.tsx @@ -32,6 +32,9 @@ const CallHistoryItem = (props: ICallHistoryItem) => { const customerName = useAppSelector( (state) => state?.allCases?.caseDetails?.[caseId]?.customerName ); + const caseBusinessVertical = useAppSelector( + (state) => state?.allCases?.caseDetails?.[caseId]?.businessVertical + ); const isCallCreationLoading = useAppSelector((state) => state?.activeCall?.isCallCreationLoading); const isCallActive = useAppSelector((state) => state?.activeCall?.activeCallDetails?.callActive); @@ -53,7 +56,13 @@ const CallHistoryItem = (props: ICallHistoryItem) => { dispatch( makeACallToCustomer( { referenceId: telephoneReferenceId, loanAccountNumber }, - { caseId, customerName, isCallHistory: true } + { + caseId, + customerName, + isCallHistory: true, + caseBusinessVertical, + telephoneReferenceId, + } ) ); } else { diff --git a/src/screens/caseDetails/CallingFlow/interfaces.ts b/src/screens/caseDetails/CallingFlow/interfaces.ts index efe4007b..248b3816 100644 --- a/src/screens/caseDetails/CallingFlow/interfaces.ts +++ b/src/screens/caseDetails/CallingFlow/interfaces.ts @@ -93,6 +93,8 @@ export interface IMakeACallToCustomerPayload { export interface IMakeACallToCustomerDetails { caseId: string; customerName: string; + caseBusinessVertical: string; + telephoneReferenceId: string; isCallHistory?: boolean; } diff --git a/src/screens/caseDetails/interface.ts b/src/screens/caseDetails/interface.ts index 86506401..34a13dea 100644 --- a/src/screens/caseDetails/interface.ts +++ b/src/screens/caseDetails/interface.ts @@ -325,6 +325,7 @@ export interface CaseDetail { lastMonthCaseInteractionStatus?:FeedbackStatusObj; escalationData ?: EscalationData; daysTillDeallocation: number; + businessVertical: string; } export interface recentEscalationDetails { diff --git a/src/screens/caseDetails/journeyStepper/RenderIcon.tsx b/src/screens/caseDetails/journeyStepper/RenderIcon.tsx index f03606a4..eb445d1c 100644 --- a/src/screens/caseDetails/journeyStepper/RenderIcon.tsx +++ b/src/screens/caseDetails/journeyStepper/RenderIcon.tsx @@ -11,7 +11,11 @@ import CallIcon from './CallIcon'; import { useAppDispatch, useAppSelector } from '@hooks'; import { RootState } from '@store'; import PhoneStateModule from '@components/utlis/PhoneState'; -import { setActiveCallData, setCallCannotInitiateBottomSheet, setCallingFeedbackNudgeBottomSheet } from '@reducers/activeCallSlice'; +import { + setActiveCallData, + setCallCannotInitiateBottomSheet, + setCallingFeedbackNudgeBottomSheet, +} from '@reducers/activeCallSlice'; import { logError } from '@components/utlis/errorUtils'; import { makeACallToCustomer } from '@actions/callRecordingActions'; import { CallVia, IRenderIcons, IconType, PhoneStateType } from '../CallingFlow/interfaces'; @@ -58,6 +62,9 @@ const RenderIcons: React.FC = ({ ); const isCallCreationLoading = useAppSelector((state) => state?.activeCall?.isCallCreationLoading); const isCallActive = useAppSelector((state) => state?.activeCall?.activeCallDetails?.callActive); + const caseBusinessVertical = useAppSelector( + (state) => state?.allCases?.caseDetails?.[caseId]?.businessVertical + ); const totalGenuineCallsRequired = useAppSelector( (state: RootState) => @@ -73,7 +80,14 @@ const RenderIcons: React.FC = ({ }); if (!isCallRecordingCosmosExotelEnabled) { Linking.openURL(`tel:${mobileNumber}`); - dispatch(setActiveCallData({ caseId, customerName, telephoneNo: mobileNumber, telephoneReferenceId: referenceId })); + dispatch( + setActiveCallData({ + caseId, + customerName, + telephoneNo: mobileNumber, + telephoneReferenceId: referenceId, + }) + ); dispatch(setCallingFeedbackNudgeBottomSheet(true)); return; } @@ -85,7 +99,10 @@ const RenderIcons: React.FC = ({ ) { dispatch(setCallAttemptedOn(mobileNumber)); dispatch( - makeACallToCustomer({ referenceId, loanAccountNumber }, { caseId, customerName }) + makeACallToCustomer( + { referenceId, loanAccountNumber }, + { caseId, customerName, caseBusinessVertical, telephoneReferenceId: referenceId } + ) ); } else { dispatch(setCallCannotInitiateBottomSheet(true));