@djb25/digit-ui-module-ekyc 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8911 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +3295 -2039
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -1
- package/dist/index.css +0 -54
- package/src/Module.js +0 -78
- package/src/components/AadhaarVerification.js +0 -315
- package/src/components/AssignEkyc.js +0 -236
- package/src/components/AssignEkycModal.js +0 -446
- package/src/components/CeoDashboard.js +0 -264
- package/src/components/CeoDashboard.jsx +0 -334
- package/src/components/ConnectionDetailsView.js +0 -241
- package/src/components/Dashboard.js +0 -43
- package/src/components/DesktopInbox.js +0 -176
- package/src/components/EKYCCard.js +0 -53
- package/src/components/Filter.js +0 -55
- package/src/components/MeterDetails.js +0 -336
- package/src/components/MobileInbox.js +0 -73
- package/src/components/PropertyInfo.js +0 -264
- package/src/components/Review.js +0 -696
- package/src/components/SearchConsumer.js +0 -142
- package/src/components/SearchFormFieldsComponent.js +0 -67
- package/src/components/SelectEkycZones.js +0 -71
- package/src/components/StatusCards.js +0 -148
- package/src/components/SurveyorDetailsCard.js +0 -512
- package/src/components/VendorDetails.jsx +0 -230
- package/src/components/analytics/charts/ClusterHeatmap.js +0 -88
- package/src/components/analytics/charts/ExecutiveBarChart.jsx +0 -30
- package/src/components/analytics/charts/ExecutiveLineChart.jsx +0 -159
- package/src/components/analytics/charts/ExecutivePieChart.jsx +0 -24
- package/src/components/analytics/charts/TaskStatusChart.js +0 -90
- package/src/components/analytics/components/AnalyticsTable.js +0 -106
- package/src/components/analytics/components/DashboardLayout.js +0 -52
- package/src/components/analytics/components/EmptyState.js +0 -27
- package/src/components/analytics/components/ErrorBoundary.js +0 -27
- package/src/components/analytics/components/FilterBar.js +0 -73
- package/src/components/analytics/components/NotificationPanel.js +0 -77
- package/src/components/analytics/components/SLAWidget.js +0 -56
- package/src/components/analytics/components/SkeletonLoader.js +0 -53
- package/src/components/analytics/components/SummaryCard.js +0 -74
- package/src/components/analytics/components/WorkflowTimeline.js +0 -55
- package/src/components/analytics/utils/exportUtils.js +0 -64
- package/src/components/analytics/utils/filterSerializer.js +0 -50
- package/src/components/mockData.js +0 -772
- package/src/config/AadhaarVerificationConfig.js +0 -367
- package/src/config/MeterDetailsConfig.js +0 -297
- package/src/config/PropertyInfoConfig.js +0 -145
- package/src/config/config.js +0 -70
- package/src/hook/SupervisorInboxTableConfig.js +0 -80
- package/src/hook/useInboxTableConfig.js +0 -131
- package/src/pages/citizen/Home.js +0 -54
- package/src/pages/citizen/Inbox.js +0 -265
- package/src/pages/citizen/index.js +0 -199
- package/src/pages/employee/ConsumerDetails.js +0 -299
- package/src/pages/employee/Create.js +0 -94
- package/src/pages/employee/EKYCForm.js +0 -118
- package/src/pages/employee/Inbox.js +0 -266
- package/src/pages/employee/Mapping.js +0 -358
- package/src/pages/employee/Update.js +0 -9
- package/src/pages/employee/index.js +0 -184
- package/src/utils/index.js +0 -46
- package/src/utils/reportDownloader.js +0 -90
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djb25/digit-ui-module-ekyc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "Digit UI Module for Ekyc",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.modern.js",
|
|
7
7
|
"source": "src/Module.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
8
11
|
"scripts": {
|
|
9
12
|
"start": "microbundle-crl watch --no-compress --format modern,cjs",
|
|
10
13
|
"build": "microbundle-crl --compress --no-sourcemap --format cjs",
|
package/dist/index.css
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/* Premium Dashboard Design System */
|
|
2
|
-
|
|
3
|
-
:root {
|
|
4
|
-
--glass-bg: rgba(255, 255, 255, 0.7);
|
|
5
|
-
--glass-border: rgba(255, 255, 255, 0.3);
|
|
6
|
-
--glass-blur: blur(12px);
|
|
7
|
-
|
|
8
|
-
--primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
|
|
9
|
-
--success-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
|
|
10
|
-
--warning-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
|
|
11
|
-
--danger-gradient: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
|
|
12
|
-
|
|
13
|
-
--card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
|
|
14
|
-
--card-hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
._Dashboard__glass-card__wTVvO {
|
|
18
|
-
background: var(--glass-bg);
|
|
19
|
-
backdrop-filter: var(--glass-blur);
|
|
20
|
-
-webkit-backdrop-filter: var(--glass-blur);
|
|
21
|
-
border: 1px solid var(--glass-border);
|
|
22
|
-
border-radius: 20px;
|
|
23
|
-
box-shadow: var(--card-shadow);
|
|
24
|
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
._Dashboard__glass-card__wTVvO:hover {
|
|
28
|
-
transform: translateY(-5px);
|
|
29
|
-
box-shadow: var(--card-hover-shadow);
|
|
30
|
-
border-color: rgba(255, 255, 255, 0.5);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
._Dashboard__gradient-text__1Dy6T {
|
|
34
|
-
background: var(--primary-gradient);
|
|
35
|
-
-webkit-background-clip: text;
|
|
36
|
-
-webkit-text-fill-color: transparent;
|
|
37
|
-
font-weight: 800;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@keyframes _Dashboard__fadeInScale__3MfMq {
|
|
41
|
-
from {
|
|
42
|
-
opacity: 0;
|
|
43
|
-
transform: scale(0.95) translateY(10px);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
to {
|
|
47
|
-
opacity: 1;
|
|
48
|
-
transform: scale(1) translateY(0);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
._Dashboard__animate-fade-in__1enKM {
|
|
53
|
-
animation: _Dashboard__fadeInScale__3MfMq 0.6s ease-out forwards;
|
|
54
|
-
}
|
package/src/Module.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { useRouteMatch } from "react-router-dom";
|
|
4
|
-
import { CitizenHomeCard, DocumentIcon, Loader } from "@djb25/digit-ui-react-components";
|
|
5
|
-
import EKYCCard from "./components/EKYCCard";
|
|
6
|
-
import Inbox from "./components/Dashboard";
|
|
7
|
-
import DesktopInbox from "./components/DesktopInbox";
|
|
8
|
-
import MobileInbox from "./components/MobileInbox";
|
|
9
|
-
import Filter from "./components/Filter";
|
|
10
|
-
import EmployeeApp from "./pages/employee";
|
|
11
|
-
import CitizenApp from "./pages/citizen";
|
|
12
|
-
import PropertyInfo from "./components/PropertyInfo";
|
|
13
|
-
import MeterDetails from "./components/MeterDetails";
|
|
14
|
-
import AadhaarVerification from "./components/AadhaarVerification";
|
|
15
|
-
|
|
16
|
-
export const EkycModule = ({ stateCode, userType, tenants }) => {
|
|
17
|
-
const { path, url } = useRouteMatch();
|
|
18
|
-
const moduleCode = "EKYC";
|
|
19
|
-
const language = Digit.StoreData.getCurrentLanguage();
|
|
20
|
-
const { isLoading } = Digit.Services.useStore({ stateCode, moduleCode, language });
|
|
21
|
-
|
|
22
|
-
Digit.SessionStorage.set("EKYC_TENANTS", tenants);
|
|
23
|
-
|
|
24
|
-
useEffect(
|
|
25
|
-
() =>
|
|
26
|
-
Digit.LocalizationService.getLocale({
|
|
27
|
-
modules: [`rainmaker-ekyc`, `rainmaker-${Digit.ULBService.getCurrentTenantId()}`],
|
|
28
|
-
locale: Digit.StoreData.getCurrentLanguage(),
|
|
29
|
-
tenantId: Digit.ULBService.getCurrentTenantId(),
|
|
30
|
-
}),
|
|
31
|
-
[]
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
if (isLoading) {
|
|
35
|
-
return <Loader page={true} />;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (userType === "employee") {
|
|
39
|
-
return <EmployeeApp path={path} url={url} userType={userType} tenants={tenants} />;
|
|
40
|
-
} else return <CitizenApp />;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const EkycLinks = ({ matchPath, userType }) => {
|
|
44
|
-
const { t } = useTranslation();
|
|
45
|
-
const links = [
|
|
46
|
-
{
|
|
47
|
-
link: `${matchPath}/create-kyc`,
|
|
48
|
-
i18nKey: t("EKYC_CREATE_KYC"),
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
link: `${matchPath}/update-kyc`,
|
|
52
|
-
i18nKey: t("EKYC_UPDATE_KYC"),
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
return <CitizenHomeCard header={t("EKYC_MODULE_NAME")} links={links} Icon={() => <DocumentIcon className="fill-path-primary-main" />} />;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const componentsToRegister = {
|
|
60
|
-
EKYCModule: EkycModule,
|
|
61
|
-
EKYCCard,
|
|
62
|
-
EKYCInbox: Inbox,
|
|
63
|
-
EKYCDesktopInbox: DesktopInbox,
|
|
64
|
-
EKYCMobileInbox: MobileInbox,
|
|
65
|
-
EKYC_INBOX_FILTER: (props) => <Filter {...props} />,
|
|
66
|
-
EkycLinks,
|
|
67
|
-
AadhaarVerification,
|
|
68
|
-
PropertyInfo,
|
|
69
|
-
MeterDetails,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const initEkycComponents = () => {
|
|
73
|
-
Object.entries(componentsToRegister).forEach(([key, value]) => {
|
|
74
|
-
Digit.ComponentRegistryService.setComponent(key, value);
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export default EkycModule;
|
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
import React, { useState, Fragment, useEffect } from "react";
|
|
2
|
-
import { useLocation } from "react-router-dom";
|
|
3
|
-
import { Toast, Loader, FormComposer } from "@djb25/digit-ui-react-components";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import AadhaarVerificationConfig from "../config/AadhaarVerificationConfig";
|
|
6
|
-
|
|
7
|
-
const AadhaarVerification = ({ config, onSelect, formData }) => {
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
const location = useLocation();
|
|
10
|
-
const flowState = location.state || {};
|
|
11
|
-
|
|
12
|
-
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
13
|
-
const queryParams = new URLSearchParams(location.search);
|
|
14
|
-
const urlKno = queryParams.get("kno");
|
|
15
|
-
const searchKno =
|
|
16
|
-
urlKno ||
|
|
17
|
-
flowState?.kNumber ||
|
|
18
|
-
flowState?.kno ||
|
|
19
|
-
formData?.kNumber ||
|
|
20
|
-
formData?.kno ||
|
|
21
|
-
sessionStorage.getItem("EKYC_K_NUMBER") ||
|
|
22
|
-
"";
|
|
23
|
-
|
|
24
|
-
const { isLoading, data: searchData } = Digit.Hooks.ekyc.useSearchConnection(
|
|
25
|
-
{ tenantId, details: { kno: searchKno, fetchType: "CONNECTION" } },
|
|
26
|
-
{ enabled: !!searchKno, cacheTime: 0 }
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const updateMutation = Digit.Hooks.ekyc.useEkycUpdate(tenantId);
|
|
30
|
-
|
|
31
|
-
const savedData = formData?.aadhaarVerification || {};
|
|
32
|
-
|
|
33
|
-
// 🔹 STATES
|
|
34
|
-
const [documentId, setDocumentId] = useState(savedData.documentId || null);
|
|
35
|
-
const [documentProof, setDocumentProof] = useState(savedData.documentProof || null);
|
|
36
|
-
const [toast, setToast] = useState(null);
|
|
37
|
-
const [isDataLoaded, setIsDataLoaded] = useState(false);
|
|
38
|
-
const [canSubmit, setCanSubmit] = useState(false);
|
|
39
|
-
|
|
40
|
-
const [defaultValues, setDefaultValues] = useState(() => ({
|
|
41
|
-
kno: savedData.kno || searchKno || "",
|
|
42
|
-
consumerType: savedData.consumerType ? { name: savedData.consumerType } : null,
|
|
43
|
-
occupantType: savedData.occupantType ? { name: savedData.occupantType } : null,
|
|
44
|
-
categoryType: savedData.categoryType ? { name: savedData.categoryType } : null,
|
|
45
|
-
firstName: savedData.firstName || "",
|
|
46
|
-
middleName: savedData.middleName || "",
|
|
47
|
-
lastName: savedData.lastName || "",
|
|
48
|
-
gender: savedData.gender ? { name: savedData.gender } : null,
|
|
49
|
-
parentSpouseName: savedData.parentSpouseName || "",
|
|
50
|
-
mobile: savedData.mobile || "",
|
|
51
|
-
whatsapp: savedData.whatsapp || "",
|
|
52
|
-
email: savedData.email || "",
|
|
53
|
-
residents: savedData.residents || "",
|
|
54
|
-
identityType: savedData.identityType ? { name: savedData.identityType } : null,
|
|
55
|
-
documentNumber: savedData.documentNumber || "",
|
|
56
|
-
informantIsConsumer: savedData.informantIsConsumer ?? true,
|
|
57
|
-
informantName: savedData.informantName || "",
|
|
58
|
-
informantRelation: savedData.informantRelation || "",
|
|
59
|
-
documentId: savedData.documentId || null,
|
|
60
|
-
documentProof: savedData.documentProof || null,
|
|
61
|
-
idFile: savedData.idFile || null,
|
|
62
|
-
ownerMobile: savedData.ownerMobile || "",
|
|
63
|
-
tenantVerification: savedData.tenantVerification || "",
|
|
64
|
-
designation: savedData.designation || "",
|
|
65
|
-
department: savedData.department || "",
|
|
66
|
-
employeeId: savedData.employeeId || "",
|
|
67
|
-
entityName: savedData.entityName || "",
|
|
68
|
-
contactPerson: savedData.contactPerson || "",
|
|
69
|
-
consent: savedData.consent || false,
|
|
70
|
-
}));
|
|
71
|
-
|
|
72
|
-
const [localFormData, setLocalFormData] = useState(defaultValues);
|
|
73
|
-
|
|
74
|
-
const extractApplicationData = (searchData) => {
|
|
75
|
-
if (!searchData) return null;
|
|
76
|
-
const reviewWrapper =
|
|
77
|
-
searchData?.applicationReviewInfo || searchData?.applicationReview || searchData;
|
|
78
|
-
const applicationData = (Array.isArray(reviewWrapper) ? reviewWrapper[0] : reviewWrapper) || {};
|
|
79
|
-
return applicationData?.newData || applicationData;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
const appData = extractApplicationData(searchData);
|
|
84
|
-
const rawData = appData || formData?.connectionDetails;
|
|
85
|
-
const details = rawData?.connectionDetails || rawData || {};
|
|
86
|
-
const addrDetails = rawData?.addressDetails || {};
|
|
87
|
-
|
|
88
|
-
if (details && Object.keys(details).length > 0 && !isDataLoaded) {
|
|
89
|
-
let fName = "";
|
|
90
|
-
let mName = "";
|
|
91
|
-
let lName = "";
|
|
92
|
-
|
|
93
|
-
if (details.firstName) {
|
|
94
|
-
fName = details.firstName;
|
|
95
|
-
mName = details.middleName || "";
|
|
96
|
-
lName = details.lastName || "";
|
|
97
|
-
} else if (details.consumerName) {
|
|
98
|
-
const parts = details.consumerName.trim().split(/\s+/);
|
|
99
|
-
fName = parts[0] || "";
|
|
100
|
-
if (parts.length === 2) lName = parts[1];
|
|
101
|
-
if (parts.length > 2) {
|
|
102
|
-
mName = parts.slice(1, -1).join(" ");
|
|
103
|
-
lName = parts[parts.length - 1];
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const updatedDefaults = {
|
|
108
|
-
kno: savedData.kno || searchKno || "",
|
|
109
|
-
consumerType: savedData.consumerType
|
|
110
|
-
? { name: savedData.consumerType }
|
|
111
|
-
: details.consumerType
|
|
112
|
-
? { name: details.consumerType }
|
|
113
|
-
: null,
|
|
114
|
-
occupantType: savedData.occupantType
|
|
115
|
-
? { name: savedData.occupantType }
|
|
116
|
-
: details.occupantType
|
|
117
|
-
? { name: details.occupantType }
|
|
118
|
-
: null,
|
|
119
|
-
categoryType: savedData.categoryType ? { name: savedData.categoryType } : null,
|
|
120
|
-
firstName: savedData.firstName || fName,
|
|
121
|
-
middleName: savedData.middleName || mName,
|
|
122
|
-
lastName: savedData.lastName || lName,
|
|
123
|
-
gender: savedData.gender
|
|
124
|
-
? { name: savedData.gender }
|
|
125
|
-
: details.gender
|
|
126
|
-
? { name: details.gender }
|
|
127
|
-
: null,
|
|
128
|
-
parentSpouseName: savedData.parentSpouseName || details.parentSpouse || "",
|
|
129
|
-
mobile: savedData.mobile || details.phoneNumber || addrDetails.mobileNo || "",
|
|
130
|
-
whatsapp: savedData.whatsapp || addrDetails.whatsappNo || "",
|
|
131
|
-
email: savedData.email || details.email || addrDetails.email || "",
|
|
132
|
-
residents: savedData.residents || (addrDetails.noOfPerson ? String(addrDetails.noOfPerson) : ""),
|
|
133
|
-
identityType: savedData.identityType ? { name: savedData.identityType } : null,
|
|
134
|
-
documentNumber: savedData.documentNumber || "",
|
|
135
|
-
informantIsConsumer: savedData.informantIsConsumer ?? true,
|
|
136
|
-
informantName: savedData.informantName || details.informantName || "",
|
|
137
|
-
informantRelation: savedData.informantRelation || details.informantRelation || "",
|
|
138
|
-
documentId: savedData.documentId || details.documentNumber || null,
|
|
139
|
-
documentProof: savedData.documentProof || null,
|
|
140
|
-
idFile: savedData.idFile || null,
|
|
141
|
-
ownerMobile: savedData.ownerMobile || "",
|
|
142
|
-
tenantVerification: savedData.tenantVerification || "",
|
|
143
|
-
designation: savedData.designation || "",
|
|
144
|
-
department: savedData.department || "",
|
|
145
|
-
employeeId: savedData.employeeId || "",
|
|
146
|
-
entityName: savedData.entityName || "",
|
|
147
|
-
contactPerson: savedData.contactPerson || "",
|
|
148
|
-
consent: savedData.consent || false,
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
setDefaultValues(updatedDefaults);
|
|
152
|
-
setLocalFormData(updatedDefaults);
|
|
153
|
-
if (updatedDefaults.documentId) {
|
|
154
|
-
setDocumentId(updatedDefaults.documentId);
|
|
155
|
-
}
|
|
156
|
-
if (updatedDefaults.documentProof) {
|
|
157
|
-
setDocumentProof(updatedDefaults.documentProof);
|
|
158
|
-
}
|
|
159
|
-
setIsDataLoaded(true);
|
|
160
|
-
}
|
|
161
|
-
}, [searchData, formData?.connectionDetails, isDataLoaded]);
|
|
162
|
-
|
|
163
|
-
// 🔹 FILE UPLOAD
|
|
164
|
-
const handleUploadProof = async (e, onChange) => {
|
|
165
|
-
const file = e.target.files[0];
|
|
166
|
-
if (!file) return;
|
|
167
|
-
|
|
168
|
-
if (file.size > 2000000) {
|
|
169
|
-
setToast({ type: "error", message: t("Max size 2MB exceeded") });
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
try {
|
|
174
|
-
const res = await Digit.UploadServices.Filestorage("EKYC", file, tenantId);
|
|
175
|
-
const fileStoreId = res?.data?.files?.[0]?.fileStoreId;
|
|
176
|
-
if (fileStoreId) {
|
|
177
|
-
onChange(file.name);
|
|
178
|
-
setDocumentProof(file.name);
|
|
179
|
-
setDocumentId(fileStoreId);
|
|
180
|
-
setToast({ type: "success", message: t("Upload successful") });
|
|
181
|
-
}
|
|
182
|
-
} catch {
|
|
183
|
-
setToast({ type: "error", message: t("Upload failed") });
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const onFormValueChange = (setValue, data) => {
|
|
188
|
-
// Avoid updating states on every keypress unless they affect conditional visibility
|
|
189
|
-
const consumerTypeChanged =
|
|
190
|
-
(data?.consumerType?.name || data?.consumerType) !==
|
|
191
|
-
(localFormData?.consumerType?.name || localFormData?.consumerType);
|
|
192
|
-
const occupantTypeChanged =
|
|
193
|
-
(data?.occupantType?.name || data?.occupantType) !==
|
|
194
|
-
(localFormData?.occupantType?.name || localFormData?.occupantType);
|
|
195
|
-
const informantIsConsumerChanged = data?.informantIsConsumer !== localFormData?.informantIsConsumer;
|
|
196
|
-
|
|
197
|
-
if (consumerTypeChanged || occupantTypeChanged || informantIsConsumerChanged) {
|
|
198
|
-
setLocalFormData((prev) => ({
|
|
199
|
-
...prev,
|
|
200
|
-
...data,
|
|
201
|
-
}));
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// Determine validation
|
|
205
|
-
const knoVal = data?.kno || searchKno;
|
|
206
|
-
const consumerTypeVal = data?.consumerType;
|
|
207
|
-
const occupantTypeVal = data?.occupantType;
|
|
208
|
-
const categoryTypeVal = data?.categoryType;
|
|
209
|
-
const firstNameVal = data?.firstName;
|
|
210
|
-
const mobileVal = data?.mobile;
|
|
211
|
-
const residentsVal = data?.residents;
|
|
212
|
-
const consentVal = data?.consent;
|
|
213
|
-
const docId = data?.documentId || documentId;
|
|
214
|
-
const ownerMobileVal = data?.ownerMobile;
|
|
215
|
-
|
|
216
|
-
let valid = true;
|
|
217
|
-
if (!knoVal) valid = false;
|
|
218
|
-
if (!consumerTypeVal) valid = false;
|
|
219
|
-
if (!occupantTypeVal) valid = false;
|
|
220
|
-
if (!categoryTypeVal) valid = false;
|
|
221
|
-
if (!firstNameVal) valid = false;
|
|
222
|
-
if (!mobileVal || !/^[6-9]\d{9}$/.test(mobileVal)) valid = false;
|
|
223
|
-
if (!residentsVal || Number(residentsVal) <= 0) valid = false;
|
|
224
|
-
if (occupantTypeVal?.name === "Tenanted" && !docId && !ownerMobileVal) valid = false;
|
|
225
|
-
if (!consentVal) valid = false;
|
|
226
|
-
|
|
227
|
-
if (valid !== canSubmit) {
|
|
228
|
-
setCanSubmit(valid);
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
const onSubmit = async (data) => {
|
|
233
|
-
const submitData = {
|
|
234
|
-
kno: data.kno || searchKno,
|
|
235
|
-
consumerType: data.consumerType?.name || data.consumerType,
|
|
236
|
-
occupantType: data.occupantType?.name || data.occupantType,
|
|
237
|
-
categoryType: data.categoryType?.name || data.categoryType,
|
|
238
|
-
consumerName: data.consumerName || `${data.firstName || ""} ${data.middleName || ""} ${data.lastName || ""}`.trim(),
|
|
239
|
-
firstName: data.firstName,
|
|
240
|
-
middleName: data.middleName,
|
|
241
|
-
lastName: data.lastName,
|
|
242
|
-
gender: data.gender?.name || data.gender,
|
|
243
|
-
parentSpouseName: data.parentSpouseName,
|
|
244
|
-
relation: data.relation || savedData.relation || "",
|
|
245
|
-
mobile: data.mobile,
|
|
246
|
-
whatsapp: data.whatsapp,
|
|
247
|
-
email: data.email,
|
|
248
|
-
residents: data.residents,
|
|
249
|
-
documentId: documentId,
|
|
250
|
-
documentProof: documentProof,
|
|
251
|
-
ownerMobile: data.ownerMobile,
|
|
252
|
-
tenantVerification: data.tenantVerification,
|
|
253
|
-
designation: data.designation,
|
|
254
|
-
department: data.department,
|
|
255
|
-
employeeId: data.employeeId,
|
|
256
|
-
landline: data.landline || savedData.landline || "",
|
|
257
|
-
entityRelation: data.entityRelation || savedData.entityRelation || "",
|
|
258
|
-
contactPerson: data.contactPerson,
|
|
259
|
-
entityName: data.entityName,
|
|
260
|
-
idProof: data.identityType?.name || data.identityType,
|
|
261
|
-
idNumber: data.documentNumber,
|
|
262
|
-
consent: data.consent,
|
|
263
|
-
informantIsConsumer: data.informantIsConsumer ?? true,
|
|
264
|
-
informantName: data.informantName,
|
|
265
|
-
informantRelation: data.informantRelation,
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
try {
|
|
269
|
-
await updateMutation.mutateAsync({
|
|
270
|
-
RequestInfo: {},
|
|
271
|
-
updateType: "CONSUMER",
|
|
272
|
-
...submitData,
|
|
273
|
-
});
|
|
274
|
-
setToast({ type: "success", message: t("Data updated successfully!") });
|
|
275
|
-
onSelect(config.key, submitData);
|
|
276
|
-
} catch (error) {
|
|
277
|
-
setToast({ type: "error", message: t("Failed to update consumer details") });
|
|
278
|
-
}
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
if (isLoading) {
|
|
282
|
-
return <Loader />;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
const Config = AadhaarVerificationConfig(t, localFormData, handleUploadProof, setDocumentId, documentId);
|
|
286
|
-
|
|
287
|
-
return (
|
|
288
|
-
<Fragment>
|
|
289
|
-
<FormComposer
|
|
290
|
-
key={isDataLoaded ? "loaded" : "loading"}
|
|
291
|
-
isDisabled={!canSubmit}
|
|
292
|
-
label={t("ES_COMMON_CONTINUE")}
|
|
293
|
-
config={Config.map((item) => ({
|
|
294
|
-
...item,
|
|
295
|
-
isCollapsible: true,
|
|
296
|
-
isDefaultOpen: true,
|
|
297
|
-
}))}
|
|
298
|
-
onSubmit={onSubmit}
|
|
299
|
-
defaultValues={defaultValues}
|
|
300
|
-
onFormValueChange={onFormValueChange}
|
|
301
|
-
noCard={false}
|
|
302
|
-
submitInForm={true}
|
|
303
|
-
/>
|
|
304
|
-
{toast && (
|
|
305
|
-
<Toast
|
|
306
|
-
error={toast.type === "error"}
|
|
307
|
-
label={toast.message}
|
|
308
|
-
onClose={() => setToast(null)}
|
|
309
|
-
/>
|
|
310
|
-
)}
|
|
311
|
-
</Fragment>
|
|
312
|
-
);
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
export default AadhaarVerification;
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useCallback, useReducer } from "react";
|
|
2
|
-
import { InboxComposer } from "@djb25/digit-ui-react-components";
|
|
3
|
-
import SupervisorInboxTableConfig from "../hook/SupervisorInboxTableConfig";
|
|
4
|
-
import SearchFormFieldsComponents from "./SearchFormFieldsComponent";
|
|
5
|
-
import { formInitValue, formReducer } from "../../../vendor/src/config/tableConfig";
|
|
6
|
-
|
|
7
|
-
// Mock data removed in favor of API integration
|
|
8
|
-
|
|
9
|
-
const AssignEkyc = () => {
|
|
10
|
-
let tenantId = Digit.ULBService.getCurrentTenantId();
|
|
11
|
-
if (!tenantId || tenantId === "dl") {
|
|
12
|
-
tenantId = "dl.djb"; // Force tenantId to dl.djb for EKYC APIs in citizen portal
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const [formState, dispatch] = useReducer(formReducer, formInitValue);
|
|
16
|
-
|
|
17
|
-
let paginationParms = {
|
|
18
|
-
limit: formState?.tableForm?.limit || 10,
|
|
19
|
-
offset: formState?.tableForm?.offset || 0,
|
|
20
|
-
sortBy: formState?.tableForm?.sortBy || "createdTime",
|
|
21
|
-
sortOrder: formState?.tableForm?.sortOrder || "DESC",
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const mobileNumber = formState?.searchForm?.mobileNumber || "";
|
|
25
|
-
const isSearchActive = !!mobileNumber;
|
|
26
|
-
|
|
27
|
-
const filters = {
|
|
28
|
-
...paginationParms,
|
|
29
|
-
status: "ACTIVE,DISABLED",
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
if (isSearchActive) {
|
|
33
|
-
filters.mobileNumber = mobileNumber;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const { data: dashboardData, isLoading } = Digit.Hooks.fsm.useSurveyorSearch(tenantId, filters, { enabled: !!tenantId, keepPreviousData: true });
|
|
37
|
-
|
|
38
|
-
const { isLoading: isDataSearchLoading, data } = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
39
|
-
enabled: !!tenantId,
|
|
40
|
-
keepPreviousData: true,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const sourceData = useMemo(() => {
|
|
44
|
-
return dashboardData?.surveyors || [];
|
|
45
|
-
}, [dashboardData]);
|
|
46
|
-
|
|
47
|
-
const filteredData = useMemo(() => {
|
|
48
|
-
return (sourceData || []).map((item) => {
|
|
49
|
-
const owner = item?.owner || {};
|
|
50
|
-
const roleCodes = owner?.roles?.map((role) => role.code)?.join(", ") || "";
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
...item,
|
|
54
|
-
id: item?.id || "",
|
|
55
|
-
surveyorName: item?.name || owner?.name || "",
|
|
56
|
-
mobileNo: item?.mobileNo || owner?.mobileNumber || "",
|
|
57
|
-
email: owner?.emailId || "",
|
|
58
|
-
vendorId: item?.vendorId || "",
|
|
59
|
-
tenantId: item?.tenantId || "",
|
|
60
|
-
supervisorId: item?.supervisorId || "",
|
|
61
|
-
status: item?.status || "",
|
|
62
|
-
roleCodes,
|
|
63
|
-
userName: owner?.userName || "",
|
|
64
|
-
gender: owner?.gender || "",
|
|
65
|
-
serviceType: item?.additionalDetails?.serviceType || "",
|
|
66
|
-
createdTime: item?.auditDetails?.createdTime || 0,
|
|
67
|
-
lastModifiedTime: item?.auditDetails?.lastModifiedTime || 0,
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
}, [sourceData]);
|
|
71
|
-
|
|
72
|
-
const totalRecords = dashboardData?.dashboardInfo?.totalRecords || dashboardData?.totalCount || 0;
|
|
73
|
-
|
|
74
|
-
// const PropsForInboxLinks = {
|
|
75
|
-
// headerText: "EKYC_MODULE",
|
|
76
|
-
// };
|
|
77
|
-
|
|
78
|
-
const SearchFormFields = useCallback(
|
|
79
|
-
({ registerRef, searchFormState, controlSearchForm }) => (
|
|
80
|
-
<SearchFormFieldsComponents {...{ registerRef, searchFormState, controlSearchForm }} searchType="mobile" className="search" />
|
|
81
|
-
),
|
|
82
|
-
[]
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
const tableOrderFormDefaultValues = {
|
|
86
|
-
sortBy: "createdTime",
|
|
87
|
-
limit: window.Digit.Utils.browser.isMobile() ? 50 : 10,
|
|
88
|
-
offset: 0,
|
|
89
|
-
sortOrder: "DESC",
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const onSearchFormSubmit = (data) => {
|
|
93
|
-
data.hasOwnProperty("") && delete data?.[""];
|
|
94
|
-
dispatch({ action: "mutateTableForm", data: { ...tableOrderFormDefaultValues } });
|
|
95
|
-
dispatch({ action: "mutateSearchForm", data });
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const searchFormDefaultValues = {
|
|
99
|
-
mobileNumber: "",
|
|
100
|
-
applicationNumber: "",
|
|
101
|
-
consumerNo: "",
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const onSearchFormReset = (setSearchFormValue) => {
|
|
105
|
-
setSearchFormValue("mobileNumber", null);
|
|
106
|
-
setSearchFormValue("applicationNumber", null);
|
|
107
|
-
setSearchFormValue("consumerNo", null);
|
|
108
|
-
dispatch({ action: "mutateSearchForm", data: searchFormDefaultValues });
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const propsForSearchForm = {
|
|
112
|
-
SearchFormFields,
|
|
113
|
-
onSearchFormSubmit,
|
|
114
|
-
searchFormDefaultValues: formState?.searchForm,
|
|
115
|
-
resetSearchFormDefaultValues: searchFormDefaultValues,
|
|
116
|
-
onSearchFormReset,
|
|
117
|
-
className: "search-form-wns-inbox",
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
// const FilterFormFields = useCallback(
|
|
121
|
-
// ({ registerRef, controlFilterForm, setFilterFormValue, getFilterFormValue }) => <React.Fragment></React.Fragment>,
|
|
122
|
-
// []
|
|
123
|
-
// );
|
|
124
|
-
|
|
125
|
-
// const propsForFilterForm = {
|
|
126
|
-
// FilterFormFields,
|
|
127
|
-
// onFilterFormSubmit: () => { },
|
|
128
|
-
// filterFormDefaultValues: "",
|
|
129
|
-
// resetFilterFormDefaultValues: "",
|
|
130
|
-
// onFilterFormReset: () => { },
|
|
131
|
-
// };
|
|
132
|
-
|
|
133
|
-
const onPageSizeChange = (e) => {
|
|
134
|
-
const newLimit = Number(e.target.value);
|
|
135
|
-
|
|
136
|
-
dispatch({
|
|
137
|
-
action: "mutateTableForm",
|
|
138
|
-
data: {
|
|
139
|
-
...formState.tableForm,
|
|
140
|
-
limit: newLimit,
|
|
141
|
-
offset: 0, // reset page
|
|
142
|
-
},
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const onSortingByData = (e) => {
|
|
147
|
-
if (e.length > 0) {
|
|
148
|
-
const [{ id, desc }] = e;
|
|
149
|
-
const sortOrder = desc ? "DESC" : "ASC";
|
|
150
|
-
const sortBy = id;
|
|
151
|
-
|
|
152
|
-
if (!(formState.tableForm.sortBy === sortBy && formState.tableForm.sortOrder === sortOrder)) {
|
|
153
|
-
dispatch({
|
|
154
|
-
action: "mutateTableForm",
|
|
155
|
-
data: {
|
|
156
|
-
...formState.tableForm,
|
|
157
|
-
sortBy: id,
|
|
158
|
-
sortOrder: desc ? "DESC" : "ASC",
|
|
159
|
-
},
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
const propsForInboxTable = SupervisorInboxTableConfig({
|
|
166
|
-
...{
|
|
167
|
-
onPageSizeChange,
|
|
168
|
-
formState,
|
|
169
|
-
totalCount: totalRecords,
|
|
170
|
-
table: filteredData,
|
|
171
|
-
dispatch,
|
|
172
|
-
onSortingByData,
|
|
173
|
-
tenantId,
|
|
174
|
-
inboxStyles: { overflowX: "scroll", overflowY: "hidden" },
|
|
175
|
-
tableStyle: { width: "70%" },
|
|
176
|
-
},
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
const isInboxLoading = isLoading;
|
|
180
|
-
|
|
181
|
-
const cards = [
|
|
182
|
-
{
|
|
183
|
-
label: "TOTAL_EKYC_APPLICATIONS",
|
|
184
|
-
count: data?.totalKnos || 0,
|
|
185
|
-
color: "#0B2559",
|
|
186
|
-
filter: null,
|
|
187
|
-
active: true,
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
label: "TOTAL_ASSIGNMENTS",
|
|
191
|
-
count: data?.totalAssignments || 0,
|
|
192
|
-
color: "#3B82F6",
|
|
193
|
-
filter: ["ASSIGNED"],
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
label: "EKYC_COMPLETED",
|
|
197
|
-
count: data?.completedKnos || 0,
|
|
198
|
-
color: "#10B981",
|
|
199
|
-
filter: ["COMPLETED"],
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
label: "PENDING_APPLICATIONS",
|
|
203
|
-
count: (data?.totalKnos || 0) - (data?.completedKnos || 0),
|
|
204
|
-
color: "#F59E0B",
|
|
205
|
-
filter: ["PENDING"],
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
label: "OVERALL_PROGRESS",
|
|
209
|
-
count: `${data?.overallProgressPercent || 0}%`,
|
|
210
|
-
color: "#A855F7",
|
|
211
|
-
filter: ["IN_PROGRESS"],
|
|
212
|
-
},
|
|
213
|
-
];
|
|
214
|
-
|
|
215
|
-
return (
|
|
216
|
-
<div className="app-container">
|
|
217
|
-
<InboxComposer
|
|
218
|
-
{...{
|
|
219
|
-
isInboxLoading,
|
|
220
|
-
// PropsForInboxLinks,
|
|
221
|
-
...propsForSearchForm,
|
|
222
|
-
// ...propsForFilterForm,
|
|
223
|
-
// ...propsForMobileSortForm,
|
|
224
|
-
propsForInboxTable,
|
|
225
|
-
// propsForInboxMobileCards,
|
|
226
|
-
formState,
|
|
227
|
-
countData: dashboardData?.dashboardInfo,
|
|
228
|
-
cards,
|
|
229
|
-
isCardLoading: isDataSearchLoading,
|
|
230
|
-
}}
|
|
231
|
-
/>
|
|
232
|
-
</div>
|
|
233
|
-
);
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
export default AssignEkyc;
|