@djb25/digit-ui-module-ekyc 1.0.1 → 1.0.3

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.
@@ -9,6 +9,11 @@ const PropertyInfo = () => {
9
9
  const location = useLocation();
10
10
 
11
11
  const { kNumber } = location.state || { kNumber: "EKYC-1234567890" };
12
+ const tenantId = Digit.ULBService.getCurrentTenantId();
13
+ const { data: dataV0, isLoading: isLoadingV0 } = Digit.Hooks.ekyc.useGetPropertyType(tenantId);
14
+ const { data, isLoading } = Digit.Hooks.ekyc.useGetConnectionTypeV2(tenantId);
15
+ const { data: dataV1, isLoading: isLoadingV1 } = Digit.Hooks.ekyc.useGetUserType(tenantId);
16
+ const { data: dataV2, isLoading: isLoadingV2 } = Digit.Hooks.ekyc.useGetFloorCount(tenantId);
12
17
 
13
18
  const [ownerType, setOwnerType] = useState("OWNER");
14
19
  const [pidNumber, setPidNumber] = useState("");
@@ -22,7 +27,19 @@ const PropertyInfo = () => {
22
27
  const cameraRef = useRef(null);
23
28
 
24
29
  const handleSaveAndContinue = () => {
25
- history.push("/digit-ui/employee/ekyc/dashboard");
30
+ history.push("/digit-ui/employee/ekyc/review", {
31
+ ...location.state,
32
+ propertyDetails: {
33
+ ownerType,
34
+ pidNumber,
35
+ connectionType,
36
+ connectionCategory,
37
+ userType,
38
+ noOfFloors,
39
+ propertyDocument,
40
+ buildingPhoto
41
+ }
42
+ });
26
43
  };
27
44
 
28
45
  const SuitcaseIcon = () => (
@@ -73,7 +90,7 @@ const PropertyInfo = () => {
73
90
  </Card>
74
91
 
75
92
  {/* Progress Steps Sidebar */}
76
- <div style={{ padding: "8px 16px" }}>
93
+ <div style={{ backgroundColor: "#FFFFFF", padding: "16px", borderRadius: "8px", border: "1px solid #EAECF0", boxShadow: "0 2px 4px rgba(0,0,0,0.02)" }}>
77
94
  <ConnectingCheckPoints>
78
95
  <CheckPoint label={t("EKYC_STEP_AADHAAR") || "Aadhaar"} isCompleted={true} />
79
96
  <CheckPoint label={t("EKYC_STEP_ADDRESS") || "Address"} isCompleted={true} />
@@ -164,17 +181,50 @@ const PropertyInfo = () => {
164
181
 
165
182
  {/* Dropdowns */}
166
183
  {[
167
- { label: "Type_of_Connection", state: connectionType, setState: setConnectionType },
168
- { label: "Connection_Category", state: connectionCategory, setState: setConnectionCategory },
169
- { label: "User_Type", state: userType, setState: setUserType },
170
- { label: "No_of_Floor", state: noOfFloors, setState: setNoOfFloors }
184
+ {
185
+ label: "Type_of_Connection",
186
+ state: connectionCategory,
187
+ setState: setConnectionCategory,
188
+ options: dataV0?.["ws-services-calculation"]?.propertyTypeV2?.map(item => ({
189
+ label: t(item.code),
190
+ value: item.code
191
+ })) || []
192
+ },
193
+ {
194
+ label: "Connection_Category",
195
+ state: connectionType,
196
+ setState: setConnectionType,
197
+ options: data?.["ws-services-calculation"]?.connectionTypeV2?.map(item => ({
198
+ label: t(item.code),
199
+ value: item.code
200
+ })) || []
201
+ },
202
+ // { label: "User_Type", state: userType, setState: setUserType },
203
+ {
204
+ label: "User_Type",
205
+ state: userType,
206
+ setState: setUserType,
207
+ options: dataV1?.["ws-services-calculation"]?.userTypeV2?.map(item => ({
208
+ label: t(item.code),
209
+ value: item.code
210
+ })) || []
211
+ },
212
+ {
213
+ label: "No_of_Floor",
214
+ state: noOfFloors,
215
+ setState: setNoOfFloors,
216
+ options: dataV2?.["ws-services-calculation"]?.floorCount?.map(item => ({
217
+ label: t(item.code),
218
+ value: item.code
219
+ })) || []
220
+ }
171
221
  ].map((item, idx) => (
172
222
  <div key={idx} style={{ marginBottom: "20px" }}>
173
223
  <CardLabel style={{ fontSize: "14px", fontWeight: "600", color: "#344054", marginBottom: "8px" }}>{t(item.label)}</CardLabel>
174
224
  <Dropdown
175
225
  selected={item.state}
176
226
  select={item.setState}
177
- option={[{ label: `Select ${item.label}`, value: "" }]}
227
+ option={item.options || [{ label: `Select ${item.label}`, value: "" }]}
178
228
  optionKey="label"
179
229
  t={t}
180
230
  style={{ borderRadius: "12px", border: "1px solid #D0D5DD", height: "48px" }}
@@ -340,7 +390,9 @@ const PropertyInfo = () => {
340
390
  {t("This_section_is_enabled_only_if_user_is_not_the_owner.")}
341
391
  </div>
342
392
  </div>
343
- <SubmitBar label={t("Save_&_Continue")} onSubmit={handleSaveAndContinue} style={{ borderRadius: "8px", height: "48px", marginTop: "24px", marginRight: "1100px" }} />
393
+ <div style={{ display: "flex", justifyContent: "flex-start", marginTop: "24px" }}>
394
+ <SubmitBar label={t("Save_&_Continue")} onSubmit={handleSaveAndContinue} style={{ borderRadius: "8px", height: "48px", margin: 0 }} />
395
+ </div>
344
396
  </Card>
345
397
 
346
398
 
@@ -0,0 +1,143 @@
1
+ import React from "react";
2
+ import {
3
+ Header,
4
+ Card,
5
+ CardHeader,
6
+ StatusTable,
7
+ Row,
8
+ SubmitBar,
9
+ HomeIcon,
10
+ ConnectingCheckPoints,
11
+ CheckPoint,
12
+ ActionBar,
13
+ } from "@djb25/digit-ui-react-components";
14
+ import { useTranslation } from "react-i18next";
15
+ import { useHistory, useLocation } from "react-router-dom";
16
+
17
+ const Review = () => {
18
+ const { t } = useTranslation();
19
+ const history = useHistory();
20
+ const location = useLocation();
21
+
22
+ // Catch data from previous steps via the router state
23
+ const { kNumber = "NA", aadhaarDetails = {}, addressDetails = {}, propertyDetails = {} } = location.state || {};
24
+
25
+ const handleSubmit = () => {
26
+ // Here to mimic final submit and go to dashboard/inbox
27
+ history.push("/digit-ui/employee/ekyc/dashboard");
28
+ };
29
+
30
+ const handleEditAadhaar = () => {
31
+ history.push("/digit-ui/employee/ekyc/aadhaar-verification", location.state);
32
+ };
33
+
34
+ const handleEditAddress = () => {
35
+ history.push("/digit-ui/employee/ekyc/address-details", location.state);
36
+ };
37
+
38
+ const handleEditProperty = () => {
39
+ history.push("/digit-ui/employee/ekyc/property-info", location.state);
40
+ };
41
+
42
+ return (
43
+ <div className="inbox-container">
44
+ <div className="filters-container">
45
+ {/* Sidebar Title Card */}
46
+ <Card
47
+ className="sidebar-title-card"
48
+ style={{ display: "flex", alignItems: "center", padding: "16px", marginBottom: "16px", borderRadius: "4px" }}
49
+ >
50
+ <div className="icon-container" style={{ color: "#0068faff", marginRight: "12px" }}>
51
+ <HomeIcon style={{ width: "24px", height: "24px" }} />
52
+ </div>
53
+ <div style={{ fontWeight: "700", fontSize: "18px", color: "#0B0C0C" }}>{t("EKYC_PROCESS")}</div>
54
+ </Card>
55
+
56
+ {/* Progress Steps Sidebar */}
57
+ <div
58
+ style={{
59
+ backgroundColor: "#FFFFFF",
60
+ padding: "16px",
61
+ borderRadius: "8px",
62
+ border: "1px solid #EAECF0",
63
+ boxShadow: "0 2px 4px rgba(0,0,0,0.02)",
64
+ }}
65
+ >
66
+ <ConnectingCheckPoints>
67
+ <CheckPoint label={t("EKYC_STEP_AADHAAR") || "Aadhaar"} isCompleted={true} />
68
+ <CheckPoint label={t("EKYC_STEP_ADDRESS") || "Address"} isCompleted={true} />
69
+ <CheckPoint label={t("EKYC_STEP_PROPERTY") || "Property"} isCompleted={true} />
70
+ <CheckPoint label={t("EKYC_STEP_REVIEW") || "Review"} isCompleted={false} />
71
+ </ConnectingCheckPoints>
72
+ </div>
73
+ </div>
74
+
75
+ <div style={{ flex: 1, marginLeft: "16px" }}>
76
+ <Card>
77
+ <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "24px" }}>
78
+ <Header>{t("EKYC_REVIEW_DETAILS") || "Review Details"}</Header>
79
+ <div style={{ fontSize: "14px", fontWeight: "700", color: "#505A5F" }}>
80
+ {t("EKYC_K_NUMBER")}: <span style={{ color: "#0B0C0C" }}>{kNumber}</span>
81
+ </div>
82
+ </div>
83
+
84
+ {/* Aadhaar Details Card */}
85
+ <Card style={{ padding: "24px", marginBottom: "24px", borderRadius: "12px", border: "1px solid #EAECF0" }}>
86
+ <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "16px" }}>
87
+ <CardHeader style={{ margin: 0, fontSize: "18px", color: "#0B0C0C" }}>
88
+ {t("EKYC_AADHAAR_VERIFICATION_HEADER") || "Aadhaar Details"}
89
+ </CardHeader>
90
+ <span onClick={handleEditAadhaar} style={{ color: "#3A8DCC", fontWeight: "600", cursor: "pointer", fontSize: "14px" }}>
91
+ {t("CS_COMMON_EDIT")}
92
+ </span>
93
+ </div>
94
+ <StatusTable>
95
+ <Row label={t("EKYC_NAME")} text={aadhaarDetails.userName || "Rajesh Kumar Singh"} />
96
+ <Row label={t("EKYC_AADHAAR")} text={aadhaarDetails.aadhaarLastFour ? `XXXX XXXX ${aadhaarDetails.aadhaarLastFour}` : t("CS_NA")} />
97
+ <Row label={t("EKYC_MOBILE_NO")} text={aadhaarDetails.mobileNumber || t("CS_NA")} />
98
+ <Row label={t("EKYC_EMAIL_ADDRESS")} text={aadhaarDetails.email || t("CS_NA")} />
99
+ </StatusTable>
100
+ </Card>
101
+
102
+ {/* Address Details Card */}
103
+ <Card style={{ padding: "24px", marginBottom: "24px", borderRadius: "12px", border: "1px solid #EAECF0" }}>
104
+ <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "16px" }}>
105
+ <CardHeader style={{ margin: 0, fontSize: "18px", color: "#0B0C0C" }}>
106
+ {t("EKYC_ADDRESS_DETAILS_HEADER") || "Address Details"}
107
+ </CardHeader>
108
+ <span onClick={handleEditAddress} style={{ color: "#3A8DCC", fontWeight: "600", cursor: "pointer", fontSize: "14px" }}>
109
+ {t("CS_COMMON_EDIT")}
110
+ </span>
111
+ </div>
112
+ <StatusTable>
113
+ <Row label={t("EKYC_FULL_ADDRESS")} text={addressDetails.fullAddress || "H.No. 123, Sector 15, Rohini"} />
114
+ <Row label={t("EKYC_PINCODE")} text={addressDetails.pincode || "110085"} />
115
+ </StatusTable>
116
+ </Card>
117
+
118
+ {/* Property Details Card */}
119
+ <Card style={{ padding: "24px", marginBottom: "24px", borderRadius: "12px", border: "1px solid #EAECF0" }}>
120
+ <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "16px" }}>
121
+ <CardHeader style={{ margin: 0, fontSize: "18px", color: "#0B0C0C" }}>{t("EKYC_PROPERTY_INFO") || "Property Information"}</CardHeader>
122
+ <span onClick={handleEditProperty} style={{ color: "#3A8DCC", fontWeight: "600", cursor: "pointer", fontSize: "14px" }}>
123
+ {t("CS_COMMON_EDIT")}
124
+ </span>
125
+ </div>
126
+ <StatusTable>
127
+ <Row label={t("Property_Owner")} text={propertyDetails.ownerType || "OWNER"} />
128
+ <Row label={t("PID_Number")} text={propertyDetails.pidNumber || t("CS_NA")} />
129
+ <Row label={t("Type_of_Connection")} text={propertyDetails.connectionType?.label || t("CS_NA")} />
130
+ <Row label={t("Connection_Category")} text={propertyDetails.connectionCategory?.label || t("CS_NA")} />
131
+ </StatusTable>
132
+ </Card>
133
+
134
+ <ActionBar>
135
+ <SubmitBar label={t("ES_COMMON_SUBMIT") || "Submit"} onSubmit={handleSubmit} />
136
+ </ActionBar>
137
+ </Card>
138
+ </div>
139
+ </div>
140
+ );
141
+ };
142
+
143
+ export default Review;
@@ -7,6 +7,7 @@ import Create from "./Create";
7
7
  import AadhaarVerification from "./AadhaarVerification";
8
8
  import AddressDetails from "./AddressDetails";
9
9
  import PropertyInfo from "./PropertyInfo";
10
+ import Review from "./Review";
10
11
 
11
12
  const EmployeeApp = ({ path }) => {
12
13
  const { t } = useTranslation();
@@ -22,6 +23,7 @@ const EmployeeApp = ({ path }) => {
22
23
  if (pathname.includes("/aadhaar-verification")) return "EKYC_AADHAAR_VERIFICATION";
23
24
  if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
24
25
  if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
26
+ if (pathname.includes("/review")) return "EKYC_REVIEW";
25
27
  return "ES_COMMON_INBOX";
26
28
  };
27
29
 
@@ -76,6 +78,11 @@ const EmployeeApp = ({ path }) => {
76
78
  path={`${path}/property-info`}
77
79
  component={() => <PropertyInfo />}
78
80
  />
81
+
82
+ <PrivateRoute
83
+ path={`${path}/review`}
84
+ component={() => <Review />}
85
+ />
79
86
 
80
87
  <PrivateRoute
81
88
  path={`${path}/`}