@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.
Files changed (63) hide show
  1. package/dist/index.js +8911 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.modern.js +3295 -2039
  4. package/dist/index.modern.js.map +1 -1
  5. package/package.json +4 -1
  6. package/dist/index.css +0 -54
  7. package/src/Module.js +0 -78
  8. package/src/components/AadhaarVerification.js +0 -315
  9. package/src/components/AssignEkyc.js +0 -236
  10. package/src/components/AssignEkycModal.js +0 -446
  11. package/src/components/CeoDashboard.js +0 -264
  12. package/src/components/CeoDashboard.jsx +0 -334
  13. package/src/components/ConnectionDetailsView.js +0 -241
  14. package/src/components/Dashboard.js +0 -43
  15. package/src/components/DesktopInbox.js +0 -176
  16. package/src/components/EKYCCard.js +0 -53
  17. package/src/components/Filter.js +0 -55
  18. package/src/components/MeterDetails.js +0 -336
  19. package/src/components/MobileInbox.js +0 -73
  20. package/src/components/PropertyInfo.js +0 -264
  21. package/src/components/Review.js +0 -696
  22. package/src/components/SearchConsumer.js +0 -142
  23. package/src/components/SearchFormFieldsComponent.js +0 -67
  24. package/src/components/SelectEkycZones.js +0 -71
  25. package/src/components/StatusCards.js +0 -148
  26. package/src/components/SurveyorDetailsCard.js +0 -512
  27. package/src/components/VendorDetails.jsx +0 -230
  28. package/src/components/analytics/charts/ClusterHeatmap.js +0 -88
  29. package/src/components/analytics/charts/ExecutiveBarChart.jsx +0 -30
  30. package/src/components/analytics/charts/ExecutiveLineChart.jsx +0 -159
  31. package/src/components/analytics/charts/ExecutivePieChart.jsx +0 -24
  32. package/src/components/analytics/charts/TaskStatusChart.js +0 -90
  33. package/src/components/analytics/components/AnalyticsTable.js +0 -106
  34. package/src/components/analytics/components/DashboardLayout.js +0 -52
  35. package/src/components/analytics/components/EmptyState.js +0 -27
  36. package/src/components/analytics/components/ErrorBoundary.js +0 -27
  37. package/src/components/analytics/components/FilterBar.js +0 -73
  38. package/src/components/analytics/components/NotificationPanel.js +0 -77
  39. package/src/components/analytics/components/SLAWidget.js +0 -56
  40. package/src/components/analytics/components/SkeletonLoader.js +0 -53
  41. package/src/components/analytics/components/SummaryCard.js +0 -74
  42. package/src/components/analytics/components/WorkflowTimeline.js +0 -55
  43. package/src/components/analytics/utils/exportUtils.js +0 -64
  44. package/src/components/analytics/utils/filterSerializer.js +0 -50
  45. package/src/components/mockData.js +0 -772
  46. package/src/config/AadhaarVerificationConfig.js +0 -367
  47. package/src/config/MeterDetailsConfig.js +0 -297
  48. package/src/config/PropertyInfoConfig.js +0 -145
  49. package/src/config/config.js +0 -70
  50. package/src/hook/SupervisorInboxTableConfig.js +0 -80
  51. package/src/hook/useInboxTableConfig.js +0 -131
  52. package/src/pages/citizen/Home.js +0 -54
  53. package/src/pages/citizen/Inbox.js +0 -265
  54. package/src/pages/citizen/index.js +0 -199
  55. package/src/pages/employee/ConsumerDetails.js +0 -299
  56. package/src/pages/employee/Create.js +0 -94
  57. package/src/pages/employee/EKYCForm.js +0 -118
  58. package/src/pages/employee/Inbox.js +0 -266
  59. package/src/pages/employee/Mapping.js +0 -358
  60. package/src/pages/employee/Update.js +0 -9
  61. package/src/pages/employee/index.js +0 -184
  62. package/src/utils/index.js +0 -46
  63. package/src/utils/reportDownloader.js +0 -90
