diff --git a/src/assets/icons/ClockIcon.tsx b/src/assets/icons/ClockIcon.tsx new file mode 100644 index 00000000..bfb31f37 --- /dev/null +++ b/src/assets/icons/ClockIcon.tsx @@ -0,0 +1,14 @@ +const ClockIcon = () => ( + + + + + + + + +); +export default ClockIcon; diff --git a/src/components/CallHistory/CallHistory.module.scss b/src/components/CallHistory/CallHistory.module.scss index ca641d53..888d8874 100644 --- a/src/components/CallHistory/CallHistory.module.scss +++ b/src/components/CallHistory/CallHistory.module.scss @@ -12,5 +12,5 @@ letter-spacing: -0.12px; } .toolTipStyle { - max-width: 212px !important; + max-width: 270px !important; } diff --git a/src/components/CallHistory/CallInteractionHistory.tsx b/src/components/CallHistory/CallInteractionHistory.tsx index 68aa2912..54d0060f 100644 --- a/src/components/CallHistory/CallInteractionHistory.tsx +++ b/src/components/CallHistory/CallInteractionHistory.tsx @@ -3,7 +3,7 @@ import RedCrossIcon from '../../assets/images/icons/RedCrossIcon'; import GreyCircleIcon from '../../assets/images/icons/GreyCircleIcon'; import styles from './CallHistory.module.scss'; import { CallBasedInteractions } from 'src/pages/CaseDetails/interfaces/CaseDetail.type'; -import { dateFormat } from 'src/utils/DateHelper'; +import { DateFormat, dateFormat, utcToIST } from 'src/utils/DateHelper'; import { FeedbackTypesCodeMap } from 'src/pages/Cases/constants/CasesConstants'; import { Tooltip, TooltipContent, TooltipTrigger } from '../TooltipV2/TooltipV2'; import cx from 'classnames'; @@ -65,11 +65,18 @@ const CallStatusList = ({ showTooltip ? (
- Call Date: {dateFormat(new Date(callRecord.interactionTimestamp), 'DD MMM, YYYY')}{' '} + Call Date and Time:{' '} + {dateFormat( + utcToIST(new Date(callRecord.interactionTimestamp)), + DateFormat.LONG_DATE_FORMAT_WITH_TIME + )}{' '} Disposition: {FeedbackTypesCodeMap[callRecord?.tag]?.label || callRecord?.tag} + + Phone Number: {callRecord?.recipientNumber} +
) : ( '' diff --git a/src/components/Dropdown/SelectPicker.tsx b/src/components/Dropdown/SelectPicker.tsx index 3648e62e..18add8d9 100644 --- a/src/components/Dropdown/SelectPicker.tsx +++ b/src/components/Dropdown/SelectPicker.tsx @@ -15,6 +15,7 @@ const SelectPicker: React.FC = ({ showSourceAtBottom = false, optionPosition = OptionPosition.bottom, customOptionTemplate, + selectPickerItemClass, ...restProps }) => { const renderOptions = useMemo(() => { @@ -34,6 +35,7 @@ const SelectPicker: React.FC = ({ multiSelect={multiSelect} showSourceAtBottom={showSourceAtBottom} customOptionTemplate={customOptionTemplate} + selectPickerItemClass={selectPickerItemClass} /> )); }, [options, selectedValue, showSourceAtBottom]); diff --git a/src/components/Dropdown/SelectPickerItem.tsx b/src/components/Dropdown/SelectPickerItem.tsx index d5fbd911..93b4d071 100644 --- a/src/components/Dropdown/SelectPickerItem.tsx +++ b/src/components/Dropdown/SelectPickerItem.tsx @@ -10,9 +10,10 @@ const SelectPickerItem = ({ onOptionClick, multiSelect, showSourceAtBottom = false, - customOptionTemplate + customOptionTemplate, + selectPickerItemClass }: SelectPickerItemProps) => { - const { label, source, isDisabled, rightAdornment } = optionInfo; + const { label, source, isDisabled, rightAdornment, dailyLimit, hourlyLimit } = optionInfo; const handleClick = () => { onOptionClick(optionInfo); @@ -25,7 +26,9 @@ const SelectPickerItem = ({
diff --git a/src/components/Dropdown/index.tsx b/src/components/Dropdown/index.tsx index e2943fa6..6b15717c 100644 --- a/src/components/Dropdown/index.tsx +++ b/src/components/Dropdown/index.tsx @@ -60,6 +60,7 @@ const Dropdown: React.FC = ({ pickerContainerClasses, showTextCursorOnDisabled = false, tabIndexEnabled = false, + selectPickerItemClass = '', ...restProps }) => { const [showPicker, setShowPicker] = useState(false); @@ -265,6 +266,7 @@ const Dropdown: React.FC = ({ showSourceAtBottom={showSourceAtBottom} optionPosition={optionPosition} customOptionTemplate={customOptionTemplate} + selectPickerItemClass={selectPickerItemClass} {...restProps} /> )} diff --git a/src/components/Dropdown/interfaces.ts b/src/components/Dropdown/interfaces.ts index 6780799a..907eb3df 100644 --- a/src/components/Dropdown/interfaces.ts +++ b/src/components/Dropdown/interfaces.ts @@ -1,5 +1,6 @@ import { GenericObject } from '@cp/src/types/CommonConstans'; import { ReactNode } from 'react'; +import { IPhoneNumberLimit } from '@cp/pages/CaseDetails/interfaces/CaseDetail.type'; export interface DropdownProps { /** Dropdown Options */ @@ -27,6 +28,7 @@ export interface DropdownProps { pickerContainerClasses?: string; showTextCursorOnDisabled?: boolean; tabIndexEnabled?: boolean; + selectPickerItemClass?: string; } export enum OptionPosition { @@ -40,6 +42,8 @@ export interface SelectPickerOptionProps { source?: string | ReactNode; isDisabled?: boolean; rightAdornment?: ReactNode; + dailyLimit?: IPhoneNumberLimit; + hourlyLimit?: IPhoneNumberLimit; } export interface SelectPickerProps extends React.ComponentPropsWithoutRef<'div'> { @@ -60,6 +64,7 @@ export interface SelectPickerProps extends React.ComponentPropsWithoutRef<'div'> showSourceAtBottom?: boolean; optionPosition?: OptionPosition; customOptionTemplate?: (option: string) => ReactNode; + selectPickerItemClass?: string; } export type SelectPickerValue = string | number; @@ -71,6 +76,7 @@ export interface SelectPickerItemProps { multiSelect: boolean; showSourceAtBottom?: boolean; customOptionTemplate?: (option: string, optionInfo?: GenericObject) => ReactNode; + selectPickerItemClass?: string; } export type SelectionChangeType = ( diff --git a/src/pages/CaseDetails/components/Overview/CallHistoryBox.tsx b/src/pages/CaseDetails/components/Overview/CallHistoryBox.tsx index a86c7c3f..f298abed 100644 --- a/src/pages/CaseDetails/components/Overview/CallHistoryBox.tsx +++ b/src/pages/CaseDetails/components/Overview/CallHistoryBox.tsx @@ -9,11 +9,14 @@ import { DateFormat, UnitsEnum, dateDiff, dateFormat, utcToIST } from 'src/utils import GridContainer from '@navi/web-ui/lib/layouts/Grid/GridContainer/GridContainer'; import GridRow from '@navi/web-ui/lib/layouts/Grid/GridRow/GridRow'; import GridColumn from '@navi/web-ui/lib/layouts/Grid/GridColumn/GridColumn'; -import { CallBasedInteractions, PtpStatus } from '../../interfaces/CaseDetail.type'; +import { CallBasedInteractions, LIMIT_TYPE, PtpStatus } from '../../interfaces/CaseDetail.type'; import { PreviousPTPs } from './PreviousPTPs'; import cx from 'classnames'; import CallInteractionHistory from 'src/components/CallHistory/CallInteractionHistory'; import { IconProps } from '@navi/web-ui/lib/icons/types'; +import CircularProgress from '@cp/components/ProgressBars/circularProgress/CircularProgress'; +import { useMemo } from 'react'; +import dayjs from 'dayjs'; const NO_OF_RECORDS = 5; @@ -28,6 +31,7 @@ const CallHistoryBox = () => { const pageData = useSelector( (state: RootState) => state.caseDetail.pageData?.[createKey(loanId, customerId)] ); + const { data: telephones } = pageData?.telephonesv2 || {}; const { data: caseDetails } = pageData?.details || {}; const { callBasedInteractions = [], ptpStatuses = [] } = caseDetails || {}; @@ -36,7 +40,6 @@ const CallHistoryBox = () => { return new Date(a.interactionTimestamp) > new Date(b.interactionTimestamp) ? 1 : -1; }) .pop()?.interactionTimestamp; - const currentDate = dateFormat(new Date(), DateFormat.ISO_DATE_FORMAT); const previousDayDate = dateFormat(getPreviousDate(), DateFormat.ISO_DATE_FORMAT); const difference = lastCalledTime @@ -44,29 +47,34 @@ const CallHistoryBox = () => { : undefined; const iconProps: IconProps = { width: 24, height: 24 }; const LastCalled = () => { - const lastCalledDate = dateFormat( - new Date(utcToIST(lastCalledTime)), - DateFormat.ISO_DATE_FORMAT - ); + const dateInIST = new Date(utcToIST(lastCalledTime)); + const lastCalledDate = dateFormat(dateInIST, DateFormat.ISO_DATE_FORMAT); + const lastCalledDateLong = dateFormat(dateInIST, DateFormat.LONG_DATE_FORMAT_WITHOUT_TIME); + const lastCalledTimeHHMM = dateFormat(dateInIST, DateFormat.HH_mm_ampm); if (lastCalledTime) { switch (lastCalledDate) { case currentDate: return ( - Today + Today at {lastCalledTimeHHMM} ); case previousDayDate: return ( - Yesterday + Yesterday at {lastCalledTimeHHMM} ); default: return ( - - Not called since last {difference} days - + <> + + Not called since last {difference} days{' '} + + + (Last call attempt: {lastCalledDateLong}) + + ); } } else { @@ -77,6 +85,35 @@ const CallHistoryBox = () => { ); } }; + const { totalCallsRemaining, nextCallTime, callRemainingPercentage } = useMemo(() => { + let newTotalCallsRemaining = 0; + let newLastCallTime: dayjs.Dayjs | null = null; + let nextCallTime; + let totalMaxCalls = 0; + telephones?.forEach(telephone => { + telephone?.limit.forEach(limitRecord => { + if (limitRecord?.type === LIMIT_TYPE.DAILY) { + newTotalCallsRemaining += limitRecord?.callRemaining || 0; + totalMaxCalls += limitRecord?.maxCalls || 0; + } + if (limitRecord?.callRemaining === 0 && limitRecord.nextCallingTime) { + const nextCallAvailableTime = dayjs(limitRecord.nextCallingTime); + newLastCallTime = + newLastCallTime && nextCallAvailableTime.isBefore(newLastCallTime) + ? nextCallAvailableTime + : newLastCallTime; + nextCallTime = newLastCallTime?.format('HH:mm A'); + } + }); + }); + const callRemainingPercentage = Math.round((newTotalCallsRemaining / totalMaxCalls) * 100); + return { + totalCallsRemaining: newTotalCallsRemaining, + nextCallTime, + callRemainingPercentage: + callRemainingPercentage > 90 && callRemainingPercentage < 100 ? 90 : callRemainingPercentage + }; + }, [telephones]); return ( @@ -87,7 +124,7 @@ const CallHistoryBox = () => { padding: '0 8px' }} > - +
Last Called : @@ -101,16 +138,43 @@ const CallHistoryBox = () => {
- - Total Call Attempts - +
+ + + {totalCallsRemaining} calls remaining + + {nextCallTime ? ( + <> + + | + + + Next call attempt available + + {totalCallsRemaining === 0 ? 'tommorow' : ` at ${nextCallTime}`} + + + + ) : null} +
Last {NO_OF_RECORDS} calls Status
-
+ +
{!ptpStatuses?.length ? (
diff --git a/src/pages/CaseDetails/components/Overview/index.module.scss b/src/pages/CaseDetails/components/Overview/index.module.scss index 7e27fc0a..3d078fd2 100644 --- a/src/pages/CaseDetails/components/Overview/index.module.scss +++ b/src/pages/CaseDetails/components/Overview/index.module.scss @@ -76,6 +76,9 @@ align-items: center; padding: 8px 16px; flex-basis: 100%; + .progress { + stroke: var(--blue-base); + } } } diff --git a/src/pages/CaseDetails/components/PhoneNumber/CustomerDeviceData.tsx b/src/pages/CaseDetails/components/PhoneNumber/CustomerDeviceData.tsx index 3a6c4a32..d2f220ad 100644 --- a/src/pages/CaseDetails/components/PhoneNumber/CustomerDeviceData.tsx +++ b/src/pages/CaseDetails/components/PhoneNumber/CustomerDeviceData.tsx @@ -1,107 +1,15 @@ import React from 'react'; - -import Typography from '@navi/web-ui/lib/primitives/Typography'; import styles from './index.module.scss'; -import CallHistory from 'src/components/CallHistory/CallHistory'; import { ITelephones } from '../../interfaces/CaseDetail.type'; -import { DateFormat, getFormatDate, utcToIST } from 'src/utils/DateHelper'; -import OpenInNewTabIcon from 'src/assets/icons/OpenInNewTabIcon'; -import { Tooltip, TooltipContent, TooltipTrigger } from 'src/components/TooltipV2/TooltipV2'; -import { PhoneNumberSourceText } from '@cp/src/components/Ameyo/interfaces'; -import cx from 'classnames'; -import PocNumbersTag from '../PocTag/Index'; -import { POC_TAG_SOURCES } from '@cp/src/pages/CaseDetails/components/PocTag/constants'; - -const NO_OF_RECORDS = 5; +import PhoneNumberContactCard from '@cp/pages/CaseDetails/components/PhoneNumber/PhoneNumberContactCard'; const CustomerDeviceData: React.FC = props => { const { data = [] } = props; - - const openTrueCallerTab = (number: string) => { - window.open(`tel:${number}`, '_blank'); - }; return (
- {data?.map(callData => { - return callData?.number ? ( -
-
-
- {getFormatDate( - utcToIST(callData?.createdAt as unknown as Date), - DateFormat.DD_MMM_YYYY - )} -
-
-
- {callData?.isPoc ? ( - - ) : ( -
{callData?.number}
- )} - {callData?.new && ( -
New
- )} -
-
- - - -
openTrueCallerTab(callData?.number)} - > - -
Truecaller ID
-
-
- - - Open Truecaller - -
-
-
- - {callData?.sources.slice(0, 2).map((source, index) => ( - <> - - {PhoneNumberSourceText[source] ?? source} - {index == 0 && callData?.sources?.length > 1 ? ', ' : ''} - - - ))} - - {callData?.sources?.length > 2 && ( - <> - - - - {' +' + (callData?.sources?.length - 2) + ' more'} - - - - - {callData?.sources - ?.slice(2, callData?.sources?.length) - .map((source, index) => ( - - {PhoneNumberSourceText[source] ?? source}{' '} - {index < callData.sources.length - 3 ? ', ' : ''} - - ))} - - - - )} -
-
- ) : null; - })} + {data?.map(callData => ( + + ))}
); }; diff --git a/src/pages/CaseDetails/components/PhoneNumber/PhoneNumberContactCard.tsx b/src/pages/CaseDetails/components/PhoneNumber/PhoneNumberContactCard.tsx new file mode 100644 index 00000000..89f01383 --- /dev/null +++ b/src/pages/CaseDetails/components/PhoneNumber/PhoneNumberContactCard.tsx @@ -0,0 +1,170 @@ +import styles from '@cp/pages/CaseDetails/components/PhoneNumber/index.module.scss'; +import { DateFormat, getFormatDate, utcToIST } from '@cp/utils/DateHelper'; +import { POC_TAG_SOURCES } from '@cp/pages/CaseDetails/components/PocTag/constants'; +import cx from 'classnames'; +import CircularProgress from '@cp/components/ProgressBars/circularProgress/CircularProgress'; +import Typography from '@primitives/Typography'; +import CallHistory from '@cp/components/CallHistory/CallHistory'; +import { Tooltip, TooltipContent, TooltipTrigger } from '@cp/components/TooltipV2/TooltipV2'; +import OpenInNewTabIcon from '@cp/assets/icons/OpenInNewTabIcon'; +import { PhoneNumberSourceText } from '@cp/components/Ameyo/interfaces'; +import React, { useMemo } from 'react'; +import { ITelePhoneData, LIMIT_TYPE } from '@cp/pages/CaseDetails/interfaces/CaseDetail.type'; +import PocNumbersTag from '../PocTag/Index'; +import dayjs from 'dayjs'; +import InfoIconOutlined from '@cp/assets/images/icons/InfoIconOutlined'; + +const NO_OF_RECORDS = 5; + +const PhoneNumberContactCard = ({ callData }: { callData: ITelePhoneData }) => { + const openTrueCallerTab = (number: string) => { + window.open(`tel:${number}`, '_blank'); + }; + const { dailyLimit, hourlyLimit, callRemainingPercentage } = useMemo(() => { + const dailyLimit = callData?.limit?.find(limitRecord => limitRecord.type === LIMIT_TYPE.DAILY); + const hourlyLimit = callData?.limit?.find( + limitRecord => limitRecord.type === LIMIT_TYPE.HOURLY + ); + return { + dailyLimit, + hourlyLimit, + callRemainingPercentage: dailyLimit + ? Math.floor((dailyLimit?.callRemaining / dailyLimit?.maxCalls) * 100) + : 0 + }; + }, [callData]); + + return callData?.number ? ( +
+
+
+ {getFormatDate(utcToIST(callData?.createdAt as unknown as Date), DateFormat.DD_MMM_YYYY)} +
+
+
+ {callData?.isPoc ? ( + + ) : ( +
{callData?.number}
+ )} + {callData?.new && ( +
New
+ )} +
+
+
+
+ 90 && callRemainingPercentage < 100 + ? 90 + : callRemainingPercentage + } + strokeWidth={3} + withAnimation + /> + + + {dailyLimit?.callRemaining} + + calls remaining + {dailyLimit?.remarks ? ( + + + + + + {dailyLimit?.remarks} + + + ) : null} + +
+ {dailyLimit?.callRemaining === 0 ? ( +
+ + Next call attempt:{' '} + + tomorrow + + +
+ ) : hourlyLimit?.nextCallingTime ? ( + + Next call attempt available at + + {dayjs(hourlyLimit?.nextCallingTime).format('HH:mm A')} + + + ) : null} +
+
+ + + +
openTrueCallerTab(callData?.number)} + > + +
Truecaller ID
+
+
+ + Open Truecaller +
+
+
+
+ + {callData?.sources.slice(0, 2).map((source, index) => ( + <> + + {PhoneNumberSourceText[source] ?? source} + {index == 0 && callData?.sources?.length > 1 ? ', ' : ''} + + + ))} + + {callData?.sources?.length > 2 && ( + <> + + + + {' +' + (callData?.sources?.length - 2) + ' more'} + + + + + {callData?.sources?.slice(2, callData?.sources?.length).map((source, index) => ( + + {PhoneNumberSourceText[source] ?? source}{' '} + {index < callData.sources.length - 3 ? ', ' : ''} + + ))} + + + + )} +
+
+ ) : null; +}; + +export default PhoneNumberContactCard; diff --git a/src/pages/CaseDetails/components/PhoneNumber/index.module.scss b/src/pages/CaseDetails/components/PhoneNumber/index.module.scss index 1402598f..8527269a 100644 --- a/src/pages/CaseDetails/components/PhoneNumber/index.module.scss +++ b/src/pages/CaseDetails/components/PhoneNumber/index.module.scss @@ -2,7 +2,7 @@ padding: 0px 6px 20px 0px; display: flex; flex-wrap: wrap; - margin: 0px 24px; + margin: 0px 16px; } .header { display: flex; @@ -54,6 +54,7 @@ top: 0px; border-bottom-left-radius: 11px; background: var(--bg-secondary); + z-index: 1; .dateText { color: var(--grayscale-2); font-weight: 400; @@ -64,7 +65,7 @@ } .sourcesWrapper { - background: var(--bg-secondary); + background: transparent; padding: 9px 16px; font-weight: 500; font-size: 12px; @@ -83,7 +84,24 @@ display: flex; justify-content: space-between; align-items: center; - padding: 0 12px 16px 12px; + padding: 12px 16px; + background-color: var(--blue-light-bg); + gap: 8px 4px; + } + .limitsContainer { + .limitsProgress { + display: flex; + align-items: center; + gap: 4px; + flex-basis: 50%; + } + .limitswrapper { + margin-top: 8px; + display: flex; + align-items: center; + background-color: var(--blue-light-bg); + gap: 4px; + } } .trueCallerWrapper { background: var(--bg-blue); @@ -92,6 +110,9 @@ align-items: center; padding: 4px; cursor: pointer; + width: fit-content; + margin-top: 6px; + margin-left: auto; .truecallerText { font-weight: 500; font-size: 12px; @@ -103,9 +124,10 @@ .phoneNumberWrapperStyles { display: flex; align-items: center; - padding: 12px 12px 12px 12px; + padding: 12px 16px; position: relative; - width: 68%; + width: 100%; + background-color: transparent; } .heading { diff --git a/src/pages/CaseDetails/components/PocTag/Index.tsx b/src/pages/CaseDetails/components/PocTag/Index.tsx index dd74147d..46d851a7 100644 --- a/src/pages/CaseDetails/components/PocTag/Index.tsx +++ b/src/pages/CaseDetails/components/PocTag/Index.tsx @@ -3,19 +3,31 @@ import Typography from '@navi/web-ui/lib/primitives/Typography/Typography'; import styles from './styles.module.scss'; import cx from 'classnames'; import { POC_TAG_SOURCES } from './constants'; +import ClockIcon from '@cp/assets/icons/ClockIcon'; +import React from 'react'; +import { ICallHistory } from '@cp/components/CallHistory/interfaces'; +import CallHistory from '@cp/components/CallHistory/CallHistory'; +import { IPhoneNumberLimit } from '@cp/pages/CaseDetails/interfaces/CaseDetail.type'; +import dayjs from 'dayjs'; const PocNumbersTag = ({ source, number, - option + option, + callHistory, + dailyLimit, + hourlyLimit }: { source: POC_TAG_SOURCES; number?: string; option?: string; + callHistory?: ICallHistory[]; + dailyLimit?: IPhoneNumberLimit; + hourlyLimit?: IPhoneNumberLimit; }) => { if (source === POC_TAG_SOURCES.CONTACT_TAB) { return ( -
+
@@ -39,26 +51,52 @@ const PocNumbersTag = ({ ); } else if (source === POC_TAG_SOURCES.FEEDBACK_FORM) { return ( -
- - -
-
-
{option}
-
-
- - Try +
+
+
+ + +
+
+
{option}
+
+
+ + Try + +
+ + + New number added. Try calling on them + + +
+ {callHistory && } +
+ {dailyLimit?.callRemaining === 0 ? ( +
+ + + Next call attempt available{' '} + + tomorrow -
- - - New number added. Try calling on them - - + +
+ ) : hourlyLimit?.nextCallingTime ? ( +
+ + + Next call attempt available + + {dayjs(hourlyLimit?.nextCallingTime).format('HH:mm A')} + + +
+ ) : null}
); } else { diff --git a/src/pages/CaseDetails/constants/Overview.constant.ts b/src/pages/CaseDetails/constants/Overview.constant.ts index 7e9fb84e..6b8d8def 100644 --- a/src/pages/CaseDetails/constants/Overview.constant.ts +++ b/src/pages/CaseDetails/constants/Overview.constant.ts @@ -19,3 +19,5 @@ export const DUE_PAID_STATUS = { ON_TIME: 'On-time', LATE: 'Late' } as { [key: string]: string }; + +export const CALL_SOURCE_LIMIT = 2; diff --git a/src/pages/CaseDetails/feedbackForm/component/CallBridge/CallBridge.tsx b/src/pages/CaseDetails/feedbackForm/component/CallBridge/CallBridge.tsx index eb7d5d60..f354aced 100644 --- a/src/pages/CaseDetails/feedbackForm/component/CallBridge/CallBridge.tsx +++ b/src/pages/CaseDetails/feedbackForm/component/CallBridge/CallBridge.tsx @@ -54,6 +54,7 @@ interface CallBridgeProps { telephoneSource?: string; telephoneRefId?: string; currentCallType?: ECallingType; + disableCallButton?: boolean; } const buildCreateCallBridgeRequestBody = ( @@ -83,7 +84,8 @@ const CallBridge = (props: CallBridgeProps) => { interactionType, telephoneSource, telephoneRefId, - currentCallType + currentCallType, + disableCallButton } = props; const dispatch = useDispatch(); const navigate = useNavigate(); @@ -355,7 +357,7 @@ const CallBridge = (props: CallBridgeProps) => { <>
); diff --git a/src/pages/CaseDetails/feedbackForm/component/Contacts/index.module.scss b/src/pages/CaseDetails/feedbackForm/component/Contacts/index.module.scss index d70a97b1..583ae778 100644 --- a/src/pages/CaseDetails/feedbackForm/component/Contacts/index.module.scss +++ b/src/pages/CaseDetails/feedbackForm/component/Contacts/index.module.scss @@ -47,6 +47,9 @@ } } +.selectedPickerItemLimits { + background-color: rgba(246, 247, 249, 0.8); +} .defaultContacts { .phoneNumberSelectContainer { margin-bottom: 15px; diff --git a/src/pages/CaseDetails/feedbackForm/index.tsx b/src/pages/CaseDetails/feedbackForm/index.tsx index 3c01b082..e509c0c5 100644 --- a/src/pages/CaseDetails/feedbackForm/index.tsx +++ b/src/pages/CaseDetails/feedbackForm/index.tsx @@ -38,7 +38,7 @@ import { import Loader from '../../../components/Loader/Loader'; import CancelCircleFilled from '../../../assets/icons/CancelCircledFilled'; import { fetchFeedbackHistory } from '../actions/overviewActions'; -import { LOCAL_STORAGE_KEYS, SESSION_STORAGE_KEYS } from '../../../constants/StorageKeys'; +import { LOCAL_STORAGE_KEYS, SESSION_STORAGE_KEYS } from '@cp/constants/StorageKeys'; import { FeedbackTabsEnum } from './component/FeedbackTabs/FeedbackTabs'; import SkipTracing from './component/Contacts/SkipTracing'; import Spade from './component/Contacts/Spade'; @@ -46,9 +46,9 @@ import DefaultContacts from './component/Contacts/DefaultContacts'; import NextPreviousCaseActions from './component/NextPreviousCaseActions'; import { toast } from '@navi/web-ui/lib/primitives/Toast'; import { setAmeyoCallDetails, setBlankDisposition } from 'src/reducers/commonSlice'; -import { createQueryParams, readQueryParams } from '../../../utils/QueryParamsHelper'; -import { addClickstreamEvent } from '../../../service/clickStreamEventService'; -import { CLICKSTREAM_EVENT_NAMES } from '../../../service/clickStream.constant'; +import { createQueryParams, readQueryParams } from '@cp/utils/QueryParamsHelper'; +import { addClickstreamEvent } from '@cp/src/service/clickStreamEventService'; +import { CLICKSTREAM_EVENT_NAMES } from '@cp/src/service/clickStream.constant'; import RadioGroup from '@navi/web-ui/lib/components/RadioGroup'; import { OLD_CALLING_TYPES, REVAMPED_CALLING_TYPES } from '../constants'; import { @@ -65,6 +65,7 @@ import { import isLitmusExperimentEnabled from '@cp/utils/isLitmusExperimentEnabled'; import { LITMUS_EXPERIMENT_NAMES } from '@cp/constants/litmusExperimentNames'; import { Roles } from '@cp/pages/auth/constants/AuthConstants'; +import { getTelephonesV2 } from '@cp/pages/CaseDetails/actions/casesDetailsActions'; interface FeedbackFromProps { isDisableNextPreviousCaseAction?: boolean; @@ -602,11 +603,11 @@ const FeedbackFrom = (props: FeedbackFromProps) => { dispatch(fetchFeedbackHistory(loanId, customerId, payload)); dispatch(resetFeedbackQuestionTypes()); dispatch(setSkipTracingInitialQuestions([])); + dispatch(getTelephonesV2(loanId, customerId)); setSkipTracingType(null); localStorage.removeItem(LOCAL_STORAGE_KEYS.AMEYO_INTERACTION_ID); sessionStorage.removeItem(SESSION_STORAGE_KEYS.INTERACTION_ID); setAmeyoCallDetails({ interactionId: '', recipientNumber: '', crtObjectId: '' }); - toggleLoading(); reset(); if (ameyoQueryParams) { diff --git a/src/pages/CaseDetails/interfaces/CaseDetail.type.ts b/src/pages/CaseDetails/interfaces/CaseDetail.type.ts index 7b02d09b..d85098c5 100644 --- a/src/pages/CaseDetails/interfaces/CaseDetail.type.ts +++ b/src/pages/CaseDetails/interfaces/CaseDetail.type.ts @@ -341,6 +341,20 @@ export interface ILegalDocument extends IApiData { loading: boolean; } +export enum LIMIT_TYPE { + DAILY = 'DAILY', + HOURLY = 'HOURLY' +} + +export interface IPhoneNumberLimit { + type: LIMIT_TYPE; + callsMade: number; + callRemaining: number; + maxCalls: number; + nextCallingTime: string; + remarks: string; +} + export interface ITelePhoneData { type: string; source: string; @@ -355,6 +369,7 @@ export interface ITelePhoneData { oldestSource: string; createdAt: string; isPoc: boolean; + limit: IPhoneNumberLimit[]; } interface IAddresses extends IApiData {