@djb25/digit-ui-module-ekyc 1.0.3 → 1.0.5
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 +2164 -1535
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ConnectionDetailsView.js +8 -8
- package/src/components/DesktopInbox.js +5 -5
- package/src/components/SearchConsumer.js +11 -2
- package/src/pages/employee/AadhaarVerification.js +367 -251
- package/src/pages/employee/AddressDetails.js +530 -373
- package/src/pages/employee/Create.js +5 -19
- package/src/pages/employee/Inbox.js +40 -34
- package/src/pages/employee/PropertyInfo.js +409 -316
- package/src/pages/employee/Review.js +290 -89
|
@@ -17,25 +17,13 @@ const Create = () => {
|
|
|
17
17
|
|
|
18
18
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
19
19
|
|
|
20
|
-
const { isLoading: isSearching, data: connectionDetails, error, revalidate } = Digit.Hooks.ekyc.
|
|
20
|
+
const { isLoading: isSearching, data: connectionDetails, error, revalidate } = Digit.Hooks.ekyc.useSearchConnection({
|
|
21
21
|
tenantId,
|
|
22
|
-
details: { kno: searchParams.kNumber }
|
|
22
|
+
details: { kno: searchParams.kNumber, name: searchParams.kName }
|
|
23
23
|
}, {
|
|
24
|
-
enabled: searchPerformed && !!searchParams.kNumber
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const { mutate: validateUser, isLoading: isValidating } = Digit.Hooks.ekyc.useValidateUser(tenantId, {
|
|
28
|
-
onSuccess: (data) => {
|
|
29
|
-
if (data?.responseInfo?.status === "successful") {
|
|
30
|
-
// Keep the flow: first validate, then search details is implied by the new UI
|
|
31
|
-
} else {
|
|
32
|
-
setShowToast({ error: true, label: data?.message || t("EKYC_VALIDATION_FAILED") });
|
|
33
|
-
setSearchPerformed(false);
|
|
34
|
-
sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED");
|
|
35
|
-
}
|
|
36
|
-
},
|
|
24
|
+
enabled: searchPerformed && !!searchParams.kNumber && !!searchParams.kName,
|
|
37
25
|
onError: (error) => {
|
|
38
|
-
setShowToast({ error: true, label: error?.response?.data?.Errors?.[0]?.message || t("
|
|
26
|
+
setShowToast({ error: true, label: error?.response?.data?.Errors?.[0]?.message || t("EKYC_SEARCH_ERROR_PLEASE_ENTER_THE_CORRECT_CREDENTIALS") });
|
|
39
27
|
setSearchPerformed(false);
|
|
40
28
|
sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED");
|
|
41
29
|
}
|
|
@@ -59,8 +47,6 @@ const Create = () => {
|
|
|
59
47
|
setSearchPerformed(true);
|
|
60
48
|
sessionStorage.setItem("EKYC_CREATE_SEARCH_PARAMS", JSON.stringify(params));
|
|
61
49
|
sessionStorage.setItem("EKYC_CREATE_SEARCH_PERFORMED", "true");
|
|
62
|
-
// We validate first as per original logic, then the hook useGetConnection will fetch details
|
|
63
|
-
validateUser({ kno: params.kNumber, name: params.kName });
|
|
64
50
|
};
|
|
65
51
|
|
|
66
52
|
const closeToast = () => {
|
|
@@ -77,7 +63,7 @@ const Create = () => {
|
|
|
77
63
|
kNumber={searchParams.kNumber}
|
|
78
64
|
kName={searchParams.kName}
|
|
79
65
|
connectionDetails={connectionDetails}
|
|
80
|
-
isLoading={isSearching
|
|
66
|
+
isLoading={isSearching}
|
|
81
67
|
/>
|
|
82
68
|
)}
|
|
83
69
|
|
|
@@ -4,13 +4,7 @@ import DesktopInbox from "../../components/DesktopInbox";
|
|
|
4
4
|
import MobileInbox from "../../components/MobileInbox";
|
|
5
5
|
import Filter from "../../components/Filter";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
{ applicationNumber: "EKYC-2024-001", citizenName: "Rahul Sharma", mobileNumber: "9876543210", status: "COMPLETED" },
|
|
9
|
-
{ applicationNumber: "EKYC-2024-002", citizenName: "Anjali Devi", mobileNumber: "9123456789", status: "PENDING" },
|
|
10
|
-
{ applicationNumber: "EKYC-2024-003", citizenName: "Amit Kumar", mobileNumber: "8888888888", status: "REJECTED" },
|
|
11
|
-
{ applicationNumber: "EKYC-2024-004", citizenName: "Priya Singh", mobileNumber: "7777777777", status: "COMPLETED" },
|
|
12
|
-
{ applicationNumber: "EKYC-2024-005", citizenName: "Suresh Gupta", mobileNumber: "6666666666", status: "PENDING" },
|
|
13
|
-
];
|
|
7
|
+
// Mock data removed in favor of API integration
|
|
14
8
|
|
|
15
9
|
const Inbox = ({
|
|
16
10
|
parentRoute,
|
|
@@ -33,28 +27,40 @@ const Inbox = ({
|
|
|
33
27
|
// Maintain the full search objects for the Search component
|
|
34
28
|
const [searchParams, setSearchParams] = useState(initialStates.searchParams || { status: defaultStatusOption });
|
|
35
29
|
|
|
36
|
-
// 2.
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
30
|
+
// 2. API Data Fetching
|
|
31
|
+
const { isLoading, data: dashboardData, isFetching } = Digit.Hooks.ekyc.useEkycSurveyorDashboard(
|
|
32
|
+
{},
|
|
33
|
+
{
|
|
34
|
+
tenantId,
|
|
35
|
+
offset: pageOffset,
|
|
36
|
+
limit: pageSize,
|
|
37
|
+
status: searchParams.status?.value || ""
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
enabled: !!tenantId,
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const filteredData = useMemo(() => {
|
|
45
|
+
const items = dashboardData?.dashboardInfo?.consumerList || [];
|
|
46
|
+
return items.map(item => ({
|
|
47
|
+
...item,
|
|
48
|
+
applicationNumber: item.kno || item.applicationNumber,
|
|
49
|
+
citizenName: item.consumerName || item.citizenName,
|
|
50
|
+
}));
|
|
51
|
+
}, [dashboardData]);
|
|
52
|
+
|
|
53
|
+
const countData = useMemo(() => {
|
|
54
|
+
const info = dashboardData?.dashboardInfo || {};
|
|
51
55
|
return {
|
|
52
|
-
total:
|
|
53
|
-
completed:
|
|
54
|
-
pending:
|
|
55
|
-
rejected:
|
|
56
|
+
total: info.total || 0,
|
|
57
|
+
completed: info.completed || 0,
|
|
58
|
+
pending: info.pending || 0,
|
|
59
|
+
rejected: info.rejected || 0
|
|
56
60
|
};
|
|
57
|
-
}, []);
|
|
61
|
+
}, [dashboardData]);
|
|
62
|
+
|
|
63
|
+
const totalRecords = dashboardData?.dashboardInfo?.totalRecords || dashboardData?.totalCount || 0;
|
|
58
64
|
|
|
59
65
|
// 3. Handlers
|
|
60
66
|
const handleSearch = useCallback((filterParam) => {
|
|
@@ -98,19 +104,19 @@ const Inbox = ({
|
|
|
98
104
|
<div className="inbox-main-container">
|
|
99
105
|
{Digit.Utils.browser.isMobile() ? (
|
|
100
106
|
<MobileInbox
|
|
101
|
-
data={{ items:
|
|
102
|
-
isLoading={
|
|
107
|
+
data={{ items: filteredData, totalCount: totalRecords }}
|
|
108
|
+
isLoading={isLoading || isFetching}
|
|
103
109
|
onSearch={handleSearch}
|
|
104
110
|
searchFields={searchFields}
|
|
105
111
|
searchParams={searchParams}
|
|
106
112
|
parentRoute={parentRoute}
|
|
107
|
-
countData={
|
|
113
|
+
countData={countData}
|
|
108
114
|
/>
|
|
109
115
|
) : (
|
|
110
116
|
<DesktopInbox
|
|
111
117
|
businessService={businessService}
|
|
112
|
-
data={{ items:
|
|
113
|
-
isLoading={
|
|
118
|
+
data={{ items: filteredData, totalCount: totalRecords }}
|
|
119
|
+
isLoading={isLoading || isFetching}
|
|
114
120
|
searchFields={searchFields}
|
|
115
121
|
onSearch={handleSearch}
|
|
116
122
|
onSort={handleSort}
|
|
@@ -122,8 +128,8 @@ const Inbox = ({
|
|
|
122
128
|
parentRoute={parentRoute}
|
|
123
129
|
searchParams={searchParams}
|
|
124
130
|
sortParams={sortParams}
|
|
125
|
-
totalRecords={
|
|
126
|
-
countData={
|
|
131
|
+
totalRecords={totalRecords}
|
|
132
|
+
countData={countData}
|
|
127
133
|
filterComponent="EKYC_INBOX_FILTER"
|
|
128
134
|
/>
|
|
129
135
|
)}
|