TP-77512| digitalCommunitaion api migration (#1077)

* TP-77512|api changes|varshitha

* TP-77512|list to string|varshitha

* TP-77512|name changes|varshitha

* TP-77512|customer refId|varshitha

* TP-77512|fix|varshitha
This commit is contained in:
Podili Varshitha
2024-08-28 16:55:51 +05:30
committed by GitHub
parent 66d6e2a8b6
commit 5cdca88b29
3 changed files with 18 additions and 3 deletions

View File

@@ -90,8 +90,7 @@ const SystemInteractions = (props: ISystemInteractionsProps) => {
return {
page_no: queryParams?.page || 0,
page_size: queryParams?.size || defaultPageSize,
customer_reachable: queryParams?.contactable,
from: defaultPreviousLoanInteractionsFromDate
customer_reachable: queryParams?.contactable
};
};
@@ -128,6 +127,7 @@ const SystemInteractions = (props: ISystemInteractionsProps) => {
};
const createPayloadForSystemInteraction = () => {
const PrevCaseRefIds = pageData?.details?.data?.closedLoanAccountViews;
if (isTypeFieldVisit && isPreviousLoanInteraction) {
return createCommonPayload(previousLoanAccountParams?.previousLoanAccount);
} else if (isTypeFieldVisit) {
@@ -136,9 +136,22 @@ const SystemInteractions = (props: ISystemInteractionsProps) => {
from: queryParams?.[FROM_TIME] || defaultLastMonthDate,
to: queryParams?.[TO_TIME] || maxInputDate
};
} else if (isPreviousLoanInteraction) {
return {
...defaultPayload(),
status: 'CLOSED',
case_reference_ids:
PrevCaseRefIds?.find(
item => item.accountNumber == previousLoanAccountParams?.previousLoanAccount
)?.caseReferenceId || '',
communication_type: type,
customer_reference_id: customerId
};
}
return {
...defaultPayload(),
status: 'ACTIVE',
case_reference_ids: pageData?.details?.data?.caseReferenceId,
communication_type: type,
customer_reference_id: customerId
};

View File

@@ -199,6 +199,7 @@ export interface MonthlyIncome {
}
export interface CustomerDetailApiResponse {
caseReferenceId: string;
customerName: string;
customerReferenceId: string;
addresses: IAddress[];
@@ -486,6 +487,7 @@ export interface IRepaymentHistoryAPIResponse extends IApiData {
}
export interface IPreviousLoanAccount {
caseReferenceId: string;
startDate: string;
accountNumber: string;
}

View File

@@ -305,7 +305,7 @@ API_URLS[ApiKeys.GENERATE_PAYMENT_LINK] = '/payments/generate-payment-link';
API_URLS[ApiKeys.FETCH_SLASH_CRM_ID] = '/users/encryptedSlashCrmId';
API_URLS[ApiKeys.MONTHLTY_ENACH_REQUEST] = 'v2/monthly-enach-request';
API_URLS[ApiKeys.WA_INTERACTIONS] = '/agent-interactions/fetch/whatsapp';
API_URLS[ApiKeys.DIGITAL_COMMUNICATION] = '/digital-communication';
API_URLS[ApiKeys.DIGITAL_COMMUNICATION] = '/v1/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/v1/{customerRefId}';