@djb25/digit-ui-module-ekyc 1.0.54 → 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.
@@ -2085,57 +2085,174 @@ const VendorDetailsCard = () => {
2085
2085
  const _useState3 = useState(false),
2086
2086
  ekycDownloadLoading = _useState3[0],
2087
2087
  setEkycDownloadLoading = _useState3[1];
2088
- const handleDownloadEkycData = function () {
2088
+ const handleDownloadEkycData = function (fromDate, toDate) {
2089
2089
  try {
2090
2090
  setEkycDownloadLoading(true);
2091
2091
  return Promise.resolve(_finallyRethrows(function () {
2092
2092
  return _catch(function () {
2093
- return Promise.resolve(Digit.EkycService.application_list({
2093
+ return Promise.resolve(Digit.EkycService.application_list(_extends({
2094
2094
  tenantId: tenantId,
2095
2095
  offset: 0,
2096
2096
  limit: 10000,
2097
2097
  reportDownload: true
2098
- })).then(function (response) {
2098
+ }, fromDate && {
2099
+ fromDate
2100
+ }, toDate && {
2101
+ toDate
2102
+ }))).then(function (response) {
2099
2103
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
2100
2104
  if (!consumerList || consumerList.length === 0) {
2101
2105
  alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
2102
2106
  return;
2103
2107
  }
2104
- 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"];
2108
+ 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"];
2105
2109
  const headerMapping = {
2106
- kno: t("KNO") || "KNO",
2107
- firstName: t("FIRST_NAME") || "First Name",
2108
- middleName: t("MIDDLE_NAME") || "Middle Name",
2109
- lastName: t("LAST_NAME") || "Last Name",
2110
- gender: t("GENDER") || "Gender",
2111
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
2112
- emailId: t("EMAIL_ID") || "Email ID",
2113
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
2114
- relationship: t("RELATIONSHIP") || "Relationship",
2115
- dob: t("DOB") || "Date of Birth",
2116
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
2117
- zoneName: t("ZONE") || "Zone",
2118
- assembly: t("ASSEMBLY") || "Assembly",
2119
- ward: t("WARD") || "Ward",
2120
- pincode: t("PINCODE") || "Pincode",
2121
- mrkey: t("MR_KEY") || "MR Key",
2122
- createdTime: t("CREATED_TIME") || "Created Time",
2123
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
2110
+ kno: t("KNO"),
2111
+ firstName: t("FIRST_NAME"),
2112
+ middleName: t("MIDDLE_NAME"),
2113
+ lastName: t("LAST_NAME"),
2114
+ status: t("STATUS"),
2115
+ ekycStatus: t("EKYC_STATUS"),
2116
+ zoneName: t("ZONE"),
2117
+ zoneCode: t("ZONE_CODE"),
2118
+ assembly: t("EKYC_ASSEMBLY"),
2119
+ ward: t("WARD"),
2120
+ pincode: t("EKYC_PINCODE"),
2121
+ addressRaw: t("ADDRESS_RAW"),
2122
+ locality: t("EKYC_LOCALITY"),
2123
+ subLocality: t("SUB_LOCALITY"),
2124
+ flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
2125
+ streetName: t("STREET_NAME"),
2126
+ landmark: t("EKYC_LANDMARK"),
2127
+ city: t("CITY"),
2128
+ state: t("STATE"),
2129
+ addressType: t("ADDRESS_TYPE"),
2130
+ addressProofType: t("ADDRESS_PROOF_TYPE"),
2131
+ mobileNo: t("MOBILE_NUMBER"),
2132
+ alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
2133
+ whatsappNo: t("WHATSAPP_NO"),
2134
+ email: t("EMAIL"),
2135
+ landlineNo: t("LANDLINE_NO"),
2136
+ mrkey: t("MR_KEY"),
2137
+ mrcode: t("MR_CODE"),
2138
+ areacode: t("AREA_CODE"),
2139
+ source: t("SOURCE"),
2140
+ submittedAt: t("SUBMITTED_AT"),
2141
+ assignedAt: t("ASSIGNED_AT"),
2142
+ connectionType: t("CONNECTION_TYPE"),
2143
+ Type: t("CONSUMER_TYPE"),
2144
+ occupantType: t("OCCUPANT_TYPE"),
2145
+ knoCategory: t("KNO_CATEGORY"),
2146
+ approvedAt: t("APPROVED_AT"),
2147
+ gender: t("GENDER"),
2148
+ parentSpouse: t("PARENT_SPOUSE"),
2149
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
2150
+ relationship: t("RELATIONSHIP"),
2151
+ informantName: t("INFORMANT_NAME"),
2152
+ informantRelation: t("INFORMANT_RELATION"),
2153
+ informantIs: t("INFORMANT_IS"),
2154
+ contactPerson: t("CONTACT_PERSON"),
2155
+ relation: t("RELATION"),
2156
+ entityName: t("ENTITY_NAME"),
2157
+ designation: t("DESIGNATION"),
2158
+ department: t("DEPARTMENT"),
2159
+ employeeId: t("EMPLOYEE_ID"),
2160
+ ownerMobile: t("OWNER_MOBILE"),
2161
+ ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
2162
+ consentGiven: t("CONSENT_GIVEN"),
2163
+ proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
2164
+ documentNumber: t("DOCUMENT_NUMBER"),
2165
+ noOfPerson: t("NUMBER_OF_PERSON"),
2166
+ latitude: t("LATITUDE"),
2167
+ longitude: t("LONGITUDE"),
2168
+ gpsValid: t("GPS_VALID"),
2169
+ meterNumber: t("METER_NUMBER"),
2170
+ meterMake: t("METER_MAKE"),
2171
+ meterStatus: t("METER_STATUS"),
2172
+ meterCondition: t("METER_CONDITION"),
2173
+ meterLocation: t("METER_LOCATION"),
2174
+ meterLocationAddress: t("METER_LOCATION_ADDRESS"),
2175
+ workingStatus: t("WORKING_STATUS"),
2176
+ sewerConnection: t("SEWER_CONNECTION"),
2177
+ septicTank: t("SEPTIC_TANK"),
2178
+ lastBillRaised: t("LAST_BILL_RAISED"),
2179
+ lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
2180
+ accessToMeter: t("ACCESS_TO_METER"),
2181
+ systemMeterId: t("SYSTEM_METER_ID"),
2182
+ lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
2183
+ waterConnectionYears: t("WATER_CONNECTION_YEARS"),
2184
+ sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
2185
+ pidNumber: t("PID_NUMBER"),
2186
+ propertyType: t("PROPERTY_TYPE"),
2187
+ subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
2188
+ noOfFloor: t("NO_OF_FLOOR"),
2189
+ noOfRooms: t("NO_OF_ROOMS"),
2190
+ noOfBeds: t("NO_OF_BEDS"),
2191
+ numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
2192
+ floorNo: t("FLOOR_NO"),
2193
+ userType: t("USER_TYPE"),
2194
+ tenantName: t("TENANT_NAME"),
2195
+ tenantMobile: t("TENANT_MOBILE"),
2196
+ verificationStatus: t("VERIFICATION_STATUS"),
2197
+ houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
2198
+ surveyorId: t("SURVEYOR_ID"),
2199
+ supervisorId: t("SUPERVISOR_ID"),
2200
+ vendorId: t("VENDOR_ID"),
2201
+ assignmentType: t("ASSIGNMENT_TYPE"),
2202
+ assignmentValue: t("ASSIGNMENT_VALUE"),
2203
+ assignedTime: t("ASSIGNED_TIME"),
2204
+ isSelfAssigned: t("IS_SELF_ASSIGNED"),
2205
+ doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
2206
+ panFilestoreId: t("PAN_FILESTORE_ID"),
2207
+ documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
2208
+ buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
2209
+ propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
2210
+ meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
2211
+ modifiedBy: t("MODIFIED_BY"),
2212
+ emailId: t("EMAIL_ID"),
2213
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
2214
+ dob: t("DOB"),
2215
+ consumerType: t("CONSUMER_TYPE"),
2216
+ createdTime: t("CREATED_TIME"),
2217
+ lastModifiedTime: t("LAST_MODIFIED_TIME"),
2218
+ meterLatitude: t("EKYC_METER_LATITUDE1"),
2219
+ meterLongitude: t("EKYC_METER_LONGITUDE1")
2220
+ };
2221
+ const toTitleCase = str => {
2222
+ if (!str) return "";
2223
+ let cleanStr = String(str);
2224
+ if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
2225
+ cleanStr = cleanStr.split(".").pop();
2226
+ }
2227
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
2124
2228
  };
2229
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
2230
+ const translatedFields = ["meterMake", "meterLocation"];
2125
2231
  const excelData = consumerList.map(item => {
2126
2232
  const cleanObj = {};
2127
2233
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
2128
2234
  if (fullName) {
2129
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
2235
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
2130
2236
  }
2131
2237
  Object.keys(item).forEach(key => {
2132
2238
  if (excludedKeys.includes(key)) return;
2133
- const val = item[key];
2239
+ let val = item[key];
2134
2240
  if (typeof val === "object" && val !== null) {
2135
2241
  return;
2136
2242
  }
2243
+ if (String(val).toLowerCase() === "true") {
2244
+ val = t("CS_YES");
2245
+ } else if (String(val).toLowerCase() === "false") {
2246
+ val = t("CS_NO");
2247
+ }
2137
2248
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
2138
- cleanObj[friendlyHeader] = val;
2249
+ if (typeof val === "string" && translatedFields.includes(key)) {
2250
+ cleanObj[friendlyHeader] = t(val);
2251
+ } else if (typeof val === "string" && !skipTitleCase.includes(key)) {
2252
+ cleanObj[friendlyHeader] = toTitleCase(val);
2253
+ } else {
2254
+ cleanObj[friendlyHeader] = val;
2255
+ }
2139
2256
  });
2140
2257
  return cleanObj;
2141
2258
  });
@@ -2155,6 +2272,34 @@ const VendorDetailsCard = () => {
2155
2272
  return Promise.reject(e);
2156
2273
  }
2157
2274
  };
2275
+ const getDateRange = filter => {
2276
+ const now = new Date();
2277
+ const start = new Date(now);
2278
+ if (filter === "today") {
2279
+ start.setHours(0, 0, 0, 0);
2280
+ return {
2281
+ from: start,
2282
+ to: now
2283
+ };
2284
+ }
2285
+ if (filter === "week") {
2286
+ start.setDate(now.getDate() - now.getDay());
2287
+ start.setHours(0, 0, 0, 0);
2288
+ return {
2289
+ from: start,
2290
+ to: now
2291
+ };
2292
+ }
2293
+ if (filter === "month") {
2294
+ start.setDate(1);
2295
+ start.setHours(0, 0, 0, 0);
2296
+ return {
2297
+ from: start,
2298
+ to: now
2299
+ };
2300
+ }
2301
+ return null;
2302
+ };
2158
2303
  const paginatedSupervisors = useMemo(() => {
2159
2304
  const start = currentPage * pageSize;
2160
2305
  const end = start + pageSize;
@@ -2269,19 +2414,35 @@ const VendorDetailsCard = () => {
2269
2414
  console.error("Failed to generate report:", err);
2270
2415
  } finally {
2271
2416
  setReportLoading(false);
2417
+ }
2418
+ };
2419
+ const handlePresetDownload = function (filter) {
2420
+ try {
2421
+ const range = getDateRange(filter);
2422
+ if (!range) return Promise.resolve();
2272
2423
  setShowReportMenu(false);
2273
2424
  setShowCustomPicker(false);
2425
+ return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
2426
+ } catch (e) {
2427
+ return Promise.reject(e);
2274
2428
  }
2275
2429
  };
2276
- const handlePresetDownload = filter => {
2277
- handleDownload();
2278
- };
2279
- const handleCustomDownload = () => {
2280
- if (!customDate.from || !customDate.to) {
2281
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
2282
- return;
2430
+ const handleCustomDownload = function () {
2431
+ try {
2432
+ if (!customDate.from || !customDate.to) {
2433
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
2434
+ return Promise.resolve();
2435
+ }
2436
+ const from = new Date(customDate.from);
2437
+ from.setHours(0, 0, 0, 0);
2438
+ const to = new Date(customDate.to);
2439
+ to.setHours(23, 59, 59, 999);
2440
+ setShowReportMenu(false);
2441
+ setShowCustomPicker(false);
2442
+ return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
2443
+ } catch (e) {
2444
+ return Promise.reject(e);
2283
2445
  }
2284
- handleDownload();
2285
2446
  };
2286
2447
  const StatCard = _ref3 => {
2287
2448
  let title = _ref3.title,
@@ -2329,65 +2490,12 @@ const VendorDetailsCard = () => {
2329
2490
  }, vendorName), /*#__PURE__*/React.createElement("div", {
2330
2491
  className: "designation"
2331
2492
  }, t("VENDOR_AGENCY") || "Agency / Vendor"))), /*#__PURE__*/React.createElement("div", {
2332
- className: "report-download",
2333
- ref: reportMenuRef
2493
+ className: "report-download"
2334
2494
  }, /*#__PURE__*/React.createElement("button", {
2335
2495
  className: "download-btn",
2336
2496
  disabled: reportLoading,
2337
- onClick: () => {
2338
- setShowReportMenu(p => !p);
2339
- setShowCustomPicker(false);
2340
- }
2341
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React.createElement("div", {
2342
- className: "report-menu"
2343
- }, [{
2344
- label: t("TODAY") || "Today",
2345
- key: "today"
2346
- }, {
2347
- label: t("THIS_WEEK") || "This Week",
2348
- key: "week"
2349
- }, {
2350
- label: t("THIS_MONTH") || "This Month",
2351
- key: "month"
2352
- }].map(_ref4 => {
2353
- let label = _ref4.label,
2354
- key = _ref4.key;
2355
- return /*#__PURE__*/React.createElement("div", {
2356
- key: key,
2357
- className: "menu-item",
2358
- onClick: () => handlePresetDownload()
2359
- }, label);
2360
- }), /*#__PURE__*/React.createElement("div", {
2361
- className: "custom-date-trigger",
2362
- onClick: () => setShowCustomPicker(p => !p)
2363
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
2364
- className: "custom-picker"
2365
- }, /*#__PURE__*/React.createElement("div", {
2366
- className: "date-field"
2367
- }, /*#__PURE__*/React.createElement("label", {
2368
- className: "date-label"
2369
- }, t("FROM_DATE") || "From"), /*#__PURE__*/React.createElement("input", {
2370
- type: "date",
2371
- className: "date-input",
2372
- value: customDate.from,
2373
- onChange: e => setCustomDate(d => _extends({}, d, {
2374
- from: e.target.value
2375
- }))
2376
- })), /*#__PURE__*/React.createElement("div", {
2377
- className: "date-field"
2378
- }, /*#__PURE__*/React.createElement("label", {
2379
- className: "date-label"
2380
- }, t("TO_DATE") || "To"), /*#__PURE__*/React.createElement("input", {
2381
- type: "date",
2382
- className: "date-input",
2383
- value: customDate.to,
2384
- onChange: e => setCustomDate(d => _extends({}, d, {
2385
- to: e.target.value
2386
- }))
2387
- })), /*#__PURE__*/React.createElement("button", {
2388
- className: "download-action-btn",
2389
- onClick: handleCustomDownload
2390
- }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React.createElement("div", {
2497
+ onClick: handleDownload
2498
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
2391
2499
  className: "stats-wrapper"
2392
2500
  }, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
2393
2501
  key: idx,
@@ -2438,10 +2546,16 @@ const VendorDetailsCard = () => {
2438
2546
  className: "details-right"
2439
2547
  }, /*#__PURE__*/React.createElement("div", {
2440
2548
  className: "download-card"
2441
- }, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("button", {
2549
+ }, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("div", {
2550
+ className: "report-download",
2551
+ ref: reportMenuRef
2552
+ }, /*#__PURE__*/React.createElement("button", {
2442
2553
  className: "download-excel-btn",
2443
2554
  disabled: ekycDownloadLoading,
2444
- onClick: handleDownloadEkycData
2555
+ onClick: () => {
2556
+ setShowReportMenu(p => !p);
2557
+ setShowCustomPicker(false);
2558
+ }
2445
2559
  }, /*#__PURE__*/React.createElement("svg", {
2446
2560
  width: "16",
2447
2561
  height: "16",
@@ -2460,20 +2574,76 @@ const VendorDetailsCard = () => {
2460
2574
  y1: "15",
2461
2575
  x2: "12",
2462
2576
  y2: "3"
2463
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React.createElement(Card, {
2464
- className: "dashboard-card"
2465
- }, /*#__PURE__*/React.createElement(Table, {
2466
- t: t,
2467
- tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
2468
- tableClass: "ekycTable",
2469
- data: paginatedSupervisors,
2470
- columns: supervisorColumns,
2471
- isLoading: isPageLoading,
2472
- totalRecords: vendorSupervisors.length,
2473
- currentPage: currentPage,
2474
- pageSizeLimit: pageSize,
2475
- isPaginationRequired: true,
2476
- onNextPage: () => {
2577
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
2578
+ className: "report-menu"
2579
+ }, [{
2580
+ label: t("TODAY") || "Today",
2581
+ key: "today"
2582
+ }, {
2583
+ label: t("THIS_WEEK") || "This Week",
2584
+ key: "week"
2585
+ }, {
2586
+ label: t("THIS_MONTH") || "This Month",
2587
+ key: "month"
2588
+ }].map(_ref4 => {
2589
+ let label = _ref4.label,
2590
+ key = _ref4.key;
2591
+ return /*#__PURE__*/React.createElement("div", {
2592
+ key: key,
2593
+ className: "menu-item",
2594
+ onClick: () => handlePresetDownload(key)
2595
+ }, label);
2596
+ }), /*#__PURE__*/React.createElement("div", {
2597
+ className: "custom-date-trigger",
2598
+ onClick: () => setShowCustomPicker(p => !p)
2599
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
2600
+ className: "custom-picker"
2601
+ }, /*#__PURE__*/React.createElement("div", {
2602
+ className: "date-inputs"
2603
+ }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
2604
+ type: "date",
2605
+ value: customDate.from,
2606
+ onChange: e => setCustomDate(_extends({}, customDate, {
2607
+ from: e.target.value
2608
+ }))
2609
+ })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
2610
+ type: "date",
2611
+ value: customDate.to,
2612
+ onChange: e => setCustomDate(_extends({}, customDate, {
2613
+ to: e.target.value
2614
+ }))
2615
+ }))), /*#__PURE__*/React.createElement("div", {
2616
+ style: {
2617
+ display: "flex",
2618
+ gap: "10px",
2619
+ marginTop: "10px"
2620
+ }
2621
+ }, /*#__PURE__*/React.createElement("button", {
2622
+ className: "picker-cancel-btn",
2623
+ onClick: () => {
2624
+ setShowCustomPicker(false);
2625
+ setCustomDate({
2626
+ from: "",
2627
+ to: ""
2628
+ });
2629
+ }
2630
+ }, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
2631
+ className: "picker-apply-btn",
2632
+ onClick: handleCustomDownload
2633
+ }, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React.createElement(Card, {
2634
+ className: "dashboard-card"
2635
+ }, /*#__PURE__*/React.createElement(Table, {
2636
+ t: t,
2637
+ tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
2638
+ tableClass: "ekycTable",
2639
+ data: paginatedSupervisors,
2640
+ columns: supervisorColumns,
2641
+ isLoading: isPageLoading,
2642
+ totalRecords: vendorSupervisors.length,
2643
+ currentPage: currentPage,
2644
+ pageSizeLimit: pageSize,
2645
+ isPaginationRequired: true,
2646
+ onNextPage: () => {
2477
2647
  if (currentPage < Math.ceil(vendorSupervisors.length / pageSize) - 1) {
2478
2648
  setCurrentPage(prev => prev + 1);
2479
2649
  }
@@ -5684,21 +5854,37 @@ const SupervisorDetailsCard = () => {
5684
5854
  console.error("Failed to generate supervisor report:", err);
5685
5855
  } finally {
5686
5856
  setReportLoading(false);
5857
+ }
5858
+ };
5859
+ const handlePresetDownload = function (filter) {
5860
+ try {
5861
+ const range = getDateRange(filter);
5862
+ if (!range) return Promise.resolve();
5687
5863
  setShowReportMenu(false);
5688
5864
  setShowCustomPicker(false);
5865
+ return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
5866
+ } catch (e) {
5867
+ return Promise.reject(e);
5689
5868
  }
5690
5869
  };
5691
- const handlePresetDownload = filter => {
5692
- handleDownload();
5693
- };
5694
- const handleCustomDownload = () => {
5695
- if (!customDate.from || !customDate.to) {
5696
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
5697
- return;
5870
+ const handleCustomDownload = function () {
5871
+ try {
5872
+ if (!customDate.from || !customDate.to) {
5873
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
5874
+ return Promise.resolve();
5875
+ }
5876
+ const from = new Date(customDate.from);
5877
+ from.setHours(0, 0, 0, 0);
5878
+ const to = new Date(customDate.to);
5879
+ to.setHours(23, 59, 59, 999);
5880
+ setShowReportMenu(false);
5881
+ setShowCustomPicker(false);
5882
+ return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
5883
+ } catch (e) {
5884
+ return Promise.reject(e);
5698
5885
  }
5699
- handleDownload();
5700
5886
  };
5701
- const handleDownloadEkycData = function () {
5887
+ const handleDownloadEkycData = function (fromDate, toDate) {
5702
5888
  try {
5703
5889
  if (!surveyors || surveyors.length === 0) {
5704
5890
  alert(t("NO_SURVEYORS_ASSIGNED") || "No surveyors assigned to this supervisor.");
@@ -5707,45 +5893,144 @@ const SupervisorDetailsCard = () => {
5707
5893
  setEkycDownloadLoading(true);
5708
5894
  return Promise.resolve(_finallyRethrows(function () {
5709
5895
  return _catch(function () {
5710
- return Promise.resolve(Digit.EkycService.application_list({
5896
+ return Promise.resolve(Digit.EkycService.application_list(_extends({
5711
5897
  tenantId: tenantId || "dl.djb",
5712
5898
  offset: 0,
5713
5899
  limit: 10000,
5714
5900
  reportDownload: true
5715
- })).then(function (response) {
5901
+ }, fromDate && {
5902
+ fromDate
5903
+ }, toDate && {
5904
+ toDate
5905
+ }))).then(function (response) {
5716
5906
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
5717
5907
  if (consumerList.length === 0) {
5718
5908
  alert(t("NO_DATA_FOUND") || "No data found for download.");
5719
5909
  return;
5720
5910
  }
5721
- 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"];
5911
+ 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"];
5722
5912
  const headerMapping = {
5723
- kno: t("KNO") || "KNO",
5724
- firstName: t("FIRST_NAME") || "First Name",
5725
- middleName: t("MIDDLE_NAME") || "Middle Name",
5726
- lastName: t("LAST_NAME") || "Last Name",
5727
- gender: t("GENDER") || "Gender",
5728
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
5729
- emailId: t("EMAIL_ID") || "Email ID",
5730
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
5731
- relationship: t("RELATIONSHIP") || "Relationship",
5732
- dob: t("DOB") || "Date of Birth",
5733
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
5734
- zoneName: t("ZONE") || "Zone",
5735
- assembly: t("ASSEMBLY") || "Assembly",
5736
- ward: t("WARD") || "Ward",
5737
- pincode: t("PINCODE") || "Pincode",
5738
- mrkey: t("MR_KEY") || "MR Key",
5739
- consumerType: t("CONSUMER_TYPE") || "Consumer Type",
5740
- createdTime: t("CREATED_TIME") || "Created Time",
5741
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
5913
+ kno: t("KNO"),
5914
+ firstName: t("FIRST_NAME"),
5915
+ middleName: t("MIDDLE_NAME"),
5916
+ lastName: t("LAST_NAME"),
5917
+ status: t("STATUS"),
5918
+ ekycStatus: t("EKYC_STATUS"),
5919
+ zoneName: t("ZONE"),
5920
+ zoneCode: t("ZONE_CODE"),
5921
+ assembly: t("EKYC_ASSEMBLY"),
5922
+ ward: t("WARD"),
5923
+ pincode: t("EKYC_PINCODE"),
5924
+ addressRaw: t("ADDRESS_RAW"),
5925
+ locality: t("EKYC_LOCALITY"),
5926
+ subLocality: t("SUB_LOCALITY"),
5927
+ flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
5928
+ streetName: t("STREET_NAME"),
5929
+ landmark: t("EKYC_LANDMARK"),
5930
+ city: t("CITY"),
5931
+ state: t("STATE"),
5932
+ addressType: t("ADDRESS_TYPE"),
5933
+ addressProofType: t("ADDRESS_PROOF_TYPE"),
5934
+ mobileNo: t("MOBILE_NUMBER"),
5935
+ alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
5936
+ whatsappNo: t("WHATSAPP_NO"),
5937
+ email: t("EMAIL"),
5938
+ landlineNo: t("LANDLINE_NO"),
5939
+ mrkey: t("MR_KEY"),
5940
+ mrcode: t("MR_CODE"),
5941
+ areacode: t("AREA_CODE"),
5942
+ source: t("SOURCE"),
5943
+ submittedAt: t("SUBMITTED_AT"),
5944
+ assignedAt: t("ASSIGNED_AT"),
5945
+ connectionType: t("CONNECTION_TYPE"),
5946
+ Type: t("CONSUMER_TYPE"),
5947
+ occupantType: t("OCCUPANT_TYPE"),
5948
+ knoCategory: t("KNO_CATEGORY"),
5949
+ approvedAt: t("APPROVED_AT"),
5950
+ gender: t("GENDER"),
5951
+ parentSpouse: t("PARENT_SPOUSE"),
5952
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
5953
+ relationship: t("RELATIONSHIP"),
5954
+ informantName: t("INFORMANT_NAME"),
5955
+ informantRelation: t("INFORMANT_RELATION"),
5956
+ informantIs: t("INFORMANT_IS"),
5957
+ contactPerson: t("CONTACT_PERSON"),
5958
+ relation: t("RELATION"),
5959
+ entityName: t("ENTITY_NAME"),
5960
+ designation: t("DESIGNATION"),
5961
+ department: t("DEPARTMENT"),
5962
+ employeeId: t("EMPLOYEE_ID"),
5963
+ ownerMobile: t("OWNER_MOBILE"),
5964
+ ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
5965
+ consentGiven: t("CONSENT_GIVEN"),
5966
+ proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
5967
+ documentNumber: t("DOCUMENT_NUMBER"),
5968
+ noOfPerson: t("NUMBER_OF_PERSON"),
5969
+ latitude: t("LATITUDE"),
5970
+ longitude: t("LONGITUDE"),
5971
+ gpsValid: t("GPS_VALID"),
5972
+ meterNumber: t("METER_NUMBER"),
5973
+ meterMake: t("METER_MAKE"),
5974
+ meterStatus: t("METER_STATUS"),
5975
+ meterCondition: t("METER_CONDITION"),
5976
+ meterLocation: t("METER_LOCATION"),
5977
+ meterLocationAddress: t("METER_LOCATION_ADDRESS"),
5978
+ workingStatus: t("WORKING_STATUS"),
5979
+ sewerConnection: t("SEWER_CONNECTION"),
5980
+ septicTank: t("SEPTIC_TANK"),
5981
+ lastBillRaised: t("LAST_BILL_RAISED"),
5982
+ lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
5983
+ accessToMeter: t("ACCESS_TO_METER"),
5984
+ systemMeterId: t("SYSTEM_METER_ID"),
5985
+ lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
5986
+ waterConnectionYears: t("WATER_CONNECTION_YEARS"),
5987
+ sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
5988
+ pidNumber: t("PID_NUMBER"),
5989
+ propertyType: t("PROPERTY_TYPE"),
5990
+ subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
5991
+ noOfFloor: t("NO_OF_FLOOR"),
5992
+ noOfRooms: t("NO_OF_ROOMS"),
5993
+ noOfBeds: t("NO_OF_BEDS"),
5994
+ numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
5995
+ floorNo: t("FLOOR_NO"),
5996
+ userType: t("USER_TYPE"),
5997
+ tenantName: t("TENANT_NAME"),
5998
+ tenantMobile: t("TENANT_MOBILE"),
5999
+ verificationStatus: t("VERIFICATION_STATUS"),
6000
+ houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
6001
+ surveyorId: t("SURVEYOR_ID"),
6002
+ supervisorId: t("SUPERVISOR_ID"),
6003
+ vendorId: t("VENDOR_ID"),
6004
+ assignmentType: t("ASSIGNMENT_TYPE"),
6005
+ assignmentValue: t("ASSIGNMENT_VALUE"),
6006
+ assignedTime: t("ASSIGNED_TIME"),
6007
+ isSelfAssigned: t("IS_SELF_ASSIGNED"),
6008
+ doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
6009
+ panFilestoreId: t("PAN_FILESTORE_ID"),
6010
+ documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
6011
+ buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
6012
+ propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
6013
+ meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
6014
+ modifiedBy: t("MODIFIED_BY"),
6015
+ emailId: t("EMAIL_ID"),
6016
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
6017
+ dob: t("DOB"),
6018
+ consumerType: t("CONSUMER_TYPE"),
6019
+ createdTime: t("CREATED_TIME"),
6020
+ lastModifiedTime: t("LAST_MODIFIED_TIME"),
6021
+ meterLatitude: t("EKYC_METER_LATITUDE1"),
6022
+ meterLongitude: t("EKYC_METER_LONGITUDE1")
5742
6023
  };
5743
6024
  const toTitleCase = str => {
5744
6025
  if (!str) return "";
5745
- const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
6026
+ let cleanStr = String(str);
6027
+ if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
6028
+ cleanStr = cleanStr.split(".").pop();
6029
+ }
5746
6030
  return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
5747
6031
  };
5748
- const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
6032
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
6033
+ const translatedFields = ["meterMake", "meterLocation"];
5749
6034
  const excelData = consumerList.map(item => {
5750
6035
  const cleanObj = {};
5751
6036
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
@@ -5754,12 +6039,19 @@ const SupervisorDetailsCard = () => {
5754
6039
  }
5755
6040
  Object.keys(item).forEach(key => {
5756
6041
  if (excludedKeys.includes(key)) return;
5757
- const val = item[key];
6042
+ let val = item[key];
5758
6043
  if (typeof val === "object" && val !== null) {
5759
6044
  return;
5760
6045
  }
6046
+ if (String(val).toLowerCase() === "true") {
6047
+ val = t("CS_YES");
6048
+ } else if (String(val).toLowerCase() === "false") {
6049
+ val = t("CS_NO");
6050
+ }
5761
6051
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
5762
- if (typeof val === "string" && titleCaseFields.includes(key)) {
6052
+ if (typeof val === "string" && translatedFields.includes(key)) {
6053
+ cleanObj[friendlyHeader] = t(val);
6054
+ } else if (typeof val === "string" && !skipTitleCase.includes(key)) {
5763
6055
  cleanObj[friendlyHeader] = toTitleCase(val);
5764
6056
  } else {
5765
6057
  cleanObj[friendlyHeader] = val;
@@ -5782,33 +6074,61 @@ const SupervisorDetailsCard = () => {
5782
6074
  return Promise.reject(e);
5783
6075
  }
5784
6076
  };
5785
- const StatCard = _ref3 => {
5786
- let title = _ref3.title,
5787
- value = _ref3.value,
5788
- type = _ref3.type,
5789
- isLoading = _ref3.isLoading,
5790
- icon = _ref3.icon;
5791
- return /*#__PURE__*/React.createElement("div", {
5792
- className: "stat-card " + type
5793
- }, isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5794
- className: "stat-title skeleton skeleton-text"
5795
- }), /*#__PURE__*/React.createElement("div", {
5796
- className: "stat-value skeleton skeleton-number"
5797
- })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5798
- className: "stat-title"
5799
- }, title), /*#__PURE__*/React.createElement("div", {
5800
- className: "stat-value"
5801
- }, value), icon && /*#__PURE__*/React.createElement("div", {
5802
- className: "stat-icon"
5803
- }, icon)));
5804
- };
5805
- const isPageLoading = isProgressLoading || isSupervisorSearchLoading || isSurveyorSearchLoading || isVendorSearchLoading;
5806
- if (isPageLoading && !supervisor) {
5807
- return /*#__PURE__*/React.createElement(Loader, null);
5808
- }
5809
- if (!supervisor) {
5810
- return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
5811
- style: {
6077
+ const getDateRange = filter => {
6078
+ const now = new Date();
6079
+ const start = new Date(now);
6080
+ if (filter === "today") {
6081
+ start.setHours(0, 0, 0, 0);
6082
+ return {
6083
+ from: start,
6084
+ to: now
6085
+ };
6086
+ }
6087
+ if (filter === "week") {
6088
+ start.setDate(now.getDate() - now.getDay());
6089
+ start.setHours(0, 0, 0, 0);
6090
+ return {
6091
+ from: start,
6092
+ to: now
6093
+ };
6094
+ }
6095
+ if (filter === "month") {
6096
+ start.setDate(1);
6097
+ start.setHours(0, 0, 0, 0);
6098
+ return {
6099
+ from: start,
6100
+ to: now
6101
+ };
6102
+ }
6103
+ return null;
6104
+ };
6105
+ const StatCard = _ref3 => {
6106
+ let title = _ref3.title,
6107
+ value = _ref3.value,
6108
+ type = _ref3.type,
6109
+ isLoading = _ref3.isLoading,
6110
+ icon = _ref3.icon;
6111
+ return /*#__PURE__*/React.createElement("div", {
6112
+ className: "stat-card " + type
6113
+ }, isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
6114
+ className: "stat-title skeleton skeleton-text"
6115
+ }), /*#__PURE__*/React.createElement("div", {
6116
+ className: "stat-value skeleton skeleton-number"
6117
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
6118
+ className: "stat-title"
6119
+ }, title), /*#__PURE__*/React.createElement("div", {
6120
+ className: "stat-value"
6121
+ }, value), icon && /*#__PURE__*/React.createElement("div", {
6122
+ className: "stat-icon"
6123
+ }, icon)));
6124
+ };
6125
+ const isPageLoading = isProgressLoading || isSupervisorSearchLoading || isSurveyorSearchLoading || isVendorSearchLoading;
6126
+ if (isPageLoading && !supervisor) {
6127
+ return /*#__PURE__*/React.createElement(Loader, null);
6128
+ }
6129
+ if (!supervisor) {
6130
+ return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
6131
+ style: {
5812
6132
  padding: "24px"
5813
6133
  }
5814
6134
  }, t("NO_SUPERVISOR_FOUND")));
@@ -5828,65 +6148,12 @@ const SupervisorDetailsCard = () => {
5828
6148
  }, fullName), /*#__PURE__*/React.createElement("div", {
5829
6149
  className: "designation"
5830
6150
  }, t("FIELD_SUPERVISOR") || "Field Supervisor"))), /*#__PURE__*/React.createElement("div", {
5831
- className: "report-download",
5832
- ref: reportMenuRef
6151
+ className: "report-download"
5833
6152
  }, /*#__PURE__*/React.createElement("button", {
5834
6153
  className: "download-btn",
5835
6154
  disabled: reportLoading,
5836
- onClick: () => {
5837
- setShowReportMenu(p => !p);
5838
- setShowCustomPicker(false);
5839
- }
5840
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React.createElement("div", {
5841
- className: "report-menu"
5842
- }, [{
5843
- label: t("TODAY") || "Today",
5844
- key: "today"
5845
- }, {
5846
- label: t("THIS_WEEK") || "This Week",
5847
- key: "week"
5848
- }, {
5849
- label: t("THIS_MONTH") || "This Month",
5850
- key: "month"
5851
- }].map(_ref4 => {
5852
- let label = _ref4.label,
5853
- key = _ref4.key;
5854
- return /*#__PURE__*/React.createElement("div", {
5855
- key: key,
5856
- className: "menu-item",
5857
- onClick: () => handlePresetDownload()
5858
- }, label);
5859
- }), /*#__PURE__*/React.createElement("div", {
5860
- className: "custom-date-trigger",
5861
- onClick: () => setShowCustomPicker(p => !p)
5862
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
5863
- className: "custom-picker"
5864
- }, /*#__PURE__*/React.createElement("div", {
5865
- className: "date-field"
5866
- }, /*#__PURE__*/React.createElement("label", {
5867
- className: "date-label"
5868
- }, t("FROM_DATE") || "From"), /*#__PURE__*/React.createElement("input", {
5869
- type: "date",
5870
- className: "date-input",
5871
- value: customDate.from,
5872
- onChange: e => setCustomDate(d => _extends({}, d, {
5873
- from: e.target.value
5874
- }))
5875
- })), /*#__PURE__*/React.createElement("div", {
5876
- className: "date-field"
5877
- }, /*#__PURE__*/React.createElement("label", {
5878
- className: "date-label"
5879
- }, t("TO_DATE") || "To"), /*#__PURE__*/React.createElement("input", {
5880
- type: "date",
5881
- className: "date-input",
5882
- value: customDate.to,
5883
- onChange: e => setCustomDate(d => _extends({}, d, {
5884
- to: e.target.value
5885
- }))
5886
- })), /*#__PURE__*/React.createElement("button", {
5887
- className: "download-action-btn",
5888
- onClick: handleCustomDownload
5889
- }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React.createElement("div", {
6155
+ onClick: handleDownload
6156
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
5890
6157
  className: "stats-wrapper"
5891
6158
  }, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
5892
6159
  key: idx,
@@ -5950,10 +6217,16 @@ const SupervisorDetailsCard = () => {
5950
6217
  className: "details-right"
5951
6218
  }, /*#__PURE__*/React.createElement("div", {
5952
6219
  className: "download-card"
5953
- }, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("button", {
6220
+ }, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("div", {
6221
+ className: "report-download",
6222
+ ref: reportMenuRef
6223
+ }, /*#__PURE__*/React.createElement("button", {
5954
6224
  className: "download-excel-btn",
5955
6225
  disabled: ekycDownloadLoading,
5956
- onClick: handleDownloadEkycData
6226
+ onClick: () => {
6227
+ setShowReportMenu(p => !p);
6228
+ setShowCustomPicker(false);
6229
+ }
5957
6230
  }, /*#__PURE__*/React.createElement("svg", {
5958
6231
  width: "16",
5959
6232
  height: "16",
@@ -5972,7 +6245,63 @@ const SupervisorDetailsCard = () => {
5972
6245
  y1: "15",
5973
6246
  x2: "12",
5974
6247
  y2: "3"
5975
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React.createElement(Card, {
6248
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
6249
+ className: "report-menu"
6250
+ }, [{
6251
+ label: t("TODAY") || "Today",
6252
+ key: "today"
6253
+ }, {
6254
+ label: t("THIS_WEEK") || "This Week",
6255
+ key: "week"
6256
+ }, {
6257
+ label: t("THIS_MONTH") || "This Month",
6258
+ key: "month"
6259
+ }].map(_ref4 => {
6260
+ let label = _ref4.label,
6261
+ key = _ref4.key;
6262
+ return /*#__PURE__*/React.createElement("div", {
6263
+ key: key,
6264
+ className: "menu-item",
6265
+ onClick: () => handlePresetDownload(key)
6266
+ }, label);
6267
+ }), /*#__PURE__*/React.createElement("div", {
6268
+ className: "custom-date-trigger",
6269
+ onClick: () => setShowCustomPicker(p => !p)
6270
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
6271
+ className: "custom-picker"
6272
+ }, /*#__PURE__*/React.createElement("div", {
6273
+ className: "date-inputs"
6274
+ }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
6275
+ type: "date",
6276
+ value: customDate.from,
6277
+ onChange: e => setCustomDate(_extends({}, customDate, {
6278
+ from: e.target.value
6279
+ }))
6280
+ })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
6281
+ type: "date",
6282
+ value: customDate.to,
6283
+ onChange: e => setCustomDate(_extends({}, customDate, {
6284
+ to: e.target.value
6285
+ }))
6286
+ }))), /*#__PURE__*/React.createElement("div", {
6287
+ style: {
6288
+ display: "flex",
6289
+ gap: "10px",
6290
+ marginTop: "10px"
6291
+ }
6292
+ }, /*#__PURE__*/React.createElement("button", {
6293
+ className: "picker-cancel-btn",
6294
+ onClick: () => {
6295
+ setShowCustomPicker(false);
6296
+ setCustomDate({
6297
+ from: "",
6298
+ to: ""
6299
+ });
6300
+ }
6301
+ }, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
6302
+ className: "picker-apply-btn",
6303
+ onClick: handleCustomDownload
6304
+ }, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React.createElement(Card, {
5976
6305
  className: "dashboard-card"
5977
6306
  }, /*#__PURE__*/React.createElement(Table, {
5978
6307
  t: t,
@@ -6514,7 +6843,7 @@ const AssignEkycModal = _ref => {
6514
6843
  };
6515
6844
 
6516
6845
  const SurveyorDetailsDashboard = () => {
6517
- 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;
6846
+ 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;
6518
6847
  const tenantId = Digit.ULBService.getCurrentTenantId();
6519
6848
  const _useState = useState(null),
6520
6849
  showModal = _useState[0],
@@ -6726,10 +7055,8 @@ const SurveyorDetailsDashboard = () => {
6726
7055
  }
6727
7056
  return null;
6728
7057
  };
6729
- const handlePresetDownload = function (filter) {
7058
+ const handleDownload = function () {
6730
7059
  try {
6731
- const range = getDateRange(filter);
6732
- if (!range) return Promise.resolve();
6733
7060
  setReportLoading(true);
6734
7061
  const _temp = _finallyRethrows(function () {
6735
7062
  return _catch(function () {
@@ -6738,9 +7065,7 @@ const SurveyorDetailsDashboard = () => {
6738
7065
  tenantId: "dl.djb",
6739
7066
  offset: 0,
6740
7067
  limit: 1000,
6741
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid,
6742
- fromDate: range.from.getTime(),
6743
- toDate: range.to.getTime()
7068
+ surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
6744
7069
  })).then(function (response) {
6745
7070
  var _response$dashboardIn;
6746
7071
  const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn = response.dashboardInfo) === null || _response$dashboardIn === void 0 ? void 0 : _response$dashboardIn.consumerList) || [];
@@ -6760,8 +7085,6 @@ const SurveyorDetailsDashboard = () => {
6760
7085
  });
6761
7086
  }, function (_wasThrown, _result) {
6762
7087
  setReportLoading(false);
6763
- setShowReportMenu(false);
6764
- setShowCustomPicker(false);
6765
7088
  if (_wasThrown) throw _result;
6766
7089
  return _result;
6767
7090
  });
@@ -6770,6 +7093,17 @@ const SurveyorDetailsDashboard = () => {
6770
7093
  return Promise.reject(e);
6771
7094
  }
6772
7095
  };
7096
+ const handlePresetDownload = function (filter) {
7097
+ try {
7098
+ const range = getDateRange(filter);
7099
+ if (!range) return Promise.resolve();
7100
+ setShowReportMenu(false);
7101
+ setShowCustomPicker(false);
7102
+ return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
7103
+ } catch (e) {
7104
+ return Promise.reject(e);
7105
+ }
7106
+ };
6773
7107
  const handleCustomDownload = function () {
6774
7108
  try {
6775
7109
  if (!customDate.from || !customDate.to) {
@@ -6780,42 +7114,9 @@ const SurveyorDetailsDashboard = () => {
6780
7114
  from.setHours(0, 0, 0, 0);
6781
7115
  const to = new Date(customDate.to);
6782
7116
  to.setHours(23, 59, 59, 999);
6783
- setReportLoading(true);
6784
- const _temp2 = _finallyRethrows(function () {
6785
- return _catch(function () {
6786
- var _surveyor$owner6;
6787
- return Promise.resolve(Digit.EkycService.dashboard({}, {
6788
- tenantId: "dl.djb",
6789
- offset: 0,
6790
- limit: 1000,
6791
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.uuid,
6792
- fromDate: from.getTime(),
6793
- toDate: to.getTime()
6794
- })).then(function (response) {
6795
- var _response$dashboardIn2;
6796
- const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn2 = response.dashboardInfo) === null || _response$dashboardIn2 === void 0 ? void 0 : _response$dashboardIn2.consumerList) || [];
6797
- downloadSurveyorPDF({
6798
- rows: rows,
6799
- surveyorName: fullName,
6800
- vendorName,
6801
- supervisorName,
6802
- employeeId,
6803
- mobileNumber,
6804
- dashboardInfo: (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {},
6805
- t
6806
- });
6807
- });
6808
- }, function (err) {
6809
- console.error("Failed to fetch custom dashboard data for report download:", err);
6810
- });
6811
- }, function (_wasThrown2, _result2) {
6812
- setReportLoading(false);
6813
- setShowReportMenu(false);
6814
- setShowCustomPicker(false);
6815
- if (_wasThrown2) throw _result2;
6816
- return _result2;
6817
- });
6818
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
7117
+ setShowReportMenu(false);
7118
+ setShowCustomPicker(false);
7119
+ return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
6819
7120
  } catch (e) {
6820
7121
  return Promise.reject(e);
6821
7122
  }
@@ -6849,61 +7150,164 @@ const SurveyorDetailsDashboard = () => {
6849
7150
  setShowOptions(false);
6850
7151
  setShowModal(option.action);
6851
7152
  };
6852
- const handleDownloadEkycData = function () {
7153
+ const handleDownloadEkycData = function (fromDate, toDate) {
6853
7154
  try {
6854
7155
  setEkycDownloadLoading(true);
6855
7156
  return Promise.resolve(_finallyRethrows(function () {
6856
7157
  return _catch(function () {
6857
- var _surveyor$owner7;
6858
- return Promise.resolve(Digit.EkycService.application_list({
7158
+ var _surveyor$owner6;
7159
+ return Promise.resolve(Digit.EkycService.application_list(_extends({
6859
7160
  tenantId: tenantId || "dl.djb",
6860
7161
  offset: 0,
6861
7162
  limit: 10000,
6862
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner7 = surveyor.owner) === null || _surveyor$owner7 === void 0 ? void 0 : _surveyor$owner7.uuid,
7163
+ surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.uuid,
6863
7164
  reportDownload: true
6864
- })).then(function (response) {
7165
+ }, fromDate && {
7166
+ fromDate
7167
+ }, toDate && {
7168
+ toDate
7169
+ }))).then(function (response) {
6865
7170
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
6866
7171
  if (consumerList.length === 0) {
6867
7172
  alert(t("NO_DATA_FOUND") || "No data found for download.");
6868
7173
  return;
6869
7174
  }
6870
- 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"];
7175
+ 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"];
6871
7176
  const headerMapping = {
6872
- kno: t("KNO") || "KNO",
6873
- firstName: t("FIRST_NAME") || "First Name",
6874
- middleName: t("MIDDLE_NAME") || "Middle Name",
6875
- lastName: t("LAST_NAME") || "Last Name",
6876
- gender: t("GENDER") || "Gender",
6877
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
6878
- emailId: t("EMAIL_ID") || "Email ID",
6879
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
6880
- relationship: t("RELATIONSHIP") || "Relationship",
6881
- dob: t("DOB") || "Date of Birth",
6882
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
6883
- zoneName: t("ZONE") || "Zone",
6884
- assembly: t("ASSEMBLY") || "Assembly",
6885
- ward: t("WARD") || "Ward",
6886
- pincode: t("PINCODE") || "Pincode",
6887
- mrkey: t("MR_KEY") || "MR Key",
6888
- consumerType: t("CONSUMER_TYPE") || "Consumer Type",
6889
- createdTime: t("CREATED_TIME") || "Created Time",
6890
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
7177
+ kno: t("KNO"),
7178
+ firstName: t("FIRST_NAME"),
7179
+ middleName: t("MIDDLE_NAME"),
7180
+ lastName: t("LAST_NAME"),
7181
+ status: t("STATUS"),
7182
+ ekycStatus: t("EKYC_STATUS"),
7183
+ zoneName: t("ZONE"),
7184
+ zoneCode: t("ZONE_CODE"),
7185
+ assembly: t("EKYC_ASSEMBLY"),
7186
+ ward: t("WARD"),
7187
+ pincode: t("EKYC_PINCODE"),
7188
+ addressRaw: t("ADDRESS_RAW"),
7189
+ locality: t("EKYC_LOCALITY"),
7190
+ subLocality: t("SUB_LOCALITY"),
7191
+ flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
7192
+ streetName: t("STREET_NAME"),
7193
+ landmark: t("EKYC_LANDMARK"),
7194
+ city: t("CITY"),
7195
+ state: t("STATE"),
7196
+ addressType: t("ADDRESS_TYPE"),
7197
+ addressProofType: t("ADDRESS_PROOF_TYPE"),
7198
+ mobileNo: t("MOBILE_NUMBER"),
7199
+ alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
7200
+ whatsappNo: t("WHATSAPP_NO"),
7201
+ email: t("EMAIL"),
7202
+ landlineNo: t("LANDLINE_NO"),
7203
+ mrkey: t("MR_KEY"),
7204
+ mrcode: t("MR_CODE"),
7205
+ areacode: t("AREA_CODE"),
7206
+ source: t("SOURCE"),
7207
+ submittedAt: t("SUBMITTED_AT"),
7208
+ assignedAt: t("ASSIGNED_AT"),
7209
+ connectionType: t("CONNECTION_TYPE"),
7210
+ Type: t("CONSUMER_TYPE"),
7211
+ occupantType: t("OCCUPANT_TYPE"),
7212
+ knoCategory: t("KNO_CATEGORY"),
7213
+ approvedAt: t("APPROVED_AT"),
7214
+ gender: t("GENDER"),
7215
+ parentSpouse: t("PARENT_SPOUSE"),
7216
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
7217
+ relationship: t("RELATIONSHIP"),
7218
+ informantName: t("INFORMANT_NAME"),
7219
+ informantRelation: t("INFORMANT_RELATION"),
7220
+ informantIs: t("INFORMANT_IS"),
7221
+ contactPerson: t("CONTACT_PERSON"),
7222
+ relation: t("RELATION"),
7223
+ entityName: t("ENTITY_NAME"),
7224
+ designation: t("DESIGNATION"),
7225
+ department: t("DEPARTMENT"),
7226
+ employeeId: t("EMPLOYEE_ID"),
7227
+ ownerMobile: t("OWNER_MOBILE"),
7228
+ ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
7229
+ consentGiven: t("CONSENT_GIVEN"),
7230
+ proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
7231
+ documentNumber: t("DOCUMENT_NUMBER"),
7232
+ noOfPerson: t("NUMBER_OF_PERSON"),
7233
+ latitude: t("LATITUDE"),
7234
+ longitude: t("LONGITUDE"),
7235
+ gpsValid: t("GPS_VALID"),
7236
+ meterNumber: t("METER_NUMBER"),
7237
+ meterMake: t("METER_MAKE"),
7238
+ meterStatus: t("METER_STATUS"),
7239
+ meterCondition: t("METER_CONDITION"),
7240
+ meterLocation: t("METER_LOCATION"),
7241
+ meterLocationAddress: t("METER_LOCATION_ADDRESS"),
7242
+ workingStatus: t("WORKING_STATUS"),
7243
+ sewerConnection: t("SEWER_CONNECTION"),
7244
+ septicTank: t("SEPTIC_TANK"),
7245
+ lastBillRaised: t("LAST_BILL_RAISED"),
7246
+ lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
7247
+ accessToMeter: t("ACCESS_TO_METER"),
7248
+ systemMeterId: t("SYSTEM_METER_ID"),
7249
+ lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
7250
+ waterConnectionYears: t("WATER_CONNECTION_YEARS"),
7251
+ sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
7252
+ pidNumber: t("PID_NUMBER"),
7253
+ propertyType: t("PROPERTY_TYPE"),
7254
+ subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
7255
+ noOfFloor: t("NO_OF_FLOOR"),
7256
+ noOfRooms: t("NO_OF_ROOMS"),
7257
+ noOfBeds: t("NO_OF_BEDS"),
7258
+ numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
7259
+ floorNo: t("FLOOR_NO"),
7260
+ userType: t("USER_TYPE"),
7261
+ tenantName: t("TENANT_NAME"),
7262
+ tenantMobile: t("TENANT_MOBILE"),
7263
+ verificationStatus: t("VERIFICATION_STATUS"),
7264
+ houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
7265
+ surveyorId: t("SURVEYOR_ID"),
7266
+ supervisorId: t("SUPERVISOR_ID"),
7267
+ vendorId: t("VENDOR_ID"),
7268
+ assignmentType: t("ASSIGNMENT_TYPE"),
7269
+ assignmentValue: t("ASSIGNMENT_VALUE"),
7270
+ assignedTime: t("ASSIGNED_TIME"),
7271
+ isSelfAssigned: t("IS_SELF_ASSIGNED"),
7272
+ doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
7273
+ panFilestoreId: t("PAN_FILESTORE_ID"),
7274
+ documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
7275
+ buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
7276
+ propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
7277
+ meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
7278
+ modifiedBy: t("MODIFIED_BY"),
7279
+ emailId: t("EMAIL_ID"),
7280
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
7281
+ dob: t("DOB"),
7282
+ consumerType: t("CONSUMER_TYPE"),
7283
+ createdTime: t("CREATED_TIME"),
7284
+ lastModifiedTime: t("LAST_MODIFIED_TIME"),
7285
+ meterLatitude: t("EKYC_METER_LATITUDE1"),
7286
+ meterLongitude: t("EKYC_METER_LONGITUDE1")
6891
7287
  };
7288
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
7289
+ const translatedFields = ["meterMake", "meterLocation"];
6892
7290
  const excelData = consumerList.map(item => {
6893
7291
  const cleanObj = {};
6894
7292
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
6895
7293
  if (fullName) {
6896
7294
  cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
6897
7295
  }
6898
- const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
6899
7296
  Object.keys(item).forEach(key => {
6900
7297
  if (excludedKeys.includes(key)) return;
6901
- const val = item[key];
7298
+ let val = item[key];
6902
7299
  if (typeof val === "object" && val !== null) {
6903
7300
  return;
6904
7301
  }
7302
+ if (String(val).toLowerCase() === "true") {
7303
+ val = t("CS_YES");
7304
+ } else if (String(val).toLowerCase() === "false") {
7305
+ val = t("CS_NO");
7306
+ }
6905
7307
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
6906
- if (typeof val === "string" && titleCaseFields.includes(key)) {
7308
+ if (typeof val === "string" && translatedFields.includes(key)) {
7309
+ cleanObj[friendlyHeader] = t(val);
7310
+ } else if (typeof val === "string" && !skipTitleCase.includes(key)) {
6907
7311
  cleanObj[friendlyHeader] = toTitleCase(val);
6908
7312
  } else {
6909
7313
  cleanObj[friendlyHeader] = val;
@@ -6917,10 +7321,10 @@ const SurveyorDetailsDashboard = () => {
6917
7321
  }, function (error) {
6918
7322
  console.error("Error downloading eKYC Excel:", error);
6919
7323
  });
6920
- }, function (_wasThrown3, _result3) {
7324
+ }, function (_wasThrown2, _result2) {
6921
7325
  setEkycDownloadLoading(false);
6922
- if (_wasThrown3) throw _result3;
6923
- return _result3;
7326
+ if (_wasThrown2) throw _result2;
7327
+ return _result2;
6924
7328
  }));
6925
7329
  } catch (e) {
6926
7330
  return Promise.reject(e);
@@ -6949,65 +7353,12 @@ const SurveyorDetailsDashboard = () => {
6949
7353
  }, fullName), /*#__PURE__*/React.createElement("div", {
6950
7354
  className: "designation"
6951
7355
  }, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.description) || t("FIELD_SURVEYOR")))), /*#__PURE__*/React.createElement("div", {
6952
- className: "report-download",
6953
- ref: reportMenuRef
7356
+ className: "report-download"
6954
7357
  }, /*#__PURE__*/React.createElement("button", {
6955
7358
  className: "download-btn",
6956
7359
  disabled: reportLoading,
6957
- onClick: () => {
6958
- setShowReportMenu(p => !p);
6959
- setShowCustomPicker(false);
6960
- }
6961
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React.createElement("div", {
6962
- className: "report-menu"
6963
- }, [{
6964
- label: t("TODAY") || "Today",
6965
- key: "today"
6966
- }, {
6967
- label: t("THIS_WEEK") || "This Week",
6968
- key: "week"
6969
- }, {
6970
- label: t("THIS_MONTH") || "This Month",
6971
- key: "month"
6972
- }].map(_ref5 => {
6973
- let label = _ref5.label,
6974
- key = _ref5.key;
6975
- return /*#__PURE__*/React.createElement("div", {
6976
- key: key,
6977
- className: "menu-item",
6978
- onClick: () => handlePresetDownload(key)
6979
- }, label);
6980
- }), /*#__PURE__*/React.createElement("div", {
6981
- className: "custom-date-trigger",
6982
- onClick: () => setShowCustomPicker(p => !p)
6983
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
6984
- className: "custom-picker"
6985
- }, /*#__PURE__*/React.createElement("div", {
6986
- className: "date-field"
6987
- }, /*#__PURE__*/React.createElement("label", {
6988
- className: "date-label"
6989
- }, t("FROM_DATE") || "From"), /*#__PURE__*/React.createElement("input", {
6990
- type: "date",
6991
- className: "date-input",
6992
- value: customDate.from,
6993
- onChange: e => setCustomDate(d => _extends({}, d, {
6994
- from: e.target.value
6995
- }))
6996
- })), /*#__PURE__*/React.createElement("div", {
6997
- className: "date-field"
6998
- }, /*#__PURE__*/React.createElement("label", {
6999
- className: "date-label"
7000
- }, t("TO_DATE") || "To"), /*#__PURE__*/React.createElement("input", {
7001
- type: "date",
7002
- className: "date-input",
7003
- value: customDate.to,
7004
- onChange: e => setCustomDate(d => _extends({}, d, {
7005
- to: e.target.value
7006
- }))
7007
- })), /*#__PURE__*/React.createElement("button", {
7008
- className: "download-action-btn",
7009
- onClick: handleCustomDownload
7010
- }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React.createElement("div", {
7360
+ onClick: handleDownload
7361
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
7011
7362
  className: "stats-wrapper"
7012
7363
  }, /*#__PURE__*/React.createElement(StatCard, {
7013
7364
  title: t("TOTAL_ASSIGNED"),
@@ -7049,19 +7400,19 @@ const SurveyorDetailsDashboard = () => {
7049
7400
  className: "label"
7050
7401
  }, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
7051
7402
  className: "value"
7052
- }, (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.createElement("div", {
7403
+ }, (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.createElement("div", {
7053
7404
  className: "detail-item"
7054
7405
  }, /*#__PURE__*/React.createElement("span", {
7055
7406
  className: "label"
7056
7407
  }, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
7057
7408
  className: "value"
7058
- }, (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.createElement("div", {
7409
+ }, (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.createElement("div", {
7059
7410
  className: "detail-item"
7060
7411
  }, /*#__PURE__*/React.createElement("span", {
7061
7412
  className: "label"
7062
7413
  }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
7063
7414
  className: "value"
7064
- }, (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.createElement("div", {
7415
+ }, (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.createElement("div", {
7065
7416
  className: "detail-item"
7066
7417
  }, /*#__PURE__*/React.createElement("span", {
7067
7418
  className: "label"
@@ -7083,10 +7434,16 @@ const SurveyorDetailsDashboard = () => {
7083
7434
  className: "details-right"
7084
7435
  }, /*#__PURE__*/React.createElement("div", {
7085
7436
  className: "download-card"
7086
- }, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("button", {
7437
+ }, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("div", {
7438
+ className: "report-download",
7439
+ ref: reportMenuRef
7440
+ }, /*#__PURE__*/React.createElement("button", {
7087
7441
  className: "download-excel-btn",
7088
7442
  disabled: ekycDownloadLoading,
7089
- onClick: handleDownloadEkycData
7443
+ onClick: () => {
7444
+ setShowReportMenu(p => !p);
7445
+ setShowCustomPicker(false);
7446
+ }
7090
7447
  }, /*#__PURE__*/React.createElement("svg", {
7091
7448
  width: "16",
7092
7449
  height: "16",
@@ -7105,7 +7462,63 @@ const SurveyorDetailsDashboard = () => {
7105
7462
  y1: "15",
7106
7463
  x2: "12",
7107
7464
  y2: "3"
7108
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React.createElement(Card, {
7465
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
7466
+ className: "report-menu"
7467
+ }, [{
7468
+ label: t("TODAY") || "Today",
7469
+ key: "today"
7470
+ }, {
7471
+ label: t("THIS_WEEK") || "This Week",
7472
+ key: "week"
7473
+ }, {
7474
+ label: t("THIS_MONTH") || "This Month",
7475
+ key: "month"
7476
+ }].map(_ref5 => {
7477
+ let label = _ref5.label,
7478
+ key = _ref5.key;
7479
+ return /*#__PURE__*/React.createElement("div", {
7480
+ key: key,
7481
+ className: "menu-item",
7482
+ onClick: () => handlePresetDownload(key)
7483
+ }, label);
7484
+ }), /*#__PURE__*/React.createElement("div", {
7485
+ className: "custom-date-trigger",
7486
+ onClick: () => setShowCustomPicker(p => !p)
7487
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
7488
+ className: "custom-picker"
7489
+ }, /*#__PURE__*/React.createElement("div", {
7490
+ className: "date-inputs"
7491
+ }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
7492
+ type: "date",
7493
+ value: customDate.from,
7494
+ onChange: e => setCustomDate(_extends({}, customDate, {
7495
+ from: e.target.value
7496
+ }))
7497
+ })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
7498
+ type: "date",
7499
+ value: customDate.to,
7500
+ onChange: e => setCustomDate(_extends({}, customDate, {
7501
+ to: e.target.value
7502
+ }))
7503
+ }))), /*#__PURE__*/React.createElement("div", {
7504
+ style: {
7505
+ display: "flex",
7506
+ gap: "10px",
7507
+ marginTop: "10px"
7508
+ }
7509
+ }, /*#__PURE__*/React.createElement("button", {
7510
+ className: "picker-cancel-btn",
7511
+ onClick: () => {
7512
+ setShowCustomPicker(false);
7513
+ setCustomDate({
7514
+ from: "",
7515
+ to: ""
7516
+ });
7517
+ }
7518
+ }, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
7519
+ className: "picker-apply-btn",
7520
+ onClick: handleCustomDownload
7521
+ }, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React.createElement(Card, {
7109
7522
  className: "dashboard-card"
7110
7523
  }, /*#__PURE__*/React.createElement(Table, {
7111
7524
  t: t,