NTP-28802 | merge master

This commit is contained in:
Aman Chaturvedi
2025-01-22 14:34:34 +05:30
160 changed files with 5579 additions and 1602 deletions

View File

@@ -112,6 +112,9 @@ export enum ApiKeys {
GET_EMI_SCHEDULE = 'GET_EMI_SCHEDULE',
GET_REPAYMENTS = 'GET_REPAYMENTS',
GET_FEEDBACK_HISTORY = 'GET_FEEDBACK_HISTORY',
GET_PRIORTIY_FEEDBACK = 'GET_PRIORTIY_FEEDBACK',
GET_TRAINING_MATERIAL_LIST = 'GET_TRAINING_MATERIAL_LIST',
GET_TRAINING_MATERIAL_DETAILS = 'GET_TRAINING_MATERIAL_DETAILS',
}
export const API_URLS: Record<ApiKeys, string> = {} as Record<ApiKeys, string>;
@@ -164,8 +167,7 @@ API_URLS[ApiKeys.GET_PERFORMANCE_METRICS] = '/allocation-cycle/agent-performance
API_URLS[ApiKeys.GET_CASH_COLLECTED] = '/allocation-cycle/cash-collected-split';
API_URLS[ApiKeys.GET_TELEPHONE_NUMBERS] =
'/v2/collection-cases/telephones-view/{loanAccountNumber}';
API_URLS[ApiKeys.GET_TELEPHONE_NUMBERS_V2] =
'/collections/{loanAccountNumber}/telephones-agent-call-activity-view';
API_URLS[ApiKeys.GET_TELEPHONE_NUMBERS_V2] = '/collections/telephones-agent-call-activity-view';
API_URLS[ApiKeys.FIRESTORE_INCONSISTENCY_INFO] = '/cases/sync-status';
API_URLS[ApiKeys.FIRESTORE_INCONSISTENCY_INFO_V2] = '/cases/v2/sync-status';
API_URLS[ApiKeys.GET_CASE_DETAILS_FROM_API] =
@@ -197,10 +199,9 @@ API_URLS[ApiKeys.FEE_WAIVER_HISTORY] = '/collection-cases/{loanAccountNumber}/wa
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.SYNC_COSMOS_TO_LONGHORN] = '/sync/tele-cosmos-sync';
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}';
@@ -211,13 +212,15 @@ API_URLS[ApiKeys.SEND_COMMUNICATION_NAVI_ACCOUNT] = '/navi-communications/{loanA
API_URLS[ApiKeys.GENERATE_DYNAMIC_DOCUMENT] = '/documents/generate/{loanAccountNumber}';
API_URLS[ApiKeys.DOWNLOAD_LATEST_APP] = 'https://longhorn.navi.com/api/app/download';
API_URLS[ApiKeys.ALL_ESCALATIONS] = '/customer-escalation';
API_URLS[ApiKeys.GET_UNGROUPED_ADDRESSES] =
'/collection-cases/{loanAccountNumber}/ungrouped/addresses';
API_URLS[ApiKeys.GET_UNGROUPED_ADDRESSES] = '/collection-cases/ungrouped/addresses';
API_URLS[ApiKeys.GET_GROUPED_ADDRESSES_AND_GEOLOCATIONS] =
'/collection-cases/{loanAccountNumber}/grouped/addresses-geo-locations';
API_URLS[ApiKeys.GET_EMI_SCHEDULE] = '/collection-cases/{loanAccountNumber}/emiSchedule';
API_URLS[ApiKeys.GET_REPAYMENTS] = '/collection-cases/{loanAccountNumber}/repayments';
'/collection-cases/grouped/addresses-geo-locations';
API_URLS[ApiKeys.GET_EMI_SCHEDULE] = '/collection-cases/emiSchedule';
API_URLS[ApiKeys.GET_REPAYMENTS] = '/collection-cases/repayments';
API_URLS[ApiKeys.GET_FEEDBACK_HISTORY] = '/feedback/filters';
API_URLS[ApiKeys.GET_PRIORTIY_FEEDBACK] = '/feedback/case-status';
API_URLS[ApiKeys.GET_TRAINING_MATERIAL_LIST] = '/training-page/content-list';
API_URLS[ApiKeys.GET_TRAINING_MATERIAL_DETAILS] = '/training-page/{docRefId}';
export const API_STATUS_CODE = {
OK: 200,
@@ -230,8 +233,11 @@ export const API_STATUS_CODE = {
INTERNAL_SERVER_ERROR: 500,
TOO_MANY_REQUESTS: 429,
GONE: 410,
POST_OPERATIVE_HOURS_ACTIVITY: 451,
};
export const UNAUTHORIZED_VALUES = [API_STATUS_CODE.UNAUTHORIZED, API_STATUS_CODE.FORBIDDEN];
const API_TIMEOUT_INTERVAL = 2e4; // 20s
let dispatch: Dispatch<any>;
@@ -351,8 +357,10 @@ axiosInstance.interceptors.response.use(
Number
);
if (
config?.headers?.donotHandleError ||
donotHandleErrorOnStatusCode.includes(error?.response?.status)
(config?.headers?.donotHandleError ||
donotHandleErrorOnStatusCode.includes(error?.response?.status)) &&
// Logout even donotHandleError is true when status code is 401, 403
!config?.headers?.autoLogoutOnUnauthorized
) {
return Promise.reject(error);
}