@djb25/digit-ui-module-ekyc 1.0.43 → 1.0.44

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.
@@ -1,18 +1,19 @@
1
- import React, { useRef, useEffect, useMemo, useState, createContext, useContext, isValidElement, cloneElement, createElement, useCallback, useReducer, Fragment } from 'react';
1
+ import React, { useState, useRef, useEffect, useMemo, createContext, useContext, isValidElement, cloneElement, createElement, useCallback, useReducer, Fragment } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { useHistory, Link, useLocation, useParams, useRouteMatch, Switch, Route, Redirect } from 'react-router-dom';
4
- import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, CustomTooltip, CardLabelError, SearchField, RadioButtons, InboxComposer, EditIcon, DeleteIcon, CardHeader, CardText, LabelFieldPair, CardLabel, ActionBar, Modal, Toast, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, Menu, LinkButton, UploadFile, FormComposer, VerticalTimeline, Close, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, CitizenHomeCard, DocumentIcon, BackButton } from '@djb25/digit-ui-react-components';
4
+ import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, CustomTooltip, CardLabelError, SearchField, RadioButtons, InboxComposer, EditIcon, DeleteIcon, CardHeader, CardText, LabelFieldPair, CardLabel, ActionBar, Modal, Toast, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, Menu, LinkButton, UploadFile, FormComposer, VerticalTimeline, Close, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, CitizenHomeCard, DocumentIcon } from '@djb25/digit-ui-react-components';
5
5
  import * as Chartjs from 'chart.js/auto';
6
6
  import Chartjs__default, { Chart } from 'chart.js/auto';
7
7
  import { FaUsers, FaCheckCircle, FaClock, FaExclamationTriangle, FaUserTie, FaChartLine, FaSearch, FaArrowRight, FaMapMarkedAlt } from 'react-icons/fa';
8
8
  import { ResponsiveContainer, LineChart, CartesianGrid, XAxis, YAxis, Tooltip, Legend, Line, BarChart, Bar, PieChart, Pie, Cell } from 'recharts';
9
9
 
10
10
  const EKYCCard = () => {
11
- var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3;
11
+ var _Digit$SessionStorage, _Digit$SessionStorage2;
12
12
  const _useTranslation = useTranslation(),
13
13
  t = _useTranslation.t;
14
14
  const tenantId = Digit.ULBService.getCurrentTenantId();
15
- const roles = ((_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.roles) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.map(r => r.code)) || [];
15
+ const citizenInfo = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : _Digit$SessionStorage2.roles;
16
+ const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code || ele) : [];
16
17
  const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycApplicationList({}, {
17
18
  tenantId,
18
19
  offset: 0,
@@ -23,47 +24,228 @@ const EKYCCard = () => {
23
24
  listData = _Digit$Hooks$ekyc$use.data,
24
25
  isLoading = _Digit$Hooks$ekyc$use.isLoading;
25
26
  const totalCount = isLoading ? "-" : (listData === null || listData === void 0 ? void 0 : listData.totalCount) || 0;
26
- const propsForModuleCard = {
27
- Icon: /*#__PURE__*/React.createElement(PersonIcon, null),
28
- moduleName: t("ACTION_TEST_EKYC"),
29
- kpis: [{
30
- count: totalCount,
31
- label: t("TOTAL_EKYC"),
32
- link: "/digit-ui/employee/ekyc/admin-dashboard"
33
- }],
34
- links: [{
27
+ const isCitizen = window.location.pathname.includes("/citizen");
28
+ const prefix = isCitizen ? "/digit-ui/citizen/ekyc" : "/digit-ui/employee/ekyc";
29
+ let links = [];
30
+ if (isCitizen) {
31
+ if (roles.includes("EKYC_SURVEYOR")) {
32
+ links.push({
33
+ label: t("SURVEYOR_DASHBOARD"),
34
+ link: prefix + "/surveyor-dashboard"
35
+ });
36
+ }
37
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
38
+ links.push({
39
+ count: totalCount,
40
+ label: t("EKYC_INBOX"),
41
+ link: prefix + "/inbox"
42
+ });
43
+ }
44
+ if (roles.includes("EKYC_SUPERVISOR")) {
45
+ links.push({
46
+ label: t("EKYC_SUPERVISOR_DASHBOARD"),
47
+ link: prefix + "/supervisor-dashboard"
48
+ }, {
49
+ label: t("EKYC_ASSIGN"),
50
+ link: prefix + "/assign"
51
+ });
52
+ }
53
+ if (roles.includes("EKYC_VENDOR")) {
54
+ links.push({
55
+ label: t("EKYC_VENDOR_DASHBOARD"),
56
+ link: prefix + "/vendor-dashboard"
57
+ });
58
+ }
59
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
60
+ links.push({
61
+ label: t("TITLE_VENDOR_MANAGEMENT"),
62
+ link: "/digit-ui/citizen/vendor/search-vendor"
63
+ });
64
+ }
65
+ if (links.length === 0 || roles.length === 1 && roles.includes("CITIZEN")) {
66
+ links.push({
67
+ label: t("EKYC_STATUS"),
68
+ link: prefix + "/:id"
69
+ });
70
+ }
71
+ } else {
72
+ links = [{
35
73
  label: t("CEO_M.F_DOR_FINANCE_VIEW"),
36
- link: "/digit-ui/employee/ekyc/ceo-dashboard"
74
+ link: prefix + "/ceo-dashboard"
37
75
  }, {
38
76
  label: t("EKYC_ADMIN_DASHBOARD") || "Admin Dashboard",
39
- link: "/digit-ui/employee/ekyc/admin-dashboard"
77
+ link: prefix + "/admin-dashboard"
40
78
  }, {
41
79
  count: totalCount,
42
80
  label: t("EKYC_INBOX"),
43
- link: "/digit-ui/employee/ekyc/inbox"
81
+ link: prefix + "/inbox"
44
82
  }, ...(!roles.includes("EMPLOYEE") ? [{
45
83
  label: t("EKYC_ASSIGN"),
46
- link: "/digit-ui/employee/ekyc/assign"
47
- }] : [])]
84
+ link: prefix + "/assign"
85
+ }] : [])];
86
+ }
87
+ const propsForModuleCard = {
88
+ Icon: /*#__PURE__*/React.createElement(PersonIcon, null),
89
+ moduleName: t("ACTION_TEST_EKYC"),
90
+ kpis: isCitizen ? [] : [{
91
+ count: totalCount,
92
+ label: t("TOTAL_EKYC"),
93
+ link: prefix + "/admin-dashboard"
94
+ }],
95
+ links: links
48
96
  };
49
97
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
50
98
  };
51
99
 
100
+ const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
101
+ const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
102
+ function _catch(body, recover) {
103
+ try {
104
+ var result = body();
105
+ } catch (e) {
106
+ return recover(e);
107
+ }
108
+ if (result && result.then) {
109
+ return result.then(void 0, recover);
110
+ }
111
+ return result;
112
+ }
113
+ function _finallyRethrows(body, finalizer) {
114
+ try {
115
+ var result = body();
116
+ } catch (e) {
117
+ return finalizer(true, e);
118
+ }
119
+ if (result && result.then) {
120
+ return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
121
+ }
122
+ return finalizer(false, result);
123
+ }
124
+
52
125
  const getChartConstructor = () => {
53
126
  const C = Chart || Chartjs__default || Chartjs;
54
127
  return C;
55
128
  };
