@djb25/digit-ui-module-ekyc 1.0.53 → 1.0.55

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 CHANGED
@@ -2088,57 +2088,174 @@ const VendorDetailsCard = () => {
2088
2088
  const _useState3 = React.useState(false),
2089
2089
  ekycDownloadLoading = _useState3[0],
2090
2090
  setEkycDownloadLoading = _useState3[1];
2091
- const handleDownloadEkycData = function () {
2091
+ const handleDownloadEkycData = function (fromDate, toDate) {
2092
2092
  try {
2093
2093
  setEkycDownloadLoading(true);
2094
2094
  return Promise.resolve(_finallyRethrows(function () {
2095
2095
  return _catch(function () {
2096
- return Promise.resolve(Digit.EkycService.application_list({
2096
+ return Promise.resolve(Digit.EkycService.application_list(_extends({
2097
2097
  tenantId: tenantId,
2098
2098
  offset: 0,
2099
2099
  limit: 10000,
2100
2100
  reportDownload: true
2101
- })).then(function (response) {
2101
+ }, fromDate && {
2102
+ fromDate
2103
+ }, toDate && {
2104
+ toDate
2105
+ }))).then(function (response) {
2102
2106
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
2103
2107
  if (!consumerList || consumerList.length === 0) {
2104
2108
  alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
2105
2109
  return;
2106
2110
  }
2107
- const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
2111
+ const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
2108
2112
  const headerMapping = {
2109
- kno: t("KNO") || "KNO",
2110
- firstName: t("FIRST_NAME") || "First Name",
2111
- middleName: t("MIDDLE_NAME") || "Middle Name",
2112
- lastName: t("LAST_NAME") || "Last Name",
2113
- gender: t("GENDER") || "Gender",
2114
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
2115
- emailId: t("EMAIL_ID") || "Email ID",
2116
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
2117
- relationship: t("RELATIONSHIP") || "Relationship",
2118
- dob: t("DOB") || "Date of Birth",
2119
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
2120
- zoneName: t("ZONE") || "Zone",
2121
- assembly: t("ASSEMBLY") || "Assembly",
2122
- ward: t("WARD") || "Ward",
2123
- pincode: t("PINCODE") || "Pincode",
2124
- mrkey: t("MR_KEY") || "MR Key",
2125
- createdTime: t("CREATED_TIME") || "Created Time",
2126
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
2113
+ kno: t("KNO"),
2114
+ firstName: t("FIRST_NAME"),
2115
+ middleName: t("MIDDLE_NAME"),
2116
+ lastName: t("LAST_NAME"),
2117
+ status: t("STATUS"),
2118
+ ekycStatus: t("EKYC_STATUS"),
2119
+ zoneName: t("ZONE"),
2120
+ zoneCode: t("ZONE_CODE"),
2121
+ assembly: t("EKYC_ASSEMBLY"),
2122
+ ward: t("WARD"),
2123
+ pincode: t("EKYC_PINCODE"),
2124
+ addressRaw: t("ADDRESS_RAW"),
2125
+ locality: t("EKYC_LOCALITY"),
2126
+ subLocality: t("SUB_LOCALITY"),
2127
+ flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
2128
+ streetName: t("STREET_NAME"),
2129
+ landmark: t("EKYC_LANDMARK"),
2130
+ city: t("CITY"),
2131
+ state: t("STATE"),
2132
+ addressType: t("ADDRESS_TYPE"),
2133
+ addressProofType: t("ADDRESS_PROOF_TYPE"),
2134
+ mobileNo: t("MOBILE_NUMBER"),
2135
+ alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
2136
+ whatsappNo: t("WHATSAPP_NO"),
2137
+ email: t("EMAIL"),
2138
+ landlineNo: t("LANDLINE_NO"),
2139
+ mrkey: t("MR_KEY"),
2140
+ mrcode: t("MR_CODE"),
2141
+ areacode: t("AREA_CODE"),
2142
+ source: t("SOURCE"),
2143
+ submittedAt: t("SUBMITTED_AT"),
2144
+ assignedAt: t("ASSIGNED_AT"),
2145
+ connectionType: t("CONNECTION_TYPE"),
2146
+ Type: t("CONSUMER_TYPE"),
2147
+ occupantType: t("OCCUPANT_TYPE"),
2148
+ knoCategory: t("KNO_CATEGORY"),
2149
+ approvedAt: t("APPROVED_AT"),
2150
+ gender: t("GENDER"),
2151
+ parentSpouse: t("PARENT_SPOUSE"),
2152
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
2153
+ relationship: t("RELATIONSHIP"),
2154
+ informantName: t("INFORMANT_NAME"),
2155
+ informantRelation: t("INFORMANT_RELATION"),
2156
+ informantIs: t("INFORMANT_IS"),
2157
+ contactPerson: t("CONTACT_PERSON"),
2158
+ relation: t("RELATION"),
2159
+ entityName: t("ENTITY_NAME"),
2160
+ designation: t("DESIGNATION"),
2161
+ department: t("DEPARTMENT"),
2162
+ employeeId: t("EMPLOYEE_ID"),
2163
+ ownerMobile: t("OWNER_MOBILE"),
2164
+ ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
2165
+ consentGiven: t("CONSENT_GIVEN"),
2166
+ proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
2167
+ documentNumber: t("DOCUMENT_NUMBER"),
2168
+ noOfPerson: t("NUMBER_OF_PERSON"),
2169
+ latitude: t("LATITUDE"),
2170
+ longitude: t("LONGITUDE"),
2171
+ gpsValid: t("GPS_VALID"),
2172
+ meterNumber: t("METER_NUMBER"),
2173
+ meterMake: t("METER_MAKE"),
2174
+ meterStatus: t("METER_STATUS"),
2175
+ meterCondition: t("METER_CONDITION"),
2176
+ meterLocation: t("METER_LOCATION"),
2177
+ meterLocationAddress: t("METER_LOCATION_ADDRESS"),
2178
+ workingStatus: t("WORKING_STATUS"),
2179
+ sewerConnection: t("SEWER_CONNECTION"),
2180
+ septicTank: t("SEPTIC_TANK"),
2181
+ lastBillRaised: t("LAST_BILL_RAISED"),
2182
+ lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
2183
+ accessToMeter: t("ACCESS_TO_METER"),
2184
+ systemMeterId: t("SYSTEM_METER_ID"),
2185
+ lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
2186
+ waterConnectionYears: t("WATER_CONNECTION_YEARS"),
2187
+ sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
2188
+ pidNumber: t("PID_NUMBER"),
2189
+ propertyType: t("PROPERTY_TYPE"),
2190
+ subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
2191
+ noOfFloor: t("NO_OF_FLOOR"),
2192
+ noOfRooms: t("NO_OF_ROOMS"),
2193
+ noOfBeds: t("NO_OF_BEDS"),
2194
+ numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
2195
+ floorNo: t("FLOOR_NO"),
2196
+ userType: t("USER_TYPE"),
2197
+ tenantName: t("TENANT_NAME"),
2198
+ tenantMobile: t("TENANT_MOBILE"),
2199
+ verificationStatus: t("VERIFICATION_STATUS"),
2200
+ houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
2201
+ surveyorId: t("SURVEYOR_ID"),
2202
+ supervisorId: t("SUPERVISOR_ID"),
2203
+ vendorId: t("VENDOR_ID"),
2204
+ assignmentType: t("ASSIGNMENT_TYPE"),
2205
+ assignmentValue: t("ASSIGNMENT_VALUE"),
2206
+ assignedTime: t("ASSIGNED_TIME"),
2207
+ isSelfAssigned: t("IS_SELF_ASSIGNED"),
2208
+ doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
2209
+ panFilestoreId: t("PAN_FILESTORE_ID"),
2210
+ documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
2211
+ buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
2212
+ propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
2213
+ meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
2214
+ modifiedBy: t("MODIFIED_BY"),
2215
+ emailId: t("EMAIL_ID"),
2216
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
2217
+ dob: t("DOB"),
2218
+ consumerType: t("CONSUMER_TYPE"),
2219
+ createdTime: t("CREATED_TIME"),
2220
+ lastModifiedTime: t("LAST_MODIFIED_TIME"),
2221
+ meterLatitude: t("EKYC_METER_LATITUDE1"),
2222
+ meterLongitude: t("EKYC_METER_LONGITUDE1")
2223
+ };
2224
+ const toTitleCase = str => {
2225
+ if (!str) return "";
2226
+ let cleanStr = String(str);
2227
+ if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
2228
+ cleanStr = cleanStr.split(".").pop();
2229
+ }
2230
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
2127
2231
  };
2232
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
2233
+ const translatedFields = ["meterMake", "meterLocation"];
2128
2234
  const excelData = consumerList.map(item => {
2129
2235
  const cleanObj = {};
2130
2236
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
2131
2237
  if (fullName) {
2132
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
2238
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
2133
2239
  }
2134
2240
  Object.keys(item).forEach(key => {
2135
2241
  if (excludedKeys.includes(key)) return;
2136
- const val = item[key];
2242
+ let val = item[key];
2137
2243
  if (typeof val === "object" && val !== null) {
2138
2244
  return;
2139
2245
  }
2246
+ if (String(val).toLowerCase() === "true") {
2247
+ val = t("CS_YES");
2248
+ } else if (String(val).toLowerCase() === "false") {
2249
+ val = t("CS_NO");
2250
+ }
2140
2251
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
2141
- cleanObj[friendlyHeader] = val;
2252
+ if (typeof val === "string" && translatedFields.includes(key)) {
2253
+ cleanObj[friendlyHeader] = t(val);
2254
+ } else if (typeof val === "string" && !skipTitleCase.includes(key)) {
2255
+ cleanObj[friendlyHeader] = toTitleCase(val);
2256
+ } else {
2257
+ cleanObj[friendlyHeader] = val;
2258
+ }
2142
2259
  });
2143
2260
  return cleanObj;
2144
2261
  });
@@ -2158,6 +2275,34 @@ const VendorDetailsCard = () => {
2158
2275
  return Promise.reject(e);
2159
2276
  }
2160
2277
  };
2278
+ const getDateRange = filter => {
2279
+ const now = new Date();
2280
+ const start = new Date(now);
2281
+ if (filter === "today") {
2282
+ start.setHours(0, 0, 0, 0);
2283
+ return {
2284
+ from: start,
2285
+ to: now
2286
+ };
2287
+ }
2288
+ if (filter === "week") {
2289
+ start.setDate(now.getDate() - now.getDay());
2290
+ start.setHours(0, 0, 0, 0);
2291
+ return {
2292
+ from: start,
2293
+ to: now
2294
+ };
2295
+ }
2296
+ if (filter === "month") {
2297
+ start.setDate(1);
2298
+ start.setHours(0, 0, 0, 0);
2299
+ return {
2300
+ from: start,
2301
+ to: now
2302
+ };
2303
+ }
2304
+ return null;
2305
+ };
2161
2306
  const paginatedSupervisors = React.useMemo(() => {
2162
2307
  const start = currentPage * pageSize;
2163
2308
  const end = start + pageSize;
@@ -2272,19 +2417,35 @@ const VendorDetailsCard = () => {
2272
2417
  console.error("Failed to generate report:", err);
2273
2418
  } finally {
2274
2419
  setReportLoading(false);
2420
+ }
2421
+ };
2422
+ const handlePresetDownload = function (filter) {
2423
+ try {
2424
+ const range = getDateRange(filter);
2425
+ if (!range) return Promise.resolve();
2275
2426
  setShowReportMenu(false);
2276
2427
  setShowCustomPicker(false);
2428
+ return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
2429
+ } catch (e) {
2430
+ return Promise.reject(e);
2277
2431
  }
2278
2432
  };
2279
- const handlePresetDownload = filter => {
2280
- handleDownload();
2281
- };
2282
- const handleCustomDownload = () => {
2283
- if (!customDate.from || !customDate.to) {
2284
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
2285
- return;
2433
+ const handleCustomDownload = function () {
2434
+ try {
2435
+ if (!customDate.from || !customDate.to) {
2436
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
2437
+ return Promise.resolve();
2438
+ }
2439
+ const from = new Date(customDate.from);
2440
+ from.setHours(0, 0, 0, 0);
2441
+ const to = new Date(customDate.to);
2442
+ to.setHours(23, 59, 59, 999);
2443
+ setShowReportMenu(false);
2444
+ setShowCustomPicker(false);
2445
+ return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
2446
+ } catch (e) {
2447
+ return Promise.reject(e);
2286
2448
  }
2287
- handleDownload();
2288
2449
  };
2289
2450
  const StatCard = _ref3 => {
2290
2451
  let title = _ref3.title,
@@ -2332,65 +2493,12 @@ const VendorDetailsCard = () => {
2332
2493
  }, vendorName), /*#__PURE__*/React__default.createElement("div", {
2333
2494
  className: "designation"
2334
2495
  }, t("VENDOR_AGENCY") || "Agency / Vendor"))), /*#__PURE__*/React__default.createElement("div", {
2335
- className: "report-download",
2336
- ref: reportMenuRef
2496
+ className: "report-download"
2337
2497
  }, /*#__PURE__*/React__default.createElement("button", {
2338
2498
  className: "download-btn",
2339
2499
  disabled: reportLoading,
2340
- onClick: () => {
2341
- setShowReportMenu(p => !p);
2342
- setShowCustomPicker(false);
2343
- }
2344
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
2345
- className: "report-menu"
2346
- }, [{
2347
- label: t("TODAY") || "Today",
2348
- key: "today"
2349
- }, {
2350
- label: t("THIS_WEEK") || "This Week",
2351
- key: "week"
2352
- }, {
2353
- label: t("THIS_MONTH") || "This Month",
2354
- key: "month"
2355
- }].map(_ref4 => {
2356
- let label = _ref4.label,
2357
- key = _ref4.key;
2358
- return /*#__PURE__*/React__default.createElement("div", {
2359
- key: key,
2360
- className: "menu-item",
2361
- onClick: () => handlePresetDownload()
2362
- }, label);
2363
- }), /*#__PURE__*/React__default.createElement("div", {
2364
- className: "custom-date-trigger",
2365
- onClick: () => setShowCustomPicker(p => !p)
2366
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
2367
- className: "custom-picker"
2368
- }, /*#__PURE__*/React__default.createElement("div", {
2369
- className: "date-field"
2370
- }, /*#__PURE__*/React__default.createElement("label", {
2371
- className: "date-label"
2372
- }, t("FROM_DATE") || "From"), /*#__PURE__*/React__default.createElement("input", {
2373
- type: "date",
2374
- className: "date-input",
2375
- value: customDate.from,
2376
- onChange: e => setCustomDate(d => _extends({}, d, {
2377
- from: e.target.value
2378
- }))
2379
- })), /*#__PURE__*/React__default.createElement("div", {
2380
- className: "date-field"
2381
- }, /*#__PURE__*/React__default.createElement("label", {
2382
- className: "date-label"
2383
- }, t("TO_DATE") || "To"), /*#__PURE__*/React__default.createElement("input", {
2384
- type: "date",
2385
- className: "date-input",
2386
- value: customDate.to,
2387
- onChange: e => setCustomDate(d => _extends({}, d, {
2388
- to: e.target.value
2389
- }))
2390
- })), /*#__PURE__*/React__default.createElement("button", {
2391
- className: "download-action-btn",
2392
- onClick: handleCustomDownload
2393
- }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React__default.createElement("div", {
2500
+ onClick: handleDownload
2501
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React__default.createElement("div", {
2394
2502
  className: "stats-wrapper"
2395
2503
  }, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
2396
2504
  key: idx,
@@ -2441,10 +2549,16 @@ const VendorDetailsCard = () => {
2441
2549
  className: "details-right"
2442
2550
  }, /*#__PURE__*/React__default.createElement("div", {
2443
2551
  className: "download-card"
2444
- }, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React__default.createElement("button", {
2552
+ }, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React__default.createElement("div", {
2553
+ className: "report-download",
2554
+ ref: reportMenuRef
2555
+ }, /*#__PURE__*/React__default.createElement("button", {
2445
2556
  className: "download-excel-btn",
2446
2557
  disabled: ekycDownloadLoading,
2447
- onClick: handleDownloadEkycData
2558
+ onClick: () => {
2559
+ setShowReportMenu(p => !p);
2560
+ setShowCustomPicker(false);
2561
+ }
2448
2562
  }, /*#__PURE__*/React__default.createElement("svg", {
2449
2563
  width: "16",
2450
2564
  height: "16",
@@ -2463,20 +2577,76 @@ const VendorDetailsCard = () => {
2463
2577
  y1: "15",
2464
2578
  x2: "12",
2465
2579
  y2: "3"
2466
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
2467
- className: "dashboard-card"
2468
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
2469
- t: t,
2470
- tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
2471
- tableClass: "ekycTable",
2472
- data: paginatedSupervisors,
2473
- columns: supervisorColumns,
2474
- isLoading: isPageLoading,
2475
- totalRecords: vendorSupervisors.length,
2476
- currentPage: currentPage,
2477
- pageSizeLimit: pageSize,
2478
- isPaginationRequired: true,
2479
- onNextPage: () => {
2580
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
2581
+ className: "report-menu"
2582
+ }, [{
2583
+ label: t("TODAY") || "Today",
2584
+ key: "today"
2585
+ }, {
2586
+ label: t("THIS_WEEK") || "This Week",
2587
+ key: "week"
2588
+ }, {
2589
+ label: t("THIS_MONTH") || "This Month",
2590
+ key: "month"
2591
+ }].map(_ref4 => {
2592
+ let label = _ref4.label,
2593
+ key = _ref4.key;
2594
+ return /*#__PURE__*/React__default.createElement("div", {
2595
+ key: key,
2596
+ className: "menu-item",
2597
+ onClick: () => handlePresetDownload(key)
2598
+ }, label);
2599
+ }), /*#__PURE__*/React__default.createElement("div", {
2600
+ className: "custom-date-trigger",
2601
+ onClick: () => setShowCustomPicker(p => !p)
2602
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
2603
+ className: "custom-picker"
2604
+ }, /*#__PURE__*/React__default.createElement("div", {
2605
+ className: "date-inputs"
2606
+ }, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "From"), /*#__PURE__*/React__default.createElement("input", {
2607
+ type: "date",
2608
+ value: customDate.from,
2609
+ onChange: e => setCustomDate(_extends({}, customDate, {
2610
+ from: e.target.value
2611
+ }))
2612
+ })), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "To"), /*#__PURE__*/React__default.createElement("input", {
2613
+ type: "date",
2614
+ value: customDate.to,
2615
+ onChange: e => setCustomDate(_extends({}, customDate, {
2616
+ to: e.target.value
2617
+ }))
2618
+ }))), /*#__PURE__*/React__default.createElement("div", {
2619
+ style: {
2620
+ display: "flex",
2621
+ gap: "10px",
2622
+ marginTop: "10px"
2623
+ }
2624
+ }, /*#__PURE__*/React__default.createElement("button", {
2625
+ className: "picker-cancel-btn",
2626
+ onClick: () => {
2627
+ setShowCustomPicker(false);
2628
+ setCustomDate({
2629
+ from: "",
2630
+ to: ""
2631
+ });
2632
+ }
2633
+ }, t("CANCEL") || "Cancel"), /*#__PURE__*/React__default.createElement("button", {
2634
+ className: "picker-apply-btn",
2635
+ onClick: handleCustomDownload
2636
+ }, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
2637
+ className: "dashboard-card"
2638
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
2639
+ t: t,
2640
+ tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
2641
+ tableClass: "ekycTable",
2642
+ data: paginatedSupervisors,
2643
+ columns: supervisorColumns,
2644
+ isLoading: isPageLoading,
2645
+ totalRecords: vendorSupervisors.length,
2646
+ currentPage: currentPage,
2647
+ pageSizeLimit: pageSize,
2648
+ isPaginationRequired: true,
2649
+ onNextPage: () => {
2480
2650
  if (currentPage < Math.ceil(vendorSupervisors.length / pageSize) - 1) {
2481
2651
  setCurrentPage(prev => prev + 1);
2482
2652
  }
@@ -3150,25 +3320,10 @@ const Inbox = _ref2 => {
3150
3320
  targetVendorId: matchedId,
3151
3321
  allVendorIds: allIds
3152
3322
  };
3153
- }, [vendorSearchResponse]),
3154
- targetVendorId = _useMemo.targetVendorId,
3155
- allVendorIds = _useMemo.allVendorIds;
3156
- const progressParams = React.useMemo(() => {
3157
- if (targetVendorId) {
3158
- return {
3159
- vendorId: targetVendorId,
3160
- vendorIds: [targetVendorId]
3161
- };
3162
- }
3163
- if (allVendorIds && allVendorIds.length > 0) {
3164
- return {
3165
- vendorId: allVendorIds[0],
3166
- vendorIds: allVendorIds
3167
- };
3168
- }
3169
- return {};
3170
- }, [targetVendorId, allVendorIds]);
3171
- const _Digit$Hooks$ekyc$use3 = Digit.Hooks.ekyc.useEkycAssignmentProgress(progressParams, {
3323
+ }, [vendorSearchResponse]);
3324
+ const _Digit$Hooks$ekyc$use3 = Digit.Hooks.ekyc.useEkycAssignmentProgress({
3325
+ tenantId
3326
+ }, {
3172
3327
  enabled: !!tenantId,
3173
3328
  keepPreviousData: true
3174
3329
  }),
@@ -3230,65 +3385,56 @@ const Inbox = _ref2 => {
3230
3385
  }, [sourceData]);
3231
3386
  const _useTranslation = reactI18next.useTranslation(),
3232
3387
  t = _useTranslation.t;
3233
- const supervisor = React.useMemo(() => {
3234
- var _Digit$SessionStorage2, _loggedInUser$roles;
3235
- const loggedInUser = (_Digit$SessionStorage2 = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage2 === void 0 ? void 0 : _Digit$SessionStorage2.info;
3236
- const roles = (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$roles = loggedInUser.roles) === null || _loggedInUser$roles === void 0 ? void 0 : _loggedInUser$roles.map(ele => ele.code)) || [];
3237
- if (roles.includes("EKYC_SUPERVISOR")) {
3238
- const targetId = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid;
3239
- if (progressData !== null && progressData !== void 0 && progressData.supervisorReport && targetId) {
3240
- const report = progressData.supervisorReport.find(s => {
3241
- var _s$supervisorId, _s$id;
3242
- return ((_s$supervisorId = s.supervisorId) === null || _s$supervisorId === void 0 ? void 0 : _s$supervisorId.toLowerCase()) === (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase()) || ((_s$id = s.id) === null || _s$id === void 0 ? void 0 : _s$id.toLowerCase()) === (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase());
3243
- });
3244
- if (report) return report;
3245
- }
3246
- }
3247
- if (progressData !== null && progressData !== void 0 && progressData.supervisorReport) {
3248
- const totalKnos = progressData.supervisorReport.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
3249
- const submittedKnos = progressData.supervisorReport.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
3250
- const pendingKnos = progressData.supervisorReport.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
3251
- const progressPercent = totalKnos > 0 ? Math.round(submittedKnos / totalKnos * 100) : 0;
3252
- return {
3253
- totalKnos,
3254
- submittedKnos,
3255
- pendingKnos,
3256
- progressPercent
3257
- };
3258
- }
3259
- return null;
3388
+ const progressMetrics = React.useMemo(() => {
3389
+ var _ref3, _progressData$totalKn, _ref4, _progressData$complet, _progressData$pending, _ref5, _progressData$overall;
3390
+ if (!progressData) return {
3391
+ totalKnos: 0,
3392
+ submittedKnos: 0,
3393
+ pendingKnos: 0,
3394
+ progressPercent: 0
3395
+ };
3396
+ const totalKnos = (_ref3 = (_progressData$totalKn = progressData === null || progressData === void 0 ? void 0 : progressData.totalKnos) != null ? _progressData$totalKn : progressData === null || progressData === void 0 ? void 0 : progressData.totalAssignments) != null ? _ref3 : 0;
3397
+ const submittedKnos = (_ref4 = (_progressData$complet = progressData === null || progressData === void 0 ? void 0 : progressData.completedKnos) != null ? _progressData$complet : progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnos) != null ? _ref4 : 0;
3398
+ const pendingKnos = (_progressData$pending = progressData === null || progressData === void 0 ? void 0 : progressData.pendingKnos) != null ? _progressData$pending : totalKnos >= submittedKnos ? totalKnos - submittedKnos : 0;
3399
+ const progressPercent = (_ref5 = (_progressData$overall = progressData === null || progressData === void 0 ? void 0 : progressData.overallProgressPercent) != null ? _progressData$overall : progressData === null || progressData === void 0 ? void 0 : progressData.progressPercent) != null ? _ref5 : totalKnos > 0 ? (submittedKnos / totalKnos * 100).toFixed(1) : 0;
3400
+ return {
3401
+ totalKnos,
3402
+ submittedKnos,
3403
+ pendingKnos,
3404
+ progressPercent
3405
+ };
3260
3406
  }, [progressData]);
3261
3407
  const cards = React.useMemo(() => [{
3262
3408
  label: t("TOTAL_EKYC_APPLICATIONS"),
3263
- count: (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0,
3409
+ count: (progressMetrics === null || progressMetrics === void 0 ? void 0 : progressMetrics.totalKnos) || 0,
3264
3410
  color: "#0B2559",
3265
3411
  type: "today",
3266
3412
  icon: /*#__PURE__*/React__default.createElement(fa.FaUsers, null)
3267
3413
  }, {
3268
3414
  label: t("EKYC_COMPLETED"),
3269
- count: (supervisor === null || supervisor === void 0 ? void 0 : supervisor.submittedKnos) || 0,
3415
+ count: (progressMetrics === null || progressMetrics === void 0 ? void 0 : progressMetrics.submittedKnos) || 0,
3270
3416
  color: "#10B981",
3271
3417
  type: "month",
3272
3418
  icon: /*#__PURE__*/React__default.createElement(fa.FaCheckCircle, null)
3273
3419
  }, {
3274
3420
  label: t("PENDING_APPLICATIONS"),
3275
- count: (supervisor === null || supervisor === void 0 ? void 0 : supervisor.pendingKnos) || 0,
3421
+ count: (progressMetrics === null || progressMetrics === void 0 ? void 0 : progressMetrics.pendingKnos) || 0,
3276
3422
  color: "#F59E0B",
3277
3423
  type: "pending",
3278
3424
  icon: /*#__PURE__*/React__default.createElement(fa.FaClock, null)
3279
3425
  }, {
3280
3426
  label: t("OVERALL_PROGRESS"),
3281
- count: ((supervisor === null || supervisor === void 0 ? void 0 : supervisor.progressPercent) || 0) + "%",
3427
+ count: ((progressMetrics === null || progressMetrics === void 0 ? void 0 : progressMetrics.progressPercent) || 0) + "%",
3282
3428
  color: "#A855F7",
3283
3429
  type: "progress",
3284
3430
  icon: /*#__PURE__*/React__default.createElement(fa.FaChartLine, null)
3285
- }], [supervisor]);
3431
+ }], [progressMetrics, t]);
3286
3432
  const totalRecords = (listData === null || listData === void 0 ? void 0 : listData.totalCount) || 0;
3287
3433
  const checkPathName = location.pathname.includes("ekyc/inbox");
3288
- const SearchFormFields = React.useCallback(_ref3 => {
3289
- let registerRef = _ref3.registerRef,
3290
- searchFormState = _ref3.searchFormState,
3291
- controlSearchForm = _ref3.controlSearchForm;
3434
+ const SearchFormFields = React.useCallback(_ref6 => {
3435
+ let registerRef = _ref6.registerRef,
3436
+ searchFormState = _ref6.searchFormState,
3437
+ controlSearchForm = _ref6.controlSearchForm;
3292
3438
  return /*#__PURE__*/React__default.createElement(SearchFormFieldsComponents, {
3293
3439
  registerRef,
3294
3440
  searchFormState,
@@ -3593,7 +3739,8 @@ const ReviewSection = _ref2 => {
3593
3739
  }, t("EKYC_PROPOSED_UPDATES")))), /*#__PURE__*/React__default.createElement("tbody", null, fields.map((field, idx) => {
3594
3740
  const valNew = newData === null || newData === void 0 ? void 0 : newData[field.key];
3595
3741
  const valOld = oldData === null || oldData === void 0 ? void 0 : oldData[field.key];
3596
- const isChanged = oldData && String(valNew) !== String(valOld) && valOld !== undefined && valOld !== null;
3742
+ const normalizeVal = v => v === null || v === undefined || v === "" ? "" : String(v);
3743
+ const isChanged = oldData && valOld !== undefined && normalizeVal(valNew) !== normalizeVal(valOld);
3597
3744
  return /*#__PURE__*/React__default.createElement("tr", {
3598
3745
  key: idx,
3599
3746
  style: {
@@ -3606,7 +3753,7 @@ const ReviewSection = _ref2 => {
3606
3753
  color: "#344054",
3607
3754
  fontWeight: "500"
3608
3755
  }
3609
- }, t(field.label)), /*#__PURE__*/React__default.createElement("td", {
3756
+ }, field.preTranslated ? field.label : t(field.label)), /*#__PURE__*/React__default.createElement("td", {
3610
3757
  style: {
3611
3758
  padding: "16px 0",
3612
3759
  fontSize: "14px",
@@ -3705,6 +3852,8 @@ const Review = () => {
3705
3852
  const _extractReviewData = extractReviewData(searchData, flowState),
3706
3853
  apiNewData = _extractReviewData.newData,
3707
3854
  apiOldData = _extractReviewData.oldData;
3855
+ const flatNewData = apiNewData ? _extends({}, apiNewData || {}, (apiNewData === null || apiNewData === void 0 ? void 0 : apiNewData.connectionDetails) || {}, (apiNewData === null || apiNewData === void 0 ? void 0 : apiNewData.addressDetails) || {}, (apiNewData === null || apiNewData === void 0 ? void 0 : apiNewData.propertyInfo) || {}, (apiNewData === null || apiNewData === void 0 ? void 0 : apiNewData.meterDetails) || {}) : null;
3856
+ const flatOldData = apiOldData ? _extends({}, apiOldData || {}, (apiOldData === null || apiOldData === void 0 ? void 0 : apiOldData.connectionDetails) || {}, (apiOldData === null || apiOldData === void 0 ? void 0 : apiOldData.addressDetails) || {}, (apiOldData === null || apiOldData === void 0 ? void 0 : apiOldData.propertyInfo) || {}, (apiOldData === null || apiOldData === void 0 ? void 0 : apiOldData.meterDetails) || {}) : null;
3708
3857
  const prepareConsolidatedData = data => {
3709
3858
  if (!data) return null;
3710
3859
  const apiConn = (data === null || data === void 0 ? void 0 : data.connectionDetails) || data || {};
@@ -3739,7 +3888,7 @@ const Review = () => {
3739
3888
  email: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.email,
3740
3889
  noOfPerson: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.noOfPerson) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.noOfPersons),
3741
3890
  knumber: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.knumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.kno),
3742
- doorPhotoFilestoreId: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.doorPhotoFilestoreId
3891
+ doorPhotoFilestoreId: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.doorPhotoFileStoreId) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.doorPhotoFilestoreId)
3743
3892
  },
3744
3893
  property: {
3745
3894
  kno: apiProp === null || apiProp === void 0 ? void 0 : apiProp.kno,
@@ -3752,7 +3901,7 @@ const Review = () => {
3752
3901
  tenantMobile: apiProp === null || apiProp === void 0 ? void 0 : apiProp.tenantMobile,
3753
3902
  ekycStatus: apiProp === null || apiProp === void 0 ? void 0 : apiProp.ekycStatus,
3754
3903
  propertyDocumentFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.propertyDocumentFileStoreId,
3755
- buildingImageFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFileStoreId
3904
+ buildingImageFileStoreId: (apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFileStoreId) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFilestoreId)
3756
3905
  },
3757
3906
  meter: {
3758
3907
  kno: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.kno,
@@ -3765,12 +3914,11 @@ const Review = () => {
3765
3914
  workingStatus: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.workingStatus,
3766
3915
  lastBillRaised: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.lastBillRaised,
3767
3916
  systemMeterId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.systemMeterId,
3768
- meterPhotoFileStoreId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFileStoreId
3917
+ meterPhotoFileStoreId: (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFileStoreId) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFilestoreId)
3769
3918
  }
3770
3919
  };
3771
3920
  };
3772
3921
  const newDataRaw = prepareConsolidatedData(apiNewData);
3773
- const oldDataRaw = prepareConsolidatedData(apiOldData);
3774
3922
  const connectionData = _extends({}, newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.connection, {
3775
3923
  consumerName: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.name) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio = newDataRaw.connection) === null || _newDataRaw$connectio === void 0 ? void 0 : _newDataRaw$connectio.consumerName),
3776
3924
  phoneNumber: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.mobileNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio2 = newDataRaw.connection) === null || _newDataRaw$connectio2 === void 0 ? void 0 : _newDataRaw$connectio2.phoneNumber),
@@ -3813,136 +3961,323 @@ const Review = () => {
3813
3961
  lastBillRaised: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$lastBill = editedMeter.lastBillRaisedData) === null || _editedMeter$lastBill === void 0 ? void 0 : _editedMeter$lastBill.value) === "Yes" || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter7 = newDataRaw.meter) === null || _newDataRaw$meter7 === void 0 ? void 0 : _newDataRaw$meter7.lastBillRaised),
3814
3962
  meterPhotoFileStoreId: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterPhotoFileStoreId) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter8 = newDataRaw.meter) === null || _newDataRaw$meter8 === void 0 ? void 0 : _newDataRaw$meter8.meterPhotoFileStoreId)
3815
3963
  });
3816
- const connectionFields = [{
3817
- label: "EKYC_K_NUMBER",
3818
- key: "knumber"
3964
+ const headerMapping = [{
3965
+ key: "kno",
3966
+ label: "KNO"
3819
3967
  }, {
3820
- label: "EKYC_CONSUMER_NAME",
3821
- key: "consumerName"
3968
+ key: "firstName",
3969
+ label: "FIRST_NAME"
3822
3970
  }, {
3823
- label: "EKYC_ADDRESS",
3824
- key: "address"
3971
+ key: "middleName",
3972
+ label: "MIDDLE_NAME"
3825
3973
  }, {
3826
- label: "EKYC_CONNECTION_TYPE",
3827
- key: "connectionType"
3974
+ key: "lastName",
3975
+ label: "LAST_NAME"
3828
3976
  }, {
3829
- label: "EKYC_METER_NO",
3830
- key: "meterNumber"
3977
+ key: "status",
3978
+ label: "STATUS"
3831
3979
  }, {
3832
- label: "EKYC_MOBILE_NO",
3833
- key: "phoneNumber"
3980
+ key: "ekycStatus",
3981
+ label: "EKYC_STATUS"
3834
3982
  }, {
3835
- label: "EKYC_EMAIL",
3836
- key: "email"
3983
+ key: "zoneName",
3984
+ label: "ZONE"
3837
3985
  }, {
3838
- label: "EKYC_STATUS_FLAG",
3839
- key: "statusflag"
3986
+ key: "zoneCode",
3987
+ label: "ZONE_CODE"
3840
3988
  }, {
3841
- label: "EKYC_STATUS",
3842
- key: "ekycStatus"
3843
- }];
3844
- const addressFields = [{
3845
- label: "EKYC_FULL_ADDRESS",
3846
- key: "fullAddress"
3989
+ key: "assembly",
3990
+ label: "EKYC_ASSEMBLY"
3847
3991
  }, {
3848
- label: "EKYC_FLAT_HOUSE_NO",
3849
- key: "flatHouseNumber"
3992
+ key: "ward",
3993
+ label: "WARD"
3850
3994
  }, {
3851
- label: "EKYC_BUILDING_TOWER",
3852
- key: "buildingTower"
3995
+ key: "pincode",
3996
+ label: "EKYC_PINCODE"
3853
3997
  }, {
3854
- label: "EKYC_LANDMARK",
3855
- key: "landmark"
3998
+ key: "addressRaw",
3999
+ label: "ADDRESS_RAW"
3856
4000
  }, {
3857
- label: "EKYC_PINCODE",
3858
- key: "pinCode"
4001
+ key: "locality",
4002
+ label: "EKYC_LOCALITY"
3859
4003
  }, {
3860
- label: "EKYC_LOCALITY",
3861
- key: "ward"
4004
+ key: "subLocality",
4005
+ label: "SUB_LOCALITY"
3862
4006
  }, {
3863
- label: "EKYC_ASSEMBLY",
3864
- key: "assembly"
4007
+ key: "flatHouseNumber",
4008
+ label: "FLAT_HOUSE_NUMBER"
3865
4009
  }, {
3866
- label: "EKYC_GPS_VALID",
3867
- key: "gpsValid",
3868
- isBool: true
4010
+ key: "streetName",
4011
+ label: "STREET_NAME"
3869
4012
  }, {
3870
- label: "EKYC_LATITUDE",
3871
- key: "latitude"
4013
+ key: "landmark",
4014
+ label: "EKYC_LANDMARK"
3872
4015
  }, {
3873
- label: "EKYC_LONGITUDE",
3874
- key: "longitude"
4016
+ key: "city",
4017
+ label: "CITY"
3875
4018
  }, {
3876
- label: "EKYC_MOBILE_NO",
3877
- key: "mobileNo"
4019
+ key: "state",
4020
+ label: "STATE"
3878
4021
  }, {
3879
- label: "EKYC_WHATSAPP_NO",
3880
- key: "whatsappNo"
4022
+ key: "addressType",
4023
+ label: "ADDRESS_TYPE"
3881
4024
  }, {
3882
- label: "EKYC_EMAIL",
3883
- key: "email"
4025
+ key: "addressProofType",
4026
+ label: "ADDRESS_PROOF_TYPE"
3884
4027
  }, {
3885
- label: "EKYC_NO_OF_PERSONS",
3886
- key: "noOfPerson"
4028
+ key: "mobileNo",
4029
+ label: "MOBILE_NUMBER"
3887
4030
  }, {
3888
- label: "EKYC_K_NUMBER",
3889
- key: "knumber"
3890
- }];
3891
- const propertyFields = [{
3892
- label: "EKYC_CONNECTION_CATEGORY",
3893
- key: "connectionCategory"
4031
+ key: "alternateMobileNo",
4032
+ label: "ALTERNATE_MOBILE_NUMBER"
3894
4033
  }, {
3895
- label: "EKYC_PID_NUMBER",
3896
- key: "pidNumber"
4034
+ key: "whatsappNo",
4035
+ label: "WHATSAPP_NO"
3897
4036
  }, {
3898
- label: "EKYC_TYPE_OF_CONNECTION",
3899
- key: "typeOfConnection"
4037
+ key: "email",
4038
+ label: "EMAIL"
3900
4039
  }, {
3901
- label: "EKYC_USER_TYPE",
3902
- key: "userType"
4040
+ key: "landlineNo",
4041
+ label: "LANDLINE_NO"
3903
4042
  }, {
3904
- label: "EKYC_FLOOR_COUNT",
3905
- key: "numberOfFloors"
4043
+ key: "mrkey",
4044
+ label: "MR_KEY"
3906
4045
  }, {
3907
- label: "EKYC_TENANT_NAME",
3908
- key: "tenantName"
4046
+ key: "mrcode",
4047
+ label: "MR_CODE"
3909
4048
  }, {
3910
- label: "EKYC_TENANT_MOBILE",
3911
- key: "tenantMobile"
4049
+ key: "areacode",
4050
+ label: "AREA_CODE"
3912
4051
  }, {
3913
- label: "EKYC_STATUS",
3914
- key: "ekycStatus"
3915
- }];
3916
- const meterFields = [{
3917
- label: "EKYC_METERED",
3918
- key: "metered",
4052
+ key: "source",
4053
+ label: "SOURCE"
4054
+ }, {
4055
+ key: "submittedAt",
4056
+ label: "SUBMITTED_AT"
4057
+ }, {
4058
+ key: "assignedAt",
4059
+ label: "ASSIGNED_AT"
4060
+ }, {
4061
+ key: "connectionType",
4062
+ label: "CONNECTION_TYPE"
4063
+ }, {
4064
+ key: "Type",
4065
+ label: "CONSUMER_TYPE"
4066
+ }, {
4067
+ key: "occupantType",
4068
+ label: "OCCUPANT_TYPE"
4069
+ }, {
4070
+ key: "knoCategory",
4071
+ label: "KNO_CATEGORY"
4072
+ }, {
4073
+ key: "approvedAt",
4074
+ label: "APPROVED_AT"
4075
+ }, {
4076
+ key: "gender",
4077
+ label: "GENDER"
4078
+ }, {
4079
+ key: "parentSpouse",
4080
+ label: "PARENT_SPOUSE"
4081
+ }, {
4082
+ key: "fatherOrHusbandName",
4083
+ label: "FATHER_HUSBUND_NAME"
4084
+ }, {
4085
+ key: "relationship",
4086
+ label: "RELATIONSHIP"
4087
+ }, {
4088
+ key: "informantName",
4089
+ label: "INFORMANT_NAME"
4090
+ }, {
4091
+ key: "informantRelation",
4092
+ label: "INFORMANT_RELATION"
4093
+ }, {
4094
+ key: "informantIs",
4095
+ label: "INFORMANT_IS"
4096
+ }, {
4097
+ key: "contactPerson",
4098
+ label: "CONTACT_PERSON"
4099
+ }, {
4100
+ key: "relation",
4101
+ label: "RELATION"
4102
+ }, {
4103
+ key: "entityName",
4104
+ label: "ENTITY_NAME"
4105
+ }, {
4106
+ key: "designation",
4107
+ label: "DESIGNATION"
4108
+ }, {
4109
+ key: "department",
4110
+ label: "DEPARTMENT"
4111
+ }, {
4112
+ key: "employeeId",
4113
+ label: "EMPLOYEE_ID"
4114
+ }, {
4115
+ key: "ownerMobile",
4116
+ label: "OWNER_MOBILE"
4117
+ }, {
4118
+ key: "ownerVerificationDone",
4119
+ label: "OWNER_VERIFICATION_DONE",
4120
+ isBool: true
4121
+ }, {
4122
+ key: "consentGiven",
4123
+ label: "CONSENT_GIVEN",
4124
+ isBool: true
4125
+ }, {
4126
+ key: "proofOfIdentityType",
4127
+ label: "PROOF_OF_IDENTITY_TYPE"
4128
+ }, {
4129
+ key: "documentNumber",
4130
+ label: "DOCUMENT_NUMBER"
4131
+ }, {
4132
+ key: "noOfPerson",
4133
+ label: "NUMBER_OF_PERSON"
4134
+ }, {
4135
+ key: "latitude",
4136
+ label: "LATITUDE"
4137
+ }, {
4138
+ key: "longitude",
4139
+ label: "LONGITUDE"
4140
+ }, {
4141
+ key: "gpsValid",
4142
+ label: "GPS_VALID",
3919
4143
  isBool: true
3920
4144
  }, {
3921
- label: "EKYC_METER_NO",
3922
- key: "meterNumber"
4145
+ key: "meterNumber",
4146
+ label: "METER_NUMBER"
4147
+ }, {
4148
+ key: "meterMake",
4149
+ label: "METER_MAKE"
3923
4150
  }, {
3924
- label: "EKYC_METER_MAKE",
3925
- key: "meterMake"
4151
+ key: "meterStatus",
4152
+ label: "METER_STATUS"
3926
4153
  }, {
3927
- label: "EKYC_METER_LOCATION_ADDRESS",
3928
- key: "meterLocationAddress"
4154
+ key: "meterCondition",
4155
+ label: "METER_CONDITION"
3929
4156
  }, {
3930
- label: "EKYC_METER_LATITUDE",
3931
- key: "meterLatitude"
4157
+ key: "meterLocation",
4158
+ label: "METER_LOCATION"
3932
4159
  }, {
3933
- label: "EKYC_METER_LONGITUDE",
3934
- key: "meterLongitude"
4160
+ key: "meterLocationAddress",
4161
+ label: "METER_LOCATION_ADDRESS"
3935
4162
  }, {
3936
- label: "EKYC_WORKING_STATUS",
3937
4163
  key: "workingStatus",
4164
+ label: "WORKING_STATUS"
4165
+ }, {
4166
+ key: "sewerConnection",
4167
+ label: "SEWER_CONNECTION",
4168
+ isBool: true
4169
+ }, {
4170
+ key: "septicTank",
4171
+ label: "SEPTIC_TANK",
3938
4172
  isBool: true
3939
4173
  }, {
3940
- label: "EKYC_LAST_BILL_RAISED",
3941
4174
  key: "lastBillRaised",
4175
+ label: "LAST_BILL_RAISED",
4176
+ isBool: true
4177
+ }, {
4178
+ key: "lastBillReceivedDate",
4179
+ label: "LAST_BILL_RECEIVED_DATE"
4180
+ }, {
4181
+ key: "accessToMeter",
4182
+ label: "ACCESS_TO_METER",
4183
+ isBool: true
4184
+ }, {
4185
+ key: "systemMeterId",
4186
+ label: "SYSTEM_METER_ID"
4187
+ }, {
4188
+ key: "lastBillNotRaisedReason",
4189
+ label: "LAST_BILL_NOT_RAISED_REASON"
4190
+ }, {
4191
+ key: "waterConnectionYears",
4192
+ label: "WATER_CONNECTION_YEARS"
4193
+ }, {
4194
+ key: "sewerConnectionYears",
4195
+ label: "SEWER_CONNECTION_YEARS"
4196
+ }, {
4197
+ key: "pidNumber",
4198
+ label: "PID_NUMBER"
4199
+ }, {
4200
+ key: "propertyType",
4201
+ label: "PROPERTY_TYPE"
4202
+ }, {
4203
+ key: "subPropertyCategory",
4204
+ label: "SUB_PROPERTY_CATEGORY"
4205
+ }, {
4206
+ key: "noOfFloor",
4207
+ label: "NO_OF_FLOOR"
4208
+ }, {
4209
+ key: "noOfRooms",
4210
+ label: "NO_OF_ROOMS"
4211
+ }, {
4212
+ key: "noOfBeds",
4213
+ label: "NO_OF_BEDS"
4214
+ }, {
4215
+ key: "numberOfDwellingUnits",
4216
+ label: "NUMBER_OF_DWELLING_UNITS"
4217
+ }, {
4218
+ key: "floorNo",
4219
+ label: "FLOOR_NO"
4220
+ }, {
4221
+ key: "userType",
4222
+ label: "USER_TYPE"
4223
+ }, {
4224
+ key: "tenantName",
4225
+ label: "TENANT_NAME"
4226
+ }, {
4227
+ key: "tenantMobile",
4228
+ label: "TENANT_MOBILE"
4229
+ }, {
4230
+ key: "verificationStatus",
4231
+ label: "VERIFICATION_STATUS"
4232
+ }, {
4233
+ key: "houseBuiltDuration",
4234
+ label: "HOUSE_BUILT_DURATION"
4235
+ }, {
4236
+ key: "surveyorId",
4237
+ label: "SURVEYOR_ID"
4238
+ }, {
4239
+ key: "supervisorId",
4240
+ label: "SUPERVISOR_ID"
4241
+ }, {
4242
+ key: "vendorId",
4243
+ label: "VENDOR_ID"
4244
+ }, {
4245
+ key: "assignmentType",
4246
+ label: "ASSIGNMENT_TYPE"
4247
+ }, {
4248
+ key: "assignmentValue",
4249
+ label: "ASSIGNMENT_VALUE"
4250
+ }, {
4251
+ key: "assignedTime",
4252
+ label: "ASSIGNED_TIME"
4253
+ }, {
4254
+ key: "isSelfAssigned",
4255
+ label: "IS_SELF_ASSIGNED",
3942
4256
  isBool: true
3943
4257
  }, {
3944
- label: "EKYC_SYSTEM_METER_ID",
3945
- key: "systemMeterId"
4258
+ key: "modifiedBy",
4259
+ label: "MODIFIED_BY"
4260
+ }, {
4261
+ key: "emailId",
4262
+ label: "EMAIL_ID"
4263
+ }, {
4264
+ key: "dob",
4265
+ label: "DOB"
4266
+ }, {
4267
+ key: "consumerType",
4268
+ label: "CONSUMER_TYPE"
4269
+ }, {
4270
+ key: "createdTime",
4271
+ label: "CREATED_TIME"
4272
+ }, {
4273
+ key: "lastModifiedTime",
4274
+ label: "LAST_MODIFIED_TIME"
4275
+ }, {
4276
+ key: "meterLatitude",
4277
+ label: "EKYC_METER_LATITUDE1"
4278
+ }, {
4279
+ key: "meterLongitude",
4280
+ label: "EKYC_METER_LONGITUDE1"
3946
4281
  }];
3947
4282
  const handleDeclaration = () => setAgree(!agree);
3948
4283
  const handleReject = function () {
@@ -4051,65 +4386,15 @@ const Review = () => {
4051
4386
  }
4052
4387
  };
4053
4388
  if (isSearchLoading || isSubmitting) return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
4054
- const baseUrl = "/digit-ui/employee/ekyc";
4055
4389
  return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
4056
4390
  className: "overflow-y-scroll"
4057
4391
  }, /*#__PURE__*/React__default.createElement(ReviewSection, {
4058
- title: t("EKYC_CONNECTION_DETAILS"),
4059
- fields: connectionFields,
4060
- newData: connectionData,
4061
- oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.connection,
4062
- t: t,
4063
- jumpTo: baseUrl + "/consumer-details?kno=" + activeKno,
4064
- state: _extends({}, flowState, {
4065
- kNumber: activeKno,
4066
- kno: activeKno,
4067
- reviewData: searchData,
4068
- edits
4069
- }),
4070
- hideEditButton: hideEditButton
4071
- }), /*#__PURE__*/React__default.createElement(ReviewSection, {
4072
- title: t("EKYC_ADDRESS_DETAILS"),
4073
- fields: addressFields,
4074
- newData: addressData,
4075
- oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.address,
4076
- t: t,
4077
- jumpTo: baseUrl + "/address-details?kno=" + activeKno,
4078
- state: _extends({}, flowState, {
4079
- kNumber: activeKno,
4080
- kno: activeKno,
4081
- reviewData: searchData,
4082
- edits
4083
- }),
4084
- hideEditButton: hideEditButton
4085
- }), /*#__PURE__*/React__default.createElement(ReviewSection, {
4086
- title: t("EKYC_PROPERTY_INFO"),
4087
- fields: propertyFields,
4088
- newData: propertyData,
4089
- oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.property,
4090
- t: t,
4091
- jumpTo: baseUrl + "/property-info?kno=" + activeKno,
4092
- state: _extends({}, flowState, {
4093
- kNumber: activeKno,
4094
- kno: activeKno,
4095
- reviewData: searchData,
4096
- edits
4097
- }),
4098
- hideEditButton: hideEditButton
4099
- }), /*#__PURE__*/React__default.createElement(ReviewSection, {
4100
- title: t("EKYC_METER_DETAILS"),
4101
- fields: meterFields,
4102
- newData: meterData,
4103
- oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.meter,
4392
+ title: t("EKYC_ALL_DETAILS") || "All Details",
4393
+ fields: headerMapping,
4394
+ newData: flatNewData,
4395
+ oldData: flatOldData,
4104
4396
  t: t,
4105
- jumpTo: baseUrl + "/meter-details?kno=" + activeKno,
4106
- state: _extends({}, flowState, {
4107
- kNumber: activeKno,
4108
- kno: activeKno,
4109
- reviewData: searchData,
4110
- edits
4111
- }),
4112
- hideEditButton: hideEditButton
4397
+ hideEditButton: true
4113
4398
  }), /*#__PURE__*/React__default.createElement("div", {
4114
4399
  style: {
4115
4400
  marginTop: "40px"
@@ -5572,21 +5857,37 @@ const SupervisorDetailsCard = () => {
5572
5857
  console.error("Failed to generate supervisor report:", err);
5573
5858
  } finally {
5574
5859
  setReportLoading(false);
5860
+ }
5861
+ };
5862
+ const handlePresetDownload = function (filter) {
5863
+ try {
5864
+ const range = getDateRange(filter);
5865
+ if (!range) return Promise.resolve();
5575
5866
  setShowReportMenu(false);
5576
5867
  setShowCustomPicker(false);
5868
+ return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
5869
+ } catch (e) {
5870
+ return Promise.reject(e);
5577
5871
  }
5578
5872
  };
5579
- const handlePresetDownload = filter => {
5580
- handleDownload();
5581
- };
5582
- const handleCustomDownload = () => {
5583
- if (!customDate.from || !customDate.to) {
5584
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
5585
- return;
5873
+ const handleCustomDownload = function () {
5874
+ try {
5875
+ if (!customDate.from || !customDate.to) {
5876
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
5877
+ return Promise.resolve();
5878
+ }
5879
+ const from = new Date(customDate.from);
5880
+ from.setHours(0, 0, 0, 0);
5881
+ const to = new Date(customDate.to);
5882
+ to.setHours(23, 59, 59, 999);
5883
+ setShowReportMenu(false);
5884
+ setShowCustomPicker(false);
5885
+ return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
5886
+ } catch (e) {
5887
+ return Promise.reject(e);
5586
5888
  }
5587
- handleDownload();
5588
5889
  };
5589
- const handleDownloadEkycData = function () {
5890
+ const handleDownloadEkycData = function (fromDate, toDate) {
5590
5891
  try {
5591
5892
  if (!surveyors || surveyors.length === 0) {
5592
5893
  alert(t("NO_SURVEYORS_ASSIGNED") || "No surveyors assigned to this supervisor.");
@@ -5595,69 +5896,175 @@ const SupervisorDetailsCard = () => {
5595
5896
  setEkycDownloadLoading(true);
5596
5897
  return Promise.resolve(_finallyRethrows(function () {
5597
5898
  return _catch(function () {
5598
- return Promise.resolve(Digit.EkycService.application_list({
5899
+ return Promise.resolve(Digit.EkycService.application_list(_extends({
5599
5900
  tenantId: tenantId || "dl.djb",
5600
5901
  offset: 0,
5601
5902
  limit: 10000,
5602
5903
  reportDownload: true
5603
- })).then(function (response) {
5904
+ }, fromDate && {
5905
+ fromDate
5906
+ }, toDate && {
5907
+ toDate
5908
+ }))).then(function (response) {
5604
5909
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
5605
5910
  if (consumerList.length === 0) {
5606
5911
  alert(t("NO_DATA_FOUND") || "No data found for download.");
5607
5912
  return;
5608
5913
  }
5609
- const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
5914
+ const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
5610
5915
  const headerMapping = {
5611
- kno: t("KNO") || "KNO",
5612
- firstName: t("FIRST_NAME") || "First Name",
5613
- middleName: t("MIDDLE_NAME") || "Middle Name",
5614
- lastName: t("LAST_NAME") || "Last Name",
5615
- gender: t("GENDER") || "Gender",
5616
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
5617
- emailId: t("EMAIL_ID") || "Email ID",
5618
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
5619
- relationship: t("RELATIONSHIP") || "Relationship",
5620
- dob: t("DOB") || "Date of Birth",
5621
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
5622
- zoneName: t("ZONE") || "Zone",
5623
- assembly: t("ASSEMBLY") || "Assembly",
5624
- ward: t("WARD") || "Ward",
5625
- pincode: t("PINCODE") || "Pincode",
5626
- mrkey: t("MR_KEY") || "MR Key",
5627
- consumerType: t("CONSUMER_TYPE") || "Consumer Type",
5628
- createdTime: t("CREATED_TIME") || "Created Time",
5629
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
5630
- };
5631
- const toTitleCase = str => {
5632
- if (!str) return "";
5633
- const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
5634
- return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
5635
- };
5636
- const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
5637
- const excelData = consumerList.map(item => {
5638
- const cleanObj = {};
5639
- const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
5640
- if (fullName) {
5641
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
5642
- }
5643
- Object.keys(item).forEach(key => {
5644
- if (excludedKeys.includes(key)) return;
5645
- const val = item[key];
5646
- if (typeof val === "object" && val !== null) {
5647
- return;
5648
- }
5649
- const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
5650
- if (typeof val === "string" && titleCaseFields.includes(key)) {
5651
- cleanObj[friendlyHeader] = toTitleCase(val);
5652
- } else {
5653
- cleanObj[friendlyHeader] = val;
5654
- }
5655
- });
5656
- return cleanObj;
5657
- });
5658
- const cleanFileName = "eKYC_Data_Supervisor_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
5659
- Digit.Download.Excel(excelData, cleanFileName);
5660
- });
5916
+ kno: t("KNO"),
5917
+ firstName: t("FIRST_NAME"),
5918
+ middleName: t("MIDDLE_NAME"),
5919
+ lastName: t("LAST_NAME"),
5920
+ status: t("STATUS"),
5921
+ ekycStatus: t("EKYC_STATUS"),
5922
+ zoneName: t("ZONE"),
5923
+ zoneCode: t("ZONE_CODE"),
5924
+ assembly: t("EKYC_ASSEMBLY"),
5925
+ ward: t("WARD"),
5926
+ pincode: t("EKYC_PINCODE"),
5927
+ addressRaw: t("ADDRESS_RAW"),
5928
+ locality: t("EKYC_LOCALITY"),
5929
+ subLocality: t("SUB_LOCALITY"),
5930
+ flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
5931
+ streetName: t("STREET_NAME"),
5932
+ landmark: t("EKYC_LANDMARK"),
5933
+ city: t("CITY"),
5934
+ state: t("STATE"),
5935
+ addressType: t("ADDRESS_TYPE"),
5936
+ addressProofType: t("ADDRESS_PROOF_TYPE"),
5937
+ mobileNo: t("MOBILE_NUMBER"),
5938
+ alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
5939
+ whatsappNo: t("WHATSAPP_NO"),
5940
+ email: t("EMAIL"),
5941
+ landlineNo: t("LANDLINE_NO"),
5942
+ mrkey: t("MR_KEY"),
5943
+ mrcode: t("MR_CODE"),
5944
+ areacode: t("AREA_CODE"),
5945
+ source: t("SOURCE"),
5946
+ submittedAt: t("SUBMITTED_AT"),
5947
+ assignedAt: t("ASSIGNED_AT"),
5948
+ connectionType: t("CONNECTION_TYPE"),
5949
+ Type: t("CONSUMER_TYPE"),
5950
+ occupantType: t("OCCUPANT_TYPE"),
5951
+ knoCategory: t("KNO_CATEGORY"),
5952
+ approvedAt: t("APPROVED_AT"),
5953
+ gender: t("GENDER"),
5954
+ parentSpouse: t("PARENT_SPOUSE"),
5955
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
5956
+ relationship: t("RELATIONSHIP"),
5957
+ informantName: t("INFORMANT_NAME"),
5958
+ informantRelation: t("INFORMANT_RELATION"),
5959
+ informantIs: t("INFORMANT_IS"),
5960
+ contactPerson: t("CONTACT_PERSON"),
5961
+ relation: t("RELATION"),
5962
+ entityName: t("ENTITY_NAME"),
5963
+ designation: t("DESIGNATION"),
5964
+ department: t("DEPARTMENT"),
5965
+ employeeId: t("EMPLOYEE_ID"),
5966
+ ownerMobile: t("OWNER_MOBILE"),
5967
+ ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
5968
+ consentGiven: t("CONSENT_GIVEN"),
5969
+ proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
5970
+ documentNumber: t("DOCUMENT_NUMBER"),
5971
+ noOfPerson: t("NUMBER_OF_PERSON"),
5972
+ latitude: t("LATITUDE"),
5973
+ longitude: t("LONGITUDE"),
5974
+ gpsValid: t("GPS_VALID"),
5975
+ meterNumber: t("METER_NUMBER"),
5976
+ meterMake: t("METER_MAKE"),
5977
+ meterStatus: t("METER_STATUS"),
5978
+ meterCondition: t("METER_CONDITION"),
5979
+ meterLocation: t("METER_LOCATION"),
5980
+ meterLocationAddress: t("METER_LOCATION_ADDRESS"),
5981
+ workingStatus: t("WORKING_STATUS"),
5982
+ sewerConnection: t("SEWER_CONNECTION"),
5983
+ septicTank: t("SEPTIC_TANK"),
5984
+ lastBillRaised: t("LAST_BILL_RAISED"),
5985
+ lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
5986
+ accessToMeter: t("ACCESS_TO_METER"),
5987
+ systemMeterId: t("SYSTEM_METER_ID"),
5988
+ lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
5989
+ waterConnectionYears: t("WATER_CONNECTION_YEARS"),
5990
+ sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
5991
+ pidNumber: t("PID_NUMBER"),
5992
+ propertyType: t("PROPERTY_TYPE"),
5993
+ subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
5994
+ noOfFloor: t("NO_OF_FLOOR"),
5995
+ noOfRooms: t("NO_OF_ROOMS"),
5996
+ noOfBeds: t("NO_OF_BEDS"),
5997
+ numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
5998
+ floorNo: t("FLOOR_NO"),
5999
+ userType: t("USER_TYPE"),
6000
+ tenantName: t("TENANT_NAME"),
6001
+ tenantMobile: t("TENANT_MOBILE"),
6002
+ verificationStatus: t("VERIFICATION_STATUS"),
6003
+ houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
6004
+ surveyorId: t("SURVEYOR_ID"),
6005
+ supervisorId: t("SUPERVISOR_ID"),
6006
+ vendorId: t("VENDOR_ID"),
6007
+ assignmentType: t("ASSIGNMENT_TYPE"),
6008
+ assignmentValue: t("ASSIGNMENT_VALUE"),
6009
+ assignedTime: t("ASSIGNED_TIME"),
6010
+ isSelfAssigned: t("IS_SELF_ASSIGNED"),
6011
+ doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
6012
+ panFilestoreId: t("PAN_FILESTORE_ID"),
6013
+ documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
6014
+ buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
6015
+ propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
6016
+ meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
6017
+ modifiedBy: t("MODIFIED_BY"),
6018
+ emailId: t("EMAIL_ID"),
6019
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
6020
+ dob: t("DOB"),
6021
+ consumerType: t("CONSUMER_TYPE"),
6022
+ createdTime: t("CREATED_TIME"),
6023
+ lastModifiedTime: t("LAST_MODIFIED_TIME"),
6024
+ meterLatitude: t("EKYC_METER_LATITUDE1"),
6025
+ meterLongitude: t("EKYC_METER_LONGITUDE1")
6026
+ };
6027
+ const toTitleCase = str => {
6028
+ if (!str) return "";
6029
+ let cleanStr = String(str);
6030
+ if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
6031
+ cleanStr = cleanStr.split(".").pop();
6032
+ }
6033
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
6034
+ };
6035
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
6036
+ const translatedFields = ["meterMake", "meterLocation"];
6037
+ const excelData = consumerList.map(item => {
6038
+ const cleanObj = {};
6039
+ const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
6040
+ if (fullName) {
6041
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
6042
+ }
6043
+ Object.keys(item).forEach(key => {
6044
+ if (excludedKeys.includes(key)) return;
6045
+ let val = item[key];
6046
+ if (typeof val === "object" && val !== null) {
6047
+ return;
6048
+ }
6049
+ if (String(val).toLowerCase() === "true") {
6050
+ val = t("CS_YES");
6051
+ } else if (String(val).toLowerCase() === "false") {
6052
+ val = t("CS_NO");
6053
+ }
6054
+ const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
6055
+ if (typeof val === "string" && translatedFields.includes(key)) {
6056
+ cleanObj[friendlyHeader] = t(val);
6057
+ } else if (typeof val === "string" && !skipTitleCase.includes(key)) {
6058
+ cleanObj[friendlyHeader] = toTitleCase(val);
6059
+ } else {
6060
+ cleanObj[friendlyHeader] = val;
6061
+ }
6062
+ });
6063
+ return cleanObj;
6064
+ });
6065
+ const cleanFileName = "eKYC_Data_Supervisor_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
6066
+ Digit.Download.Excel(excelData, cleanFileName);
6067
+ });
5661
6068
  }, function (error) {
5662
6069
  console.error("Error downloading eKYC Excel:", error);
5663
6070
  });
@@ -5670,6 +6077,34 @@ const SupervisorDetailsCard = () => {
5670
6077
  return Promise.reject(e);
5671
6078
  }
5672
6079
  };
6080
+ const getDateRange = filter => {
6081
+ const now = new Date();
6082
+ const start = new Date(now);
6083
+ if (filter === "today") {
6084
+ start.setHours(0, 0, 0, 0);
6085
+ return {
6086
+ from: start,
6087
+ to: now
6088
+ };
6089
+ }
6090
+ if (filter === "week") {
6091
+ start.setDate(now.getDate() - now.getDay());
6092
+ start.setHours(0, 0, 0, 0);
6093
+ return {
6094
+ from: start,
6095
+ to: now
6096
+ };
6097
+ }
6098
+ if (filter === "month") {
6099
+ start.setDate(1);
6100
+ start.setHours(0, 0, 0, 0);
6101
+ return {
6102
+ from: start,
6103
+ to: now
6104
+ };
6105
+ }
6106
+ return null;
6107
+ };
5673
6108
  const StatCard = _ref3 => {
5674
6109
  let title = _ref3.title,
5675
6110
  value = _ref3.value,
@@ -5716,65 +6151,12 @@ const SupervisorDetailsCard = () => {
5716
6151
  }, fullName), /*#__PURE__*/React__default.createElement("div", {
5717
6152
  className: "designation"
5718
6153
  }, t("FIELD_SUPERVISOR") || "Field Supervisor"))), /*#__PURE__*/React__default.createElement("div", {
5719
- className: "report-download",
5720
- ref: reportMenuRef
6154
+ className: "report-download"
5721
6155
  }, /*#__PURE__*/React__default.createElement("button", {
5722
6156
  className: "download-btn",
5723
6157
  disabled: reportLoading,
5724
- onClick: () => {
5725
- setShowReportMenu(p => !p);
5726
- setShowCustomPicker(false);
5727
- }
5728
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
5729
- className: "report-menu"
5730
- }, [{
5731
- label: t("TODAY") || "Today",
5732
- key: "today"
5733
- }, {
5734
- label: t("THIS_WEEK") || "This Week",
5735
- key: "week"
5736
- }, {
5737
- label: t("THIS_MONTH") || "This Month",
5738
- key: "month"
5739
- }].map(_ref4 => {
5740
- let label = _ref4.label,
5741
- key = _ref4.key;
5742
- return /*#__PURE__*/React__default.createElement("div", {
5743
- key: key,
5744
- className: "menu-item",
5745
- onClick: () => handlePresetDownload()
5746
- }, label);
5747
- }), /*#__PURE__*/React__default.createElement("div", {
5748
- className: "custom-date-trigger",
5749
- onClick: () => setShowCustomPicker(p => !p)
5750
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
5751
- className: "custom-picker"
5752
- }, /*#__PURE__*/React__default.createElement("div", {
5753
- className: "date-field"
5754
- }, /*#__PURE__*/React__default.createElement("label", {
5755
- className: "date-label"
5756
- }, t("FROM_DATE") || "From"), /*#__PURE__*/React__default.createElement("input", {
5757
- type: "date",
5758
- className: "date-input",
5759
- value: customDate.from,
5760
- onChange: e => setCustomDate(d => _extends({}, d, {
5761
- from: e.target.value
5762
- }))
5763
- })), /*#__PURE__*/React__default.createElement("div", {
5764
- className: "date-field"
5765
- }, /*#__PURE__*/React__default.createElement("label", {
5766
- className: "date-label"
5767
- }, t("TO_DATE") || "To"), /*#__PURE__*/React__default.createElement("input", {
5768
- type: "date",
5769
- className: "date-input",
5770
- value: customDate.to,
5771
- onChange: e => setCustomDate(d => _extends({}, d, {
5772
- to: e.target.value
5773
- }))
5774
- })), /*#__PURE__*/React__default.createElement("button", {
5775
- className: "download-action-btn",
5776
- onClick: handleCustomDownload
5777
- }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React__default.createElement("div", {
6158
+ onClick: handleDownload
6159
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React__default.createElement("div", {
5778
6160
  className: "stats-wrapper"
5779
6161
  }, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
5780
6162
  key: idx,
@@ -5838,10 +6220,16 @@ const SupervisorDetailsCard = () => {
5838
6220
  className: "details-right"
5839
6221
  }, /*#__PURE__*/React__default.createElement("div", {
5840
6222
  className: "download-card"
5841
- }, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React__default.createElement("button", {
6223
+ }, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React__default.createElement("div", {
6224
+ className: "report-download",
6225
+ ref: reportMenuRef
6226
+ }, /*#__PURE__*/React__default.createElement("button", {
5842
6227
  className: "download-excel-btn",
5843
6228
  disabled: ekycDownloadLoading,
5844
- onClick: handleDownloadEkycData
6229
+ onClick: () => {
6230
+ setShowReportMenu(p => !p);
6231
+ setShowCustomPicker(false);
6232
+ }
5845
6233
  }, /*#__PURE__*/React__default.createElement("svg", {
5846
6234
  width: "16",
5847
6235
  height: "16",
@@ -5860,7 +6248,63 @@ const SupervisorDetailsCard = () => {
5860
6248
  y1: "15",
5861
6249
  x2: "12",
5862
6250
  y2: "3"
5863
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
6251
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
6252
+ className: "report-menu"
6253
+ }, [{
6254
+ label: t("TODAY") || "Today",
6255
+ key: "today"
6256
+ }, {
6257
+ label: t("THIS_WEEK") || "This Week",
6258
+ key: "week"
6259
+ }, {
6260
+ label: t("THIS_MONTH") || "This Month",
6261
+ key: "month"
6262
+ }].map(_ref4 => {
6263
+ let label = _ref4.label,
6264
+ key = _ref4.key;
6265
+ return /*#__PURE__*/React__default.createElement("div", {
6266
+ key: key,
6267
+ className: "menu-item",
6268
+ onClick: () => handlePresetDownload(key)
6269
+ }, label);
6270
+ }), /*#__PURE__*/React__default.createElement("div", {
6271
+ className: "custom-date-trigger",
6272
+ onClick: () => setShowCustomPicker(p => !p)
6273
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
6274
+ className: "custom-picker"
6275
+ }, /*#__PURE__*/React__default.createElement("div", {
6276
+ className: "date-inputs"
6277
+ }, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "From"), /*#__PURE__*/React__default.createElement("input", {
6278
+ type: "date",
6279
+ value: customDate.from,
6280
+ onChange: e => setCustomDate(_extends({}, customDate, {
6281
+ from: e.target.value
6282
+ }))
6283
+ })), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "To"), /*#__PURE__*/React__default.createElement("input", {
6284
+ type: "date",
6285
+ value: customDate.to,
6286
+ onChange: e => setCustomDate(_extends({}, customDate, {
6287
+ to: e.target.value
6288
+ }))
6289
+ }))), /*#__PURE__*/React__default.createElement("div", {
6290
+ style: {
6291
+ display: "flex",
6292
+ gap: "10px",
6293
+ marginTop: "10px"
6294
+ }
6295
+ }, /*#__PURE__*/React__default.createElement("button", {
6296
+ className: "picker-cancel-btn",
6297
+ onClick: () => {
6298
+ setShowCustomPicker(false);
6299
+ setCustomDate({
6300
+ from: "",
6301
+ to: ""
6302
+ });
6303
+ }
6304
+ }, t("CANCEL") || "Cancel"), /*#__PURE__*/React__default.createElement("button", {
6305
+ className: "picker-apply-btn",
6306
+ onClick: handleCustomDownload
6307
+ }, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
5864
6308
  className: "dashboard-card"
5865
6309
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
5866
6310
  t: t,
@@ -6402,7 +6846,7 @@ const AssignEkycModal = _ref => {
6402
6846
  };
6403
6847
 
6404
6848
  const SurveyorDetailsDashboard = () => {
6405
- var _Digit$SessionStorage, _Digit$SessionStorage2, _surveyorSearchById$s, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$owner8, _surveyor$owner9, _surveyor$owner0, _dashboardData$dashbo5, _dashboardData$dashbo6;
6849
+ var _Digit$SessionStorage, _Digit$SessionStorage2, _surveyorSearchById$s, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$owner7, _surveyor$owner8, _surveyor$owner9, _dashboardData$dashbo5, _dashboardData$dashbo6;
6406
6850
  const tenantId = Digit.ULBService.getCurrentTenantId();
6407
6851
  const _useState = React.useState(null),
6408
6852
  showModal = _useState[0],
@@ -6614,10 +7058,8 @@ const SurveyorDetailsDashboard = () => {
6614
7058
  }
6615
7059
  return null;
6616
7060
  };
6617
- const handlePresetDownload = function (filter) {
7061
+ const handleDownload = function () {
6618
7062
  try {
6619
- const range = getDateRange(filter);
6620
- if (!range) return Promise.resolve();
6621
7063
  setReportLoading(true);
6622
7064
  const _temp = _finallyRethrows(function () {
6623
7065
  return _catch(function () {
@@ -6626,9 +7068,7 @@ const SurveyorDetailsDashboard = () => {
6626
7068
  tenantId: "dl.djb",
6627
7069
  offset: 0,
6628
7070
  limit: 1000,
6629
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid,
6630
- fromDate: range.from.getTime(),
6631
- toDate: range.to.getTime()
7071
+ surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
6632
7072
  })).then(function (response) {
6633
7073
  var _response$dashboardIn;
6634
7074
  const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn = response.dashboardInfo) === null || _response$dashboardIn === void 0 ? void 0 : _response$dashboardIn.consumerList) || [];
@@ -6648,8 +7088,6 @@ const SurveyorDetailsDashboard = () => {
6648
7088
  });
6649
7089
  }, function (_wasThrown, _result) {
6650
7090
  setReportLoading(false);
6651
- setShowReportMenu(false);
6652
- setShowCustomPicker(false);
6653
7091
  if (_wasThrown) throw _result;
6654
7092
  return _result;
6655
7093
  });
@@ -6658,52 +7096,30 @@ const SurveyorDetailsDashboard = () => {
6658
7096
  return Promise.reject(e);
6659
7097
  }
6660
7098
  };
6661
- const handleCustomDownload = function () {
7099
+ const handlePresetDownload = function (filter) {
6662
7100
  try {
6663
- if (!customDate.from || !customDate.to) {
6664
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
6665
- return Promise.resolve();
6666
- }
6667
- const from = new Date(customDate.from);
6668
- from.setHours(0, 0, 0, 0);
6669
- const to = new Date(customDate.to);
6670
- to.setHours(23, 59, 59, 999);
6671
- setReportLoading(true);
6672
- const _temp2 = _finallyRethrows(function () {
6673
- return _catch(function () {
6674
- var _surveyor$owner6;
6675
- return Promise.resolve(Digit.EkycService.dashboard({}, {
6676
- tenantId: "dl.djb",
6677
- offset: 0,
6678
- limit: 1000,
6679
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.uuid,
6680
- fromDate: from.getTime(),
6681
- toDate: to.getTime()
6682
- })).then(function (response) {
6683
- var _response$dashboardIn2;
6684
- const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn2 = response.dashboardInfo) === null || _response$dashboardIn2 === void 0 ? void 0 : _response$dashboardIn2.consumerList) || [];
6685
- downloadSurveyorPDF({
6686
- rows: rows,
6687
- surveyorName: fullName,
6688
- vendorName,
6689
- supervisorName,
6690
- employeeId,
6691
- mobileNumber,
6692
- dashboardInfo: (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {},
6693
- t
6694
- });
6695
- });
6696
- }, function (err) {
6697
- console.error("Failed to fetch custom dashboard data for report download:", err);
6698
- });
6699
- }, function (_wasThrown2, _result2) {
6700
- setReportLoading(false);
6701
- setShowReportMenu(false);
6702
- setShowCustomPicker(false);
6703
- if (_wasThrown2) throw _result2;
6704
- return _result2;
6705
- });
6706
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
7101
+ const range = getDateRange(filter);
7102
+ if (!range) return Promise.resolve();
7103
+ setShowReportMenu(false);
7104
+ setShowCustomPicker(false);
7105
+ return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
7106
+ } catch (e) {
7107
+ return Promise.reject(e);
7108
+ }
7109
+ };
7110
+ const handleCustomDownload = function () {
7111
+ try {
7112
+ if (!customDate.from || !customDate.to) {
7113
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
7114
+ return Promise.resolve();
7115
+ }
7116
+ const from = new Date(customDate.from);
7117
+ from.setHours(0, 0, 0, 0);
7118
+ const to = new Date(customDate.to);
7119
+ to.setHours(23, 59, 59, 999);
7120
+ setShowReportMenu(false);
7121
+ setShowCustomPicker(false);
7122
+ return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
6707
7123
  } catch (e) {
6708
7124
  return Promise.reject(e);
6709
7125
  }
@@ -6737,61 +7153,164 @@ const SurveyorDetailsDashboard = () => {
6737
7153
  setShowOptions(false);
6738
7154
  setShowModal(option.action);
6739
7155
  };
6740
- const handleDownloadEkycData = function () {
7156
+ const handleDownloadEkycData = function (fromDate, toDate) {
6741
7157
  try {
6742
7158
  setEkycDownloadLoading(true);
6743
7159
  return Promise.resolve(_finallyRethrows(function () {
6744
7160
  return _catch(function () {
6745
- var _surveyor$owner7;
6746
- return Promise.resolve(Digit.EkycService.application_list({
7161
+ var _surveyor$owner6;
7162
+ return Promise.resolve(Digit.EkycService.application_list(_extends({
6747
7163
  tenantId: tenantId || "dl.djb",
6748
7164
  offset: 0,
6749
7165
  limit: 10000,
6750
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner7 = surveyor.owner) === null || _surveyor$owner7 === void 0 ? void 0 : _surveyor$owner7.uuid,
7166
+ surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.uuid,
6751
7167
  reportDownload: true
6752
- })).then(function (response) {
7168
+ }, fromDate && {
7169
+ fromDate
7170
+ }, toDate && {
7171
+ toDate
7172
+ }))).then(function (response) {
6753
7173
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
6754
7174
  if (consumerList.length === 0) {
6755
7175
  alert(t("NO_DATA_FOUND") || "No data found for download.");
6756
7176
  return;
6757
7177
  }
6758
- const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
7178
+ const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
6759
7179
  const headerMapping = {
6760
- kno: t("KNO") || "KNO",
6761
- firstName: t("FIRST_NAME") || "First Name",
6762
- middleName: t("MIDDLE_NAME") || "Middle Name",
6763
- lastName: t("LAST_NAME") || "Last Name",
6764
- gender: t("GENDER") || "Gender",
6765
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
6766
- emailId: t("EMAIL_ID") || "Email ID",
6767
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
6768
- relationship: t("RELATIONSHIP") || "Relationship",
6769
- dob: t("DOB") || "Date of Birth",
6770
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
6771
- zoneName: t("ZONE") || "Zone",
6772
- assembly: t("ASSEMBLY") || "Assembly",
6773
- ward: t("WARD") || "Ward",
6774
- pincode: t("PINCODE") || "Pincode",
6775
- mrkey: t("MR_KEY") || "MR Key",
6776
- consumerType: t("CONSUMER_TYPE") || "Consumer Type",
6777
- createdTime: t("CREATED_TIME") || "Created Time",
6778
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
7180
+ kno: t("KNO"),
7181
+ firstName: t("FIRST_NAME"),
7182
+ middleName: t("MIDDLE_NAME"),
7183
+ lastName: t("LAST_NAME"),
7184
+ status: t("STATUS"),
7185
+ ekycStatus: t("EKYC_STATUS"),
7186
+ zoneName: t("ZONE"),
7187
+ zoneCode: t("ZONE_CODE"),
7188
+ assembly: t("EKYC_ASSEMBLY"),
7189
+ ward: t("WARD"),
7190
+ pincode: t("EKYC_PINCODE"),
7191
+ addressRaw: t("ADDRESS_RAW"),
7192
+ locality: t("EKYC_LOCALITY"),
7193
+ subLocality: t("SUB_LOCALITY"),
7194
+ flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
7195
+ streetName: t("STREET_NAME"),
7196
+ landmark: t("EKYC_LANDMARK"),
7197
+ city: t("CITY"),
7198
+ state: t("STATE"),
7199
+ addressType: t("ADDRESS_TYPE"),
7200
+ addressProofType: t("ADDRESS_PROOF_TYPE"),
7201
+ mobileNo: t("MOBILE_NUMBER"),
7202
+ alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
7203
+ whatsappNo: t("WHATSAPP_NO"),
7204
+ email: t("EMAIL"),
7205
+ landlineNo: t("LANDLINE_NO"),
7206
+ mrkey: t("MR_KEY"),
7207
+ mrcode: t("MR_CODE"),
7208
+ areacode: t("AREA_CODE"),
7209
+ source: t("SOURCE"),
7210
+ submittedAt: t("SUBMITTED_AT"),
7211
+ assignedAt: t("ASSIGNED_AT"),
7212
+ connectionType: t("CONNECTION_TYPE"),
7213
+ Type: t("CONSUMER_TYPE"),
7214
+ occupantType: t("OCCUPANT_TYPE"),
7215
+ knoCategory: t("KNO_CATEGORY"),
7216
+ approvedAt: t("APPROVED_AT"),
7217
+ gender: t("GENDER"),
7218
+ parentSpouse: t("PARENT_SPOUSE"),
7219
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
7220
+ relationship: t("RELATIONSHIP"),
7221
+ informantName: t("INFORMANT_NAME"),
7222
+ informantRelation: t("INFORMANT_RELATION"),
7223
+ informantIs: t("INFORMANT_IS"),
7224
+ contactPerson: t("CONTACT_PERSON"),
7225
+ relation: t("RELATION"),
7226
+ entityName: t("ENTITY_NAME"),
7227
+ designation: t("DESIGNATION"),
7228
+ department: t("DEPARTMENT"),
7229
+ employeeId: t("EMPLOYEE_ID"),
7230
+ ownerMobile: t("OWNER_MOBILE"),
7231
+ ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
7232
+ consentGiven: t("CONSENT_GIVEN"),
7233
+ proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
7234
+ documentNumber: t("DOCUMENT_NUMBER"),
7235
+ noOfPerson: t("NUMBER_OF_PERSON"),
7236
+ latitude: t("LATITUDE"),
7237
+ longitude: t("LONGITUDE"),
7238
+ gpsValid: t("GPS_VALID"),
7239
+ meterNumber: t("METER_NUMBER"),
7240
+ meterMake: t("METER_MAKE"),
7241
+ meterStatus: t("METER_STATUS"),
7242
+ meterCondition: t("METER_CONDITION"),
7243
+ meterLocation: t("METER_LOCATION"),
7244
+ meterLocationAddress: t("METER_LOCATION_ADDRESS"),
7245
+ workingStatus: t("WORKING_STATUS"),
7246
+ sewerConnection: t("SEWER_CONNECTION"),
7247
+ septicTank: t("SEPTIC_TANK"),
7248
+ lastBillRaised: t("LAST_BILL_RAISED"),
7249
+ lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
7250
+ accessToMeter: t("ACCESS_TO_METER"),
7251
+ systemMeterId: t("SYSTEM_METER_ID"),
7252
+ lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
7253
+ waterConnectionYears: t("WATER_CONNECTION_YEARS"),
7254
+ sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
7255
+ pidNumber: t("PID_NUMBER"),
7256
+ propertyType: t("PROPERTY_TYPE"),
7257
+ subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
7258
+ noOfFloor: t("NO_OF_FLOOR"),
7259
+ noOfRooms: t("NO_OF_ROOMS"),
7260
+ noOfBeds: t("NO_OF_BEDS"),
7261
+ numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
7262
+ floorNo: t("FLOOR_NO"),
7263
+ userType: t("USER_TYPE"),
7264
+ tenantName: t("TENANT_NAME"),
7265
+ tenantMobile: t("TENANT_MOBILE"),
7266
+ verificationStatus: t("VERIFICATION_STATUS"),
7267
+ houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
7268
+ surveyorId: t("SURVEYOR_ID"),
7269
+ supervisorId: t("SUPERVISOR_ID"),
7270
+ vendorId: t("VENDOR_ID"),
7271
+ assignmentType: t("ASSIGNMENT_TYPE"),
7272
+ assignmentValue: t("ASSIGNMENT_VALUE"),
7273
+ assignedTime: t("ASSIGNED_TIME"),
7274
+ isSelfAssigned: t("IS_SELF_ASSIGNED"),
7275
+ doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
7276
+ panFilestoreId: t("PAN_FILESTORE_ID"),
7277
+ documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
7278
+ buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
7279
+ propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
7280
+ meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
7281
+ modifiedBy: t("MODIFIED_BY"),
7282
+ emailId: t("EMAIL_ID"),
7283
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
7284
+ dob: t("DOB"),
7285
+ consumerType: t("CONSUMER_TYPE"),
7286
+ createdTime: t("CREATED_TIME"),
7287
+ lastModifiedTime: t("LAST_MODIFIED_TIME"),
7288
+ meterLatitude: t("EKYC_METER_LATITUDE1"),
7289
+ meterLongitude: t("EKYC_METER_LONGITUDE1")
6779
7290
  };
7291
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
7292
+ const translatedFields = ["meterMake", "meterLocation"];
6780
7293
  const excelData = consumerList.map(item => {
6781
7294
  const cleanObj = {};
6782
7295
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
6783
7296
  if (fullName) {
6784
7297
  cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
6785
7298
  }
6786
- const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
6787
7299
  Object.keys(item).forEach(key => {
6788
7300
  if (excludedKeys.includes(key)) return;
6789
- const val = item[key];
7301
+ let val = item[key];
6790
7302
  if (typeof val === "object" && val !== null) {
6791
7303
  return;
6792
7304
  }
7305
+ if (String(val).toLowerCase() === "true") {
7306
+ val = t("CS_YES");
7307
+ } else if (String(val).toLowerCase() === "false") {
7308
+ val = t("CS_NO");
7309
+ }
6793
7310
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
6794
- if (typeof val === "string" && titleCaseFields.includes(key)) {
7311
+ if (typeof val === "string" && translatedFields.includes(key)) {
7312
+ cleanObj[friendlyHeader] = t(val);
7313
+ } else if (typeof val === "string" && !skipTitleCase.includes(key)) {
6795
7314
  cleanObj[friendlyHeader] = toTitleCase(val);
6796
7315
  } else {
6797
7316
  cleanObj[friendlyHeader] = val;
@@ -6805,10 +7324,10 @@ const SurveyorDetailsDashboard = () => {
6805
7324
  }, function (error) {
6806
7325
  console.error("Error downloading eKYC Excel:", error);
6807
7326
  });
6808
- }, function (_wasThrown3, _result3) {
7327
+ }, function (_wasThrown2, _result2) {
6809
7328
  setEkycDownloadLoading(false);
6810
- if (_wasThrown3) throw _result3;
6811
- return _result3;
7329
+ if (_wasThrown2) throw _result2;
7330
+ return _result2;
6812
7331
  }));
6813
7332
  } catch (e) {
6814
7333
  return Promise.reject(e);
@@ -6837,65 +7356,12 @@ const SurveyorDetailsDashboard = () => {
6837
7356
  }, fullName), /*#__PURE__*/React__default.createElement("div", {
6838
7357
  className: "designation"
6839
7358
  }, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.description) || t("FIELD_SURVEYOR")))), /*#__PURE__*/React__default.createElement("div", {
6840
- className: "report-download",
6841
- ref: reportMenuRef
7359
+ className: "report-download"
6842
7360
  }, /*#__PURE__*/React__default.createElement("button", {
6843
7361
  className: "download-btn",
6844
7362
  disabled: reportLoading,
6845
- onClick: () => {
6846
- setShowReportMenu(p => !p);
6847
- setShowCustomPicker(false);
6848
- }
6849
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
6850
- className: "report-menu"
6851
- }, [{
6852
- label: t("TODAY") || "Today",
6853
- key: "today"
6854
- }, {
6855
- label: t("THIS_WEEK") || "This Week",
6856
- key: "week"
6857
- }, {
6858
- label: t("THIS_MONTH") || "This Month",
6859
- key: "month"
6860
- }].map(_ref5 => {
6861
- let label = _ref5.label,
6862
- key = _ref5.key;
6863
- return /*#__PURE__*/React__default.createElement("div", {
6864
- key: key,
6865
- className: "menu-item",
6866
- onClick: () => handlePresetDownload(key)
6867
- }, label);
6868
- }), /*#__PURE__*/React__default.createElement("div", {
6869
- className: "custom-date-trigger",
6870
- onClick: () => setShowCustomPicker(p => !p)
6871
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
6872
- className: "custom-picker"
6873
- }, /*#__PURE__*/React__default.createElement("div", {
6874
- className: "date-field"
6875
- }, /*#__PURE__*/React__default.createElement("label", {
6876
- className: "date-label"
6877
- }, t("FROM_DATE") || "From"), /*#__PURE__*/React__default.createElement("input", {
6878
- type: "date",
6879
- className: "date-input",
6880
- value: customDate.from,
6881
- onChange: e => setCustomDate(d => _extends({}, d, {
6882
- from: e.target.value
6883
- }))
6884
- })), /*#__PURE__*/React__default.createElement("div", {
6885
- className: "date-field"
6886
- }, /*#__PURE__*/React__default.createElement("label", {
6887
- className: "date-label"
6888
- }, t("TO_DATE") || "To"), /*#__PURE__*/React__default.createElement("input", {
6889
- type: "date",
6890
- className: "date-input",
6891
- value: customDate.to,
6892
- onChange: e => setCustomDate(d => _extends({}, d, {
6893
- to: e.target.value
6894
- }))
6895
- })), /*#__PURE__*/React__default.createElement("button", {
6896
- className: "download-action-btn",
6897
- onClick: handleCustomDownload
6898
- }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React__default.createElement("div", {
7363
+ onClick: handleDownload
7364
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React__default.createElement("div", {
6899
7365
  className: "stats-wrapper"
6900
7366
  }, /*#__PURE__*/React__default.createElement(StatCard, {
6901
7367
  title: t("TOTAL_ASSIGNED"),
@@ -6937,19 +7403,19 @@ const SurveyorDetailsDashboard = () => {
6937
7403
  className: "label"
6938
7404
  }, t("MOBILE")), /*#__PURE__*/React__default.createElement("span", {
6939
7405
  className: "value"
6940
- }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner8 = surveyor.owner) === null || _surveyor$owner8 === void 0 ? void 0 : _surveyor$owner8.mobileNumber) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.mobileNo) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
7406
+ }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner7 = surveyor.owner) === null || _surveyor$owner7 === void 0 ? void 0 : _surveyor$owner7.mobileNumber) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.mobileNo) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
6941
7407
  className: "detail-item"
6942
7408
  }, /*#__PURE__*/React__default.createElement("span", {
6943
7409
  className: "label"
6944
7410
  }, t("EMAIL")), /*#__PURE__*/React__default.createElement("span", {
6945
7411
  className: "value"
6946
- }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner9 = surveyor.owner) === null || _surveyor$owner9 === void 0 ? void 0 : _surveyor$owner9.emailId) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
7412
+ }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner8 = surveyor.owner) === null || _surveyor$owner8 === void 0 ? void 0 : _surveyor$owner8.emailId) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
6947
7413
  className: "detail-item"
6948
7414
  }, /*#__PURE__*/React__default.createElement("span", {
6949
7415
  className: "label"
6950
7416
  }, t("GENDER")), /*#__PURE__*/React__default.createElement("span", {
6951
7417
  className: "value"
6952
- }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner0 = surveyor.owner) === null || _surveyor$owner0 === void 0 ? void 0 : _surveyor$owner0.gender) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
7418
+ }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner9 = surveyor.owner) === null || _surveyor$owner9 === void 0 ? void 0 : _surveyor$owner9.gender) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
6953
7419
  className: "detail-item"
6954
7420
  }, /*#__PURE__*/React__default.createElement("span", {
6955
7421
  className: "label"
@@ -6971,10 +7437,16 @@ const SurveyorDetailsDashboard = () => {
6971
7437
  className: "details-right"
6972
7438
  }, /*#__PURE__*/React__default.createElement("div", {
6973
7439
  className: "download-card"
6974
- }, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React__default.createElement("button", {
7440
+ }, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React__default.createElement("div", {
7441
+ className: "report-download",
7442
+ ref: reportMenuRef
7443
+ }, /*#__PURE__*/React__default.createElement("button", {
6975
7444
  className: "download-excel-btn",
6976
7445
  disabled: ekycDownloadLoading,
6977
- onClick: handleDownloadEkycData
7446
+ onClick: () => {
7447
+ setShowReportMenu(p => !p);
7448
+ setShowCustomPicker(false);
7449
+ }
6978
7450
  }, /*#__PURE__*/React__default.createElement("svg", {
6979
7451
  width: "16",
6980
7452
  height: "16",
@@ -6993,7 +7465,63 @@ const SurveyorDetailsDashboard = () => {
6993
7465
  y1: "15",
6994
7466
  x2: "12",
6995
7467
  y2: "3"
6996
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
7468
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
7469
+ className: "report-menu"
7470
+ }, [{
7471
+ label: t("TODAY") || "Today",
7472
+ key: "today"
7473
+ }, {
7474
+ label: t("THIS_WEEK") || "This Week",
7475
+ key: "week"
7476
+ }, {
7477
+ label: t("THIS_MONTH") || "This Month",
7478
+ key: "month"
7479
+ }].map(_ref5 => {
7480
+ let label = _ref5.label,
7481
+ key = _ref5.key;
7482
+ return /*#__PURE__*/React__default.createElement("div", {
7483
+ key: key,
7484
+ className: "menu-item",
7485
+ onClick: () => handlePresetDownload(key)
7486
+ }, label);
7487
+ }), /*#__PURE__*/React__default.createElement("div", {
7488
+ className: "custom-date-trigger",
7489
+ onClick: () => setShowCustomPicker(p => !p)
7490
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
7491
+ className: "custom-picker"
7492
+ }, /*#__PURE__*/React__default.createElement("div", {
7493
+ className: "date-inputs"
7494
+ }, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "From"), /*#__PURE__*/React__default.createElement("input", {
7495
+ type: "date",
7496
+ value: customDate.from,
7497
+ onChange: e => setCustomDate(_extends({}, customDate, {
7498
+ from: e.target.value
7499
+ }))
7500
+ })), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "To"), /*#__PURE__*/React__default.createElement("input", {
7501
+ type: "date",
7502
+ value: customDate.to,
7503
+ onChange: e => setCustomDate(_extends({}, customDate, {
7504
+ to: e.target.value
7505
+ }))
7506
+ }))), /*#__PURE__*/React__default.createElement("div", {
7507
+ style: {
7508
+ display: "flex",
7509
+ gap: "10px",
7510
+ marginTop: "10px"
7511
+ }
7512
+ }, /*#__PURE__*/React__default.createElement("button", {
7513
+ className: "picker-cancel-btn",
7514
+ onClick: () => {
7515
+ setShowCustomPicker(false);
7516
+ setCustomDate({
7517
+ from: "",
7518
+ to: ""
7519
+ });
7520
+ }
7521
+ }, t("CANCEL") || "Cancel"), /*#__PURE__*/React__default.createElement("button", {
7522
+ className: "picker-apply-btn",
7523
+ onClick: handleCustomDownload
7524
+ }, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
6997
7525
  className: "dashboard-card"
6998
7526
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
6999
7527
  t: t,