@djb25/digit-ui-module-ekyc 1.0.67 → 1.0.68

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 CHANGED
@@ -477,17 +477,13 @@ const StatusCards = _ref => {
477
477
  label: t("EKYC_TOTAL"),
478
478
  value: (countData === null || countData === void 0 ? void 0 : countData.total) || 0
479
479
  }, {
480
- color: "#4C8BF5",
481
- label: t("EKYC_ASSIGNED"),
482
- value: (countData === null || countData === void 0 ? void 0 : countData.totalAssignments) || 0
480
+ color: "#0c2a52",
481
+ label: t("EKYC_PENDING"),
482
+ value: (countData === null || countData === void 0 ? void 0 : countData.pending) || 0
483
483
  }, {
484
484
  color: "#2E8B57",
485
485
  label: t("EKYC_COMPLETED"),
486
486
  value: (countData === null || countData === void 0 ? void 0 : countData.completed) || 0
487
- }, {
488
- color: "#0c2a52",
489
- label: t("EKYC_PENDING"),
490
- value: (countData === null || countData === void 0 ? void 0 : countData.pending) || 0
491
487
  }, {
492
488
  color: "#8B5CF6",
493
489
  label: t("EKYC_SUBMITTED_BY_VENDORS"),
@@ -641,8 +637,8 @@ const Dashboard = () => {
641
637
  const countData = React.useMemo(() => {
642
638
  return {
643
639
  total: (progressData === null || progressData === void 0 ? void 0 : progressData.totalKnosInSystem) || 0,
644
- completed: (progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnos) + (progressData === null || progressData === void 0 ? void 0 : progressData.selfEkycCount) || 0,
645
- pending: (progressData === null || progressData === void 0 ? void 0 : progressData.pendingKnos) || 0,
640
+ completed: (progressData === null || progressData === void 0 ? void 0 : progressData.completedKnosInZones) || 0,
641
+ pending: (progressData === null || progressData === void 0 ? void 0 : progressData.pendingKnosInZones) || 0,
646
642
  rejected: (progressData === null || progressData === void 0 ? void 0 : progressData.rejectedKnos) || 0,
647
643
  totalAssignments: (progressData === null || progressData === void 0 ? void 0 : progressData.totalAssignments) || 0,
648
644
  submittedCount: (progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnos) || 0,
@@ -1222,7 +1218,6 @@ const downloadSupervisorPDF = function (_ref2) {
1222
1218
  mobileNo: row.status || "N/A",
1223
1219
  zoneName: String(row.total || 0),
1224
1220
  ekycStatus: (row.completed || 0) + " / " + (row.pending || 0),
1225
- submittedAt: 1717171717171,
1226
1221
  progress: row.progress || "0%"
1227
1222
  };
1228
1223
  });
@@ -1320,7 +1315,7 @@ const downloadVendorPDF = function (_ref3) {
1320
1315
  title: t("TOTAL_ASSIGNED") || "Total Assigned",
1321
1316
  value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
1322
1317
  }, {
1323
- title: t("COMPLETED") || "Completed",
1318
+ title: t("TOTAL_EKYC_APPLICATIONS") || "Completed",
1324
1319
  value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
1325
1320
  }, {
1326
1321
  title: t("PENDING") || "Pending",
@@ -1337,7 +1332,6 @@ const downloadVendorPDF = function (_ref3) {
1337
1332
  mobileNo: row.status || "N/A",
1338
1333
  zoneName: String(row.total || 0),
1339
1334
  ekycStatus: (row.completed || 0) + " / " + (row.pending || 0),
1340
- submittedAt: 1717171717171,
1341
1335
  progress: row.progress || "0%"
1342
1336
  }));
1343
1337
  const originalToLocaleDateString = Date.prototype.toLocaleDateString;
@@ -1356,7 +1350,6 @@ const downloadVendorPDF = function (_ref3) {
1356
1350
  if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
1357
1351
  if (key === "MOBILE") return t("STATUS") || "Status";
1358
1352
  if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
1359
- if (key === "EKYC_STATUS") return t("COMPLETED_PENDING") || "Completed / Pending";
1360
1353
  if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
1361
1354
  if (key === "CONSUMER_LIST") return t("CONNECTED_SUPERVISORS") || "Connected Supervisors";
1362
1355
  return t(key);
@@ -1390,7 +1383,7 @@ const downloadVendorPDF = function (_ref3) {
1390
1383
  };
1391
1384
 
1392
1385
  const VendorDetailsCard = () => {
1393
- var _vendor$owner, _vendor$owner2, _vendorName$charAt;
1386
+ var _vendor$owner, _vendor$owner2, _vendorName$charAt, _progressData$supervi;
1394
1387
  const _useTranslation = reactI18next.useTranslation(),
1395
1388
  t = _useTranslation.t;
1396
1389
  const history = reactRouterDom.useHistory();
@@ -1414,14 +1407,6 @@ const VendorDetailsCard = () => {
1414
1407
  _Digit$Hooks$fsm$useV5 = _Digit$Hooks$fsm$useV4 === void 0 ? [] : _Digit$Hooks$fsm$useV4,
1415
1408
  vendor = _Digit$Hooks$fsm$useV5[0],
1416
1409
  isVendorSearchLoading = _Digit$Hooks$fsm$useV.isLoading;
1417
- const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorSearch(tenantId, {
1418
- status: "ACTIVE"
1419
- }, {
1420
- enabled: !!tenantId,
1421
- staleTime: 300000
1422
- }),
1423
- supervisorSearchResponse = _Digit$Hooks$fsm$useS.data,
1424
- isSupervisorSearchLoading = _Digit$Hooks$fsm$useS.isLoading;
1425
1410
  const targetVendorId = vendorId || (vendor === null || vendor === void 0 ? void 0 : vendor.id) || (vendor === null || vendor === void 0 ? void 0 : vendor.vendorId);
1426
1411
  const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress(targetVendorId ? {
1427
1412
  vendorId: targetVendorId
@@ -1431,50 +1416,6 @@ const VendorDetailsCard = () => {
1431
1416
  }),
1432
1417
  isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
1433
1418
  progressData = _Digit$Hooks$ekyc$use.data;
1434
- const createDummySupervisors = vendor => {
1435
- const count = Number(vendor === null || vendor === void 0 ? void 0 : vendor.supervisors) || 5;
1436
- return Array.from({
1437
- length: count
1438
- }, (_, i) => ({
1439
- id: "SUP_V_" + ((vendor === null || vendor === void 0 ? void 0 : vendor.id) || "DEFAULT") + "_" + (i + 1),
1440
- name: "Supervisor " + (i + 1),
1441
- mobileNo: "99999120" + i,
1442
- status: "ACTIVE",
1443
- totalKnos: 0,
1444
- submittedKnos: 0,
1445
- pendingKnos: 0,
1446
- progressPercent: 0,
1447
- isDummy: true
1448
- }));
1449
- };
1450
- const vendorSupervisors = React.useMemo(() => {
1451
- const currentVendorId = (vendor === null || vendor === void 0 ? void 0 : vendor.id) || (vendor === null || vendor === void 0 ? void 0 : vendor.vendorId) || vendorId;
1452
- if (!Array.isArray(supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : supervisorSearchResponse.supervisors)) {
1453
- return vendor ? createDummySupervisors(vendor) : [];
1454
- }
1455
- const matchedSups = supervisorSearchResponse.supervisors.filter(s => s.vendorId === currentVendorId || s.vendorId === (vendor === null || vendor === void 0 ? void 0 : vendor.id) || s.vendorId === (vendor === null || vendor === void 0 ? void 0 : vendor.vendorId));
1456
- if (matchedSups.length === 0) {
1457
- return [];
1458
- }
1459
- return matchedSups.map(sup => {
1460
- var _progressData$supervi, _sup$owner2, _sup$owner3, _sup$owner4;
1461
- const report = progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.find(r => {
1462
- var _sup$owner;
1463
- return r.supervisorId === sup.id || r.supervisorId === ((_sup$owner = sup.owner) === null || _sup$owner === void 0 ? void 0 : _sup$owner.uuid);
1464
- });
1465
- return {
1466
- id: sup.id || ((_sup$owner2 = sup.owner) === null || _sup$owner2 === void 0 ? void 0 : _sup$owner2.uuid),
1467
- name: sup.name || ((_sup$owner3 = sup.owner) === null || _sup$owner3 === void 0 ? void 0 : _sup$owner3.name) || "N/A",
1468
- mobileNo: ((_sup$owner4 = sup.owner) === null || _sup$owner4 === void 0 ? void 0 : _sup$owner4.mobileNumber) || sup.mobileNo || "N/A",
1469
- status: sup.status || "ACTIVE",
1470
- totalKnos: (report === null || report === void 0 ? void 0 : report.totalKnos) || 0,
1471
- submittedKnos: (report === null || report === void 0 ? void 0 : report.submittedKnos) || 0,
1472
- pendingKnos: (report === null || report === void 0 ? void 0 : report.pendingKnos) || 0,
1473
- progressPercent: (report === null || report === void 0 ? void 0 : report.progressPercent) || 0,
1474
- isDummy: false
1475
- };
1476
- });
1477
- }, [supervisorSearchResponse, vendor, progressData, vendorId]);
1478
1419
  const vendorName = (vendor === null || vendor === void 0 ? void 0 : vendor.name) || "N/A";
1479
1420
  const mobileNumber = (vendor === null || vendor === void 0 ? void 0 : vendor.mobileNumber) || (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner = vendor.owner) === null || _vendor$owner === void 0 ? void 0 : _vendor$owner.mobileNumber) || "N/A";
1480
1421
  const email = (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner2 = vendor.owner) === null || _vendor$owner2 === void 0 ? void 0 : _vendor$owner2.emailId) || "N/A";
@@ -1485,10 +1426,9 @@ const VendorDetailsCard = () => {
1485
1426
  const cards = React.useMemo(() => {
1486
1427
  const totalKnos = (progressData === null || progressData === void 0 ? void 0 : progressData.totalKnosInZones) || 0;
1487
1428
  const totalAssignments = (progressData === null || progressData === void 0 ? void 0 : progressData.totalKnos) || 0;
1488
- const completedKnos = (progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnos) || 0;
1489
1429
  const selfEkycCount = (progressData === null || progressData === void 0 ? void 0 : progressData.selfEkycCountInZones) || 0;
1490
1430
  const submittedKnos = (progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnosInZones) || 0;
1491
- const pendingKnos = (progressData === null || progressData === void 0 ? void 0 : progressData.pendingKnos) || 0;
1431
+ const pendingKnos = (progressData === null || progressData === void 0 ? void 0 : progressData.pendingKnosInZones) || 0;
1492
1432
  const progressPercent = (progressData === null || progressData === void 0 ? void 0 : progressData.overallProgressPercent) || 0;
1493
1433
  return [{
1494
1434
  label: "TOTAL_KNOS",
@@ -1502,12 +1442,6 @@ const VendorDetailsCard = () => {
1502
1442
  color: "#0B2559",
1503
1443
  type: "today",
1504
1444
  icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.FaFileAlt, null)
1505
- }, {
1506
- label: "EKYC_COMPLETED",
1507
- count: completedKnos,
1508
- color: "#10B981",
1509
- type: "month",
1510
- icon: /*#__PURE__*/React__default.createElement(fa.FaCheckCircle, null)
1511
1445
  }, {
1512
1446
  label: "EKYC_SUBMITTED_BY_VENDORS",
1513
1447
  count: submittedKnos,
@@ -1533,7 +1467,7 @@ const VendorDetailsCard = () => {
1533
1467
  type: "progress",
1534
1468
  icon: /*#__PURE__*/React__default.createElement(fa.FaChartLine, null)
1535
1469
  }];
1536
- }, [vendorSupervisors, vendor, progressData]);
1470
+ }, [vendor, progressData]);
1537
1471
  const _useState = React.useState(0),
1538
1472
  currentPage = _useState[0],
1539
1473
  setCurrentPage = _useState[1];
@@ -1758,19 +1692,17 @@ const VendorDetailsCard = () => {
1758
1692
  }
1759
1693
  return null;
1760
1694
  };
1761
- const paginatedSupervisors = React.useMemo(() => {
1762
- const start = currentPage * pageSize;
1763
- const end = start + pageSize;
1764
- return vendorSupervisors.slice(start, end);
1765
- }, [vendorSupervisors, currentPage, pageSize]);
1766
1695
  const supervisorColumns = React.useMemo(() => [{
1767
1696
  Header: t("SUPERVISOR_NAME") || "Supervisor Name",
1768
- accessor: row => (row === null || row === void 0 ? void 0 : row.name) || "N/A",
1697
+ accessor: row => {
1698
+ var _row$original;
1699
+ return (row === null || row === void 0 ? void 0 : (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.supervisorName) || "N/A";
1700
+ },
1769
1701
  Cell: _ref => {
1770
- var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _row$original;
1702
+ var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _row$original2, _row$original3;
1771
1703
  let row = _ref.row;
1772
1704
  const userType = ((_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.type) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.toLowerCase()) || "citizen";
1773
- const targetPath = "/digit-ui/" + userType + "/ekyc/supervisor-dashboard/" + row.original.id;
1705
+ const targetPath = "/digit-ui/" + userType + "/ekyc/supervisor-dashboard/" + (row === null || row === void 0 ? void 0 : (_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.supervisorId);
1774
1706
  return /*#__PURE__*/React__default.createElement("a", {
1775
1707
  href: targetPath,
1776
1708
  style: {
@@ -1782,12 +1714,12 @@ const VendorDetailsCard = () => {
1782
1714
  e.preventDefault();
1783
1715
  history.push(targetPath);
1784
1716
  }
1785
- }, ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.name) || "N/A");
1717
+ }, (row === null || row === void 0 ? void 0 : (_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.supervisorName) || "N/A");
1786
1718
  }
1787
1719
  }, {
1788
1720
  Header: t("MOBILE_NUMBER") || "Mobile Number",
1789
1721
  accessor: row => (row === null || row === void 0 ? void 0 : row.mobileNo) || "N/A",
1790
- id: "mobileNumber"
1722
+ id: "mobileNo"
1791
1723
  }, {
1792
1724
  Header: t("STATUS") || "Status",
1793
1725
  accessor: row => (row === null || row === void 0 ? void 0 : row.status) || "ACTIVE",
@@ -1812,7 +1744,7 @@ const VendorDetailsCard = () => {
1812
1744
  id: "pendingApplications"
1813
1745
  }, {
1814
1746
  Header: t("OVERALL_PROGRESS") || "Overall Progress",
1815
- accessor: row => (row !== null && row !== void 0 && row.progressPercent || (row === null || row === void 0 ? void 0 : row.progressPercent) === 0 ? row.progressPercent : row.progress) + "%",
1747
+ accessor: row => ((row === null || row === void 0 ? void 0 : row.progressPercent) || 0) + "%",
1816
1748
  id: "overallProgress"
1817
1749
  }], [t, history]);
1818
1750
  const _useState4 = React.useState(false),
@@ -1844,27 +1776,24 @@ const VendorDetailsCard = () => {
1844
1776
  const handleDownload = () => {
1845
1777
  setReportLoading(true);
1846
1778
  try {
1847
- const rowsWithStats = vendorSupervisors.map(s => ({
1848
- name: s.name,
1779
+ const rowsWithStats = progressData === null || progressData === void 0 ? void 0 : progressData.supervisorReport.map(s => ({
1780
+ name: s.supervisorName,
1849
1781
  mobileNo: s.mobileNo,
1850
- status: s.status,
1851
1782
  total: s.totalKnos,
1852
1783
  completed: s.submittedKnos,
1853
1784
  pending: s.pendingKnos,
1854
- progress: s.progressPercent + "%"
1785
+ progress: (s.progressPercent || 0) + "%"
1855
1786
  }));
1856
- const totalKnos = vendorSupervisors.reduce((acc, s) => acc + (s.totalKnos || 0), 0) || (vendor === null || vendor === void 0 ? void 0 : vendor.assignedConnections) || 0;
1857
- const completedKnos = vendorSupervisors.reduce((acc, s) => acc + (s.submittedKnos || 0), 0) || (vendor === null || vendor === void 0 ? void 0 : vendor.completedEkyc) || 0;
1858
1787
  downloadVendorPDF({
1859
1788
  rows: rowsWithStats,
1860
1789
  vendorName,
1861
1790
  mobileNumber,
1862
1791
  email,
1863
1792
  dashboardInfo: {
1864
- total: totalKnos,
1865
- completed: completedKnos,
1866
- pending: totalKnos - completedKnos,
1867
- submittedCount: completedKnos
1793
+ total: progressData === null || progressData === void 0 ? void 0 : progressData.totalKnosInZones,
1794
+ completed: (progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnosInZones) + (progressData === null || progressData === void 0 ? void 0 : progressData.selfEkycCountInZones),
1795
+ pending: progressData === null || progressData === void 0 ? void 0 : progressData.pendingKnosInZones,
1796
+ submittedCount: progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnosInZones
1868
1797
  },
1869
1798
  t
1870
1799
  });
@@ -1922,7 +1851,7 @@ const VendorDetailsCard = () => {
1922
1851
  className: "stat-icon"
1923
1852
  }, icon)));
1924
1853
  };
1925
- const isPageLoading = isProgressLoading || isVendorSearchLoading || isSupervisorSearchLoading;
1854
+ const isPageLoading = isProgressLoading || isVendorSearchLoading;
1926
1855
  if (isPageLoading && !vendor) {
1927
1856
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
1928
1857
  }
@@ -2073,15 +2002,16 @@ const VendorDetailsCard = () => {
2073
2002
  tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
2074
2003
  tableClass: "ekycTable",
2075
2004
  isTableScrollable: true,
2076
- data: paginatedSupervisors,
2005
+ data: progressData === null || progressData === void 0 ? void 0 : progressData.supervisorReport,
2077
2006
  columns: supervisorColumns,
2078
- isLoading: isPageLoading,
2079
- totalRecords: vendorSupervisors.length,
2007
+ isLoading: isProgressLoading,
2008
+ totalRecords: progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.length,
2080
2009
  currentPage: currentPage,
2081
2010
  pageSizeLimit: pageSize,
2082
2011
  isPaginationRequired: true,
2083
2012
  onNextPage: () => {
2084
- if (currentPage < Math.ceil(vendorSupervisors.length / pageSize) - 1) {
2013
+ var _progressData$supervi2;
2014
+ if (currentPage < Math.ceil((progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi2 = progressData.supervisorReport) === null || _progressData$supervi2 === void 0 ? void 0 : _progressData$supervi2.length) / pageSize) - 1) {
2085
2015
  setCurrentPage(prev => prev + 1);
2086
2016
  }
2087
2017
  },
@@ -2091,7 +2021,10 @@ const VendorDetailsCard = () => {
2091
2021
  }
2092
2022
  },
2093
2023
  onFirstPage: () => setCurrentPage(0),
2094
- onLastPage: () => setCurrentPage(Math.max(Math.ceil(vendorSupervisors.length / pageSize) - 1, 0)),
2024
+ onLastPage: () => {
2025
+ var _progressData$supervi3;
2026
+ return setCurrentPage(Math.max(Math.ceil((progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi3 = progressData.supervisorReport) === null || _progressData$supervi3 === void 0 ? void 0 : _progressData$supervi3.length) / pageSize) - 1, 0));
2027
+ },
2095
2028
  onPageSizeChange: e => {
2096
2029
  setPageSize(Number(e.target.value));
2097
2030
  setCurrentPage(0);
@@ -4883,21 +4816,21 @@ const AdminDashboard = () => {
4883
4816
  className: "stat-value"
4884
4817
  }, vendor.totalKnos), /*#__PURE__*/React__default.createElement("span", {
4885
4818
  className: "stat-label"
4886
- }, t("TOTAL_KNOS") || "Total KNOs"))), /*#__PURE__*/React__default.createElement("div", {
4819
+ }, t("TOTAL_EKYC_APPLICATIONS") || "Total KNOs"))), /*#__PURE__*/React__default.createElement("div", {
4887
4820
  className: "knos-summary"
4888
4821
  }, /*#__PURE__*/React__default.createElement("div", {
4889
4822
  className: "kno-stat"
4890
4823
  }, /*#__PURE__*/React__default.createElement("span", {
4891
4824
  className: "kno-label"
4892
- }, t("SUBMITTED") || "Submitted"), /*#__PURE__*/React__default.createElement("strong", null, vendor.submittedKnos)), /*#__PURE__*/React__default.createElement("div", {
4825
+ }, t("SUBMITTED") || "Submitted"), /*#__PURE__*/React__default.createElement("strong", null, vendor.submittedKnosInZones)), /*#__PURE__*/React__default.createElement("div", {
4893
4826
  className: "kno-stat pending"
4894
4827
  }, /*#__PURE__*/React__default.createElement("span", {
4895
4828
  className: "kno-label"
4896
- }, t("PENDING") || "Pending"), /*#__PURE__*/React__default.createElement("strong", null, vendor.pendingKnos)), /*#__PURE__*/React__default.createElement("div", {
4829
+ }, t("PENDING") || "Pending"), /*#__PURE__*/React__default.createElement("strong", null, vendor.pendingKnosInZones)), /*#__PURE__*/React__default.createElement("div", {
4897
4830
  className: "kno-stat rejected"
4898
4831
  }, /*#__PURE__*/React__default.createElement("span", {
4899
4832
  className: "kno-label"
4900
- }, t("REJECTED") || "Rejected"), /*#__PURE__*/React__default.createElement("strong", null, vendor.rejectedKnos))));
4833
+ }, t("EKYC_SUBMITTED_BY_CITIZEN") || "SUBMITTED BY CITIZEN"), /*#__PURE__*/React__default.createElement("strong", null, vendor.selfEkycCountInZones))));
4901
4834
  })))));
4902
4835
  };
4903
4836