56
129
  const StatusCards = _ref => {
130
+ var _Digit$SessionStorage;
57
131
  let countData = _ref.countData;
58
132
  const _useTranslation = useTranslation(),
59
133
  t = _useTranslation.t;
134
+ const _useState = useState(false),
135
+ ekycDownloadLoading = _useState[0],
136
+ setEkycDownloadLoading = _useState[1];
137
+ let tenantId = Digit.ULBService.getCurrentTenantId();
138
+ if (!tenantId || tenantId === "dl") {
139
+ tenantId = "dl.djb";
140
+ }
141
+ const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
142
+ const fullName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "Admin";
143
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycSurveyorDashboard({}, {
144
+ tenantId,
145
+ offset: 0,
146
+ limit: 10,
147
+ ekycStatus: "submitted"
148
+ }, {
149
+ enabled: !!tenantId
150
+ }),
151
+ dashboardData = _Digit$Hooks$ekyc$use.data;
152
+ const apiCountData = React.useMemo(() => {
153
+ const info = (dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo) || {};
154
+ return {
155
+ total: info.total || 0,
156
+ completed: info.completed || 0,
157
+ pending: info.pending || 0,
158
+ rejected: info.rejected || 0,
159
+ active: info.active || 0
160
+ };
161
+ }, [dashboardData]);
162
+ const handleDownloadEkycData = function () {
163
+ try {
164
+ setEkycDownloadLoading(true);
165
+ return Promise.resolve(_finallyRethrows(function () {
166
+ return _catch(function () {
167
+ return Promise.resolve(Digit.EkycService.application_list({
168
+ tenantId: tenantId,
169
+ offset: 0,
170
+ limit: 10000,
171
+ reportDownload: true
172
+ })).then(function (response) {
173
+ const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
174
+ if (consumerList.length === 0) {
175
+ alert(t("NO_DATA_FOUND") || "No data found for download.");
176
+ return;
177
+ }
178
+ const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
179
+ const headerMapping = {
180
+ kno: t("KNO") || "KNO",
181
+ firstName: t("FIRST_NAME") || "First Name",
182
+ middleName: t("MIDDLE_NAME") || "Middle Name",
183
+ lastName: t("LAST_NAME") || "Last Name",
184
+ gender: t("GENDER") || "Gender",
185
+ mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
186
+ emailId: t("EMAIL_ID") || "Email ID",
187
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
188
+ relationship: t("RELATIONSHIP") || "Relationship",
189
+ dob: t("DOB") || "Date of Birth",
190
+ ekycStatus: t("EKYC_STATUS") || "eKYC Status",
191
+ zoneName: t("ZONE") || "Zone",
192
+ assembly: t("ASSEMBLY") || "Assembly",
193
+ ward: t("WARD") || "Ward",
194
+ pincode: t("PINCODE") || "Pincode",
195
+ mrkey: t("MR_KEY") || "MR Key",
196
+ consumerType: t("CONSUMER_TYPE") || "Consumer Type",
197
+ createdTime: t("CREATED_TIME") || "Created Time",
198
+ lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
199
+ };
200
+ const toTitleCase = str => {
201
+ if (!str) return "";
202
+ const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
203
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
204
+ };
205
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime"];
206
+ const excelData = consumerList.map(item => {
207
+ const cleanObj = {};
208
+ const name = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
209
+ if (name) {
210
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(name);
211
+ }
212
+ Object.keys(item).forEach(key => {
213
+ if (excludedKeys.includes(key)) return;
214
+ const val = item[key];
215
+ if (typeof val === "object" && val !== null) {
216
+ return;
217
+ }
218
+ const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
219
+ if (typeof val === "string" && !skipTitleCase.includes(key)) {
220
+ cleanObj[friendlyHeader] = toTitleCase(val);
221
+ } else {
222
+ cleanObj[friendlyHeader] = val;
223
+ }
224
+ });
225
+ return cleanObj;
226
+ });
227
+ const cleanFileName = "eKYC_All_Data_Admin_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
228
+ Digit.Download.Excel(excelData, cleanFileName);
229
+ });
230
+ }, function (error) {
231
+ console.error("Error downloading eKYC Excel:", error);
232
+ });
233
+ }, function (_wasThrown, _result) {
234
+ setEkycDownloadLoading(false);
235
+ if (_wasThrown) throw _result;
236
+ return _result;
237
+ }));
238
+ } catch (e) {
239
+ return Promise.reject(e);
240
+ }
241
+ };
60
242
  const chartRef1 = useRef(null);
61
243
  const chartInstance1 = useRef(null);
62
- const total = (countData === null || countData === void 0 ? void 0 : countData.total) || 0;
63
- const pending = (countData === null || countData === void 0 ? void 0 : countData.pending) || 0;
64
- const active = (countData === null || countData === void 0 ? void 0 : countData.completed) || 0;
65
- const completed = 0;
66
- const actualCompleted = (countData === null || countData === void 0 ? void 0 : countData.completed) || 0;
244
+ const total = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.total) || (countData === null || countData === void 0 ? void 0 : countData.total) || (countData === null || countData === void 0 ? void 0 : countData.totalCount) || 0;
245
+ const pending = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.pending) || (countData === null || countData === void 0 ? void 0 : countData.pending) || 0;
246
+ const active = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.active) || (countData === null || countData === void 0 ? void 0 : countData.active) || 0;
247
+ const completed = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.completed) || (countData === null || countData === void 0 ? void 0 : countData.completed) || 0;
248
+ const actualCompleted = completed;
67
249
  const approved = actualCompleted;
68
250
  const efficiency = total > 0 ? Math.round(actualCompleted / total * 100) : 0;
69
251
  const healthPct = total > 0 ? Math.round(approved / total * 100) : 0;
