TP-71301 | additional customer docs added
This commit is contained in:
@@ -32,6 +32,7 @@ import { useTimeout } from 'react-native-toast-message/lib/src/hooks';
|
||||
import { DELAY_FOR_PAINTING_IMAGE } from '../../common/Constants';
|
||||
import Text from '../../../RN-UI-LIB/src/components/Text';
|
||||
import { isNullOrEmptyString } from '../../../RN-UI-LIB/src/utlis/common';
|
||||
import { CUSTOMER_PROFILE_DOCS } from './constants';
|
||||
|
||||
interface ICustomerProfile {
|
||||
route: {
|
||||
@@ -92,17 +93,7 @@ const CustomerProfile: React.FC<ICustomerProfile> = (props) => {
|
||||
setDocumentsLoading(true);
|
||||
const docList: IDocument[] = getDocumentList(caseDetail) || [];
|
||||
const docPromises: Promise<DocumentDetail | null>[] = [];
|
||||
const updatedDocList = [
|
||||
DOCUMENT_TYPE.LDN,
|
||||
DOCUMENT_TYPE.LRN,
|
||||
DOCUMENT_TYPE.VKYC_VIDEO,
|
||||
DOCUMENT_TYPE.AADHAR_PHOTO,
|
||||
DOCUMENT_TYPE.AADHAR,
|
||||
DOCUMENT_TYPE.DRIVING_LICENSE,
|
||||
DOCUMENT_TYPE.PAN,
|
||||
DOCUMENT_TYPE.AUTHORIZATION_LETTER
|
||||
];
|
||||
updatedDocList.forEach((documentType) => {
|
||||
CUSTOMER_PROFILE_DOCS.forEach((documentType) => {
|
||||
const document = findDocumentByDocumentType(docList, documentType);
|
||||
if (document) {
|
||||
const docPromise = getDocumentDetails(document);
|
||||
@@ -280,9 +271,9 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
positionAbsoluteCenterAlign: {
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
left : '50%',
|
||||
transform: [{ translateX: -7 }, { translateY: 5 }],
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
transform: [{ translateX: -7 }, { translateY: 5 }],
|
||||
zIndex: 99,
|
||||
},
|
||||
loadingState: {
|
||||
|
||||
@@ -11,3 +11,19 @@ export const viewableDocTypesMap = new Map([
|
||||
[DOCUMENT_TYPE.AADHAR, true],
|
||||
]);
|
||||
|
||||
export const CUSTOMER_PROFILE_DOCS = [
|
||||
DOCUMENT_TYPE.LDN,
|
||||
DOCUMENT_TYPE.LRN,
|
||||
DOCUMENT_TYPE.VKYC_VIDEO,
|
||||
DOCUMENT_TYPE.AADHAR_PHOTO,
|
||||
DOCUMENT_TYPE.AADHAR,
|
||||
DOCUMENT_TYPE.DRIVING_LICENSE,
|
||||
DOCUMENT_TYPE.PAN,
|
||||
DOCUMENT_TYPE.AUTHORIZATION_LETTER,
|
||||
DOCUMENT_TYPE.ELECTRICITY_BILL,
|
||||
DOCUMENT_TYPE.RENTAL_AGREEMENT,
|
||||
DOCUMENT_TYPE.PASSPORT,
|
||||
DOCUMENT_TYPE.OTHER_DOCUMENT,
|
||||
DOCUMENT_TYPE.BROADBAND_BILL,
|
||||
DOCUMENT_TYPE.GAS_BILL,
|
||||
];
|
||||
@@ -147,7 +147,13 @@ export enum DOCUMENT_TYPE {
|
||||
DRIVING_LICENSE = 'DRIVING_LICENSE',
|
||||
LDN = 'LDN',
|
||||
LRN = 'LRN',
|
||||
AUTHORIZATION_LETTER = 'AUTHORIZATION_LETTER'
|
||||
AUTHORIZATION_LETTER = 'AUTHORIZATION_LETTER',
|
||||
ELECTRICITY_BILL = 'ELECTRICITY_BILL',
|
||||
RENTAL_AGREEMENT = 'RENTAL_AGREEMENT',
|
||||
PASSPORT = 'PASSPORT',
|
||||
OTHER_DOCUMENT = 'OTHER_DOCUMENT',
|
||||
BROADBAND_BILL = 'BROADBAND_BILL',
|
||||
GAS_BILL = 'GAS_BILL',
|
||||
}
|
||||
|
||||
export enum LegalDocumentFullName {
|
||||
@@ -168,6 +174,12 @@ export enum DocumentTitle {
|
||||
SELFIE = 'Selfie',
|
||||
OPTIMIZED_SELFIE = 'Selfie',
|
||||
AUTHORIZATION_LETTER = 'Authorization letter',
|
||||
ELECTRICITY_BILL = 'Electricity bill',
|
||||
RENTAL_AGREEMENT = 'Rental agreement',
|
||||
PASSPORT = 'Passport',
|
||||
OTHER_DOCUMENT = 'Other document',
|
||||
BROADBAND_BILL = 'Broadband bill',
|
||||
GAS_BILL = 'Gas bill',
|
||||
}
|
||||
|
||||
export enum DocumentContentType {
|
||||
|
||||
@@ -2,10 +2,9 @@ import React from 'react';
|
||||
import ImageIcon from '../../../../RN-UI-LIB/src/Icons/ImageIcon';
|
||||
import PdfIcon from '../../../../RN-UI-LIB/src/Icons/PdfIcon';
|
||||
import VideoIcon from '../../../../RN-UI-LIB/src/Icons/VideoIcon';
|
||||
import { DOCUMENT_TYPE, DocumentTitle, IDocument } from '../interface';
|
||||
import { DOCUMENT_TYPE, DocumentContentType, DocumentTitle, IDocument } from '../interface';
|
||||
import RNFS from 'react-native-fs';
|
||||
import { navigateToScreen } from '../../../components/utlis/navigationUtlis';
|
||||
import { toTileCase } from '@components/utlis/commonFunctions';
|
||||
|
||||
const getDocumentType = (docContentType: string) => {
|
||||
if (!docContentType) return 'image';
|
||||
@@ -24,6 +23,7 @@ export const getDocumentDetails = async (document: IDocument) => {
|
||||
const imageUrl = document.uri;
|
||||
if (!imageUrl) return null;
|
||||
const docType = getDocumentType(document?.docContentType);
|
||||
const isPDF = docType === DocumentContentType.PDF;
|
||||
if (!docType && document.type !== DOCUMENT_TYPE.VKYC_VIDEO) return null;
|
||||
switch (document.type) {
|
||||
case DOCUMENT_TYPE.VKYC_VIDEO:
|
||||
@@ -102,7 +102,7 @@ export const getDocumentDetails = async (document: IDocument) => {
|
||||
unSignedUri: document.unSignedUri,
|
||||
documentRefId: document.referenceId,
|
||||
};
|
||||
|
||||
|
||||
case DOCUMENT_TYPE.AUTHORIZATION_LETTER:
|
||||
return {
|
||||
icon: <PdfIcon />,
|
||||
@@ -114,8 +114,17 @@ export const getDocumentDetails = async (document: IDocument) => {
|
||||
documentRefId: document.referenceId,
|
||||
};
|
||||
|
||||
default:
|
||||
break;
|
||||
default: {
|
||||
return {
|
||||
icon: isPDF ? <PdfIcon /> : <ImageIcon />,
|
||||
title: DocumentTitle[document.type] || document.type,
|
||||
docType: document.type,
|
||||
docContentType: docType,
|
||||
url: imageUrl,
|
||||
unSignedUri: document.unSignedUri,
|
||||
documentRefId: document.referenceId,
|
||||
};
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user