TP-76974 | Customer Info API migration (#1070)

* TP-76974 | Customer Info API migration

* TP-76974 | Contract changes

* TP-76974 | Contract changes

* TP-76974 | Customer Info API migration
This commit is contained in:
Mantri Ramkishor
2024-08-12 18:34:09 +05:30
committed by GitHub
parent 4bdda1c960
commit 903c9268b4
6 changed files with 19 additions and 18 deletions

View File

@@ -18,6 +18,7 @@ import { EMPLOYMENT_TYPE } from './interfaces';
import CopyToClipboardIcon from '@cp/src/assets/icons/CopyToClipboardIcon';
import EllipsisText from '@cp/src/components/EllipsisText';
import CompanyIcon from '@cp/src/assets/icons/CompanyIcon';
import { capitalizeFirstLetterOfEachWord } from '@cp/src/pages/AllAgents/AgentForm/utils/utils';
const CustomerDescriptions = () => {
const { loanId = '', customerId = '' } = useParams();
@@ -52,18 +53,12 @@ const CustomerDescriptions = () => {
const { monthlyIncome, employmentType, employerName } = pageDetail?.data?.employmentDetails || {};
const getAddress = () => {
let permanentAddresses = customerInfo?.addresses
?.filter(address => {
return address.permanent && address.state;
})
.reduce((acc, curr) => {
return curr.state?.length && curr.state.length >= acc.length ? curr.state : acc;
}, '--');
permanentAddresses = String(permanentAddresses).toUpperCase();
return permanentAddresses?.length == 2 ? getStateName(permanentAddresses) : permanentAddresses;
const stateName = customerInfo?.addresses?.[0]?.state || '';
return stateName?.length == 2
? getStateName(stateName?.toUpperCase())
: capitalizeFirstLetterOfEachWord(stateName);
};
return (
<div className={styles.footerContainer}>
<CheckAndRender

View File

@@ -33,7 +33,7 @@ const Overview = () => {
<BankDetails
accountNumber={customerDetails?.data?.bankAccounts?.[0]?.accountNumber || ''}
bankName={customerDetails?.data?.bankAccounts?.[0]?.bankName || ''}
ifscCode={customerDetails?.data?.bankAccounts?.[0]?.ifscCode || ''}
ifscCode={customerDetails?.data?.bankAccounts?.[0]?.ifsc || ''}
/>
</div>
);

View File

@@ -549,7 +549,7 @@ interface BankAccount {
referenceId: string;
beneficiaryName: string;
accountNumber: string;
ifscCode: string;
ifsc: string;
bankName: string;
type: string;
status: string;

View File

@@ -1,14 +1,12 @@
import axiosInstance, { ApiKeys, getApiUrl } from '@cp/src/utils/ApiHelper';
import React, { useEffect } from 'react';
import styles from './index.module.scss';
import { Button, Typography } from '@navi/web-ui/lib/primitives';
import { NaviLogoIcon } from '@navi/web-ui/lib/icons';
import cx from 'classnames';
import Header from '@cp/src/components/Header/Header';
import Lottie from 'react-lottie';
import dancingRobot from '../../assets/json/dancingRobot.json';
import NaviIconWithText from '@cp/src/assets/icons/NaviIconWithText';
import { CLICKSTREAM_EVENT_NAMES } from '@cp/src/service/clickStream.constant';
import { addClickstreamEvent } from '@cp/src/service/clickStreamEventService';
interface AppData {
downloadPreSignedUrl: string;
@@ -40,6 +38,10 @@ const DownloadForFieldAgent = () => {
anchorTag.current?.setAttribute('href', fileUrl);
anchorTag.current?.setAttribute('download', `fileld_agent_app_${appData?.appVersion}.apk`);
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.LH_FIELD_AGENT_COSMOS_DOWNLOAD_BUTTON_CLICKED, {
appVersion: appData?.appVersion,
buildNumber: appData?.buildNumber
});
// Trigger click event on the anchor element
anchorTag.current?.click();
};

View File

@@ -779,6 +779,10 @@ export const CLICKSTREAM_EVENT_NAMES = Object.freeze({
LH_MAP_VIEW_INCORRECT_DATA: {
name: 'LH_MAP_VIEW_INCORRECT_DATA',
description: 'Wrong reference id in url of map view'
},
LH_FIELD_AGENT_COSMOS_DOWNLOAD_BUTTON_CLICKED: {
name: 'LH_FIELD_AGENT_COSMOS_DOWNLOAD_BUTTON_CLICKED',
description: 'Cosmos download button clicked'
}
});

View File

@@ -306,7 +306,7 @@ API_URLS[ApiKeys.WA_INTERACTIONS] = '/agent-interactions/fetch/whatsapp';
API_URLS[ApiKeys.DIGITAL_COMMUNICATION] = '/digital-communication';
API_URLS[ApiKeys.GET_LEADERBOARD_DETAILS] = '/levels/agents/{agentReferenceId}/ranking';
API_URLS[ApiKeys.GET_FORECLOSURE_AMOUNT] = '/payments/{lan}/pre-closure-amount';
API_URLS[ApiKeys.FETCH_CUSTOMER_INFO] = '/customers/{customerRefId}';
API_URLS[ApiKeys.FETCH_CUSTOMER_INFO] = '/customers/v1/{customerRefId}';
API_URLS[ApiKeys.FETCH_REPAYMENT_HISTORY] = 'loan-details/{loanId}/repayment-history';
API_URLS[ApiKeys.OAUTH_SIGNIN] = '/google/sign-in/url';
API_URLS[ApiKeys.OAUTH_EXCHANGE_SESSION] = '/session/exchange';