@@ -136,7 +318,29 @@ const StatusCards = _ref => {
136
318
  className: "total-number"
137
319
  }, formatNumber(total)), /*#__PURE__*/React.createElement("div", {
138
320
  className: "total-badge"
139
- }, "\u2197 +12.4% ", t("EKYC_FROM_LAST_QUARTER") || "from last quarter"))), /*#__PURE__*/React.createElement("div", {
321
+ }, "\u2197 +12.4% ", t("EKYC_FROM_LAST_QUARTER") || "from last quarter"), /*#__PURE__*/React.createElement("button", {
322
+ className: "download-excel-btn",
323
+ disabled: ekycDownloadLoading,
324
+ onClick: handleDownloadEkycData
325
+ }, /*#__PURE__*/React.createElement("svg", {
326
+ width: "16",
327
+ height: "16",
328
+ viewBox: "0 0 24 24",
329
+ fill: "none",
330
+ stroke: "currentColor",
331
+ strokeWidth: "2.5",
332
+ strokeLinecap: "round",
333
+ strokeLinejoin: "round"
334
+ }, /*#__PURE__*/React.createElement("path", {
335
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
336
+ }), /*#__PURE__*/React.createElement("polyline", {
337
+ points: "7 10 12 15 17 10"
338
+ }), /*#__PURE__*/React.createElement("line", {
339
+ x1: "12",
340
+ y1: "15",
341
+ x2: "12",
342
+ y2: "3"
343
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))), /*#__PURE__*/React.createElement("div", {
140
344
  className: "status-panels-grid"
141
345
  }, /*#__PURE__*/React.createElement("div", {
142
346
  className: "status-panel"
@@ -279,6 +483,10 @@ const DesktopInbox = _ref => {
279
483
  countData = props.countData;
280
484
  const _useTranslation = useTranslation(),
281
485
  t = _useTranslation.t;
486
+ const toTitleCase = str => {
487
+ if (!str) return "";
488
+ return String(str).toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
489
+ };
282
490
  const history = useHistory();
283
491
  const tenantId = Digit.ULBService.getCurrentTenantId();
284
492
  const FilterComponent = (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent(filterComponent);
@@ -321,37 +529,38 @@ const DesktopInbox = _ref => {
321
529
  Cell: _ref3 => {
322
530
  var _row$original3;
323
531
  let row = _ref3.row;
324
- return /*#__PURE__*/React.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
532
+ return /*#__PURE__*/React.createElement("span", null, toTitleCase((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
325
533
  }
326
534
  }, {
327
535
  Header: t("EKYC_STATUS"),
328
536
  accessor: "actionStatus",
329
537
  Cell: _ref4 => {
330
- var _row$original4;
538
+ var _row$original4, _row$original5;
331
539
  let row = _ref4.row;
332
540
  const status = (((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT").toUpperCase();
333
541
  return /*#__PURE__*/React.createElement("span", {
334
542
  className: "ekyc-status-tag " + status
335
- }, t("" + status));
543
+ }, toTitleCase(((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status) || "DEFAULT"));
336
544
  }
337
545
  }, {
338
546
  Header: t("EKYC_EKYC_STATUS"),
339
547
  accessor: "ekycStatus",
340
548
  Cell: _ref5 => {
341
- var _row$original5, _row$original6;
549
+ var _row$original6, _row$original7;
342
550
  let row = _ref5.row;
343
- const ekycStatus = (((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.ekycStatus) || ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycstatus) || "NA").toUpperCase();
551
+ const raw = ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycStatus) || ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.ekycstatus) || "NA";
552
+ const ekycStatus = raw.toUpperCase();
344
553
  return /*#__PURE__*/React.createElement("span", {
345
554
  className: "ekyc-status-tag " + ekycStatus
346
- }, t("" + ekycStatus));
555
+ }, toTitleCase(raw));
347
556
  }
348
557
  }, {
349
558
  Header: t("EKYC_ACTION"),
350
559
  accessor: "status",
351
560
  Cell: _ref6 => {
352
- var _row$original7, _row$original8;
561
+ var _row$original8, _row$original9;
353
562
  let row = _ref6.row;
354
- const kno = ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.kno) || ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.applicationNumber) || "NA";
563
+ const kno = ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.kno) || ((_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : _row$original9.applicationNumber) || "NA";
355
564
  return /*#__PURE__*/React.createElement("span", {
356
565
  className: "link",
357
566
  onClick: () => handleReview(kno)
@@ -1590,31 +1799,6 @@ const CeoDashboard = () => {
1590
1799
  }, /*#__PURE__*/React.createElement("h3", null, topKpis.successRate, "%"), /*#__PURE__*/React.createElement("p", null, "Operational Efficiency")))))));
1591
1800
  };
1592
1801
 
1593
- const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
1594
- const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
1595
- function _catch(body, recover) {
1596
- try {
1597
- var result = body();
1598
- } catch (e) {
1599
- return recover(e);
1600
- }
1601
- if (result && result.then) {
1602
- return result.then(void 0, recover);
1603
- }
1604
- return result;
1605
- }
1606
- function _finallyRethrows(body, finalizer) {
1607
- try {
1608
- var result = body();
1609
- } catch (e) {
1610
- return finalizer(true, e);
1611
- }
1612
- if (result && result.then) {
1613
- return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
1614
- }
1615
- return finalizer(false, result);
1616
- }
1617
-
1618
1802
  const downloadSurveyorPDF = function (_ref) {
1619
1803
  let rows = _ref.rows,
1620
1804
  surveyorName = _ref.surveyorName,
@@ -1704,6 +1888,123 @@ const downloadSurveyorPDF = function (_ref) {
1704
1888
  return Promise.reject(e);
1705
1889
  }
1706
1890
  };
1891
+ const downloadSupervisorPDF = function (_ref2) {
1892
+ let rows = _ref2.rows,
1893
+ supervisorName = _ref2.supervisorName,
1894
+ mobileNumber = _ref2.mobileNumber,
1895
+ vendorName = _ref2.vendorName,
1896
+ dashboardInfo = _ref2.dashboardInfo,
1897
+ t = _ref2.t;
1898
+ try {
1899
+ const tenantId = Digit.ULBService.getCurrentTenantId();
1900
+ const name = "Delhi Jal Board";
1901
+ const email = "contact@delhijalboard.nic.in";
1902
+ const phoneNumber = "+91-11-23538416";
1903
+ const currentDate = new Date();
1904
+ const formattedDate = currentDate.toLocaleDateString("en-IN", {
1905
+ day: "2-digit",
1906
+ month: "2-digit",
1907
+ year: "numeric"
1908
+ });
1909
+ const formattedTime = currentDate.toLocaleTimeString("en-IN", {
1910
+ hour: "2-digit",
1911
+ minute: "2-digit",
1912
+ second: "2-digit",
1913
+ hour12: false
1914
+ });
1915
+ const downloadDateTime = formattedDate + " " + formattedTime;
1916
+ const isValDefined = val => val !== undefined && val !== null && val !== "";
1917
+ const details = [{
1918
+ title: t("SUPERVISOR_DETAILS") || "Supervisor Details",
1919
+ asSectionHeader: true,
1920
+ values: [{
1921
+ title: t("SUPERVISOR_NAME") || "Supervisor Name",
1922
+ value: supervisorName
1923
+ }, {
1924
+ title: t("MOBILE_NUMBER") || "Mobile Number",
1925
+ value: mobileNumber
1926
+ }, {
1927
+ title: t("VENDOR_NAME") || "Vendor Name",
1928
+ value: vendorName
1929
+ }].filter(item => isValDefined(item.value))
1930
+ }, {
1931
+ title: t("SUMMARY_STATISTICS") || "Summary Statistics",
1932
+ asSectionHeader: true,
1933
+ values: [{
1934
+ title: t("TOTAL_ASSIGNED") || "Total Assigned",
1935
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
1936
+ }, {
1937
+ title: t("COMPLETED") || "Completed",
1938
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
1939
+ }, {
1940
+ title: t("PENDING") || "Pending",
1941
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
1942
+ }, {
1943
+ title: t("SUBMITTED") || "Submitted",
1944
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
1945
+ }].filter(item => isValDefined(item.value))
1946
+ }];
1947
+ const mappedRows = rows.map(row => {
1948
+ var _row$owner, _row$owner2;
1949
+ return {
1950
+ kno: row.name || ((_row$owner = row.owner) === null || _row$owner === void 0 ? void 0 : _row$owner.name) || "N/A",
1951
+ firstName: ((_row$owner2 = row.owner) === null || _row$owner2 === void 0 ? void 0 : _row$owner2.mobileNumber) || row.mobileNo || "N/A",
1952
+ lastName: "",
1953
+ mobileNo: row.status || "N/A",
1954
+ zoneName: String(row.total || 0),
1955
+ ekycStatus: (row.completed || 0) + " / " + (row.pending || 0),
1956
+ submittedAt: 1717171717171,
1957
+ progress: row.progress || "0%"
1958
+ };
1959
+ });
1960
+ const originalToLocaleDateString = Date.prototype.toLocaleDateString;
1961
+ let progressIndex = 0;
1962
+ Date.prototype.toLocaleDateString = function () {
1963
+ if (progressIndex < mappedRows.length) {
1964
+ return mappedRows[progressIndex++].progress || "0%";
1965
+ }
1966
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1967
+ args[_key] = arguments[_key];
1968
+ }
1969
+ return originalToLocaleDateString.apply(this, args);
1970
+ };
1971
+ const customT = key => {
1972
+ if (key === "KNO") return t("SURVEYOR_NAME") || "Surveyor Name";
1973
+ if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
1974
+ if (key === "MOBILE") return t("STATUS") || "Status";
1975
+ if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
1976
+ if (key === "EKYC_STATUS") return t("COMPLETED_PENDING") || "Completed / Pending";
1977
+ if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
1978
+ if (key === "CONSUMER_LIST") return t("CONNECTED_SURVEYORS") || "Connected Surveyors";
1979
+ return t(key);
1980
+ };
1981
+ try {
1982
+ if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
1983
+ window.Digit.Utils.pdf.generateSurveyorReport({
1984
+ tenantId,
1985
+ logo: null,
1986
+ name,
1987
+ email,
1988
+ phoneNumber,
1989
+ heading: t("EKYC_SUPERVISOR_REPORT") || "eKYC Supervisor Report",
1990
+ details,
1991
+ applicationNumber: mobileNumber,
1992
+ rows: mappedRows,
1993
+ t: customT,
1994
+ hideApplicationNumber: true,
1995
+ downloadTime: downloadDateTime
1996
+ });
1997
+ } else {
1998
+ console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
1999
+ }
2000
+ } finally {
2001
+ Date.prototype.toLocaleDateString = originalToLocaleDateString;
2002
+ }
2003
+ return Promise.resolve();
2004
+ } catch (e) {
2005
+ return Promise.reject(e);
2006
+ }
2007
+ };
1707
2008
  const downloadVendorPDF = function (_ref3) {
1708
2009
  let rows = _ref3.rows,
1709
2010
  vendorName = _ref3.vendorName,
@@ -1929,6 +2230,10 @@ const VendorDetailsCard = () => {
1929
2230
  }
1930
2231
  return "N/A";
1931
2232
  }, [vendor]);