@@ -1,265 +0,0 @@
1
- import React, { useMemo, useCallback, useReducer } from "react";
2
- import { useLocation } from "react-router-dom";
3
- import { InboxComposer } from "@djb25/digit-ui-react-components";
4
- import useInboxTableConfig from "../../hook/useInboxTableConfig";
5
- import SearchFormFieldsComponents from "../../components/SearchFormFieldsComponent";
6
-
7
- // Mock data removed in favor of API integration
8
-
9
- const Inbox = ({ parentRoute }) => {
10
- const tenantId = Digit.ULBService.getCurrentTenantId();
11
- const location = useLocation();
12
-
13
- const formInitValue = {
14
- filterForm: {},
15
- searchForm: {},
16
- tableForm: {
17
- limit: 10,
18
- offset: 0,
19
- sortBy: "createdTime",
20
- sortOrder: "DESC",
21
- },
22
- };
23
-
24
- const [formState, dispatch] = useReducer(formReducer, formInitValue);
25
-
26
- const queryParams = useMemo(() => {
27
- return {
28
- tenantId,
29
- offset: formState?.tableForm?.offset || 0,
30
- limit: formState?.tableForm?.limit || 10,
31
- search: formState?.searchForm || {},
32
- };
33
- }, [tenantId, formState?.tableForm?.offset, formState?.tableForm?.limit, formState?.searchForm]);
34
-
35
- const filters = useMemo(() => {
36
- const searchForm = formState?.searchForm || {};
37
- return {
38
- ...searchForm,
39
- ...(searchForm.kNumber && { kno: searchForm.kNumber }),
40
- };
41
- }, [formState?.searchForm]);
42
-
43
- const { isLoading, data: dashboardData = {} } = Digit.Hooks.ekyc.useEkycApplicationList(filters, queryParams, {
44
- enabled: !!tenantId,
45
- keepPreviousData: true,
46
- });
47
-
48
- const searchDetails = useMemo(
49
- () => ({
50
- kno: formState?.searchForm?.kNumber || "",
51
- name: formState?.searchForm?.kName || "",
52
- }),
53
- [formState?.searchForm?.kNumber, formState?.searchForm?.kName]
54
- );
55
-
56
- const isSearchActive = !!(searchDetails.kno || searchDetails.name);
57
-
58
- const { isLoading: isSearchLoading, data: searchData } = Digit.Hooks.ekyc.useSearchConnection(
59
- {
60
- tenantId,
61
- details: searchDetails,
62
- },
63
- {
64
- enabled: !!tenantId && !!searchDetails.kno, // 🔥 important
65
- keepPreviousData: true,
66
- }
67
- );
68
-
69
- const sourceData = useMemo(() => {
70
- if (isSearchActive) {
71
- if (!searchData) return [];
72
- return [searchData];
73
- }
74
-
75
- return dashboardData?.consumerList || [];
76
- }, [isSearchActive, searchData, dashboardData]);
77
-
78
- const filteredData = useMemo(() => {
79
- return (sourceData || []).map((item) => {
80
- // ✅ detect search response
81
- const isSearchItem = !!item.connectionDetails;
82
-
83
- if (isSearchItem) {
84
- return {
85
- applicationNo: item.propertyInfo?.kno || "",
86
- connectionNo: item.propertyInfo?.kno || "",
87
- owner: item.connectionDetails?.consumerName || "",
88
- applicationNumber: item.propertyInfo?.kno || "",
89
- citizenName: item.connectionDetails?.consumerName || "",
90
- status: item.connectionDetails?.statusflag || "",
91
- ekycStatus: (item.connectionDetails?.ekycStatus || item.connectionDetails?.ekycstatus || item.ekycStatus || item.ekycstatus || "NA").toUpperCase(),
92
- sla: 0,
93
- };
94
- }
95
-
96
- // ✅ dashboard mapping
97
- return {
98
- ...item,
99
- applicationNo: item.kno || item.applicationNumber || "",
100
- connectionNo: item.connectionNo || "",
101
- owner: item.consumerName || item.citizenName || "",
102
- applicationNumber: item.kno || item.applicationNumber || "",
103
- citizenName: item.consumerName || item.citizenName || "",
104
- status: item.status || "",
105
- ekycStatus: (item.ekycStatus || item.ekycstatus || "NA").toUpperCase(),
106
- sla: item.sla ?? 0,
107
- };
108
- });
109
- }, [sourceData]);
110
-
111
- const totalRecords = dashboardData?.dashboardInfo?.totalRecords || dashboardData?.totalCount || 0;
112
-
113
- const checkPathName = location.pathname.includes("ekyc/inbox");
114
- // const PropsForInboxLinks = {
115
- // headerText: "EKYC_MODULE",
116
- // };
117
-
118
- const SearchFormFields = useCallback(
119
- ({ registerRef, searchFormState, controlSearchForm }) => (
120
- <SearchFormFieldsComponents {...{ registerRef, searchFormState, controlSearchForm }} searchType="kno" className="search" />
121
- ),
122
- []
123
- );
124
-
125
- const tableOrderFormDefaultValues = {
126
- sortBy: "createdTime",
127
- limit: window.Digit.Utils.browser.isMobile() ? 50 : 10,
128
- offset: 0,
129
- sortOrder: "DESC",
130
- };
131
-
132
- const onSearchFormSubmit = (data) => {
133
- data.hasOwnProperty("") && delete data?.[""];
134
- dispatch({ action: "mutateTableForm", data: { ...tableOrderFormDefaultValues }, checkPathName });
135
- dispatch({ action: "mutateSearchForm", data, checkPathName });
136
- };
137
-
138
- const searchFormDefaultValues = {
139
- kNumber: "",
140
- applicationNumber: "",
141
- consumerNo: "",
142
- };
143
-
144
- const onSearchFormReset = (setSearchFormValue) => {
145
- setSearchFormValue("kNumber", null);
146
- setSearchFormValue("applicationNumber", null);
147
- setSearchFormValue("consumerNo", null);
148
- dispatch({ action: "mutateSearchForm", data: searchFormDefaultValues });
149
- };
150
-
151
- const propsForSearchForm = {
152
- SearchFormFields,
153
- onSearchFormSubmit,
154
- searchFormDefaultValues: formState?.searchForm,
155
- resetSearchFormDefaultValues: searchFormDefaultValues,
156
- onSearchFormReset,
157
- className: "search-form-wns-inbox",
158
- };
159
-
160
- // const FilterFormFields = useCallback(
161
- // ({ registerRef, controlFilterForm, setFilterFormValue, getFilterFormValue }) => <React.Fragment></React.Fragment>,
162
- // []
163
- // );
164
-
165
- // const propsForFilterForm = {
166
- // FilterFormFields,
167
- // onFilterFormSubmit: () => { },
168
- // filterFormDefaultValues: "",
169
- // resetFilterFormDefaultValues: "",
170
- // onFilterFormReset: () => { },
171
- // };
172
-
173
- function formReducer(state, payload) {
174
- const storageKey = payload.checkPathName ? "EKYC.INBOX" : "EKYC.SW.INBOX";
175
-
176
- // ✅ safety for SLA
177
- switch (payload.action) {
178
- case "mutateSearchForm":
179
- Digit.SessionStorage.set(storageKey, { ...state, searchForm: payload.data });
180
- return { ...state, searchForm: payload.data };
181
-
182
- case "mutateFilterForm":
183
- Digit.SessionStorage.set(storageKey, { ...state, filterForm: payload.data });
184
- return { ...state, filterForm: payload.data };
185
-
186
- case "mutateTableForm":
187
- Digit.SessionStorage.set(storageKey, { ...state, tableForm: payload.data });
188
- return { ...state, tableForm: payload.data };
189
-
190
- default:
191
- return state; // ✅ IMPORTANT
192
- }
193
- }
194
-
195
- const onPageSizeChange = (e) => {
196
- const newLimit = Number(e.target.value);
197
-
198
- dispatch({
199
- action: "mutateTableForm",
200
- data: {
201
- ...formState.tableForm,
202
- limit: newLimit,
203
- offset: 0, // reset page
204
- },
205
- checkPathName,
206
- });
207
- };
208
-
209
- const onSortingByData = (e) => {
210
- if (e.length > 0) {
211
- const [{ id, desc }] = e;
212
- const sortOrder = desc ? "DESC" : "ASC";
213
- const sortBy = id;
214
-
215
- if (!(formState.tableForm.sortBy === sortBy && formState.tableForm.sortOrder === sortOrder)) {
216
- dispatch({
217
- action: "mutateTableForm",
218
- data: {
219
- ...formState.tableForm,
220
- sortBy: id,
221
- sortOrder: desc ? "DESC" : "ASC",
222
- },
223
- checkPathName,
224
- });
225
- }
226
- }
227
- };
228
-
229
- const propsForInboxTable = useInboxTableConfig({
230
- ...{
231
- parentRoute,
232
- onPageSizeChange,
233
- formState,
234
- totalCount: totalRecords,
235
- table: filteredData,
236
- dispatch,
237
- onSortingByData,
238
- tenantId,
239
- checkPathName,
240
- inboxStyles: { overflowX: "scroll", overflowY: "hidden" },
241
- tableStyle: { width: "70%" },
242
- },
243
- });
244
-
245
- const isInboxLoading = isLoading || isSearchLoading;
246
-
247
- return (
248
- <div className="app-container">
249
- <InboxComposer
250
- {...{
251
- isInboxLoading,
252
- // PropsForInboxLinks,
253
- ...propsForSearchForm,
254
- // ...propsForFilterForm,
255
- // ...propsForMobileSortForm,
256
- propsForInboxTable,
257
- // propsForInboxMobileCards,
258
- formState,
259
- }}
260
- />
261
- </div>
262
- );
263
- };
264
-
265
- export default Inbox;
@@ -1,199 +0,0 @@
1
- import React from "react";
2
- import { PrivateRoute, ModuleHeader, ArrowLeft, HomeIcon, LayoutWrapper } from "@djb25/digit-ui-react-components";
3
- import { useTranslation } from "react-i18next";
4
- import { Switch, useLocation, useRouteMatch } from "react-router-dom";
5
- import AadhaarVerification from "../../components/AadhaarVerification";
6
- import PropertyInfo from "../../components/PropertyInfo";
7
- import MeterDetails from "../../components/MeterDetails";
8
- import Review from "../../components/Review";
9
- import Home from "./Home";
10
- import Inbox from "./Inbox";
11
- import AssignEkyc from "../../components/AssignEkyc";
12
- import SurveyorDetailsCard from "../../components/SurveyorDetailsCard";
13
- import VendorDetails from "../../components/VendorDetails";
14
-
15
- const CitizenApp = () => {
16
- const { t } = useTranslation();
17
- const location = useLocation();
18
- const { path } = useRouteMatch();
19
-
20
- sessionStorage.removeItem("revalidateddone");
21
-
22
- const getDynamicBreadcrumbs = () => {
23
- const pathname = location.pathname;
24
-
25
- // Parent crumb — always present and clickable → redirects to eKYC citizen home
26
- const crumbs = [
27
- { icon: HomeIcon, path: "/digit-ui/citizen" },
28
- { label: t("EKYC_MODULE_NAME"), path: `/digit-ui/citizen/ekyc` },
29
- ];
30
-
31
- // Child crumb — only appended when on a sub-page
32
- if (pathname.includes("/create-kyc")) {
33
- crumbs.push({ label: t("EKYC_CREATE_KYC") });
34
- } else if (pathname.includes("/aadhaar-verification")) {
35
- crumbs.push({ label: t("EKYC_AADHAAR_VERIFICATION") });
36
- } else if (pathname.includes("/address-details")) {
37
- crumbs.push({ label: t("EKYC_ADDRESS_DETAILS") });
38
- } else if (pathname.includes("/property-info")) {
39
- crumbs.push({ label: t("EKYC_PROPERTY_INFO") });
40
- } else if (pathname.includes("/meter-details")) {
41
- crumbs.push({ label: t("EKYC_METER_DETAILS") });
42
- } else if (pathname.includes("/review")) {
43
- crumbs.push({ label: t("EKYC_INBOX"), path: `/digit-ui/citizen/ekyc/inbox` });
44
- crumbs.push({ label: t("EKYC_REVIEW") });
45
- } else if (pathname.includes("/assign/surveyor-details")) {
46
- crumbs.push({ label: t("EKYC_ASSIGN"), path: `/digit-ui/citizen/ekyc/assign` });
47
- crumbs.push({ label: t("EKYC_SURVEYOR_DETAILS") });
48
- } else if (pathname.includes("/assign")) {
49
- crumbs.push({ label: t("EKYC_ASSIGN") });
50
- } else if (pathname.includes("/surveyor-dashboard")) {
51
- crumbs.push({ label: t("EKYC_SURVEYOR_DASHBOARD") });
52
- } else if (pathname.includes("/dashboard")) {
53
- crumbs.push({ label: t("EKYC_DASHBOARD") });
54
- } else if (pathname.includes("/inbox")) {
55
- crumbs.push({ label: t("EKYC_INBOX") });
56
- } else if (pathname.includes("/status/")) {
57
- crumbs.push({ label: t("EKYC_STATUS") });
58
- }
59
- // home (exact path) → no child crumb
60
-
61
- return crumbs;
62
- };
63
-
64
- // const roles = Digit.SessionStorage.get("User")?.info?.roles.map((ele) => ele.code);
65
- // const isEkyAction = (!roles?.includes("EKYC_SURVEYOR") || roles?.includes("EMPLOYEE"))
66
- return (
67
- <React.Fragment>
68
- <div className="ground-container form-container">
69
- <ModuleHeader
70
- leftContent={
71
- <React.Fragment>
72
- <ArrowLeft className="icon" />
73
- {t("CS_COMMON_BACK")}
74
- </React.Fragment>
75
- }
76
- onLeftClick={() => window.history.back()}
77
- breadcrumbs={getDynamicBreadcrumbs()}
78
- />
79
-
80
- <Switch>
81
- <PrivateRoute
82
- exact
83
- path={`${path}`}
84
- component={() => (
85
- <LayoutWrapper layoutClass="normal">
86
- <Home />
87
- </LayoutWrapper>
88
- )}
89
- />
90
- <PrivateRoute
91
- path={`${path}/dashboard`}
92
- component={() => (
93
- <LayoutWrapper layoutClass="normal">
94
- <VendorDetails />
95
- </LayoutWrapper>
96
- )}
97
- />
98
- <PrivateRoute
99
- path={`${path}/inbox`}
100
- component={() => (
101
- <LayoutWrapper layoutClass="normal">
102
- <Inbox />
103
- </LayoutWrapper>
104
- )}
105
- />
106
-
107
- <PrivateRoute
108
- path={`${path}/aadhaar-verification`}
109
- component={() => (
110
- <LayoutWrapper layoutClass="normal">
111
- <AadhaarVerification />
112
- </LayoutWrapper>
113
- )}
114
- />
115
-
116
- {/* <PrivateRoute
117
- path={`${path}/address-details`}
118
- component={() => (
119
- <LayoutWrapper layoutClass="normal">
120
- <AddressDetails />
121
- </LayoutWrapper>
122
- )}
123
- /> */}
124
-
125
- <PrivateRoute
126
- path={`${path}/property-info`}
127
- component={() => (
128
- <LayoutWrapper layoutClass="normal">
129
- <PropertyInfo />
130
- </LayoutWrapper>
131
- )}
132
- />
133
-
134
- <PrivateRoute
135
- path={`${path}/meter-details`}
136
- component={() => (
137
- <LayoutWrapper layoutClass="normal">
138
- <MeterDetails />
139
- </LayoutWrapper>
140
- )}
141
- />
142
-
143
- <PrivateRoute
144
- path={`${path}/review`}
145
- component={() => (
146
- <LayoutWrapper layoutClass="normal">
147
- <Review />
148
- </LayoutWrapper>
149
- )}
150
- />
151
- <PrivateRoute
152
- path={`${path}/assign`}
153
- exact
154
- component={() => (
155
- <LayoutWrapper layoutClass="normal">
156
- <AssignEkyc />
157
- </LayoutWrapper>
158
- )}
159
- />
160
- <PrivateRoute
161
- path={`${path}/assign/surveyor-details/:id`}
162
- exact
163
- component={() => (
164
- <LayoutWrapper layoutClass="action">
165
- <SurveyorDetailsCard />
166
- </LayoutWrapper>
167
- )}
168
- />
169
- <PrivateRoute
170
- path={`${path}/surveyor-dashboard/:id`}
171
- component={() => (
172
- <LayoutWrapper layoutClass="normal">
173
- <SurveyorDetailsCard />
174
- </LayoutWrapper>
175
- )}
176
- />
177
- <PrivateRoute
178
- path={`${path}/surveyor-dashboard`}
179
- component={() => (
180
- <LayoutWrapper layoutClass="normal">
181
- <SurveyorDetailsCard />
182
- </LayoutWrapper>
183
- )}
184
- />
185
- <PrivateRoute
186
- path={`${path}/status/:applicationId`}
187
- component={() => (
188
- <LayoutWrapper layoutClass="normal">
189
- <Review />
190
- </LayoutWrapper>
191
- )}
192
- />
193
- </Switch>
194
- </div>
195
- </React.Fragment>
196
- );
197
- };
198
-
199
- export default CitizenApp;