@djb25/digit-ui-module-ekyc 1.0.7 → 1.0.8

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.
@@ -171,8 +171,6 @@ const Review = () => {
171
171
  const propertyDetails = state.propertyDetails || {
172
172
  ownerType: sessionStorage.getItem("EKYC_OWNER_TYPE"),
173
173
  pidNumber: sessionStorage.getItem("EKYC_PID_NUMBER"),
174
- connectionCategory: getSavedData("EKYC_TYPE_OF_CONNECTION_DATA"),
175
- connectionType: getSavedData("EKYC_CONNECTION_CATEGORY_DATA"),
176
174
  userType: getSavedData("EKYC_USER_TYPE_DATA"),
177
175
  noOfFloors: getSavedData("EKYC_NO_OF_FLOORS_DATA"),
178
176
  propertyDocument: sessionStorage.getItem("EKYC_PROPERTY_DOC"),
@@ -181,6 +179,19 @@ const Review = () => {
181
179
  buildingPhotoFileStoreId: sessionStorage.getItem("EKYC_BUILDING_PHOTO_FILESTORE_ID"),
182
180
  };
183
181
 
182
+ const meterDetails = state.meterDetails || {
183
+ meterStatus: getSavedData("EKYC_METER_STATUS_DATA"),
184
+ workingStatus: getSavedData("EKYC_METER_WORKING_STATUS_DATA"),
185
+ meterLocation: sessionStorage.getItem("EKYC_METER_LOCATION"),
186
+ lastBillRaised: getSavedData("EKYC_LAST_BILL_RAISED_DATA"),
187
+ noBillReason: sessionStorage.getItem("EKYC_REASON_FOR_NO_BILL"),
188
+ sewerConnection: getSavedData("EKYC_SEWER_CONNECTION_DATA"),
189
+ connectionCategory: getSavedData("EKYC_TYPE_OF_CONNECTION_DATA"),
190
+ connectionType: getSavedData("EKYC_CONNECTION_CATEGORY_DATA"),
191
+ meterPhoto: sessionStorage.getItem("EKYC_METER_PHOTO"),
192
+ meterPhotoFileStoreId: sessionStorage.getItem("EKYC_METER_PHOTO_FILESTORE_ID"),
193
+ };
194
+
184
195
  useEffect(() => {
185
196
  sessionStorage.setItem("EKYC_CURRENT_STEP", "REVIEW");
186
197
  }, []);
@@ -241,6 +252,13 @@ const Review = () => {
241
252
  doorPhotoFileStoreId = await uploadFile(doorFile, tenantId);
242
253
  }
243
254
 
255
+ // ── 4. Upload meter photo ──────────────────────────────────────────────
256
+ let meterImageFileStoreId = meterDetails.meterPhotoFileStoreId || null;
257
+ if (!meterImageFileStoreId && meterDetails.meterPhoto) {
258
+ const meterFile = dataUrlToFile(meterDetails.meterPhoto, "meter_photo.jpg");
259
+ meterImageFileStoreId = await uploadFile(meterFile, tenantId);
260
+ }
261
+
244
262
  // ── 4. Build optimized request payload ────────────────────────────────
245
263
  // Note: RequestInfo is added automatically by the Digit Request utility
246
264
  const requestBody = {
@@ -266,6 +284,16 @@ const Review = () => {
266
284
  pincode: addressDetails.pincode || null,
267
285
  assembly: addressDetails.assembly || null,
268
286
  ward: addressDetails.ward || null,
287
+ // Meter Details
288
+ meterStatus: meterDetails.meterStatus?.value || null,
289
+ meterWorkingStatus: meterDetails.workingStatus?.value || null,
290
+ meterLocation: meterDetails.meterLocation || null,
291
+ lastBillRaised: meterDetails.lastBillRaised?.value || null,
292
+ noBillReason: meterDetails.noBillReason || null,
293
+ sewerConnection: meterDetails.sewerConnection?.value || null,
294
+ typeOfConnection: meterDetails.connectionCategory?.value || null,
295
+ connectionCategory: meterDetails.connectionType?.value || null,
296
+ meterImageFileStoreId: meterImageFileStoreId,
269
297
  };
270
298
 
271
299
  // ── 4. Call the update API using the new Hook ──────────────────────────
@@ -313,9 +341,11 @@ const Review = () => {
313
341
  history.push("/digit-ui/employee/ekyc/property-info", location.state);
314
342
  };
315
343
 
316
- return (
317
- <div className="ground-container employee-app-container form-container">
344
+ const handleEditMeter = () => {
345
+ history.push("/digit-ui/employee/ekyc/meter-details", location.state);
346
+ };
318
347
 
348
+ return (
319
349
  <Fragment>
320
350
  <div className="inbox-container">
321
351
  <style>{`
@@ -341,13 +371,14 @@ const Review = () => {
341
371
  { label: t("EKYC_STEP_AADHAAR") || "Aadhaar", done: true, active: false },
342
372
  { label: t("EKYC_STEP_ADDRESS") || "Address", done: true, active: false },
343
373
  { label: t("EKYC_STEP_PROPERTY") || "Property", done: true, active: false },
374
+ { label: t("EKYC_STEP_METER") || "Meter", done: true, active: false },
344
375
  { label: t("EKYC_STEP_REVIEW") || "Review", done: false, active: true },
345
376
  ].map((step, i) => (
346
377
  <div key={i} style={{
347
378
  display: "flex", gap: "10px", alignItems: "flex-start",
348
- position: "relative", paddingBottom: i < 3 ? "18px" : 0,
379
+ position: "relative", paddingBottom: i < 4 ? "18px" : 0,
349
380
  }}>
350
- {i < 3 && (
381
+ {i < 4 && (
351
382
  <div style={{
352
383
  position: "absolute", left: "10px", top: "22px",
353
384
  width: "1px", height: "calc(100% - 10px)", background: "#EAECF0",
@@ -482,6 +513,32 @@ const Review = () => {
482
513
  ]}
483
514
  />
484
515
 
516
+ <hr style={{ margin: "20px 0", border: 0, borderTop: "1px solid #EAECF0" }} />
517
+
518
+ {/* ── Meter section head ── */}
519
+ <SectionHead
520
+ icon={<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67V7z" /></svg>}
521
+ label={t("EKYC_METER_DETAILS_HEADER") || "Meter details"}
522
+ />
523
+
524
+ <ReviewCard
525
+ icon={<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67V7z" /></svg>}
526
+ title={t("EKYC_METER_DETAILS_HEADER") || "Meter details"}
527
+ onEdit={handleEditMeter}
528
+ editLabel={t("CS_COMMON_EDIT") || "Edit"}
529
+ t={t}
530
+ rows={[
531
+ { label: t("EKYC_METER_STATUS") || "Meter status", value: meterDetails.meterStatus?.label || null, isModified: isFieldModified("meterStatus", meterDetails.meterStatus?.value) },
532
+ { label: t("EKYC_METER_WORKING_STATUS") || "Meter working status", value: meterDetails.workingStatus?.label || null, isModified: isFieldModified("meterWorkingStatus", meterDetails.workingStatus?.value) },
533
+ { label: t("EKYC_METER_LOCATION") || "Meter location", value: meterDetails.meterLocation || null, isModified: isFieldModified("meterLocation", meterDetails.meterLocation) },
534
+ { label: t("EKYC_LAST_BILL_RAISED") || "Last bill raised", value: meterDetails.lastBillRaised?.label || null, isModified: isFieldModified("lastBillRaised", meterDetails.lastBillRaised?.value) },
535
+ { label: t("EKYC_REASON_FOR_NO_BILL") || "Reason for no bill", value: meterDetails.noBillReason || null, isModified: isFieldModified("noBillReason", meterDetails.noBillReason) },
536
+ { label: t("EKYC_SEWER_CONNECTION") || "Sewer connection", value: meterDetails.sewerConnection?.label || null, isModified: isFieldModified("sewerConnection", meterDetails.sewerConnection?.value) },
537
+ { label: t("EKYC_TYPE_OF_CONNECTION") || "Type of connection", value: meterDetails.connectionCategory?.label || null, isModified: isFieldModified("typeOfConnection", meterDetails.connectionCategory?.value) },
538
+ { label: t("EKYC_CONNECTION_CATEGORY") || "Connection category", value: meterDetails.connectionType?.label || null, isModified: isFieldModified("connectionCategory", meterDetails.connectionType?.value) },
539
+ ]}
540
+ />
541
+
485
542
  </div>
486
543
 
487
544
  {/* Submit (Non-sticky, at form end) */}
@@ -523,7 +580,6 @@ const Review = () => {
523
580
  />
524
581
  )}
525
582
  </Fragment>
526
- </div>
527
583
  );
528
584
  };
529
585
 
@@ -3,10 +3,12 @@ import React from "react";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import { Switch, useLocation } from "react-router-dom";
5
5
  import Inbox from "./Inbox";
6
+ //import Mapping from "./Mapping";
6
7
  import Create from "./Create";
7
8
  import AadhaarVerification from "./AadhaarVerification";
8
9
  import AddressDetails from "./AddressDetails";
9
10
  import PropertyInfo from "./PropertyInfo";
11
+ import MeterDetails from "./MeterDetails";
10
12
  import Review from "./Review";
11
13
 
12
14
  const EmployeeApp = ({ path }) => {
@@ -23,6 +25,7 @@ const EmployeeApp = ({ path }) => {
23
25
  if (pathname.includes("/aadhaar-verification")) return "EKYC_AADHAAR_VERIFICATION";
24
26
  if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
25
27
  if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
28
+ if (pathname.includes("/meter-details")) return "EKYC_METER_DETAILS";
26
29
  if (pathname.includes("/review")) return "EKYC_REVIEW";
27
30
  return "ES_COMMON_INBOX";
28
31
  };
@@ -34,7 +37,7 @@ const EmployeeApp = ({ path }) => {
34
37
 
35
38
  return (
36
39
  <AppContainer>
37
- <div className="ground-container employee-app-container">
40
+ <div className="ground-container employee-app-container employee-app-homepage-container">
38
41
  <ModuleHeader
39
42
  leftContent={
40
43
  <React.Fragment>
@@ -64,6 +67,11 @@ const EmployeeApp = ({ path }) => {
64
67
  component={() => <Create />}
65
68
  />
66
69
 
70
+ {/* <PrivateRoute
71
+ path={`${path}/mapping`}
72
+ component={() => <Mapping />}
73
+ /> */}
74
+
67
75
  <PrivateRoute
68
76
  path={`${path}/aadhaar-verification`}
69
77
  component={() => <AadhaarVerification />}
@@ -78,6 +86,11 @@ const EmployeeApp = ({ path }) => {
78
86
  path={`${path}/property-info`}
79
87
  component={() => <PropertyInfo />}
80
88
  />
89
+
90
+ <PrivateRoute
91
+ path={`${path}/meter-details`}
92
+ component={() => <MeterDetails />}
93
+ />
81
94
 
82
95
  <PrivateRoute
83
96
  path={`${path}/review`}