2233
+ const zoneIds = useMemo(() => {
2234
+ var _vendor$zoneIds;
2235
+ return vendor !== null && vendor !== void 0 && (_vendor$zoneIds = vendor.zoneIds) !== null && _vendor$zoneIds !== void 0 && _vendor$zoneIds.length ? vendor.zoneIds.map(zone => zone.toUpperCase().replace("", " ")).join(", ") : "N/A";
2236
+ }, [vendor]);
1932
2237
  const cards = useMemo(() => {
1933
2238
  const hasRealData = vendorSupervisors.some(s => s.totalKnos > 0);
1934
2239
  const totalKnos = hasRealData ? vendorSupervisors.reduce((acc, s) => acc + (s.totalKnos || 0), 0) : (progressData === null || progressData === void 0 ? void 0 : progressData.totalKnos) || (vendor === null || vendor === void 0 ? void 0 : vendor.assignedConnections) || 0;
@@ -1986,7 +2291,7 @@ const VendorDetailsCard = () => {
1986
2291
  alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
1987
2292
  return;
1988
2293
  }
1989
- const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
2294
+ const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
1990
2295
  const headerMapping = {
1991
2296
  kno: t("KNO") || "KNO",
1992
2297
  firstName: t("FIRST_NAME") || "First Name",
@@ -2311,9 +2616,9 @@ const VendorDetailsCard = () => {
2311
2616
  className: "detail-item"
2312
2617
  }, /*#__PURE__*/React.createElement("span", {
2313
2618
  className: "label"
2314
- }, t("JURISDICTIONS") || "Jurisdictions"), /*#__PURE__*/React.createElement("span", {
2619
+ }, t("ASSIGNED_ZONES") || "Assigned Zones"), /*#__PURE__*/React.createElement("span", {
2315
2620
  className: "value"
2316
- }, jurisdictions)))), /*#__PURE__*/React.createElement("div", {
2621
+ }, zoneIds)))), /*#__PURE__*/React.createElement("div", {
2317
2622
  className: "details-right"
2318
2623
  }, /*#__PURE__*/React.createElement("div", {
2319
2624
  className: "download-card"
@@ -2391,6 +2696,10 @@ const useInboxTableConfig = _ref => {
2391
2696
  tableStyle = _ref$tableStyle === void 0 ? {} : _ref$tableStyle;
2392
2697
  const _useTranslation = useTranslation(),
2393
2698
  t = _useTranslation.t;
2699
+ const toTitleCase = str => {
2700
+ if (!str) return "";
2701
+ return String(str).toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
2702
+ };
2394
2703
  const history = useHistory();
2395
2704
  const _useState = useState(""),
2396
2705
  selectedKno = _useState[0],
@@ -2434,18 +2743,18 @@ const useInboxTableConfig = _ref => {
2434
2743
  Cell: _ref3 => {
2435
2744
  var _row$original3;
2436
2745
  let row = _ref3.row;
2437
- return /*#__PURE__*/React.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
2746
+ return /*#__PURE__*/React.createElement("span", null, toTitleCase((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
2438
2747
  }
2439
2748
  }, {
2440
2749
  Header: t("EKYC_STATUS"),
2441
2750
  accessor: "actionStatus",
2442
2751
  Cell: _ref4 => {
2443
- var _row$original4;
2752
+ var _row$original4, _row$original5;
2444
2753
  let row = _ref4.row;
2445
2754
  const status = (((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT").toUpperCase();
2446
2755
  return /*#__PURE__*/React.createElement("span", {
2447
2756
  className: "ekyc-status-tag " + status
2448
- }, t("" + status));
2757
+ }, toTitleCase(((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status) || "DEFAULT"));
2449
2758
  }
2450
2759
  }, {
2451
2760
  Header: t("SUBMITTED_AT") || "Submitted At",
@@ -2465,12 +2774,13 @@ const useInboxTableConfig = _ref => {
2465
2774
  Header: t("EKYC_EKYC_STATUS"),
2466
2775
  accessor: "ekycStatus",
2467
2776
  Cell: _ref7 => {
2468
- var _row$original5, _row$original6;
2777
+ var _row$original6, _row$original7;
2469
2778
  let row = _ref7.row;
2470
- const ekycStatus = (((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.ekycStatus) || ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycstatus) || "NA").toUpperCase();
2779
+ const raw = ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycStatus) || ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.ekycstatus) || "NA";
2780
+ const ekycStatus = raw.toUpperCase();
2471
2781
  return /*#__PURE__*/React.createElement("span", {
2472
2782
  className: "ekyc-status-tag " + ekycStatus
2473
- }, t("" + ekycStatus));
2783
+ }, toTitleCase(raw));
2474
2784
  }
2475
2785
  }];
2476
2786
  return {
@@ -3181,7 +3491,9 @@ const Inbox = _ref => {
3181
3491
  propsForInboxTable,
3182
3492
  propsForInboxMobileCards,
3183
3493
  formState,
3184
- countData: listData
3494
+ countData: listData,
3495
+ forceTable: true,
3496
+ showSearchOnMobile: true
3185
3497
  })));
3186
3498
  };
3187
3499
 
@@ -5861,12 +6173,14 @@ const AssignEkyc = () => {
5861
6173
  propsForInboxMobileCards,
5862
6174
  formState,
5863
6175
  countData: dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo,
5864
- isCardLoading: isDataSearchLoading
6176
+ isCardLoading: isDataSearchLoading,
6177
+ showSearchOnMobile: true,
6178
+ forceTable: true
5865
6179
  })));
5866
6180
  };
5867
6181
 
