@djb25/digit-ui-module-ekyc 1.0.8 → 1.0.9
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 +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +3281 -4272
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/src/Module.js +42 -31
- package/src/components/ConnectionDetailsView.js +5 -3
- package/src/components/DesktopInbox.js +68 -184
- package/src/components/EKYCCard.js +35 -27
- package/src/components/Filter.js +48 -53
- package/src/components/SearchFormFieldsComponent.js +55 -0
- package/src/components/StatusCards.js +7 -3
- package/src/config/config.js +69 -0
- package/src/hook/useInboxTableConfig.js +134 -0
- package/src/pages/citizen/index.js +1 -1
- package/src/pages/employee/AadhaarVerification.js +473 -609
- package/src/pages/employee/AddressDetails.js +508 -733
- package/src/pages/employee/ConsumerDetails.js +512 -0
- package/src/pages/employee/Create.js +5 -1
- package/src/pages/employee/Dashboard.js +43 -0
- package/src/pages/employee/EKYCForm.js +117 -0
- package/src/pages/employee/Inbox.js +248 -140
- package/src/pages/employee/Mapping.js +640 -6
- package/src/pages/employee/MeterDetails.js +481 -471
- package/src/pages/employee/PropertyInfo.js +472 -562
- package/src/pages/employee/Review.js +268 -540
- package/src/pages/employee/Update.js +9 -0
- package/src/pages/employee/index.js +59 -94
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Controller } from "react-hook-form";
|
|
3
|
+
import { CardLabelError, TextInput, Tooltip, Label } from "@djb25/digit-ui-react-components";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
|
|
6
|
+
const SearchFormFieldsComponents = ({ searchFormState, controlSearchForm }) => {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
const { errors } = searchFormState;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<React.Fragment>
|
|
12
|
+
{/* K NUMBER */}
|
|
13
|
+
<span className="mobile-input">
|
|
14
|
+
<Label className="flex-roww flex-gap-2">
|
|
15
|
+
{t("EKYC_K_NUMBER") || "K Number"}
|
|
16
|
+
<Tooltip message={t("EKYC_K_NUMBER_MESSAGE")} />
|
|
17
|
+
</Label>
|
|
18
|
+
|
|
19
|
+
<Controller
|
|
20
|
+
name="kNumber"
|
|
21
|
+
control={controlSearchForm}
|
|
22
|
+
defaultValue=""
|
|
23
|
+
rules={{
|
|
24
|
+
pattern: {
|
|
25
|
+
value: /^[a-zA-Z0-9-_/]*$/,
|
|
26
|
+
message: t("ERR_INVALID_APPLICATION_NO"),
|
|
27
|
+
},
|
|
28
|
+
}}
|
|
29
|
+
render={({ onChange, value }) => <TextInput value={value || ""} onChange={(e) => onChange(e.target.value)} />}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
{errors?.kNumber && <CardLabelError>{errors.kNumber.message}</CardLabelError>}
|
|
33
|
+
</span>
|
|
34
|
+
|
|
35
|
+
{/* K NAME */}
|
|
36
|
+
{/* <span className="mobile-input">
|
|
37
|
+
<Label className="flex-roww flex-gap-2">
|
|
38
|
+
{t("EKYC_K_NAME") || "K Name"}
|
|
39
|
+
<Tooltip message={t("EKYC_K_NAME_MESSAGE")} />
|
|
40
|
+
</Label>
|
|
41
|
+
|
|
42
|
+
<Controller
|
|
43
|
+
name="kName"
|
|
44
|
+
control={controlSearchForm}
|
|
45
|
+
defaultValue=""
|
|
46
|
+
render={({ onChange, value }) => <TextInput value={value || ""} onChange={(e) => onChange(e.target.value)} />}
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
{errors?.kName && <CardLabelError>{errors.kName.message}</CardLabelError>}
|
|
50
|
+
</span> */}
|
|
51
|
+
</React.Fragment>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default SearchFormFieldsComponents;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import
|
|
3
|
+
import * as Chartjs from "chart.js/auto";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const getChartConstructor = () => {
|
|
6
|
+
const C = Chartjs.Chart || Chartjs.default || Chartjs;
|
|
7
|
+
return C;
|
|
8
|
+
};
|
|
6
9
|
|
|
7
10
|
const StatusCards = ({ countData }) => {
|
|
8
11
|
const { t } = useTranslation();
|
|
@@ -27,7 +30,8 @@ const StatusCards = ({ countData }) => {
|
|
|
27
30
|
if (chartRef1.current) {
|
|
28
31
|
if (chartInstance1.current) chartInstance1.current.destroy();
|
|
29
32
|
const ctx1 = chartRef1.current.getContext("2d");
|
|
30
|
-
|
|
33
|
+
const ChartConstructor = getChartConstructor();
|
|
34
|
+
chartInstance1.current = new ChartConstructor(ctx1, {
|
|
31
35
|
type: "doughnut",
|
|
32
36
|
data: {
|
|
33
37
|
labels: [t("EKYC_ACTIVE"), t("EKYC_PENDING"), t("EKYC_COMPLETED")],
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import AadhaarVerification from "../pages/employee/AadhaarVerification";
|
|
2
|
+
|
|
3
|
+
export const ekycConfig = [
|
|
4
|
+
{
|
|
5
|
+
body: [
|
|
6
|
+
{
|
|
7
|
+
route: "consumer-details",
|
|
8
|
+
component: AadhaarVerification,
|
|
9
|
+
key: "aadhaarVerification",
|
|
10
|
+
texts: {
|
|
11
|
+
header: "EKYC_CONSUMER_CONNECTION",
|
|
12
|
+
submitBarLabel: "COMMON_SAVE_NEXT",
|
|
13
|
+
},
|
|
14
|
+
timeLine: [
|
|
15
|
+
{
|
|
16
|
+
currentStep: 1,
|
|
17
|
+
actions: "EKYC_CONSUMER_CONNECTION",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
route: "address-details",
|
|
23
|
+
component: "AddressDetails",
|
|
24
|
+
key: "addressDetails",
|
|
25
|
+
doorImage: true,
|
|
26
|
+
texts: {
|
|
27
|
+
header: "EKYC_ADDRESS_DETAILS",
|
|
28
|
+
submitBarLabel: "COMMON_SAVE_NEXT",
|
|
29
|
+
},
|
|
30
|
+
timeLine: [
|
|
31
|
+
{
|
|
32
|
+
currentStep: 2,
|
|
33
|
+
actions: "EKYC_ADDRESS_DETAILS",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
route: "property-info",
|
|
39
|
+
component: "PropertyInfo",
|
|
40
|
+
key: "propertyDetails",
|
|
41
|
+
texts: {
|
|
42
|
+
header: "EKYC_PROPERTY_INFO",
|
|
43
|
+
submitBarLabel: "COMMON_SAVE_NEXT",
|
|
44
|
+
},
|
|
45
|
+
timeLine: [
|
|
46
|
+
{
|
|
47
|
+
currentStep: 3,
|
|
48
|
+
actions: "EKYC_PROPERTY_INFO",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
route: "meter-details",
|
|
54
|
+
component: "MeterDetails",
|
|
55
|
+
key: "meterDetails",
|
|
56
|
+
texts: {
|
|
57
|
+
header: "EKYC_METER_DETAILS",
|
|
58
|
+
submitBarLabel: "COMMON_SAVE_NEXT",
|
|
59
|
+
},
|
|
60
|
+
timeLine: [
|
|
61
|
+
{
|
|
62
|
+
currentStep: 4,
|
|
63
|
+
actions: "EKYC_METER_DETAILS",
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { useHistory } from "react-router-dom";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
|
|
5
|
+
const useInboxTableConfig = ({
|
|
6
|
+
parentRoute,
|
|
7
|
+
onPageSizeChange,
|
|
8
|
+
formState,
|
|
9
|
+
totalCount,
|
|
10
|
+
table,
|
|
11
|
+
dispatch,
|
|
12
|
+
checkPathName,
|
|
13
|
+
onSortingByData,
|
|
14
|
+
tenantId,
|
|
15
|
+
inboxStyles = {},
|
|
16
|
+
tableStyle = {},
|
|
17
|
+
}) => {
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const history = useHistory();
|
|
20
|
+
const [selectedKno, setSelectedKno] = useState("");
|
|
21
|
+
const { data: reviewData, getReview } = Digit.Hooks.ekyc.useEkycAPI("review", tenantId);
|
|
22
|
+
const handleReview = (kno) => {
|
|
23
|
+
setSelectedKno(kno);
|
|
24
|
+
getReview({ kno });
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const limit = formState?.tableForm?.limit || 10;
|
|
28
|
+
const offset = formState?.tableForm?.offset || 0;
|
|
29
|
+
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (reviewData) {
|
|
32
|
+
history.push("/digit-ui/employee/ekyc/review", { kNumber: selectedKno, aadhaarData: reviewData?.aadhaarData, reviewData });
|
|
33
|
+
}
|
|
34
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
|
+
}, [reviewData]);
|
|
36
|
+
|
|
37
|
+
const tableColumnConfig = [
|
|
38
|
+
{
|
|
39
|
+
Header: t("EKYC_APPLICATION_NO"),
|
|
40
|
+
accessor: "applicationNumber",
|
|
41
|
+
disableSortBy: true,
|
|
42
|
+
Cell: ({ row }) => {
|
|
43
|
+
const kno = row.original?.kno || row.original?.applicationNumber || "NA";
|
|
44
|
+
return (
|
|
45
|
+
<span
|
|
46
|
+
className="ekyc-application-link"
|
|
47
|
+
style={{ color: "#add8f7", cursor: "pointer", fontWeight: "bold" }}
|
|
48
|
+
onClick={() => handleReview(kno)}
|
|
49
|
+
>
|
|
50
|
+
{kno}
|
|
51
|
+
</span>
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
Header: t("EKYC_CITIZEN_NAME"),
|
|
57
|
+
accessor: "citizenName",
|
|
58
|
+
Cell: ({ row }) => <span>{row.original?.citizenName || "NA"}</span>,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
Header: t("EKYC_STATUS"),
|
|
62
|
+
accessor: "actionStatus",
|
|
63
|
+
Cell: ({ row }) => {
|
|
64
|
+
const status = row.original?.status || "DEFAULT";
|
|
65
|
+
return <span className={`ekyc-status-tag ${status}`}>{t(`${status}`)}</span>;
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
Header: t("EKYC_ACTION"),
|
|
70
|
+
accessor: "status",
|
|
71
|
+
Cell: ({ row }) => {
|
|
72
|
+
const kno = row.original?.kno || row.original?.applicationNumber || "NA";
|
|
73
|
+
return (
|
|
74
|
+
<span
|
|
75
|
+
className="ekyc-application-link"
|
|
76
|
+
style={{ color: "#add8f7", cursor: "pointer", fontWeight: "bold" }}
|
|
77
|
+
onClick={() => handleReview(kno)}
|
|
78
|
+
>
|
|
79
|
+
{t("EKYC_REVIEW")}
|
|
80
|
+
</span>
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
getCellProps: (cellInfo) => {
|
|
88
|
+
return {
|
|
89
|
+
style: {
|
|
90
|
+
padding: "8px",
|
|
91
|
+
fontSize: "12px",
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
disableSort: false,
|
|
96
|
+
autoSort: false,
|
|
97
|
+
manualPagination: true,
|
|
98
|
+
initSortId: "applicationDate",
|
|
99
|
+
onPageSizeChange: onPageSizeChange,
|
|
100
|
+
currentPage: Math.floor(offset / limit),
|
|
101
|
+
onNextPage: () =>
|
|
102
|
+
dispatch({
|
|
103
|
+
action: "mutateTableForm",
|
|
104
|
+
data: { ...formState.tableForm, offset: parseInt(formState.tableForm?.offset) + parseInt(formState.tableForm?.limit) },
|
|
105
|
+
checkPathName,
|
|
106
|
+
}),
|
|
107
|
+
onPrevPage: () =>
|
|
108
|
+
dispatch({
|
|
109
|
+
action: "mutateTableForm",
|
|
110
|
+
data: { ...formState.tableForm, offset: parseInt(formState.tableForm?.offset) - parseInt(formState.tableForm?.limit) },
|
|
111
|
+
checkPathName,
|
|
112
|
+
}),
|
|
113
|
+
pageSizeLimit: limit,
|
|
114
|
+
onSort: onSortingByData,
|
|
115
|
+
// sortParams: [{id: getValues("sortBy"), desc: getValues("sortOrder") === "DESC" ? true : false}],
|
|
116
|
+
totalRecords: totalCount,
|
|
117
|
+
onSearch: formState?.searchForm?.message,
|
|
118
|
+
onLastPage: () =>
|
|
119
|
+
dispatch({
|
|
120
|
+
action: "mutateTableForm",
|
|
121
|
+
data: { ...formState.tableForm, offset: Math.ceil(totalCount / 10) * 10 - parseInt(formState.tableForm?.limit) },
|
|
122
|
+
checkPathName,
|
|
123
|
+
}),
|
|
124
|
+
onFirstPage: () => dispatch({ action: "mutateTableForm", data: { ...formState.tableForm, offset: 0 }, checkPathName }),
|
|
125
|
+
// globalSearch: {searchForItemsInTable},
|
|
126
|
+
// searchQueryForTable,
|
|
127
|
+
data: table,
|
|
128
|
+
columns: tableColumnConfig,
|
|
129
|
+
inboxStyles: { ...inboxStyles },
|
|
130
|
+
tableStyle: { ...tableStyle },
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export default useInboxTableConfig;
|