@djb25/digit-ui-module-ekyc 1.0.54 → 1.0.56

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
@@ -226,7 +226,7 @@ const StatusCards = _ref => {
226
226
  alert(t("NO_DATA_FOUND") || "No data found for download.");
227
227
  return;
228
228
  }
229
- 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"];
229
+ const excludedKeys = ["status", "source", "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"];
230
230
  const headerMapping = {
231
231
  kno: t("KNO"),
232
232
  firstName: t("FIRST_NAME"),
@@ -355,9 +355,16 @@ const StatusCards = _ref => {
355
355
  if (name) {
356
356
  cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(name);
357
357
  }
358
- Object.keys(item).forEach(key => {
358
+ const keys = Object.keys(item);
359
+ const orderedKeys = [...keys.filter(key => key !== "submittedAt"), ...(keys.includes("submittedAt") ? ["submittedAt"] : [])];
360
+ orderedKeys.forEach(key => {
359
361
  if (excludedKeys.includes(key)) return;
360
362
  let val = item[key];
363
+ if (key === "submittedAt" && val) {
364
+ const date = new Date(Number(val));
365
+ const pad = n => String(n).padStart(2, "0");
366
+ val = pad(date.getDate()) + "/" + pad(date.getMonth() + 1) + "/" + date.getFullYear() + " " + pad(date.getHours()) + ":" + pad(date.getMinutes()) + ":" + pad(date.getSeconds());
367
+ }
361
368
  if (typeof val === "object" && val !== null) {
362
369
  return;
363
370
  }
@@ -2088,57 +2095,174 @@ const VendorDetailsCard = () => {
2088
2095
  const _useState3 = React.useState(false),
2089
2096
  ekycDownloadLoading = _useState3[0],
2090
2097
  setEkycDownloadLoading = _useState3[1];
2091
- const handleDownloadEkycData = function () {
2098
+ const handleDownloadEkycData = function (fromDate, toDate) {
2092
2099
  try {
2093
2100
  setEkycDownloadLoading(true);
2094
2101
  return Promise.resolve(_finallyRethrows(function () {
2095
2102
  return _catch(function () {
2096
- return Promise.resolve(Digit.EkycService.application_list({
2103
+ return Promise.resolve(Digit.EkycService.application_list(_extends({
2097
2104
  tenantId: tenantId,
2098
2105
  offset: 0,
2099
2106
  limit: 10000,
2100
2107
  reportDownload: true
2101
- })).then(function (response) {
2108
+ }, fromDate && {
2109
+ fromDate
2110
+ }, toDate && {
2111
+ toDate
2112
+ }))).then(function (response) {
2102
2113
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
2103
2114
  if (!consumerList || consumerList.length === 0) {
2104
2115
  alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
2105
2116
  return;
2106
2117
  }
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"];
2118
+ const excludedKeys = ["status", "source", "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
2119
  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"
2120
+ kno: t("KNO"),
2121
+ firstName: t("FIRST_NAME"),
2122
+ middleName: t("MIDDLE_NAME"),
2123
+ lastName: t("LAST_NAME"),
2124
+ status: t("STATUS"),
2125
+ ekycStatus: t("EKYC_STATUS"),
2126
+ zoneName: t("ZONE"),
2127
+ zoneCode: t("ZONE_CODE"),
2128
+ assembly: t("EKYC_ASSEMBLY"),
2129
+ ward: t("WARD"),
2130
+ pincode: t("EKYC_PINCODE"),
2131
+ addressRaw: t("ADDRESS_RAW"),
2132
+ locality: t("EKYC_LOCALITY"),
2133
+ subLocality: t("SUB_LOCALITY"),
2134
+ flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
2135
+ streetName: t("STREET_NAME"),
2136
+ landmark: t("EKYC_LANDMARK"),
2137
+ city: t("CITY"),
2138
+ state: t("STATE"),
2139
+ addressType: t("ADDRESS_TYPE"),
2140
+ addressProofType: t("ADDRESS_PROOF_TYPE"),
2141
+ mobileNo: t("MOBILE_NUMBER"),
2142
+ alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
2143
+ whatsappNo: t("WHATSAPP_NO"),
2144
+ email: t("EMAIL"),
2145
+ landlineNo: t("LANDLINE_NO"),
2146
+ mrkey: t("MR_KEY"),
2147
+ mrcode: t("MR_CODE"),
2148
+ areacode: t("AREA_CODE"),
2149
+ source: t("SOURCE"),
2150
+ submittedAt: t("SUBMITTED_AT"),
2151
+ assignedAt: t("ASSIGNED_AT"),
2152
+ connectionType: t("CONNECTION_TYPE"),
2153
+ Type: t("CONSUMER_TYPE"),
2154
+ occupantType: t("OCCUPANT_TYPE"),
2155
+ knoCategory: t("KNO_CATEGORY"),
2156
+ approvedAt: t("APPROVED_AT"),
2157
+ gender: t("GENDER"),
2158
+ parentSpouse: t("PARENT_SPOUSE"),
2159
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
2160
+ relationship: t("RELATIONSHIP"),
2161
+ informantName: t("INFORMANT_NAME"),
2162
+ informantRelation: t("INFORMANT_RELATION"),
2163
+ informantIs: t("INFORMANT_IS"),
2164
+ contactPerson: t("CONTACT_PERSON"),
2165
+ relation: t("RELATION"),
2166
+ entityName: t("ENTITY_NAME"),
2167
+ designation: t("DESIGNATION"),
2168
+ department: t("DEPARTMENT"),
2169
+ employeeId: t("EMPLOYEE_ID"),
2170
+ ownerMobile: t("OWNER_MOBILE"),
2171
+ ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
2172
+ consentGiven: t("CONSENT_GIVEN"),
2173
+ proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
2174
+ documentNumber: t("DOCUMENT_NUMBER"),
2175
+ noOfPerson: t("NUMBER_OF_PERSON"),
2176
+ latitude: t("LATITUDE"),
2177
+ longitude: t("LONGITUDE"),
2178
+ gpsValid: t("GPS_VALID"),
2179
+ meterNumber: t("METER_NUMBER"),
2180
+ meterMake: t("METER_MAKE"),
2181
+ meterStatus: t("METER_STATUS"),
2182
+ meterCondition: t("METER_CONDITION"),
2183
+ meterLocation: t("METER_LOCATION"),
2184
+ meterLocationAddress: t("METER_LOCATION_ADDRESS"),
2185
+ workingStatus: t("WORKING_STATUS"),
2186
+ sewerConnection: t("SEWER_CONNECTION"),
2187
+ septicTank: t("SEPTIC_TANK"),
2188
+ lastBillRaised: t("LAST_BILL_RAISED"),
2189
+ lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
2190
+ accessToMeter: t("ACCESS_TO_METER"),
2191
+ systemMeterId: t("SYSTEM_METER_ID"),
2192
+ lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
2193
+ waterConnectionYears: t("WATER_CONNECTION_YEARS"),
2194
+ sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
2195
+ pidNumber: t("PID_NUMBER"),
2196
+ propertyType: t("PROPERTY_TYPE"),
2197
+ subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
2198
+ noOfFloor: t("NO_OF_FLOOR"),
2199
+ noOfRooms: t("NO_OF_ROOMS"),
2200
+ noOfBeds: t("NO_OF_BEDS"),
2201
+ numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
2202
+ floorNo: t("FLOOR_NO"),
2203
+ userType: t("USER_TYPE"),
2204
+ tenantName: t("TENANT_NAME"),
2205
+ tenantMobile: t("TENANT_MOBILE"),
2206
+ verificationStatus: t("VERIFICATION_STATUS"),
2207
+ houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
2208
+ surveyorId: t("SURVEYOR_ID"),
2209
+ supervisorId: t("SUPERVISOR_ID"),
2210
+ vendorId: t("VENDOR_ID"),
2211
+ assignmentType: t("ASSIGNMENT_TYPE"),
2212
+ assignmentValue: t("ASSIGNMENT_VALUE"),
2213
+ assignedTime: t("ASSIGNED_TIME"),
2214
+ isSelfAssigned: t("IS_SELF_ASSIGNED"),
2215
+ doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
2216
+ panFilestoreId: t("PAN_FILESTORE_ID"),
2217
+ documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
2218
+ buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
2219
+ propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
2220
+ meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
2221
+ modifiedBy: t("MODIFIED_BY"),
2222
+ emailId: t("EMAIL_ID"),
2223
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
2224
+ dob: t("DOB"),
2225
+ consumerType: t("CONSUMER_TYPE"),
2226
+ createdTime: t("CREATED_TIME"),
2227
+ lastModifiedTime: t("LAST_MODIFIED_TIME"),
2228
+ meterLatitude: t("EKYC_METER_LATITUDE1"),
2229
+ meterLongitude: t("EKYC_METER_LONGITUDE1")
2230
+ };
2231
+ const toTitleCase = str => {
2232
+ if (!str) return "";
2233
+ let cleanStr = String(str);
2234
+ if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
2235
+ cleanStr = cleanStr.split(".").pop();
2236
+ }
2237
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
2127
2238
  };
2239
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
2240
+ const translatedFields = ["meterMake", "meterLocation"];
2128
2241
  const excelData = consumerList.map(item => {
2129
2242
  const cleanObj = {};
2130
2243
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
2131
2244
  if (fullName) {
2132
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
2245
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
2133
2246
  }
2134
2247
  Object.keys(item).forEach(key => {
2135
2248
  if (excludedKeys.includes(key)) return;
2136
- const val = item[key];
2249
+ let val = item[key];
2137
2250
  if (typeof val === "object" && val !== null) {
2138
2251
  return;
2139
2252
  }
2253
+ if (String(val).toLowerCase() === "true") {
2254
+ val = t("CS_YES");
2255
+ } else if (String(val).toLowerCase() === "false") {
2256
+ val = t("CS_NO");
2257
+ }
2140
2258
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
2141
- cleanObj[friendlyHeader] = val;
2259
+ if (typeof val === "string" && translatedFields.includes(key)) {
2260
+ cleanObj[friendlyHeader] = t(val);
2261
+ } else if (typeof val === "string" && !skipTitleCase.includes(key)) {
2262
+ cleanObj[friendlyHeader] = toTitleCase(val);
2263
+ } else {
2264
+ cleanObj[friendlyHeader] = val;
2265
+ }
2142
2266
  });
2143
2267
  return cleanObj;
2144
2268
  });
@@ -2158,6 +2282,34 @@ const VendorDetailsCard = () => {
2158
2282
  return Promise.reject(e);
2159
2283
  }
2160
2284
  };
2285
+ const getDateRange = filter => {
2286
+ const now = new Date();
2287
+ const start = new Date(now);
2288
+ if (filter === "today") {
2289
+ start.setHours(0, 0, 0, 0);
2290
+ return {
2291
+ from: start,
2292
+ to: now
2293
+ };
2294
+ }
2295
+ if (filter === "week") {
2296
+ start.setDate(now.getDate() - now.getDay());
2297
+ start.setHours(0, 0, 0, 0);
2298
+ return {
2299
+ from: start,
2300
+ to: now
2301
+ };
2302
+ }
2303
+ if (filter === "month") {
2304
+ start.setDate(1);
2305
+ start.setHours(0, 0, 0, 0);
2306
+ return {
2307
+ from: start,
2308
+ to: now
2309
+ };
2310
+ }
2311
+ return null;
2312
+ };
2161
2313
  const paginatedSupervisors = React.useMemo(() => {
2162
2314
  const start = currentPage * pageSize;
2163
2315
  const end = start + pageSize;
@@ -2272,19 +2424,35 @@ const VendorDetailsCard = () => {
2272
2424
  console.error("Failed to generate report:", err);
2273
2425
  } finally {
2274
2426
  setReportLoading(false);
2427
+ }
2428
+ };
2429
+ const handlePresetDownload = function (filter) {
2430
+ try {
2431
+ const range = getDateRange(filter);
2432
+ if (!range) return Promise.resolve();
2275
2433
  setShowReportMenu(false);
2276
2434
  setShowCustomPicker(false);
2435
+ return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
2436
+ } catch (e) {
2437
+ return Promise.reject(e);
2277
2438
  }
2278
2439
  };
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;
2440
+ const handleCustomDownload = function () {
2441
+ try {
2442
+ if (!customDate.from || !customDate.to) {
2443
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
2444
+ return Promise.resolve();
2445
+ }
2446
+ const from = new Date(customDate.from);
2447
+ from.setHours(0, 0, 0, 0);
2448
+ const to = new Date(customDate.to);
2449
+ to.setHours(23, 59, 59, 999);
2450
+ setShowReportMenu(false);
2451
+ setShowCustomPicker(false);
2452
+ return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
2453
+ } catch (e) {
2454
+ return Promise.reject(e);
2286
2455
  }
2287
- handleDownload();
2288
2456
  };
2289
2457
  const StatCard = _ref3 => {
2290
2458
  let title = _ref3.title,
@@ -2332,65 +2500,12 @@ const VendorDetailsCard = () => {
2332
2500
  }, vendorName), /*#__PURE__*/React__default.createElement("div", {
2333
2501
  className: "designation"
2334
2502
  }, t("VENDOR_AGENCY") || "Agency / Vendor"))), /*#__PURE__*/React__default.createElement("div", {
2335
- className: "report-download",
2336
- ref: reportMenuRef
2503
+ className: "report-download"
2337
2504
  }, /*#__PURE__*/React__default.createElement("button", {
2338
2505
  className: "download-btn",
2339
2506
  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", {
2507
+ onClick: handleDownload
2508
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React__default.createElement("div", {
2394
2509
  className: "stats-wrapper"
2395
2510
  }, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
2396
2511
  key: idx,
@@ -2441,10 +2556,16 @@ const VendorDetailsCard = () => {
2441
2556
  className: "details-right"
2442
2557
  }, /*#__PURE__*/React__default.createElement("div", {
2443
2558
  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", {
2559
+ }, /*#__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", {
2560
+ className: "report-download",
2561
+ ref: reportMenuRef
2562
+ }, /*#__PURE__*/React__default.createElement("button", {
2445
2563
  className: "download-excel-btn",
2446
2564
  disabled: ekycDownloadLoading,
2447
- onClick: handleDownloadEkycData
2565
+ onClick: () => {
2566
+ setShowReportMenu(p => !p);
2567
+ setShowCustomPicker(false);
2568
+ }
2448
2569
  }, /*#__PURE__*/React__default.createElement("svg", {
2449
2570
  width: "16",
2450
2571
  height: "16",
@@ -2463,19 +2584,75 @@ const VendorDetailsCard = () => {
2463
2584
  y1: "15",
2464
2585
  x2: "12",
2465
2586
  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,
2587
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
2588
+ className: "report-menu"
2589
+ }, [{
2590
+ label: t("TODAY") || "Today",
2591
+ key: "today"
2592
+ }, {
2593
+ label: t("THIS_WEEK") || "This Week",
2594
+ key: "week"
2595
+ }, {
2596
+ label: t("THIS_MONTH") || "This Month",
2597
+ key: "month"
2598
+ }].map(_ref4 => {
2599
+ let label = _ref4.label,
2600
+ key = _ref4.key;
2601
+ return /*#__PURE__*/React__default.createElement("div", {
2602
+ key: key,
2603
+ className: "menu-item",
2604
+ onClick: () => handlePresetDownload(key)
2605
+ }, label);
2606
+ }), /*#__PURE__*/React__default.createElement("div", {
2607
+ className: "custom-date-trigger",
2608
+ onClick: () => setShowCustomPicker(p => !p)
2609
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
2610
+ className: "custom-picker"
2611
+ }, /*#__PURE__*/React__default.createElement("div", {
2612
+ className: "date-inputs"
2613
+ }, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "From"), /*#__PURE__*/React__default.createElement("input", {
2614
+ type: "date",
2615
+ value: customDate.from,
2616
+ onChange: e => setCustomDate(_extends({}, customDate, {
2617
+ from: e.target.value
2618
+ }))
2619
+ })), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "To"), /*#__PURE__*/React__default.createElement("input", {
2620
+ type: "date",
2621
+ value: customDate.to,
2622
+ onChange: e => setCustomDate(_extends({}, customDate, {
2623
+ to: e.target.value
2624
+ }))
2625
+ }))), /*#__PURE__*/React__default.createElement("div", {
2626
+ style: {
2627
+ display: "flex",
2628
+ gap: "10px",
2629
+ marginTop: "10px"
2630
+ }
2631
+ }, /*#__PURE__*/React__default.createElement("button", {
2632
+ className: "picker-cancel-btn",
2633
+ onClick: () => {
2634
+ setShowCustomPicker(false);
2635
+ setCustomDate({
2636
+ from: "",
2637
+ to: ""
2638
+ });
2639
+ }
2640
+ }, t("CANCEL") || "Cancel"), /*#__PURE__*/React__default.createElement("button", {
2641
+ className: "picker-apply-btn",
2642
+ onClick: handleCustomDownload
2643
+ }, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
2644
+ className: "dashboard-card"
2645
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
2646
+ t: t,
2647
+ tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
2648
+ tableClass: "ekycTable",
2649
+ data: paginatedSupervisors,
2650
+ columns: supervisorColumns,
2651
+ isLoading: isPageLoading,
2652
+ totalRecords: vendorSupervisors.length,
2653
+ currentPage: currentPage,
2654
+ pageSizeLimit: pageSize,
2655
+ isPaginationRequired: true,
2479
2656
  onNextPage: () => {
2480
2657
  if (currentPage < Math.ceil(vendorSupervisors.length / pageSize) - 1) {
2481
2658
  setCurrentPage(prev => prev + 1);
@@ -3615,7 +3792,7 @@ const ReviewSection = _ref2 => {
3615
3792
  })))));
3616
3793
  };
3617
3794
  const Review = () => {
3618
- var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _newDataRaw$connectio, _newDataRaw$connectio2, _newDataRaw$connectio3, _newDataRaw$address, _newDataRaw$address2, _newDataRaw$address3, _newDataRaw$address4, _newDataRaw$address5, _newDataRaw$address6, _newDataRaw$address7, _newDataRaw$address8, _newDataRaw$address9, _newDataRaw$address0, _newDataRaw$address1, _newDataRaw$address10, _newDataRaw$address11, _newDataRaw$address12, _newDataRaw$address13, _newDataRaw$address14, _newDataRaw$property, _newDataRaw$property2, _editedProperty$conne, _newDataRaw$property3, _editedProperty$conne2, _newDataRaw$property4, _editedProperty$userT, _newDataRaw$property5, _editedProperty$noOfF, _newDataRaw$property6, _newDataRaw$property7, _newDataRaw$meter, _editedMeter$meterSta, _newDataRaw$meter2, _newDataRaw$meter3, _newDataRaw$meter4, _newDataRaw$meter5, _editedMeter$workingS, _newDataRaw$meter6, _editedMeter$lastBill, _newDataRaw$meter7, _newDataRaw$meter8;
3795
+ var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _newDataRaw$connectio, _newDataRaw$connectio2, _newDataRaw$connectio3, _newDataRaw$address, _newDataRaw$address2, _newDataRaw$address3, _newDataRaw$address4, _newDataRaw$address5, _newDataRaw$address6, _newDataRaw$address7, _newDataRaw$address8, _newDataRaw$address9, _newDataRaw$address0, _newDataRaw$address1, _newDataRaw$address10, _newDataRaw$address11, _newDataRaw$address12, _newDataRaw$address13, _newDataRaw$address14, _newDataRaw$property, _newDataRaw$property2, _editedProperty$conne, _newDataRaw$property3, _editedProperty$conne2, _newDataRaw$property4, _editedProperty$userT, _newDataRaw$property5, _editedProperty$noOfF, _newDataRaw$property6, _newDataRaw$property7, _newDataRaw$meter, _editedMeter$meterSta, _newDataRaw$meter2, _newDataRaw$meter3, _newDataRaw$meter4, _newDataRaw$meter5, _editedMeter$workingS, _newDataRaw$meter6, _editedMeter$lastBill, _newDataRaw$meter7, _newDataRaw$meter8, _Digit$UserService$ge, _supervisorData;
3619
3796
  const _useTranslation = reactI18next.useTranslation(),
3620
3797
  t = _useTranslation.t;
3621
3798
  const history = reactRouterDom.useHistory();
@@ -3676,7 +3853,9 @@ const Review = () => {
3676
3853
  isSearchLoading = _Digit$Hooks$ekyc$use.isLoading;
3677
3854
  const userRoles = ((_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.roles) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.map(ele => ele.code)) || [];
3678
3855
  const isZRO = userRoles.includes("EKYC_ZRO") || userRoles.includes("ZRO");
3679
- const isSupervisorOrSurveyorOrVendor = userRoles.includes("EKYC_SUPERVISOR") || userRoles.includes("EKYC_SURVEYOR") || userRoles.includes("EKYC_VENDOR");
3856
+ const isSupervisorOrSurveyorOrVendor = userRoles.includes("EKYC_SURVEYOR") || userRoles.includes("EKYC_VENDOR");
3857
+ const EKYC_ROLE_PRIORITY = ["EKYC_ZRO", "ZRO", "EKYC_SUPERVISOR", "EKYC_SURVEYOR", "EKYC_VENDOR"];
3858
+ const currentUserRole = EKYC_ROLE_PRIORITY.find(r => userRoles.includes(r)) || userRoles[0] || "EMPLOYEE";
3680
3859
  const isStatusView = location.pathname.includes("/status/");
3681
3860
  const hideEditButton = isSupervisorOrSurveyorOrVendor && !isZRO || isStatusView;
3682
3861
  const _extractReviewData = extractReviewData(searchData, flowState),
@@ -4110,34 +4289,48 @@ const Review = () => {
4110
4289
  label: "EKYC_METER_LONGITUDE1"
4111
4290
  }];
4112
4291
  const handleDeclaration = () => setAgree(!agree);
4292
+ const loggedInUserInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
4293
+ const matchedSupervisor = (_supervisorData = supervisorData) === null || _supervisorData === void 0 ? void 0 : _supervisorData.find(s => (s === null || s === void 0 ? void 0 : s.uuid) === (loggedInUserInfo === null || loggedInUserInfo === void 0 ? void 0 : loggedInUserInfo.uuid) || (s === null || s === void 0 ? void 0 : s.userName) === (loggedInUserInfo === null || loggedInUserInfo === void 0 ? void 0 : loggedInUserInfo.userName));
4294
+ const supervisorId = (matchedSupervisor === null || matchedSupervisor === void 0 ? void 0 : matchedSupervisor.uuid) || (loggedInUserInfo === null || loggedInUserInfo === void 0 ? void 0 : loggedInUserInfo.uuid);
4113
4295
  const handleReject = function () {
4114
4296
  try {
4115
- var _Digit$UserService$ge, _Digit$UserService$ge2, _Digit$UserService$ge3;
4297
+ var _Digit$UserService$ge2;
4116
4298
  const payload = {
4117
4299
  RequestInfo: {
4118
4300
  apiId: "Rainmaker",
4119
4301
  ver: "1.0",
4120
4302
  msgId: "message-id",
4121
4303
  tenantId: tenantId,
4122
- authToken: (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.access_token
4304
+ authToken: (_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.access_token
4123
4305
  },
4124
4306
  kno: activeKno,
4125
4307
  action: "REJECTED",
4126
4308
  remarks: "Application rejected by reviewer",
4127
- reviewedBy: (_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : (_Digit$UserService$ge3 = _Digit$UserService$ge2.info) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.userName,
4128
- role: "ZRO"
4309
+ reviewedBy: supervisorId,
4310
+ role: currentUserRole
4129
4311
  };
4130
4312
  const _temp = _catch(function () {
4131
4313
  return Promise.resolve(workflowMutation.mutateAsync(payload)).then(function (result) {
4132
4314
  if (result) {
4133
- history.push("/digit-ui/employee/ekyc/response", {
4134
- success: true,
4135
- result
4315
+ setToastData({
4316
+ error: true,
4317
+ label: t("EKYC_APPLICATION_REJECT_SUCCESSFUL") || "Application Rejected Successfully"
4136
4318
  });
4319
+ setShowToast(true);
4320
+ setTimeout(() => {
4321
+ history.push("/digit-ui/employee/ekyc/inbox");
4322
+ }, 2000);
4137
4323
  }
4138
4324
  });
4139
4325
  }, function (err) {
4326
+ var _err$response, _err$response$data, _err$response2, _err$response2$data, _err$response2$data$E, _err$response2$data$E2, _err$Errors, _err$Errors$;
4140
4327
  console.error("Reject Error:", err);
4328
+ const errMsg = (err === null || err === void 0 ? void 0 : err.message) || (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.message) || (err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : (_err$response2$data$E = _err$response2$data.Errors) === null || _err$response2$data$E === void 0 ? void 0 : (_err$response2$data$E2 = _err$response2$data$E[0]) === null || _err$response2$data$E2 === void 0 ? void 0 : _err$response2$data$E2.message) || (err === null || err === void 0 ? void 0 : (_err$Errors = err.Errors) === null || _err$Errors === void 0 ? void 0 : (_err$Errors$ = _err$Errors[0]) === null || _err$Errors$ === void 0 ? void 0 : _err$Errors$.message) || t("EKYC_REJECT_ERROR") || "Reject failed. Please try again.";
4329
+ setToastData({
4330
+ error: true,
4331
+ label: errMsg
4332
+ });
4333
+ setShowToast(true);
4141
4334
  });
4142
4335
  return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
4143
4336
  } catch (e) {
@@ -4146,20 +4339,20 @@ const Review = () => {
4146
4339
  };
4147
4340
  const handleApprove = function () {
4148
4341
  try {
4149
- var _Digit$UserService$ge4, _Digit$UserService$ge5, _Digit$UserService$ge6;
4342
+ var _Digit$UserService$ge3;
4150
4343
  const payload = {
4151
4344
  RequestInfo: {
4152
4345
  apiId: "Rainmaker",
4153
4346
  ver: "1.0",
4154
4347
  msgId: "message-id",
4155
4348
  tenantId: tenantId,
4156
- authToken: (_Digit$UserService$ge4 = Digit.UserService.getUser()) === null || _Digit$UserService$ge4 === void 0 ? void 0 : _Digit$UserService$ge4.access_token
4349
+ authToken: (_Digit$UserService$ge3 = Digit.UserService.getUser()) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.access_token
4157
4350
  },
4158
4351
  kno: activeKno,
4159
4352
  action: "APPROVED",
4160
4353
  remarks: "All documents verified",
4161
- reviewedBy: (_Digit$UserService$ge5 = Digit.UserService.getUser()) === null || _Digit$UserService$ge5 === void 0 ? void 0 : (_Digit$UserService$ge6 = _Digit$UserService$ge5.info) === null || _Digit$UserService$ge6 === void 0 ? void 0 : _Digit$UserService$ge6.userName,
4162
- role: "ZRO"
4354
+ reviewedBy: supervisorId,
4355
+ role: currentUserRole
4163
4356
  };
4164
4357
  const _temp2 = _catch(function () {
4165
4358
  return Promise.resolve(workflowMutation.mutateAsync(payload)).then(function (result) {
@@ -4175,11 +4368,12 @@ const Review = () => {
4175
4368
  }
4176
4369
  });
4177
4370
  }, function (err) {
4178
- var _err$response, _err$response$data;
4371
+ var _err$response3, _err$response3$data, _err$response3$data$E, _err$response3$data$E2, _err$Errors2, _err$Errors2$;
4179
4372
  console.error("Approve Error:", err);
4373
+ const errMsg = (err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : (_err$response3$data$E = _err$response3$data.Errors) === null || _err$response3$data$E === void 0 ? void 0 : (_err$response3$data$E2 = _err$response3$data$E[0]) === null || _err$response3$data$E2 === void 0 ? void 0 : _err$response3$data$E2.message) || (err === null || err === void 0 ? void 0 : (_err$Errors2 = err.Errors) === null || _err$Errors2 === void 0 ? void 0 : (_err$Errors2$ = _err$Errors2[0]) === null || _err$Errors2$ === void 0 ? void 0 : _err$Errors2$.message) || (err === null || err === void 0 ? void 0 : err.message) || t("EKYC_APPROVE_ERROR") || "Approve failed. Please try again.";
4180
4374
  setToastData({
4181
4375
  error: true,
4182
- label: (err === null || err === void 0 ? void 0 : err.message) || (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.message) || "Approve Error"
4376
+ label: errMsg
4183
4377
  });
4184
4378
  setShowToast(true);
4185
4379
  });
@@ -4209,9 +4403,9 @@ const Review = () => {
4209
4403
  };
4210
4404
  const handleMenuSelect = option => {
4211
4405
  setShowOptions(false);
4212
- if (option.action === t("Approve")) {
4406
+ if (option.action === t("APPROVE")) {
4213
4407
  handleApprove();
4214
- } else if (option.action === t("Reject")) {
4408
+ } else if (option.action === t("REJECT")) {
4215
4409
  handleReject();
4216
4410
  }
4217
4411
  };
@@ -5687,21 +5881,37 @@ const SupervisorDetailsCard = () => {
5687
5881
  console.error("Failed to generate supervisor report:", err);
5688
5882
  } finally {
5689
5883
  setReportLoading(false);
5884
+ }
5885
+ };
5886
+ const handlePresetDownload = function (filter) {
5887
+ try {
5888
+ const range = getDateRange(filter);
5889
+ if (!range) return Promise.resolve();
5690
5890
  setShowReportMenu(false);
5691
5891
  setShowCustomPicker(false);
5892
+ return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
5893
+ } catch (e) {
5894
+ return Promise.reject(e);
5692
5895
  }
5693
5896
  };
5694
- const handlePresetDownload = filter => {
5695
- handleDownload();
5696
- };
5697
- const handleCustomDownload = () => {
5698
- if (!customDate.from || !customDate.to) {
5699
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
5700
- return;
5897
+ const handleCustomDownload = function () {
5898
+ try {
5899
+ if (!customDate.from || !customDate.to) {
5900
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
5901
+ return Promise.resolve();
5902
+ }
5903
+ const from = new Date(customDate.from);
5904
+ from.setHours(0, 0, 0, 0);
5905
+ const to = new Date(customDate.to);
5906
+ to.setHours(23, 59, 59, 999);
5907
+ setShowReportMenu(false);
5908
+ setShowCustomPicker(false);
5909
+ return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
5910
+ } catch (e) {
5911
+ return Promise.reject(e);
5701
5912
  }
5702
- handleDownload();
5703
5913
  };
5704
- const handleDownloadEkycData = function () {
5914
+ const handleDownloadEkycData = function (fromDate, toDate) {
5705
5915
  try {
5706
5916
  if (!surveyors || surveyors.length === 0) {
5707
5917
  alert(t("NO_SURVEYORS_ASSIGNED") || "No surveyors assigned to this supervisor.");
@@ -5710,45 +5920,144 @@ const SupervisorDetailsCard = () => {
5710
5920
  setEkycDownloadLoading(true);
5711
5921
  return Promise.resolve(_finallyRethrows(function () {
5712
5922
  return _catch(function () {
5713
- return Promise.resolve(Digit.EkycService.application_list({
5923
+ return Promise.resolve(Digit.EkycService.application_list(_extends({
5714
5924
  tenantId: tenantId || "dl.djb",
5715
5925
  offset: 0,
5716
5926
  limit: 10000,
5717
5927
  reportDownload: true
5718
- })).then(function (response) {
5928
+ }, fromDate && {
5929
+ fromDate
5930
+ }, toDate && {
5931
+ toDate
5932
+ }))).then(function (response) {
5719
5933
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
5720
5934
  if (consumerList.length === 0) {
5721
5935
  alert(t("NO_DATA_FOUND") || "No data found for download.");
5722
5936
  return;
5723
5937
  }
5724
- 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"];
5938
+ const excludedKeys = ["status", "source", "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"];
5725
5939
  const headerMapping = {
5726
- kno: t("KNO") || "KNO",
5727
- firstName: t("FIRST_NAME") || "First Name",
5728
- middleName: t("MIDDLE_NAME") || "Middle Name",
5729
- lastName: t("LAST_NAME") || "Last Name",
5730
- gender: t("GENDER") || "Gender",
5731
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
5732
- emailId: t("EMAIL_ID") || "Email ID",
5733
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
5734
- relationship: t("RELATIONSHIP") || "Relationship",
5735
- dob: t("DOB") || "Date of Birth",
5736
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
5737
- zoneName: t("ZONE") || "Zone",
5738
- assembly: t("ASSEMBLY") || "Assembly",
5739
- ward: t("WARD") || "Ward",
5740
- pincode: t("PINCODE") || "Pincode",
5741
- mrkey: t("MR_KEY") || "MR Key",
5742
- consumerType: t("CONSUMER_TYPE") || "Consumer Type",
5743
- createdTime: t("CREATED_TIME") || "Created Time",
5744
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
5940
+ kno: t("KNO"),
5941
+ firstName: t("FIRST_NAME"),
5942
+ middleName: t("MIDDLE_NAME"),
5943
+ lastName: t("LAST_NAME"),
5944
+ status: t("STATUS"),
5945
+ ekycStatus: t("EKYC_STATUS"),
5946
+ zoneName: t("ZONE"),
5947
+ zoneCode: t("ZONE_CODE"),
5948
+ assembly: t("EKYC_ASSEMBLY"),
5949
+ ward: t("WARD"),
5950
+ pincode: t("EKYC_PINCODE"),
5951
+ addressRaw: t("ADDRESS_RAW"),
5952
+ locality: t("EKYC_LOCALITY"),
5953
+ subLocality: t("SUB_LOCALITY"),
5954
+ flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
5955
+ streetName: t("STREET_NAME"),
5956
+ landmark: t("EKYC_LANDMARK"),
5957
+ city: t("CITY"),
5958
+ state: t("STATE"),
5959
+ addressType: t("ADDRESS_TYPE"),
5960
+ addressProofType: t("ADDRESS_PROOF_TYPE"),
5961
+ mobileNo: t("MOBILE_NUMBER"),
5962
+ alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
5963
+ whatsappNo: t("WHATSAPP_NO"),
5964
+ email: t("EMAIL"),
5965
+ landlineNo: t("LANDLINE_NO"),
5966
+ mrkey: t("MR_KEY"),
5967
+ mrcode: t("MR_CODE"),
5968
+ areacode: t("AREA_CODE"),
5969
+ source: t("SOURCE"),
5970
+ submittedAt: t("SUBMITTED_AT"),
5971
+ assignedAt: t("ASSIGNED_AT"),
5972
+ connectionType: t("CONNECTION_TYPE"),
5973
+ Type: t("CONSUMER_TYPE"),
5974
+ occupantType: t("OCCUPANT_TYPE"),
5975
+ knoCategory: t("KNO_CATEGORY"),
5976
+ approvedAt: t("APPROVED_AT"),
5977
+ gender: t("GENDER"),
5978
+ parentSpouse: t("PARENT_SPOUSE"),
5979
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
5980
+ relationship: t("RELATIONSHIP"),
5981
+ informantName: t("INFORMANT_NAME"),
5982
+ informantRelation: t("INFORMANT_RELATION"),
5983
+ informantIs: t("INFORMANT_IS"),
5984
+ contactPerson: t("CONTACT_PERSON"),
5985
+ relation: t("RELATION"),
5986
+ entityName: t("ENTITY_NAME"),
5987
+ designation: t("DESIGNATION"),
5988
+ department: t("DEPARTMENT"),
5989
+ employeeId: t("EMPLOYEE_ID"),
5990
+ ownerMobile: t("OWNER_MOBILE"),
5991
+ ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
5992
+ consentGiven: t("CONSENT_GIVEN"),
5993
+ proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
5994
+ documentNumber: t("DOCUMENT_NUMBER"),
5995
+ noOfPerson: t("NUMBER_OF_PERSON"),
5996
+ latitude: t("LATITUDE"),
5997
+ longitude: t("LONGITUDE"),
5998
+ gpsValid: t("GPS_VALID"),
5999
+ meterNumber: t("METER_NUMBER"),
6000
+ meterMake: t("METER_MAKE"),
6001
+ meterStatus: t("METER_STATUS"),
6002
+ meterCondition: t("METER_CONDITION"),
6003
+ meterLocation: t("METER_LOCATION"),
6004
+ meterLocationAddress: t("METER_LOCATION_ADDRESS"),
6005
+ workingStatus: t("WORKING_STATUS"),
6006
+ sewerConnection: t("SEWER_CONNECTION"),
6007
+ septicTank: t("SEPTIC_TANK"),
6008
+ lastBillRaised: t("LAST_BILL_RAISED"),
6009
+ lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
6010
+ accessToMeter: t("ACCESS_TO_METER"),
6011
+ systemMeterId: t("SYSTEM_METER_ID"),
6012
+ lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
6013
+ waterConnectionYears: t("WATER_CONNECTION_YEARS"),
6014
+ sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
6015
+ pidNumber: t("PID_NUMBER"),
6016
+ propertyType: t("PROPERTY_TYPE"),
6017
+ subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
6018
+ noOfFloor: t("NO_OF_FLOOR"),
6019
+ noOfRooms: t("NO_OF_ROOMS"),
6020
+ noOfBeds: t("NO_OF_BEDS"),
6021
+ numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
6022
+ floorNo: t("FLOOR_NO"),
6023
+ userType: t("USER_TYPE"),
6024
+ tenantName: t("TENANT_NAME"),
6025
+ tenantMobile: t("TENANT_MOBILE"),
6026
+ verificationStatus: t("VERIFICATION_STATUS"),
6027
+ houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
6028
+ surveyorId: t("SURVEYOR_ID"),
6029
+ supervisorId: t("SUPERVISOR_ID"),
6030
+ vendorId: t("VENDOR_ID"),
6031
+ assignmentType: t("ASSIGNMENT_TYPE"),
6032
+ assignmentValue: t("ASSIGNMENT_VALUE"),
6033
+ assignedTime: t("ASSIGNED_TIME"),
6034
+ isSelfAssigned: t("IS_SELF_ASSIGNED"),
6035
+ doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
6036
+ panFilestoreId: t("PAN_FILESTORE_ID"),
6037
+ documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
6038
+ buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
6039
+ propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
6040
+ meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
6041
+ modifiedBy: t("MODIFIED_BY"),
6042
+ emailId: t("EMAIL_ID"),
6043
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
6044
+ dob: t("DOB"),
6045
+ consumerType: t("CONSUMER_TYPE"),
6046
+ createdTime: t("CREATED_TIME"),
6047
+ lastModifiedTime: t("LAST_MODIFIED_TIME"),
6048
+ meterLatitude: t("EKYC_METER_LATITUDE1"),
6049
+ meterLongitude: t("EKYC_METER_LONGITUDE1")
5745
6050
  };
5746
6051
  const toTitleCase = str => {
5747
6052
  if (!str) return "";
5748
- const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
6053
+ let cleanStr = String(str);
6054
+ if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
6055
+ cleanStr = cleanStr.split(".").pop();
6056
+ }
5749
6057
  return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
5750
6058
  };
5751
- const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
6059
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
6060
+ const translatedFields = ["meterMake", "meterLocation"];
5752
6061
  const excelData = consumerList.map(item => {
5753
6062
  const cleanObj = {};
5754
6063
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
@@ -5757,12 +6066,19 @@ const SupervisorDetailsCard = () => {
5757
6066
  }
5758
6067
  Object.keys(item).forEach(key => {
5759
6068
  if (excludedKeys.includes(key)) return;
5760
- const val = item[key];
6069
+ let val = item[key];
5761
6070
  if (typeof val === "object" && val !== null) {
5762
6071
  return;
5763
6072
  }
6073
+ if (String(val).toLowerCase() === "true") {
6074
+ val = t("CS_YES");
6075
+ } else if (String(val).toLowerCase() === "false") {
6076
+ val = t("CS_NO");
6077
+ }
5764
6078
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
5765
- if (typeof val === "string" && titleCaseFields.includes(key)) {
6079
+ if (typeof val === "string" && translatedFields.includes(key)) {
6080
+ cleanObj[friendlyHeader] = t(val);
6081
+ } else if (typeof val === "string" && !skipTitleCase.includes(key)) {
5766
6082
  cleanObj[friendlyHeader] = toTitleCase(val);
5767
6083
  } else {
5768
6084
  cleanObj[friendlyHeader] = val;
@@ -5785,6 +6101,34 @@ const SupervisorDetailsCard = () => {
5785
6101
  return Promise.reject(e);
5786
6102
  }
5787
6103
  };
6104
+ const getDateRange = filter => {
6105
+ const now = new Date();
6106
+ const start = new Date(now);
6107
+ if (filter === "today") {
6108
+ start.setHours(0, 0, 0, 0);
6109
+ return {
6110
+ from: start,
6111
+ to: now
6112
+ };
6113
+ }
6114
+ if (filter === "week") {
6115
+ start.setDate(now.getDate() - now.getDay());
6116
+ start.setHours(0, 0, 0, 0);
6117
+ return {
6118
+ from: start,
6119
+ to: now
6120
+ };
6121
+ }
6122
+ if (filter === "month") {
6123
+ start.setDate(1);
6124
+ start.setHours(0, 0, 0, 0);
6125
+ return {
6126
+ from: start,
6127
+ to: now
6128
+ };
6129
+ }
6130
+ return null;
6131
+ };
5788
6132
  const StatCard = _ref3 => {
5789
6133
  let title = _ref3.title,
5790
6134
  value = _ref3.value,
@@ -5831,65 +6175,12 @@ const SupervisorDetailsCard = () => {
5831
6175
  }, fullName), /*#__PURE__*/React__default.createElement("div", {
5832
6176
  className: "designation"
5833
6177
  }, t("FIELD_SUPERVISOR") || "Field Supervisor"))), /*#__PURE__*/React__default.createElement("div", {
5834
- className: "report-download",
5835
- ref: reportMenuRef
6178
+ className: "report-download"
5836
6179
  }, /*#__PURE__*/React__default.createElement("button", {
5837
6180
  className: "download-btn",
5838
6181
  disabled: reportLoading,
5839
- onClick: () => {
5840
- setShowReportMenu(p => !p);
5841
- setShowCustomPicker(false);
5842
- }
5843
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
5844
- className: "report-menu"
5845
- }, [{
5846
- label: t("TODAY") || "Today",
5847
- key: "today"
5848
- }, {
5849
- label: t("THIS_WEEK") || "This Week",
5850
- key: "week"
5851
- }, {
5852
- label: t("THIS_MONTH") || "This Month",
5853
- key: "month"
5854
- }].map(_ref4 => {
5855
- let label = _ref4.label,
5856
- key = _ref4.key;
5857
- return /*#__PURE__*/React__default.createElement("div", {
5858
- key: key,
5859
- className: "menu-item",
5860
- onClick: () => handlePresetDownload()
5861
- }, label);
5862
- }), /*#__PURE__*/React__default.createElement("div", {
5863
- className: "custom-date-trigger",
5864
- onClick: () => setShowCustomPicker(p => !p)
5865
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
5866
- className: "custom-picker"
5867
- }, /*#__PURE__*/React__default.createElement("div", {
5868
- className: "date-field"
5869
- }, /*#__PURE__*/React__default.createElement("label", {
5870
- className: "date-label"
5871
- }, t("FROM_DATE") || "From"), /*#__PURE__*/React__default.createElement("input", {
5872
- type: "date",
5873
- className: "date-input",
5874
- value: customDate.from,
5875
- onChange: e => setCustomDate(d => _extends({}, d, {
5876
- from: e.target.value
5877
- }))
5878
- })), /*#__PURE__*/React__default.createElement("div", {
5879
- className: "date-field"
5880
- }, /*#__PURE__*/React__default.createElement("label", {
5881
- className: "date-label"
5882
- }, t("TO_DATE") || "To"), /*#__PURE__*/React__default.createElement("input", {
5883
- type: "date",
5884
- className: "date-input",
5885
- value: customDate.to,
5886
- onChange: e => setCustomDate(d => _extends({}, d, {
5887
- to: e.target.value
5888
- }))
5889
- })), /*#__PURE__*/React__default.createElement("button", {
5890
- className: "download-action-btn",
5891
- onClick: handleCustomDownload
5892
- }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React__default.createElement("div", {
6182
+ onClick: handleDownload
6183
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React__default.createElement("div", {
5893
6184
  className: "stats-wrapper"
5894
6185
  }, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
5895
6186
  key: idx,
@@ -5953,10 +6244,16 @@ const SupervisorDetailsCard = () => {
5953
6244
  className: "details-right"
5954
6245
  }, /*#__PURE__*/React__default.createElement("div", {
5955
6246
  className: "download-card"
5956
- }, /*#__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", {
6247
+ }, /*#__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", {
6248
+ className: "report-download",
6249
+ ref: reportMenuRef
6250
+ }, /*#__PURE__*/React__default.createElement("button", {
5957
6251
  className: "download-excel-btn",
5958
6252
  disabled: ekycDownloadLoading,
5959
- onClick: handleDownloadEkycData
6253
+ onClick: () => {
6254
+ setShowReportMenu(p => !p);
6255
+ setShowCustomPicker(false);
6256
+ }
5960
6257
  }, /*#__PURE__*/React__default.createElement("svg", {
5961
6258
  width: "16",
5962
6259
  height: "16",
@@ -5975,7 +6272,63 @@ const SupervisorDetailsCard = () => {
5975
6272
  y1: "15",
5976
6273
  x2: "12",
5977
6274
  y2: "3"
5978
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
6275
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
6276
+ className: "report-menu"
6277
+ }, [{
6278
+ label: t("TODAY") || "Today",
6279
+ key: "today"
6280
+ }, {
6281
+ label: t("THIS_WEEK") || "This Week",
6282
+ key: "week"
6283
+ }, {
6284
+ label: t("THIS_MONTH") || "This Month",
6285
+ key: "month"
6286
+ }].map(_ref4 => {
6287
+ let label = _ref4.label,
6288
+ key = _ref4.key;
6289
+ return /*#__PURE__*/React__default.createElement("div", {
6290
+ key: key,
6291
+ className: "menu-item",
6292
+ onClick: () => handlePresetDownload(key)
6293
+ }, label);
6294
+ }), /*#__PURE__*/React__default.createElement("div", {
6295
+ className: "custom-date-trigger",
6296
+ onClick: () => setShowCustomPicker(p => !p)
6297
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
6298
+ className: "custom-picker"
6299
+ }, /*#__PURE__*/React__default.createElement("div", {
6300
+ className: "date-inputs"
6301
+ }, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "From"), /*#__PURE__*/React__default.createElement("input", {
6302
+ type: "date",
6303
+ value: customDate.from,
6304
+ onChange: e => setCustomDate(_extends({}, customDate, {
6305
+ from: e.target.value
6306
+ }))
6307
+ })), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "To"), /*#__PURE__*/React__default.createElement("input", {
6308
+ type: "date",
6309
+ value: customDate.to,
6310
+ onChange: e => setCustomDate(_extends({}, customDate, {
6311
+ to: e.target.value
6312
+ }))
6313
+ }))), /*#__PURE__*/React__default.createElement("div", {
6314
+ style: {
6315
+ display: "flex",
6316
+ gap: "10px",
6317
+ marginTop: "10px"
6318
+ }
6319
+ }, /*#__PURE__*/React__default.createElement("button", {
6320
+ className: "picker-cancel-btn",
6321
+ onClick: () => {
6322
+ setShowCustomPicker(false);
6323
+ setCustomDate({
6324
+ from: "",
6325
+ to: ""
6326
+ });
6327
+ }
6328
+ }, t("CANCEL") || "Cancel"), /*#__PURE__*/React__default.createElement("button", {
6329
+ className: "picker-apply-btn",
6330
+ onClick: handleCustomDownload
6331
+ }, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
5979
6332
  className: "dashboard-card"
5980
6333
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
5981
6334
  t: t,
@@ -6517,7 +6870,7 @@ const AssignEkycModal = _ref => {
6517
6870
  };
6518
6871
 
6519
6872
  const SurveyorDetailsDashboard = () => {
6520
- 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;
6873
+ 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;
6521
6874
  const tenantId = Digit.ULBService.getCurrentTenantId();
6522
6875
  const _useState = React.useState(null),
6523
6876
  showModal = _useState[0],
@@ -6729,10 +7082,8 @@ const SurveyorDetailsDashboard = () => {
6729
7082
  }
6730
7083
  return null;
6731
7084
  };
6732
- const handlePresetDownload = function (filter) {
7085
+ const handleDownload = function () {
6733
7086
  try {
6734
- const range = getDateRange(filter);
6735
- if (!range) return Promise.resolve();
6736
7087
  setReportLoading(true);
6737
7088
  const _temp = _finallyRethrows(function () {
6738
7089
  return _catch(function () {
@@ -6741,9 +7092,7 @@ const SurveyorDetailsDashboard = () => {
6741
7092
  tenantId: "dl.djb",
6742
7093
  offset: 0,
6743
7094
  limit: 1000,
6744
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid,
6745
- fromDate: range.from.getTime(),
6746
- toDate: range.to.getTime()
7095
+ surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
6747
7096
  })).then(function (response) {
6748
7097
  var _response$dashboardIn;
6749
7098
  const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn = response.dashboardInfo) === null || _response$dashboardIn === void 0 ? void 0 : _response$dashboardIn.consumerList) || [];
@@ -6763,8 +7112,6 @@ const SurveyorDetailsDashboard = () => {
6763
7112
  });
6764
7113
  }, function (_wasThrown, _result) {
6765
7114
  setReportLoading(false);
6766
- setShowReportMenu(false);
6767
- setShowCustomPicker(false);
6768
7115
  if (_wasThrown) throw _result;
6769
7116
  return _result;
6770
7117
  });
@@ -6773,52 +7120,30 @@ const SurveyorDetailsDashboard = () => {
6773
7120
  return Promise.reject(e);
6774
7121
  }
6775
7122
  };
6776
- const handleCustomDownload = function () {
7123
+ const handlePresetDownload = function (filter) {
6777
7124
  try {
6778
- if (!customDate.from || !customDate.to) {
6779
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
6780
- return Promise.resolve();
6781
- }
6782
- const from = new Date(customDate.from);
6783
- from.setHours(0, 0, 0, 0);
6784
- const to = new Date(customDate.to);
6785
- to.setHours(23, 59, 59, 999);
6786
- setReportLoading(true);
6787
- const _temp2 = _finallyRethrows(function () {
6788
- return _catch(function () {
6789
- var _surveyor$owner6;
6790
- return Promise.resolve(Digit.EkycService.dashboard({}, {
6791
- tenantId: "dl.djb",
6792
- offset: 0,
6793
- limit: 1000,
6794
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.uuid,
6795
- fromDate: from.getTime(),
6796
- toDate: to.getTime()
6797
- })).then(function (response) {
6798
- var _response$dashboardIn2;
6799
- const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn2 = response.dashboardInfo) === null || _response$dashboardIn2 === void 0 ? void 0 : _response$dashboardIn2.consumerList) || [];
6800
- downloadSurveyorPDF({
6801
- rows: rows,
6802
- surveyorName: fullName,
6803
- vendorName,
6804
- supervisorName,
6805
- employeeId,
6806
- mobileNumber,
6807
- dashboardInfo: (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {},
6808
- t
6809
- });
6810
- });
6811
- }, function (err) {
6812
- console.error("Failed to fetch custom dashboard data for report download:", err);
6813
- });
6814
- }, function (_wasThrown2, _result2) {
6815
- setReportLoading(false);
6816
- setShowReportMenu(false);
6817
- setShowCustomPicker(false);
6818
- if (_wasThrown2) throw _result2;
6819
- return _result2;
6820
- });
6821
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
7125
+ const range = getDateRange(filter);
7126
+ if (!range) return Promise.resolve();
7127
+ setShowReportMenu(false);
7128
+ setShowCustomPicker(false);
7129
+ return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
7130
+ } catch (e) {
7131
+ return Promise.reject(e);
7132
+ }
7133
+ };
7134
+ const handleCustomDownload = function () {
7135
+ try {
7136
+ if (!customDate.from || !customDate.to) {
7137
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
7138
+ return Promise.resolve();
7139
+ }
7140
+ const from = new Date(customDate.from);
7141
+ from.setHours(0, 0, 0, 0);
7142
+ const to = new Date(customDate.to);
7143
+ to.setHours(23, 59, 59, 999);
7144
+ setShowReportMenu(false);
7145
+ setShowCustomPicker(false);
7146
+ return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
6822
7147
  } catch (e) {
6823
7148
  return Promise.reject(e);
6824
7149
  }
@@ -6852,61 +7177,164 @@ const SurveyorDetailsDashboard = () => {
6852
7177
  setShowOptions(false);
6853
7178
  setShowModal(option.action);
6854
7179
  };
6855
- const handleDownloadEkycData = function () {
7180
+ const handleDownloadEkycData = function (fromDate, toDate) {
6856
7181
  try {
6857
7182
  setEkycDownloadLoading(true);
6858
7183
  return Promise.resolve(_finallyRethrows(function () {
6859
7184
  return _catch(function () {
6860
- var _surveyor$owner7;
6861
- return Promise.resolve(Digit.EkycService.application_list({
7185
+ var _surveyor$owner6;
7186
+ return Promise.resolve(Digit.EkycService.application_list(_extends({
6862
7187
  tenantId: tenantId || "dl.djb",
6863
7188
  offset: 0,
6864
7189
  limit: 10000,
6865
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner7 = surveyor.owner) === null || _surveyor$owner7 === void 0 ? void 0 : _surveyor$owner7.uuid,
7190
+ surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.uuid,
6866
7191
  reportDownload: true
6867
- })).then(function (response) {
7192
+ }, fromDate && {
7193
+ fromDate
7194
+ }, toDate && {
7195
+ toDate
7196
+ }))).then(function (response) {
6868
7197
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
6869
7198
  if (consumerList.length === 0) {
6870
7199
  alert(t("NO_DATA_FOUND") || "No data found for download.");
6871
7200
  return;
6872
7201
  }
6873
- 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"];
7202
+ const excludedKeys = ["status", "source", "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"];
6874
7203
  const headerMapping = {
6875
- kno: t("KNO") || "KNO",
6876
- firstName: t("FIRST_NAME") || "First Name",
6877
- middleName: t("MIDDLE_NAME") || "Middle Name",
6878
- lastName: t("LAST_NAME") || "Last Name",
6879
- gender: t("GENDER") || "Gender",
6880
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
6881
- emailId: t("EMAIL_ID") || "Email ID",
6882
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
6883
- relationship: t("RELATIONSHIP") || "Relationship",
6884
- dob: t("DOB") || "Date of Birth",
6885
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
6886
- zoneName: t("ZONE") || "Zone",
6887
- assembly: t("ASSEMBLY") || "Assembly",
6888
- ward: t("WARD") || "Ward",
6889
- pincode: t("PINCODE") || "Pincode",
6890
- mrkey: t("MR_KEY") || "MR Key",
6891
- consumerType: t("CONSUMER_TYPE") || "Consumer Type",
6892
- createdTime: t("CREATED_TIME") || "Created Time",
6893
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
7204
+ kno: t("KNO"),
7205
+ firstName: t("FIRST_NAME"),
7206
+ middleName: t("MIDDLE_NAME"),
7207
+ lastName: t("LAST_NAME"),
7208
+ status: t("STATUS"),
7209
+ ekycStatus: t("EKYC_STATUS"),
7210
+ zoneName: t("ZONE"),
7211
+ zoneCode: t("ZONE_CODE"),
7212
+ assembly: t("EKYC_ASSEMBLY"),
7213
+ ward: t("WARD"),
7214
+ pincode: t("EKYC_PINCODE"),
7215
+ addressRaw: t("ADDRESS_RAW"),
7216
+ locality: t("EKYC_LOCALITY"),
7217
+ subLocality: t("SUB_LOCALITY"),
7218
+ flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
7219
+ streetName: t("STREET_NAME"),
7220
+ landmark: t("EKYC_LANDMARK"),
7221
+ city: t("CITY"),
7222
+ state: t("STATE"),
7223
+ addressType: t("ADDRESS_TYPE"),
7224
+ addressProofType: t("ADDRESS_PROOF_TYPE"),
7225
+ mobileNo: t("MOBILE_NUMBER"),
7226
+ alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
7227
+ whatsappNo: t("WHATSAPP_NO"),
7228
+ email: t("EMAIL"),
7229
+ landlineNo: t("LANDLINE_NO"),
7230
+ mrkey: t("MR_KEY"),
7231
+ mrcode: t("MR_CODE"),
7232
+ areacode: t("AREA_CODE"),
7233
+ source: t("SOURCE"),
7234
+ submittedAt: t("SUBMITTED_AT"),
7235
+ assignedAt: t("ASSIGNED_AT"),
7236
+ connectionType: t("CONNECTION_TYPE"),
7237
+ Type: t("CONSUMER_TYPE"),
7238
+ occupantType: t("OCCUPANT_TYPE"),
7239
+ knoCategory: t("KNO_CATEGORY"),
7240
+ approvedAt: t("APPROVED_AT"),
7241
+ gender: t("GENDER"),
7242
+ parentSpouse: t("PARENT_SPOUSE"),
7243
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
7244
+ relationship: t("RELATIONSHIP"),
7245
+ informantName: t("INFORMANT_NAME"),
7246
+ informantRelation: t("INFORMANT_RELATION"),
7247
+ informantIs: t("INFORMANT_IS"),
7248
+ contactPerson: t("CONTACT_PERSON"),
7249
+ relation: t("RELATION"),
7250
+ entityName: t("ENTITY_NAME"),
7251
+ designation: t("DESIGNATION"),
7252
+ department: t("DEPARTMENT"),
7253
+ employeeId: t("EMPLOYEE_ID"),
7254
+ ownerMobile: t("OWNER_MOBILE"),
7255
+ ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
7256
+ consentGiven: t("CONSENT_GIVEN"),
7257
+ proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
7258
+ documentNumber: t("DOCUMENT_NUMBER"),
7259
+ noOfPerson: t("NUMBER_OF_PERSON"),
7260
+ latitude: t("LATITUDE"),
7261
+ longitude: t("LONGITUDE"),
7262
+ gpsValid: t("GPS_VALID"),
7263
+ meterNumber: t("METER_NUMBER"),
7264
+ meterMake: t("METER_MAKE"),
7265
+ meterStatus: t("METER_STATUS"),
7266
+ meterCondition: t("METER_CONDITION"),
7267
+ meterLocation: t("METER_LOCATION"),
7268
+ meterLocationAddress: t("METER_LOCATION_ADDRESS"),
7269
+ workingStatus: t("WORKING_STATUS"),
7270
+ sewerConnection: t("SEWER_CONNECTION"),
7271
+ septicTank: t("SEPTIC_TANK"),
7272
+ lastBillRaised: t("LAST_BILL_RAISED"),
7273
+ lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
7274
+ accessToMeter: t("ACCESS_TO_METER"),
7275
+ systemMeterId: t("SYSTEM_METER_ID"),
7276
+ lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
7277
+ waterConnectionYears: t("WATER_CONNECTION_YEARS"),
7278
+ sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
7279
+ pidNumber: t("PID_NUMBER"),
7280
+ propertyType: t("PROPERTY_TYPE"),
7281
+ subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
7282
+ noOfFloor: t("NO_OF_FLOOR"),
7283
+ noOfRooms: t("NO_OF_ROOMS"),
7284
+ noOfBeds: t("NO_OF_BEDS"),
7285
+ numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
7286
+ floorNo: t("FLOOR_NO"),
7287
+ userType: t("USER_TYPE"),
7288
+ tenantName: t("TENANT_NAME"),
7289
+ tenantMobile: t("TENANT_MOBILE"),
7290
+ verificationStatus: t("VERIFICATION_STATUS"),
7291
+ houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
7292
+ surveyorId: t("SURVEYOR_ID"),
7293
+ supervisorId: t("SUPERVISOR_ID"),
7294
+ vendorId: t("VENDOR_ID"),
7295
+ assignmentType: t("ASSIGNMENT_TYPE"),
7296
+ assignmentValue: t("ASSIGNMENT_VALUE"),
7297
+ assignedTime: t("ASSIGNED_TIME"),
7298
+ isSelfAssigned: t("IS_SELF_ASSIGNED"),
7299
+ doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
7300
+ panFilestoreId: t("PAN_FILESTORE_ID"),
7301
+ documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
7302
+ buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
7303
+ propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
7304
+ meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
7305
+ modifiedBy: t("MODIFIED_BY"),
7306
+ emailId: t("EMAIL_ID"),
7307
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
7308
+ dob: t("DOB"),
7309
+ consumerType: t("CONSUMER_TYPE"),
7310
+ createdTime: t("CREATED_TIME"),
7311
+ lastModifiedTime: t("LAST_MODIFIED_TIME"),
7312
+ meterLatitude: t("EKYC_METER_LATITUDE1"),
7313
+ meterLongitude: t("EKYC_METER_LONGITUDE1")
6894
7314
  };
7315
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
7316
+ const translatedFields = ["meterMake", "meterLocation"];
6895
7317
  const excelData = consumerList.map(item => {
6896
7318
  const cleanObj = {};
6897
7319
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
6898
7320
  if (fullName) {
6899
7321
  cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
6900
7322
  }
6901
- const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
6902
7323
  Object.keys(item).forEach(key => {
6903
7324
  if (excludedKeys.includes(key)) return;
6904
- const val = item[key];
7325
+ let val = item[key];
6905
7326
  if (typeof val === "object" && val !== null) {
6906
7327
  return;
6907
7328
  }
7329
+ if (String(val).toLowerCase() === "true") {
7330
+ val = t("CS_YES");
7331
+ } else if (String(val).toLowerCase() === "false") {
7332
+ val = t("CS_NO");
7333
+ }
6908
7334
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
6909
- if (typeof val === "string" && titleCaseFields.includes(key)) {
7335
+ if (typeof val === "string" && translatedFields.includes(key)) {
7336
+ cleanObj[friendlyHeader] = t(val);
7337
+ } else if (typeof val === "string" && !skipTitleCase.includes(key)) {
6910
7338
  cleanObj[friendlyHeader] = toTitleCase(val);
6911
7339
  } else {
6912
7340
  cleanObj[friendlyHeader] = val;
@@ -6920,10 +7348,10 @@ const SurveyorDetailsDashboard = () => {
6920
7348
  }, function (error) {
6921
7349
  console.error("Error downloading eKYC Excel:", error);
6922
7350
  });
6923
- }, function (_wasThrown3, _result3) {
7351
+ }, function (_wasThrown2, _result2) {
6924
7352
  setEkycDownloadLoading(false);
6925
- if (_wasThrown3) throw _result3;
6926
- return _result3;
7353
+ if (_wasThrown2) throw _result2;
7354
+ return _result2;
6927
7355
  }));
6928
7356
  } catch (e) {
6929
7357
  return Promise.reject(e);
@@ -6952,65 +7380,12 @@ const SurveyorDetailsDashboard = () => {
6952
7380
  }, fullName), /*#__PURE__*/React__default.createElement("div", {
6953
7381
  className: "designation"
6954
7382
  }, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.description) || t("FIELD_SURVEYOR")))), /*#__PURE__*/React__default.createElement("div", {
6955
- className: "report-download",
6956
- ref: reportMenuRef
7383
+ className: "report-download"
6957
7384
  }, /*#__PURE__*/React__default.createElement("button", {
6958
7385
  className: "download-btn",
6959
7386
  disabled: reportLoading,
6960
- onClick: () => {
6961
- setShowReportMenu(p => !p);
6962
- setShowCustomPicker(false);
6963
- }
6964
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
6965
- className: "report-menu"
6966
- }, [{
6967
- label: t("TODAY") || "Today",
6968
- key: "today"
6969
- }, {
6970
- label: t("THIS_WEEK") || "This Week",
6971
- key: "week"
6972
- }, {
6973
- label: t("THIS_MONTH") || "This Month",
6974
- key: "month"
6975
- }].map(_ref5 => {
6976
- let label = _ref5.label,
6977
- key = _ref5.key;
6978
- return /*#__PURE__*/React__default.createElement("div", {
6979
- key: key,
6980
- className: "menu-item",
6981
- onClick: () => handlePresetDownload(key)
6982
- }, label);
6983
- }), /*#__PURE__*/React__default.createElement("div", {
6984
- className: "custom-date-trigger",
6985
- onClick: () => setShowCustomPicker(p => !p)
6986
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
6987
- className: "custom-picker"
6988
- }, /*#__PURE__*/React__default.createElement("div", {
6989
- className: "date-field"
6990
- }, /*#__PURE__*/React__default.createElement("label", {
6991
- className: "date-label"
6992
- }, t("FROM_DATE") || "From"), /*#__PURE__*/React__default.createElement("input", {
6993
- type: "date",
6994
- className: "date-input",
6995
- value: customDate.from,
6996
- onChange: e => setCustomDate(d => _extends({}, d, {
6997
- from: e.target.value
6998
- }))
6999
- })), /*#__PURE__*/React__default.createElement("div", {
7000
- className: "date-field"
7001
- }, /*#__PURE__*/React__default.createElement("label", {
7002
- className: "date-label"
7003
- }, t("TO_DATE") || "To"), /*#__PURE__*/React__default.createElement("input", {
7004
- type: "date",
7005
- className: "date-input",
7006
- value: customDate.to,
7007
- onChange: e => setCustomDate(d => _extends({}, d, {
7008
- to: e.target.value
7009
- }))
7010
- })), /*#__PURE__*/React__default.createElement("button", {
7011
- className: "download-action-btn",
7012
- onClick: handleCustomDownload
7013
- }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React__default.createElement("div", {
7387
+ onClick: handleDownload
7388
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React__default.createElement("div", {
7014
7389
  className: "stats-wrapper"
7015
7390
  }, /*#__PURE__*/React__default.createElement(StatCard, {
7016
7391
  title: t("TOTAL_ASSIGNED"),
@@ -7052,19 +7427,19 @@ const SurveyorDetailsDashboard = () => {
7052
7427
  className: "label"
7053
7428
  }, t("MOBILE")), /*#__PURE__*/React__default.createElement("span", {
7054
7429
  className: "value"
7055
- }, (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", {
7430
+ }, (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", {
7056
7431
  className: "detail-item"
7057
7432
  }, /*#__PURE__*/React__default.createElement("span", {
7058
7433
  className: "label"
7059
7434
  }, t("EMAIL")), /*#__PURE__*/React__default.createElement("span", {
7060
7435
  className: "value"
7061
- }, (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", {
7436
+ }, (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", {
7062
7437
  className: "detail-item"
7063
7438
  }, /*#__PURE__*/React__default.createElement("span", {
7064
7439
  className: "label"
7065
7440
  }, t("GENDER")), /*#__PURE__*/React__default.createElement("span", {
7066
7441
  className: "value"
7067
- }, (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", {
7442
+ }, (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", {
7068
7443
  className: "detail-item"
7069
7444
  }, /*#__PURE__*/React__default.createElement("span", {
7070
7445
  className: "label"
@@ -7086,10 +7461,16 @@ const SurveyorDetailsDashboard = () => {
7086
7461
  className: "details-right"
7087
7462
  }, /*#__PURE__*/React__default.createElement("div", {
7088
7463
  className: "download-card"
7089
- }, /*#__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", {
7464
+ }, /*#__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", {
7465
+ className: "report-download",
7466
+ ref: reportMenuRef
7467
+ }, /*#__PURE__*/React__default.createElement("button", {
7090
7468
  className: "download-excel-btn",
7091
7469
  disabled: ekycDownloadLoading,
7092
- onClick: handleDownloadEkycData
7470
+ onClick: () => {
7471
+ setShowReportMenu(p => !p);
7472
+ setShowCustomPicker(false);
7473
+ }
7093
7474
  }, /*#__PURE__*/React__default.createElement("svg", {
7094
7475
  width: "16",
7095
7476
  height: "16",
@@ -7108,7 +7489,63 @@ const SurveyorDetailsDashboard = () => {
7108
7489
  y1: "15",
7109
7490
  x2: "12",
7110
7491
  y2: "3"
7111
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
7492
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
7493
+ className: "report-menu"
7494
+ }, [{
7495
+ label: t("TODAY") || "Today",
7496
+ key: "today"
7497
+ }, {
7498
+ label: t("THIS_WEEK") || "This Week",
7499
+ key: "week"
7500
+ }, {
7501
+ label: t("THIS_MONTH") || "This Month",
7502
+ key: "month"
7503
+ }].map(_ref5 => {
7504
+ let label = _ref5.label,
7505
+ key = _ref5.key;
7506
+ return /*#__PURE__*/React__default.createElement("div", {
7507
+ key: key,
7508
+ className: "menu-item",
7509
+ onClick: () => handlePresetDownload(key)
7510
+ }, label);
7511
+ }), /*#__PURE__*/React__default.createElement("div", {
7512
+ className: "custom-date-trigger",
7513
+ onClick: () => setShowCustomPicker(p => !p)
7514
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
7515
+ className: "custom-picker"
7516
+ }, /*#__PURE__*/React__default.createElement("div", {
7517
+ className: "date-inputs"
7518
+ }, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "From"), /*#__PURE__*/React__default.createElement("input", {
7519
+ type: "date",
7520
+ value: customDate.from,
7521
+ onChange: e => setCustomDate(_extends({}, customDate, {
7522
+ from: e.target.value
7523
+ }))
7524
+ })), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "To"), /*#__PURE__*/React__default.createElement("input", {
7525
+ type: "date",
7526
+ value: customDate.to,
7527
+ onChange: e => setCustomDate(_extends({}, customDate, {
7528
+ to: e.target.value
7529
+ }))
7530
+ }))), /*#__PURE__*/React__default.createElement("div", {
7531
+ style: {
7532
+ display: "flex",
7533
+ gap: "10px",
7534
+ marginTop: "10px"
7535
+ }
7536
+ }, /*#__PURE__*/React__default.createElement("button", {
7537
+ className: "picker-cancel-btn",
7538
+ onClick: () => {
7539
+ setShowCustomPicker(false);
7540
+ setCustomDate({
7541
+ from: "",
7542
+ to: ""
7543
+ });
7544
+ }
7545
+ }, t("CANCEL") || "Cancel"), /*#__PURE__*/React__default.createElement("button", {
7546
+ className: "picker-apply-btn",
7547
+ onClick: handleCustomDownload
7548
+ }, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
7112
7549
  className: "dashboard-card"
7113
7550
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
7114
7551
  t: t,
@@ -9579,7 +10016,7 @@ const CitizenApp = () => {
9579
10016
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
9580
10017
  path: path + "/review",
9581
10018
  component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
9582
- layoutClass: "normal"
10019
+ layoutClass: "action"
9583
10020
  }, /*#__PURE__*/React__default.createElement(Review, null))
9584
10021
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
9585
10022
  path: path + "/assign",