5868
6182
  const AdminDashboard = () => {
5869
- var _Digit$SessionStorage, _loggedInUser$roles, _fullName$charAt;
6183
+ var _Digit$SessionStorage;
5870
6184
  const _useTranslation = useTranslation(),
5871
6185
  t = _useTranslation.t;
5872
6186
  const history = useHistory();
@@ -5875,177 +6189,55 @@ const AdminDashboard = () => {
5875
6189
  tenantId = "dl.djb";
5876
6190
  }
5877
6191
  const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
5878
- const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
5879
- status: "ACTIVE"
5880
- }, {
5881
- enabled: !!tenantId
5882
- }),
5883
- vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
5884
- isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
5885
- const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
5886
- enabled: !!tenantId,
5887
- keepPreviousData: true
5888
- }),
5889
- progressData = _Digit$Hooks$ekyc$use.data,
5890
- isProgressLoading = _Digit$Hooks$ekyc$use.isLoading;
5891
- const vendorsList = useMemo(() => {
5892
- if (vendorSearchResponse && vendorSearchResponse.length > 0) {
5893
- return vendorSearchResponse.map(v => {
5894
- var _progressData$supervi, _dso$owner, _v$owner, _dso$owner2;
5895
- const dso = v.dsoDetails || v;
5896
- const supervisorsList = dso.supervisors || [];
5897
- const surveyorsList = dso.surveyors || [];
5898
- const supervisorIds = supervisorsList.map(s => {
5899
- var _s$owner;
5900
- return s.id || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid);
5901
- }).filter(Boolean);
5902
- const matchedReports = (progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.filter(r => supervisorIds.includes(r.supervisorId))) || [];
5903
- const completed = matchedReports.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
5904
- const pending = matchedReports.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
5905
- const total = matchedReports.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
5906
- const progress = total > 0 ? Math.round(completed / total * 100) : 0;
5907
- const rejected = 0;
5908
- return {
5909
- id: dso.id || dso.vendorId || v.id || v.vendorId,
5910
- name: dso.name || dso.displayName || v.name || "N/A",
5911
- ownerName: ((_dso$owner = dso.owner) === null || _dso$owner === void 0 ? void 0 : _dso$owner.name) || ((_v$owner = v.owner) === null || _v$owner === void 0 ? void 0 : _v$owner.name) || "N/A",
5912
- mobileNumber: dso.mobileNumber || ((_dso$owner2 = dso.owner) === null || _dso$owner2 === void 0 ? void 0 : _dso$owner2.mobileNumber) || v.mobileNumber || "N/A",
5913
- supervisors: supervisorsList.length,
5914
- surveyors: surveyorsList.length,
5915
- completed: completed,
5916
- progress: progress,
5917
- pending: pending,
5918
- rejected: rejected
5919
- };
5920
- });
5921
- }
5922
- return [];
5923
- }, [vendorSearchResponse, progressData]);
5924
- const _useState = useState(false),
5925
- ekycDownloadLoading = _useState[0],
5926
- setEkycDownloadLoading = _useState[1];
5927
- const _useState2 = useState(0),
5928
- currentPage = _useState2[0];
5929
- const _useState3 = useState(20),
5930
- pageSize = _useState3[0];
5931
- const _Digit$Hooks$ekyc$use2 = Digit.Hooks.ekyc.useEkycApplicationList({}, {
5932
- tenantId,
5933
- offset: currentPage * pageSize,
5934
- limit: pageSize
5935
- }, {
5936
- keepPreviousData: true
5937
- });
5938
- const fullName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "Admin";
5939
- const mobileNumber = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber) || "N/A";
5940
- const roleText = (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$roles = loggedInUser.roles) === null || _loggedInUser$roles === void 0 ? void 0 : _loggedInUser$roles.map(r => r.name).join(", ")) || "EKYC Admin";
5941
- const handleDownloadEkycData = function () {
5942
- try {
5943
- setEkycDownloadLoading(true);
5944
- return Promise.resolve(_finallyRethrows(function () {
5945
- return _catch(function () {
5946
- return Promise.resolve(Digit.EkycService.application_list({
5947
- tenantId: tenantId,
5948
- offset: 0,
5949
- limit: 10000,
5950
- reportDownload: true
5951
- })).then(function (response) {
5952
- const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
5953
- if (consumerList.length === 0) {
5954
- alert(t("NO_DATA_FOUND") || "No data found for download.");
5955
- return;
5956
- }
5957
- const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
5958
- const headerMapping = {
5959
- kno: t("KNO") || "KNO",
5960
- firstName: t("FIRST_NAME") || "First Name",
5961
- middleName: t("MIDDLE_NAME") || "Middle Name",
5962
- lastName: t("LAST_NAME") || "Last Name",
5963
- gender: t("GENDER") || "Gender",
5964
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
5965
- emailId: t("EMAIL_ID") || "Email ID",
5966
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
5967
- relationship: t("RELATIONSHIP") || "Relationship",
5968
- dob: t("DOB") || "Date of Birth",
5969
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
5970
- zoneName: t("ZONE") || "Zone",
5971
- assembly: t("ASSEMBLY") || "Assembly",
5972
- ward: t("WARD") || "Ward",
5973
- pincode: t("PINCODE") || "Pincode",
5974
- mrkey: t("MR_KEY") || "MR Key",
5975
- createdTime: t("CREATED_TIME") || "Created Time",
5976
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
5977
- };
5978
- const excelData = consumerList.map(item => {
5979
- const cleanObj = {};
5980
- const name = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
5981
- if (name) {
5982
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = name;
5983
- }
5984
- Object.keys(item).forEach(key => {
5985
- if (excludedKeys.includes(key)) return;
5986
- const val = item[key];
5987
- if (typeof val === "object" && val !== null) {
5988
- return;
5989
- }
5990
- const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
5991
- cleanObj[friendlyHeader] = val;
5992
- });
5993
- return cleanObj;
5994
- });
5995
- const cleanFileName = "eKYC_All_Data_Admin_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
5996
- Digit.Download.Excel(excelData, cleanFileName);
5997
- });
5998
- }, function (error) {
5999
- console.error("Error downloading eKYC Excel:", error);
6000
- });
6001
- }, function (_wasThrown, _result) {
6002
- setEkycDownloadLoading(false);
6003
- if (_wasThrown) throw _result;
6004
- return _result;
6005
- }));
6006
- } catch (e) {
6007
- return Promise.reject(e);
6192
+ const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
6193
+ status: "ACTIVE"
6194
+ }, {
6195
+ enabled: !!tenantId
6196
+ }),
6197
+ vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
6198
+ isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
6199
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
6200
+ enabled: !!tenantId,
6201
+ keepPreviousData: true
6202
+ }),
6203
+ progressData = _Digit$Hooks$ekyc$use.data,
6204
+ isProgressLoading = _Digit$Hooks$ekyc$use.isLoading;
6205
+ const vendorsList = useMemo(() => {
6206
+ if (vendorSearchResponse && vendorSearchResponse.length > 0) {
6207
+ return vendorSearchResponse.map(v => {
6208
+ var _progressData$supervi, _dso$owner, _v$owner, _dso$owner2;
6209
+ const dso = v.dsoDetails || v;
6210
+ const supervisorsList = dso.supervisors || [];
6211
+ const surveyorsList = dso.surveyors || [];
6212
+ const supervisorIds = supervisorsList.map(s => {
6213
+ var _s$owner;
6214
+ return s.id || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid);
6215
+ }).filter(Boolean);
6216
+ const matchedReports = (progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.filter(r => supervisorIds.includes(r.supervisorId))) || [];
6217
+ const completed = matchedReports.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
6218
+ const pending = matchedReports.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
6219
+ const total = matchedReports.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
6220
+ const progress = total > 0 ? Math.round(completed / total * 100) : 0;
6221
+ const rejected = 0;
6222
+ return {
6223
+ id: dso.id || dso.vendorId || v.id || v.vendorId,
6224
+ name: dso.name || dso.displayName || v.name || "N/A",
6225
+ ownerName: ((_dso$owner = dso.owner) === null || _dso$owner === void 0 ? void 0 : _dso$owner.name) || ((_v$owner = v.owner) === null || _v$owner === void 0 ? void 0 : _v$owner.name) || "N/A",
6226
+ mobileNumber: dso.mobileNumber || ((_dso$owner2 = dso.owner) === null || _dso$owner2 === void 0 ? void 0 : _dso$owner2.mobileNumber) || v.mobileNumber || "N/A",
6227
+ supervisors: supervisorsList.length,
6228
+ surveyors: surveyorsList.length,
6229
+ completed: completed,
6230
+ progress: progress,
6231
+ pending: pending,
6232
+ rejected: rejected
6233
+ };
6234
+ });
6008
6235
  }
6009
- };
6236
+ return [];
6237
+ }, [vendorSearchResponse, progressData]);
6010
6238
  return /*#__PURE__*/React.createElement(Card, {
6011
6239
  className: "surveyor-dashboard"
6012
- }, /*#__PURE__*/React.createElement("div", {
6013
- className: "ekyc-dashboard-section"
6014
- }, /*#__PURE__*/React.createElement("div", {
6015
- className: "ekyc-dashboard-header"
6016
- }, /*#__PURE__*/React.createElement("div", {
6017
- className: "avatar"
6018
- }, fullName === null || fullName === void 0 ? void 0 : (_fullName$charAt = fullName.charAt(0)) === null || _fullName$charAt === void 0 ? void 0 : _fullName$charAt.toUpperCase()), /*#__PURE__*/React.createElement("div", {
6019
- className: "header-content"
6020
- }, /*#__PURE__*/React.createElement("h2", {
6021
- className: "name"
6022
- }, fullName), /*#__PURE__*/React.createElement("div", {
6023
- className: "designation"
6024
- }, t("EKYC_ADMIN") || "eKYC Admin / Manager"), /*#__PURE__*/React.createElement("div", {
6025
- className: "mobile-number"
6026
- }, mobileNumber))), /*#__PURE__*/React.createElement("button", {
6027
- className: "download-excel-btn",
6028
- disabled: ekycDownloadLoading,
6029
- onClick: handleDownloadEkycData
6030
- }, /*#__PURE__*/React.createElement("svg", {
6031
- width: "16",
6032
- height: "16",
6033
- viewBox: "0 0 24 24",
6034
- fill: "none",
6035
- stroke: "currentColor",
6036
- strokeWidth: "2.5",
6037
- strokeLinecap: "round",
6038
- strokeLinejoin: "round"
6039
- }, /*#__PURE__*/React.createElement("path", {
6040
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
6041
- }), /*#__PURE__*/React.createElement("polyline", {
6042
- points: "7 10 12 15 17 10"
6043
- }), /*#__PURE__*/React.createElement("line", {
6044
- x1: "12",
6045
- y1: "15",
6046
- x2: "12",
6047
- y2: "3"
6048
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")), /*#__PURE__*/React.createElement(Dashboard, null), /*#__PURE__*/React.createElement("div", {
6240
+ }, /*#__PURE__*/React.createElement(Dashboard, null), /*#__PURE__*/React.createElement("div", {
6049
6241
  className: "admin-performance-section"
6050
6242
  }, /*#__PURE__*/React.createElement("h3", {
6051
6243
  className: "section-title"
@@ -6333,7 +6525,8 @@ const SupervisorDetailsCard = () => {
6333
6525
  showCustomPicker = _useState6[0],
6334
6526
  setShowCustomPicker = _useState6[1];
6335
6527
  const _useState7 = useState(false),
6336
- reportLoading = _useState7[0];
6528
+ reportLoading = _useState7[0],
6529
+ setReportLoading = _useState7[1];
6337
6530
  const reportMenuRef = useRef(null);
6338
6531
  useEffect(() => {
6339
6532
  const handler = e => {
@@ -6345,6 +6538,42 @@ const SupervisorDetailsCard = () => {
6345
6538
  document.addEventListener("mousedown", handler);
6346
6539
  return () => document.removeEventListener("mousedown", handler);
6347
6540
  }, []);
6541
+ const handleDownload = () => {
6542
+ setReportLoading(true);
6543
+ try {
6544
+ const rowsWithStats = surveyors.map(s => ({
6545
+ name: s.surveyorName,
6546
+ mobileNo: s.mobileNo,
6547
+ status: s.status,
6548
+ total: s.totalKnos,
6549
+ completed: s.submittedKnos,
6550
+ pending: s.pendingKnos,
6551
+ progress: s.progressPercent + "%"
6552
+ }));
6553
+ const totalKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0;
6554
+ const completedKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.submittedKnos) || 0;
6555
+ downloadSupervisorPDF({
6556
+ rows: rowsWithStats,
6557
+ supervisorName: fullName,
6558
+ vendorName,
6559
+ mobileNumber,
6560
+ email,
6561
+ dashboardInfo: {
6562
+ total: totalKnos,
6563
+ completed: completedKnos,
6564
+ pending: totalKnos - completedKnos,
6565
+ submittedCount: completedKnos
6566
+ },
6567
+ t
6568
+ });
6569
+ } catch (err) {
6570
+ console.error("Failed to generate supervisor report:", err);
6571
+ } finally {
6572
+ setReportLoading(false);
6573
+ setShowReportMenu(false);
6574
+ setShowCustomPicker(false);
6575
+ }
6576
+ };
6348
6577
  const handlePresetDownload = filter => {
6349
6578
  handleDownload();
6350
6579
  };
@@ -6400,14 +6629,21 @@ const SupervisorDetailsCard = () => {
6400
6629
  ward: t("WARD") || "Ward",
6401
6630
  pincode: t("PINCODE") || "Pincode",
6402
6631
  mrkey: t("MR_KEY") || "MR Key",
6632
+ consumerType: t("CONSUMER_TYPE") || "Consumer Type",
6403
6633
  createdTime: t("CREATED_TIME") || "Created Time",
6404
6634
  lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
6405
6635
  };
6636
+ const toTitleCase = str => {
6637
+ if (!str) return "";
6638
+ const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
6639
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
6640
+ };
6641
+ const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
6406
6642
  const excelData = consumerList.map(item => {
6407
6643
  const cleanObj = {};
6408
6644
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
6409
6645
  if (fullName) {
6410
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
6646
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
6411
6647
  }
6412
6648
  Object.keys(item).forEach(key => {
6413
6649
  if (excludedKeys.includes(key)) return;
@@ -6416,7 +6652,11 @@ const SupervisorDetailsCard = () => {
6416
6652
  return;
6417
6653
  }
6418
6654
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
6419
- cleanObj[friendlyHeader] = val;
6655
+ if (typeof val === "string" && titleCaseFields.includes(key)) {
6656
+ cleanObj[friendlyHeader] = toTitleCase(val);
6657
+ } else {
6658
+ cleanObj[friendlyHeader] = val;
6659
+ }
6420
6660
  });
6421
6661
  return cleanObj;
6422
6662
  });
@@ -7038,10 +7278,16 @@ const AssignEkycModal = _ref => {
7038
7278
  onChange: e => handleFilterChange("ward", e.target.value)
7039
7279
  }, /*#__PURE__*/React.createElement("option", {
7040
7280
  value: ""
7041
- }, "Select Ward"), wardOptions.map(ward => /*#__PURE__*/React.createElement("option", {
7042
- key: ward.code,
7043
- value: ward.name
7044
- }, ward.name))), /*#__PURE__*/React.createElement("select", {
7281
+ }, "Select Ward"), wardOptions.filter(ward => {
7282
+ const stripped = ward.name.replace(/[0-9]/g, "").replace(/^[-\s]+|[-\s]+$/g, "");
7283
+ return stripped.trim().length > 0;
7284
+ }).map(ward => {
7285
+ const displayName = ward.name.replace(/[0-9]/g, "").replace(/^[-\s]+|[-\s]+$/g, "");
7286
+ return /*#__PURE__*/React.createElement("option", {
7287
+ key: ward.code,
7288
+ value: ward.name
7289
+ }, displayName);
7290
+ })), /*#__PURE__*/React.createElement("select", {
7045
7291
  className: "form-control",
7046
7292
  value: filters.assembly,
7047
7293
  onChange: e => handleFilterChange("assembly", e.target.value)
@@ -7098,7 +7344,7 @@ const AssignEkycModal = _ref => {
7098
7344
  };
7099
7345
 
7100
7346
  const SurveyorDetailsDashboard = () => {
7101
- var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$owner8, _surveyor$owner9, _surveyor$owner0, _surveyor$additionalD, _dashboardData$dashbo5, _dashboardData$dashbo6;
7347
+ var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$owner8, _surveyor$owner9, _surveyor$owner0, _dashboardData$dashbo5, _dashboardData$dashbo6;
7102
7348
  const tenantId = Digit.ULBService.getCurrentTenantId();
7103
7349
  const _useState = useState(false),
7104
7350
  showModal = _useState[0],
@@ -7202,16 +7448,22 @@ const SurveyorDetailsDashboard = () => {
7202
7448
  _Digit$Hooks$ekyc$use2 = _Digit$Hooks$ekyc$use.data,
7203
7449
  dashboardData = _Digit$Hooks$ekyc$use2 === void 0 ? {} : _Digit$Hooks$ekyc$use2,
7204
7450
  refetchDashboard = _Digit$Hooks$ekyc$use.refetch;
7451
+ const toTitleCase = str => {
7452
+ if (!str) return "";
7453
+ const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
7454
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
7455
+ };
7205
7456
  const knoColumns = useMemo(() => [{
7206
7457
  Header: t("KNO") || "KNO",
7207
7458
  accessor: "kno"
7208
7459
  }, {
7209
7460
  Header: t("CONSUMER_NAME") || "Consumer Name",
7210
- accessor: row => ((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim(),
7461
+ accessor: row => toTitleCase(((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim()),
7211
7462
  id: "consumerName"
7212
7463
  }, {
7213
7464
  Header: t("ZONE") || "Zone",
7214
- accessor: "zoneName"
7465
+ accessor: row => toTitleCase(row.zoneName),
7466
+ id: "zoneName"
7215
7467
  }, {
7216
7468
  Header: t("EKYC_STATUS") || "eKYC Status",
7217
7469
  accessor: "ekycStatus",
@@ -7220,7 +7472,7 @@ const SurveyorDetailsDashboard = () => {
7220
7472
  const status = (value || "NA").toUpperCase();
7221
7473
  return value ? /*#__PURE__*/React.createElement("span", {
7222
7474
  className: "ekyc-status-tag " + status
7223
- }, t(status)) : "-";
7475
+ }, toTitleCase(value)) : "-";
7224
7476
  }
7225
7477
  }, {
7226
7478
  Header: t("SUBMITTED_AT") || "Submitted At",
@@ -7459,6 +7711,7 @@ const SurveyorDetailsDashboard = () => {
7459
7711
  ward: t("WARD") || "Ward",
7460
7712
  pincode: t("PINCODE") || "Pincode",
7461
7713
  mrkey: t("MR_KEY") || "MR Key",
7714
+ consumerType: t("CONSUMER_TYPE") || "Consumer Type",
7462
7715
  createdTime: t("CREATED_TIME") || "Created Time",
7463
7716
  lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
7464
7717
  };
@@ -7466,8 +7719,9 @@ const SurveyorDetailsDashboard = () => {
7466
7719
  const cleanObj = {};
7467
7720
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
7468
7721
  if (fullName) {
7469
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
7722
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
7470
7723
  }
7724
+ const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
7471
7725
  Object.keys(item).forEach(key => {
7472
7726
  if (excludedKeys.includes(key)) return;
7473
7727
  const val = item[key];
@@ -7475,7 +7729,11 @@ const SurveyorDetailsDashboard = () => {
7475
7729
  return;
7476
7730
  }
7477
7731
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
7478
- cleanObj[friendlyHeader] = val;
7732
+ if (typeof val === "string" && titleCaseFields.includes(key)) {
7733
+ cleanObj[friendlyHeader] = toTitleCase(val);
7734
+ } else {
7735
+ cleanObj[friendlyHeader] = val;
7736
+ }
7479
7737
  });
7480
7738
  return cleanObj;
7481
7739
  });
@@ -7639,12 +7897,6 @@ const SurveyorDetailsDashboard = () => {
7639
7897
  className: "detail-item"
7640
7898
  }, /*#__PURE__*/React.createElement("span", {
7641
7899
  className: "label"
7642
- }, t("SERVICE_TYPE")), /*#__PURE__*/React.createElement("span", {
7643
- className: "value"
7644
- }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$additionalD = surveyor.additionalDetails) === null || _surveyor$additionalD === void 0 ? void 0 : _surveyor$additionalD.serviceType) || "N/A")), /*#__PURE__*/React.createElement("div", {
7645
- className: "detail-item"
7646
- }, /*#__PURE__*/React.createElement("span", {
7647
- className: "label"
7648
7900
  }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React.createElement("span", {
7649
7901
  className: "value"
7650
7902
  }, vendorName)), /*#__PURE__*/React.createElement("div", {
@@ -9120,74 +9372,6 @@ const MeterDetails = _ref => {
9120
9372
  }));
9121
9373
  };
9122
9374
 
9123
- const Home = () => {
9124
- var _Digit$SessionStorage, _Digit$SessionStorage2;
9125
- const _useTranslation = useTranslation(),
9126
- t = _useTranslation.t;
9127
- const propsForModuleCard = {
9128
- moduleName: t("ACTION_TEST_EKYC"),
9129
- kpis: [{
9130
- count: "-",
9131
- label: t("TOTAL_EKYC"),
9132
- link: "/digit-ui/citizen/ekyc/dashboard"
9133
- }],
9134
- links: []
9135
- };
9136
- const citizenInfo = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : _Digit$SessionStorage2.roles;
9137
- const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code) : [];
9138
- if (roles.includes("EKYC_SURVEYOR")) {
9139
- propsForModuleCard.links.push({
9140
- label: t("SURVEYOR_DASHBOARD"),
9141
- link: "/digit-ui/citizen/ekyc/surveyor-dashboard"
9142
- });
9143
- }
9144
- if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
9145
- propsForModuleCard.links.push({
9146
- label: t("EKYC_INBOX"),
9147
- link: "/digit-ui/citizen/ekyc/inbox"
9148
- });
9149
- }
9150
- if (roles.includes("EKYC_SUPERVISOR")) {
9151
- propsForModuleCard.links.push({
9152
- label: t("EKYC_SUPERVISOR_DASHBOARD"),
9153
- link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
9154
- }, {
9155
- label: t("EKYC_ASSIGN"),
9156
- link: "/digit-ui/citizen/ekyc/assign"
9157
- });
9158
- }
9159
- if (roles.includes("EKYC_VENDOR")) {
9160
- propsForModuleCard.links.push({
9161
- label: t("EKYC_VENDOR_DASHBOARD"),
9162
- link: "/digit-ui/citizen/ekyc/vendor-dashboard"
9163
- });
9164
- }
9165
- if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
9166
- propsForModuleCard.links.push({
9167
- label: t("TITLE_VENDOR_MANAGEMENT"),
9168
- link: "/digit-ui/citizen/vendor/search-vendor"
9169
- });
9170
- }
9171
- if (roles.length === 1 && roles.includes("CITIZEN")) {
9172
- propsForModuleCard.links.push({
9173
- label: t("EKYC_STATUS"),
9174
- link: "/digit-ui/citizen/ekyc/:id"
9175
- });
9176
- }
9177
- const formattedLinks = propsForModuleCard.links.map(l => ({
9178
- i18nKey: l.label,
9179
- link: l.link,
9180
- count: l.count
9181
- }));
9182
- return /*#__PURE__*/React.createElement(CitizenHomeCard, {
9183
- header: t("EKYC_MODULE_NAME"),
9184
- links: formattedLinks,
9185
- Icon: () => /*#__PURE__*/React.createElement(DocumentIcon, {
9186
- className: "fill-path-primary-main"
9187
- })
9188
- });
9189
- };
9190
-
9191
9375
  const Inbox$1 = _ref => {
9192
9376
  var _formState$tableForm3, _formState$tableForm4, _formState$searchForm3, _formState$searchForm4, _dashboardData$dashbo;
9193
9377
  let parentRoute = _ref.parentRoute;
@@ -9448,7 +9632,9 @@ const Inbox$1 = _ref => {
9448
9632
  }, propsForSearchForm, propsForMobileSortForm, {
9449
9633
  propsForInboxTable,
9450
9634
  propsForInboxMobileCards,
9451
- formState
9635
+ formState,
9636
+ forceTable: true,
9637
+ showSearchOnMobile: true
9452
9638
  })));
9453
9639
  };
9454
9640
 
@@ -9661,7 +9847,8 @@ const EkycStatus = () => {
9661
9847
  }, propsForSearchForm, {
9662
9848
  propsForInboxTable,
9663
9849
  propsForInboxMobileCards,
9664
- formState
9850
+ formState,
9851
+ showSearchOnMobile: true
9665
9852
  })))), errorMsg && /*#__PURE__*/React.createElement("div", {
9666
9853
  className: "ekyc-status-error-msg"
9667
9854
  }, errorMsg), isLoading && /*#__PURE__*/React.createElement(Loader, null), !isLoading && details && /*#__PURE__*/React.createElement(Card, {
@@ -9709,10 +9896,7 @@ const CitizenApp = () => {
9709
9896
  const location = useLocation();
9710
9897
  const _useRouteMatch = useRouteMatch(),
9711
9898
  path = _useRouteMatch.path;
9712
- const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData(),
9713
- _Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data,
9714
- _Digit$Hooks$useStore3 = _Digit$Hooks$useStore2 === void 0 ? {} : _Digit$Hooks$useStore2,
9715
- stateInfo = _Digit$Hooks$useStore3.stateInfo;
9899
+ const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData();
9716
9900
  sessionStorage.removeItem("revalidateddone");
9717
9901
  const getDynamicBreadcrumbs = () => {
9718
9902
  const pathname = location.pathname;
@@ -9791,44 +9975,23 @@ const CitizenApp = () => {
9791
9975
  }
9792
9976
  return crumbs;
9793
9977
  };
9794
- const isEkycHome = location.pathname === "/digit-ui/citizen/ekyc" || location.pathname === "/digit-ui/citizen/ekyc/";
9795
- if (isEkycHome) {
9796
- const isMobile = window.Digit.Utils.browser.isMobile();
9797
- return (
9798
- /*#__PURE__*/
9799
- React.createElement("div", {
9800
- className: "moduleLinkHomePage"
9801
- }, /*#__PURE__*/React.createElement("div", {
9802
- style: {
9803
- position: "relative"
9804
- }
9805
- }, /*#__PURE__*/React.createElement("img", {
9806
- src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl,
9807
- alt: "noimagefound"
9808
- }), /*#__PURE__*/React.createElement(BackButton, {
9809
- className: "moduleLinkHomePageBackButton"
9810
- }), /*#__PURE__*/React.createElement("div", {
9811
- className: "moduleTitle"
9812
- }, isMobile ? /*#__PURE__*/React.createElement("h4", null, t("MODULE_EKYC")) : /*#__PURE__*/React.createElement("h1", null, t("MODULE_EKYC")))), /*#__PURE__*/React.createElement("div", {
9813
- className: "moduleLinkHomePageModuleLinks"
9814
- }, /*#__PURE__*/React.createElement(Home, null)))
9815
- );
9816
- }
9817
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
9818
- className: "ground-container form-container"
9978
+ return /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement("div", {
9979
+ className: "ground-container form-container",
9980
+ style: {
9981
+ flex: 1
9982
+ }
9819
9983
  }, /*#__PURE__*/React.createElement(ModuleHeader, {
9820
9984
  leftContent: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArrowLeft, {
9821
9985
  className: "icon"
9822
9986
  }), t("CS_COMMON_BACK")),
9823
9987
  onLeftClick: () => window.history.back(),
9824
9988
  breadcrumbs: getDynamicBreadcrumbs()
9825
- }), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
9989
+ }), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
9826
9990
  exact: true,
9827
- path: "" + path,
9828
- component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
9829
- layoutClass: "normal"
9830
- }, /*#__PURE__*/React.createElement(Home, null))
9831
- }), /*#__PURE__*/React.createElement(PrivateRoute, {
9991
+ path: "" + path
9992
+ }, /*#__PURE__*/React.createElement(Redirect, {
9993
+ to: "/digit-ui/citizen/ekyc-home"
9994
+ })), /*#__PURE__*/React.createElement(PrivateRoute, {
9832
9995
  path: [path + "/vendor-dashboard/:vendorId", path + "/vendor-dashboard"],
9833
9996
  component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
9834
9997
  layoutClass: "normal"
@@ -9934,19 +10097,61 @@ const EkycModule = _ref => {
9934
10097
  } else return /*#__PURE__*/React.createElement(CitizenApp, null);
9935
10098
  };
9936
10099
  const EkycLinks = _ref2 => {
9937
- let matchPath = _ref2.matchPath;
10100
+ var _Digit$SessionStorage, _Digit$SessionStorage2;
9938
10101
  const _useTranslation = useTranslation(),
9939
10102
  t = _useTranslation.t;
9940
- const links = [{
9941
- link: matchPath + "/create-kyc",
9942
- i18nKey: t("EKYC_CREATE_KYC")
9943
- }, {
9944
- link: matchPath + "/update-kyc",
9945
- i18nKey: t("EKYC_UPDATE_KYC")
9946
- }];
10103
+ const propsForModuleCard = {
10104
+ links: []
10105
+ };
10106
+ const citizenInfo = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : _Digit$SessionStorage2.roles;
10107
+ const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code) : [];
10108
+ if (roles.includes("EKYC_SURVEYOR")) {
10109
+ propsForModuleCard.links.push({
10110
+ label: t("SURVEYOR_DASHBOARD"),
10111
+ link: "/digit-ui/citizen/ekyc/surveyor-dashboard"
10112
+ });
10113
+ }
10114
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
10115
+ propsForModuleCard.links.push({
10116
+ label: t("EKYC_INBOX"),
10117
+ link: "/digit-ui/citizen/ekyc/inbox"
10118
+ });
10119
+ }
10120
+ if (roles.includes("EKYC_SUPERVISOR")) {
10121
+ propsForModuleCard.links.push({
10122
+ label: t("EKYC_SUPERVISOR_DASHBOARD"),
10123
+ link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
10124
+ }, {
10125
+ label: t("EKYC_ASSIGN"),
10126
+ link: "/digit-ui/citizen/ekyc/assign"
10127
+ });
10128
+ }
10129
+ if (roles.includes("EKYC_VENDOR")) {
10130
+ propsForModuleCard.links.push({
10131
+ label: t("EKYC_VENDOR_DASHBOARD"),
10132
+ link: "/digit-ui/citizen/ekyc/vendor-dashboard"
10133
+ });
10134
+ }
10135
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
10136
+ propsForModuleCard.links.push({
10137
+ label: t("TITLE_VENDOR_MANAGEMENT"),
10138
+ link: "/digit-ui/citizen/vendor/search-vendor"
10139
+ });
10140
+ }
10141
+ if (roles.length === 1 && roles.includes("CITIZEN")) {
10142
+ propsForModuleCard.links.push({
10143
+ label: t("EKYC_STATUS"),
10144
+ link: "/digit-ui/citizen/ekyc/:id"
10145
+ });
10146
+ }
10147
+ const formattedLinks = propsForModuleCard.links.map(l => ({
10148
+ i18nKey: l.label,
10149
+ link: l.link,
10150
+ count: l.count
10151
+ }));
9947
10152
  return /*#__PURE__*/React.createElement(CitizenHomeCard, {
9948
10153
  header: t("EKYC_MODULE_NAME"),
9949
- links: links,
10154
+ links: formattedLinks,
9950
10155
  Icon: () => /*#__PURE__*/React.createElement(DocumentIcon, {
9951
10156
  className: "fill-path-primary-main"
9952
10157
  })