@djb25/digit-ui-module-ekyc 1.0.4 → 1.0.6

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.
@@ -1,4 +1,4 @@
1
- import React, { useMemo, useState, useCallback, useRef, Fragment } from 'react';
1
+ import React, { useMemo, useState, useCallback, useRef, useEffect, Fragment } from 'react';
2
2
  import { Link, useHistory, useRouteMatch, useLocation, Switch } from 'react-router-dom';
3
3
  import { PersonIcon as PersonIcon$1, EmployeeModuleCard, Card, HomeIcon, Table, Header, TextInput, SubmitBar, Loader, DetailsCard, FilterForm, FilterFormField, Dropdown, CardHeader, StatusTable, Row, CardLabel, Modal, RadioButtons, Toast, LocationIcon, PropertyHouse, InfoBannerIcon, ActionBar, LabelFieldPair, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute } from '@djb25/digit-ui-react-components';
4
4
  import { useTranslation } from 'react-i18next';
@@ -107,33 +107,27 @@ const DesktopInbox = ({
107
107
  var _row$original2;
108
108
  return /*#__PURE__*/React.createElement("span", null, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.citizenName) || "NA");
109
109
  }
110
- }, {
111
- Header: t("EKYC_MOBILE_NO"),
112
- accessor: "mobileNumber",
113
- Cell: ({
114
- row
115
- }) => {
116
- var _row$original3;
117
- return /*#__PURE__*/React.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.mobileNumber) || "NA");
118
- }
119
110
  }, {
120
111
  Header: t("EKYC_STATUS"),
121
112
  accessor: "status",
122
113
  Cell: ({
123
114
  row
124
115
  }) => {
125
- var _row$original4;
126
- const status = ((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT";
116
+ var _row$original3;
117
+ const status = ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.status) || "DEFAULT";
127
118
  return /*#__PURE__*/React.createElement("span", {
128
119
  className: `ekyc-status-tag ${status}`
129
- }, t(`EKYC_STATUS_${status}`));
120
+ }, t(`${status}`));
130
121
  }
131
122
  }], [t, parentRoute]);
132
123
  const tableData = useMemo(() => {
133
124
  return (data === null || data === void 0 ? void 0 : data.items) || [];
134
125
  }, [data]);
135
126
  return /*#__PURE__*/React.createElement("div", {
136
- className: "inbox-container"
127
+ className: "inbox-container",
128
+ style: {
129
+ paddingBottom: "16px"
130
+ }
137
131
  }, /*#__PURE__*/React.createElement("div", {
138
132
  className: "filters-container"
139
133
  }, /*#__PURE__*/React.createElement(Card, {
@@ -360,7 +354,13 @@ const SearchConsumer = ({
360
354
  paddingLeft: "12px",
361
355
  height: "44px"
362
356
  }
363
- }))), /*#__PURE__*/React.createElement("div", {
357
+ })))), /*#__PURE__*/React.createElement("div", {
358
+ style: {
359
+ display: "flex",
360
+ justifyContent: "flex-end",
361
+ marginTop: "20px"
362
+ }
363
+ }, /*#__PURE__*/React.createElement("div", {
364
364
  style: {
365
365
  display: "flex",
366
366
  gap: "12px",
@@ -385,8 +385,7 @@ const SearchConsumer = ({
385
385
  margin: 0,
386
386
  borderRadius: "8px",
387
387
  height: "44px",
388
- padding: "0 32px",
389
- marginTop: "-55px"
388
+ padding: "0 32px"
390
389
  }
391
390
  }))))), children));
392
391
  };
@@ -457,18 +456,6 @@ const Filter = ({
457
456
  const [_searchParams, setSearchParams] = useState(() => ({
458
457
  ...searchParams
459
458
  }));
460
- const localParamChange = filterParam => {
461
- let keys_to_delete = filterParam.delete;
462
- let _new = {
463
- ..._searchParams,
464
- ...filterParam
465
- };
466
- if (keys_to_delete) keys_to_delete.forEach(key => delete _new[key]);
467
- delete filterParam.delete;
468
- setSearchParams({
469
- ..._new
470
- });
471
- };
472
459
  const applyLocalFilters = () => {
473
460
  onFilterChange(_searchParams);
474
461
  };
@@ -481,9 +468,12 @@ const Filter = ({
481
468
  });
482
469
  };
483
470
  const onStatusChange = value => {
484
- localParamChange({
471
+ const newParams = {
472
+ ..._searchParams,
485
473
  status: value
486
- });
474
+ };
475
+ setSearchParams(newParams);
476
+ onFilterChange(newParams);
487
477
  };
488
478
  return /*#__PURE__*/React.createElement(FilterForm, {
489
479
  onSubmit: applyLocalFilters,
@@ -504,14 +494,11 @@ const Filter = ({
504
494
  label: t("EKYC_STATUS_ALL"),
505
495
  value: ""
506
496
  }, {
507
- label: t("EKYC_STATUS_COMPLETED"),
508
- value: "COMPLETED"
497
+ label: t("EKYC_STATUS_ACTIVE"),
498
+ value: "ACTIVE"
509
499
  }, {
510
500
  label: t("EKYC_STATUS_PENDING"),
511
- value: "PENDING"
512
- }, {
513
- label: t("EKYC_STATUS_REJECTED"),
514
- value: "REJECTED"
501
+ value: "PENDING START"
515
502
  }],
516
503
  optionKey: "label",
517
504
  select: onStatusChange,
@@ -522,32 +509,6 @@ const Filter = ({
522
509
  })));
523
510
  };
524
511
 
525
- const MOCK_DATA_ITEMS = [{
526
- applicationNumber: "EKYC-2024-001",
527
- citizenName: "Rahul Sharma",
528
- mobileNumber: "9876543210",
529
- status: "COMPLETED"
530
- }, {
531
- applicationNumber: "EKYC-2024-002",
532
- citizenName: "Anjali Devi",
533
- mobileNumber: "9123456789",
534
- status: "PENDING"
535
- }, {
536
- applicationNumber: "EKYC-2024-003",
537
- citizenName: "Amit Kumar",
538
- mobileNumber: "8888888888",
539
- status: "REJECTED"
540
- }, {
541
- applicationNumber: "EKYC-2024-004",
542
- citizenName: "Priya Singh",
543
- mobileNumber: "7777777777",
544
- status: "COMPLETED"
545
- }, {
546
- applicationNumber: "EKYC-2024-005",
547
- citizenName: "Suresh Gupta",
548
- mobileNumber: "6666666666",
549
- status: "PENDING"
550
- }];
551
512
  const Inbox = ({
552
513
  parentRoute,
553
514
  businessService: _businessService = "EKYC",
@@ -555,6 +516,7 @@ const Inbox = ({
555
516
  filterComponent,
556
517
  isInbox
557
518
  }) => {
519
+ var _searchParams$status, _dashboardData$dashbo2;
558
520
  const tenantId = Digit.ULBService.getCurrentTenantId();
559
521
  const {
560
522
  t
@@ -572,25 +534,37 @@ const Inbox = ({
572
534
  const [searchParams, setSearchParams] = useState(_initialStates.searchParams || {
573
535
  status: defaultStatusOption
574
536
  });
575
- const filteredStaticData = useMemo(() => {
576
- return MOCK_DATA_ITEMS.filter(item => {
577
- var _searchParams$status;
578
- let match = true;
579
- const currentStatus = ((_searchParams$status = searchParams.status) === null || _searchParams$status === void 0 ? void 0 : _searchParams$status.value) !== undefined ? searchParams.status.value : searchParams.status;
580
- if (currentStatus && item.status !== currentStatus) {
581
- match = false;
582
- }
583
- return match;
584
- });
585
- }, [searchParams]);
586
- const staticCountData = useMemo(() => {
537
+ const {
538
+ isLoading,
539
+ data: dashboardData,
540
+ isFetching
541
+ } = Digit.Hooks.ekyc.useEkycSurveyorDashboard({}, {
542
+ tenantId,
543
+ offset: pageOffset,
544
+ limit: pageSize,
545
+ status: ((_searchParams$status = searchParams.status) === null || _searchParams$status === void 0 ? void 0 : _searchParams$status.value) || ""
546
+ }, {
547
+ enabled: !!tenantId
548
+ });
549
+ const filteredData = useMemo(() => {
550
+ var _dashboardData$dashbo;
551
+ const items = (dashboardData === null || dashboardData === void 0 ? void 0 : (_dashboardData$dashbo = dashboardData.dashboardInfo) === null || _dashboardData$dashbo === void 0 ? void 0 : _dashboardData$dashbo.consumerList) || [];
552
+ return items.map(item => ({
553
+ ...item,
554
+ applicationNumber: item.kno || item.applicationNumber,
555
+ citizenName: item.consumerName || item.citizenName
556
+ }));
557
+ }, [dashboardData]);
558
+ const countData = useMemo(() => {
559
+ const info = (dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo) || {};
587
560
  return {
588
- total: MOCK_DATA_ITEMS.length,
589
- completed: MOCK_DATA_ITEMS.filter(i => i.status === "COMPLETED").length,
590
- pending: MOCK_DATA_ITEMS.filter(i => i.status === "PENDING").length,
591
- rejected: MOCK_DATA_ITEMS.filter(i => i.status === "REJECTED").length
561
+ total: info.total || 0,
562
+ completed: info.completed || 0,
563
+ pending: info.pending || 0,
564
+ rejected: info.rejected || 0
592
565
  };
593
- }, []);
566
+ }, [dashboardData]);
567
+ const totalRecords = (dashboardData === null || dashboardData === void 0 ? void 0 : (_dashboardData$dashbo2 = dashboardData.dashboardInfo) === null || _dashboardData$dashbo2 === void 0 ? void 0 : _dashboardData$dashbo2.totalRecords) || (dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.totalCount) || 0;
594
568
  const handleSearch = useCallback(filterParam => {
595
569
  setSearchParams(prev => ({
596
570
  ...prev,
@@ -613,17 +587,14 @@ const Inbox = ({
613
587
  name: "status",
614
588
  type: "dropdown",
615
589
  options: [{
616
- label: t("CHOOSE_STATUS"),
590
+ label: t("EKYC_STATUS_ALL"),
617
591
  value: ""
618
592
  }, {
619
- label: t("EKYC_STATUS_COMPLETED"),
620
- value: "COMPLETED"
593
+ label: t("EKYC_STATUS_ACTIVE"),
594
+ value: "ACTIVE"
621
595
  }, {
622
596
  label: t("EKYC_STATUS_PENDING"),
623
- value: "PENDING"
624
- }, {
625
- label: t("EKYC_STATUS_REJECTED"),
626
- value: "REJECTED"
597
+ value: "PENDING START"
627
598
  }],
628
599
  optionsKey: "label"
629
600
  }], [t]);
@@ -633,22 +604,22 @@ const Inbox = ({
633
604
  className: "inbox-main-container"
634
605
  }, Digit.Utils.browser.isMobile() ? /*#__PURE__*/React.createElement(MobileInbox, {
635
606
  data: {
636
- items: filteredStaticData,
637
- totalCount: filteredStaticData.length
607
+ items: filteredData,
608
+ totalCount: totalRecords
638
609
  },
639
- isLoading: false,
610
+ isLoading: isLoading || isFetching,
640
611
  onSearch: handleSearch,
641
612
  searchFields: searchFields,
642
613
  searchParams: searchParams,
643
614
  parentRoute: parentRoute,
644
- countData: staticCountData
615
+ countData: countData
645
616
  }) : /*#__PURE__*/React.createElement(DesktopInbox, {
646
617
  businessService: _businessService,
647
618
  data: {
648
- items: filteredStaticData,
649
- totalCount: filteredStaticData.length
619
+ items: filteredData,
620
+ totalCount: totalRecords
650
621
  },
651
- isLoading: false,
622
+ isLoading: isLoading || isFetching,
652
623
  searchFields: searchFields,
653
624
  onSearch: handleSearch,
654
625
  onSort: handleSort,
@@ -660,8 +631,8 @@ const Inbox = ({
660
631
  parentRoute: parentRoute,
661
632
  searchParams: searchParams,
662
633
  sortParams: sortParams,
663
- totalRecords: filteredStaticData.length,
664
- countData: staticCountData,
634
+ totalRecords: totalRecords,
635
+ countData: countData,
665
636
  filterComponent: "EKYC_INBOX_FILTER"
666
637
  })));
667
638
  };
@@ -885,28 +856,6 @@ const Create = () => {
885
856
  }));
886
857
  };
887
858
 
888
- const FlagIcon = ({
889
- size: _size = 20
890
- }) => /*#__PURE__*/React.createElement("svg", {
891
- width: _size,
892
- height: _size,
893
- viewBox: "0 0 24 24",
894
- fill: "none"
895
- }, /*#__PURE__*/React.createElement("path", {
896
- d: "M14.4 6L13.6 4H5V21H7V14H12.6L13.4 16H20V6H14.4Z",
897
- fill: "#0F6E56"
898
- }));
899
- const IdCardIcon = ({
900
- size: _size2 = 20
901
- }) => /*#__PURE__*/React.createElement("svg", {
902
- width: _size2,
903
- height: _size2,
904
- viewBox: "0 0 24 24",
905
- fill: "none"
906
- }, /*#__PURE__*/React.createElement("path", {
907
- d: "M2 7V17C2 18.1 2.9 19 4 19H20C21.1 19 22 18.1 22 17V7C22 5.9 21.1 5 20 5H4C2.9 5 2 5.9 2 7ZM12 11H14V13H12V11ZM12 7H14V9H12V7ZM16 11H20V13H16V11ZM16 7H20V9H16V7ZM4 7H10V15H4V7ZM20 17H4V16H20V17Z",
908
- fill: "#185FA5"
909
- }));
910
859
  const CameraIcon = ({
911
860
  size: _size3 = 28
912
861
  }) => /*#__PURE__*/React.createElement("svg", {
@@ -1035,53 +984,12 @@ const SectionHead = ({
1035
984
  background: "#EAECF0"
1036
985
  }
1037
986
  }));
1038
- const AdminCard = ({
1039
- bgColor,
1040
- iconBg,
1041
- icon,
1042
- labelColor,
1043
- label,
1044
- value
1045
- }) => /*#__PURE__*/React.createElement("div", {
1046
- style: {
1047
- backgroundColor: bgColor,
1048
- padding: "14px 16px",
1049
- borderRadius: "8px",
1050
- display: "flex",
1051
- alignItems: "center",
1052
- gap: "14px",
1053
- border: "0.5px solid #EAECF0"
1054
- }
1055
- }, /*#__PURE__*/React.createElement("div", {
1056
- style: {
1057
- backgroundColor: iconBg,
1058
- padding: "8px",
1059
- borderRadius: "8px",
1060
- display: "flex",
1061
- flexShrink: 0
1062
- }
1063
- }, icon), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
1064
- style: {
1065
- color: labelColor,
1066
- fontSize: "10px",
1067
- fontWeight: "600",
1068
- textTransform: "uppercase",
1069
- letterSpacing: "0.05em",
1070
- marginBottom: "3px"
1071
- }
1072
- }, label), /*#__PURE__*/React.createElement("div", {
1073
- style: {
1074
- fontSize: "14px",
1075
- fontWeight: "600",
1076
- color: "#101828"
1077
- }
1078
- }, value)));
1079
987
  const AddressDetails = ({
1080
988
  isSection: _isSection = false,
1081
989
  onComplete,
1082
990
  parentState
1083
991
  }) => {
1084
- var _flowState$connection;
992
+ var _flowState$connection, _mdmsRes$egovLocatio, _mdmsRes$egovLocatio$, _mdmsRes$egovLocatio2, _mdmsRes$egovLocatio3;
1085
993
  const {
1086
994
  t
1087
995
  } = useTranslation();
@@ -1112,6 +1020,72 @@ const AddressDetails = ({
1112
1020
  const [doorPhoto, setDoorPhoto] = useState(null);
1113
1021
  const [isLocationFetching, setIsLocationFetching] = useState(false);
1114
1022
  const fileInputRef = useRef(null);
1023
+ const tenantId = Digit.ULBService.getCurrentTenantId();
1024
+ const {
1025
+ data: mdmsData,
1026
+ isLoading: isMdmsLoading
1027
+ } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
1028
+ const mdmsRes = (mdmsData === null || mdmsData === void 0 ? void 0 : mdmsData.MdmsRes) || mdmsData;
1029
+ const adminHierarchy = (mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$egovLocatio = mdmsRes["egov-location"]) === null || _mdmsRes$egovLocatio === void 0 ? void 0 : (_mdmsRes$egovLocatio$ = _mdmsRes$egovLocatio.TenantBoundary) === null || _mdmsRes$egovLocatio$ === void 0 ? void 0 : _mdmsRes$egovLocatio$.find(h => h.hierarchyType.code === "ADMIN")) || (mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$egovLocatio2 = mdmsRes["egov-location"]) === null || _mdmsRes$egovLocatio2 === void 0 ? void 0 : (_mdmsRes$egovLocatio3 = _mdmsRes$egovLocatio2.TenantBoundary) === null || _mdmsRes$egovLocatio3 === void 0 ? void 0 : _mdmsRes$egovLocatio3[0]);
1030
+ const rootBoundary = adminHierarchy === null || adminHierarchy === void 0 ? void 0 : adminHierarchy.boundary;
1031
+ const getAssemblies = boundaries => {
1032
+ if (!boundaries) return [];
1033
+ let assemblies = [];
1034
+ const targetLabel = "assembly constituency";
1035
+ for (const boundary of boundaries) {
1036
+ var _boundary$children;
1037
+ const label = (boundary.label || boundary.name || "").toLowerCase().replace(/_/g, " ");
1038
+ if (label === targetLabel || label === "assemblyconstituency") {
1039
+ assemblies.push({
1040
+ code: boundary.code,
1041
+ name: boundary.name,
1042
+ children: boundary.children
1043
+ });
1044
+ }
1045
+ if ((_boundary$children = boundary.children) !== null && _boundary$children !== void 0 && _boundary$children.length) {
1046
+ assemblies.push(...getAssemblies(boundary.children));
1047
+ }
1048
+ }
1049
+ return assemblies;
1050
+ };
1051
+ const getBlocks = children => {
1052
+ if (!children) return [];
1053
+ let blocks = [];
1054
+ const targetLabel = "block";
1055
+ for (const child of children) {
1056
+ var _child$children;
1057
+ const label = (child.label || child.name || "").toLowerCase().replace(/_/g, " ");
1058
+ if (label === targetLabel) {
1059
+ blocks.push({
1060
+ code: child.code,
1061
+ name: child.name
1062
+ });
1063
+ }
1064
+ if ((_child$children = child.children) !== null && _child$children !== void 0 && _child$children.length) {
1065
+ blocks.push(...getBlocks(child.children));
1066
+ }
1067
+ }
1068
+ return blocks;
1069
+ };
1070
+ const assemblies = getAssemblies(Array.isArray(rootBoundary) ? rootBoundary : rootBoundary ? [rootBoundary] : []);
1071
+ const [assembly, setAssembly] = useState(addrDetails.assembly ? {
1072
+ name: addrDetails.assembly
1073
+ } : null);
1074
+ const [ward, setWard] = useState(addrDetails.ward ? {
1075
+ name: addrDetails.ward
1076
+ } : null);
1077
+ useEffect(() => {
1078
+ if (mdmsRes && addrDetails.assembly && !(assembly !== null && assembly !== void 0 && assembly.code)) {
1079
+ const foundAssembly = assemblies.find(a => a.name === addrDetails.assembly || a.code === addrDetails.assembly);
1080
+ if (foundAssembly) setAssembly(foundAssembly);
1081
+ }
1082
+ }, [mdmsRes, assemblies]);
1083
+ const blocks = assembly ? getBlocks(assembly.children) : [];
1084
+ useEffect(() => {
1085
+ if (assembly && ward && !blocks.find(b => b.name === ward.name)) {
1086
+ setWard(null);
1087
+ }
1088
+ }, [assembly]);
1115
1089
  const addressOptions = [{
1116
1090
  code: "AADHAAR",
1117
1091
  name: "EKYC_AADHAAR_ADDRESS"
@@ -1134,7 +1108,9 @@ const AddressDetails = ({
1134
1108
  building,
1135
1109
  landmark,
1136
1110
  pincode,
1137
- doorPhoto
1111
+ doorPhoto,
1112
+ assembly: assembly === null || assembly === void 0 ? void 0 : assembly.name,
1113
+ ward: ward === null || ward === void 0 ? void 0 : ward.name
1138
1114
  };
1139
1115
  if (onComplete) {
1140
1116
  onComplete(payload);
@@ -1165,7 +1141,7 @@ const AddressDetails = ({
1165
1141
  };
1166
1142
  const handleUseCurrentLocation = () => {
1167
1143
  if (!("geolocation" in navigator)) {
1168
- alert(t("GEOLOCATION_NOT_SUPPORTED") || "Geolocation is not supported by your browser");
1144
+ alert(t("GEOLOCATION_NOT_SUPPORTED"));
1169
1145
  return;
1170
1146
  }
1171
1147
  setIsLocationFetching(true);
@@ -1194,7 +1170,7 @@ const AddressDetails = ({
1194
1170
  }, err => {
1195
1171
  console.error("Geolocation error:", err);
1196
1172
  setIsLocationFetching(false);
1197
- alert(t("LOCATION_FETCH_FAILED") || "Failed to fetch location. Please grant location permissions.");
1173
+ alert(t("LOCATION_FETCH_FAILED"));
1198
1174
  }, {
1199
1175
  enableHighAccuracy: true,
1200
1176
  timeout: 10000,
@@ -1214,7 +1190,7 @@ const AddressDetails = ({
1214
1190
  height: "16px"
1215
1191
  }
1216
1192
  }),
1217
- label: t("EKYC_ADDRESS_DETAILS_HEADER") || "Address Details"
1193
+ label: t("EKYC_ADDRESS_DETAILS_HEADER")
1218
1194
  }), /*#__PURE__*/React.createElement("div", {
1219
1195
  style: {
1220
1196
  marginBottom: "20px"
@@ -1267,7 +1243,7 @@ const AddressDetails = ({
1267
1243
  color: "#04342C",
1268
1244
  fontWeight: "500"
1269
1245
  }
1270
- }, addrDetails.fullAddress || "H.No. 123, Sector 15, Rohini, Delhi – 110085")), addressType.code === "OLD" && /*#__PURE__*/React.createElement("div", {
1246
+ }, addrDetails.fullAddress)), addressType.code === "OLD" && /*#__PURE__*/React.createElement("div", {
1271
1247
  style: {
1272
1248
  animation: "fadeSlideIn 0.3s ease"
1273
1249
  }
@@ -1285,7 +1261,7 @@ const AddressDetails = ({
1285
1261
  fontSize: "13px",
1286
1262
  color: "#505A5F"
1287
1263
  }
1288
- }, t("EKYC_ADDRESS_CORRECTION_PROMPT") || "Correct the address?"), /*#__PURE__*/React.createElement(RadioButtons, {
1264
+ }, t("EKYC_ADDRESS_CORRECTION_PROMPT")), /*#__PURE__*/React.createElement(RadioButtons, {
1289
1265
  options: yesNoOptions,
1290
1266
  optionsKey: "name",
1291
1267
  selectedOption: correctAddress,
@@ -1349,7 +1325,7 @@ const AddressDetails = ({
1349
1325
  fontSize: "14px",
1350
1326
  color: "#344054"
1351
1327
  }
1352
- }, isLocationFetching ? t("EKYC_FETCHING_LOCATION") || "Fetching location..." : t("EKYC_USE_CURRENT_LOCATION") || "Use current location")), !isLocationFetching && /*#__PURE__*/React.createElement("span", {
1328
+ }, isLocationFetching ? t("EKYC_FETCHING_LOCATION") : t("EKYC_USE_CURRENT_LOCATION"))), !isLocationFetching && /*#__PURE__*/React.createElement("span", {
1353
1329
  style: {
1354
1330
  fontSize: "18px",
1355
1331
  color: "#98A2B3",
@@ -1368,7 +1344,7 @@ const AddressDetails = ({
1368
1344
  letterSpacing: "0.04em",
1369
1345
  marginBottom: "6px"
1370
1346
  }
1371
- }, t("EKYC_FULL_ADDRESS") || "Full address"), /*#__PURE__*/React.createElement(IconInput, {
1347
+ }, t("EKYC_FULL_ADDRESS")), /*#__PURE__*/React.createElement(IconInput, {
1372
1348
  icon: /*#__PURE__*/React.createElement(PropertyHouse, {
1373
1349
  styles: {
1374
1350
  fill: "#0068fa",
@@ -1379,7 +1355,7 @@ const AddressDetails = ({
1379
1355
  topAligned: true,
1380
1356
  value: fullAddress,
1381
1357
  onChange: e => setFullAddress(e.target.value),
1382
- placeholder: t("EKYC_ENTER_FULL_ADDRESS") || "Enter full address",
1358
+ placeholder: t("EKYC_ENTER_FULL_ADDRESS"),
1383
1359
  inputStyle: {
1384
1360
  minHeight: "72px"
1385
1361
  }
@@ -1399,7 +1375,7 @@ const AddressDetails = ({
1399
1375
  letterSpacing: "0.04em",
1400
1376
  marginBottom: "6px"
1401
1377
  }
1402
- }, t("EKYC_FLAT_HOUSE_NUMBER") || "Flat / House no."), /*#__PURE__*/React.createElement(IconInput, {
1378
+ }, t("EKYC_FLAT_HOUSE_NUMBER")), /*#__PURE__*/React.createElement(IconInput, {
1403
1379
  icon: /*#__PURE__*/React.createElement(PropertyHouse, {
1404
1380
  styles: {
1405
1381
  fill: "#0068fa",
@@ -1409,7 +1385,7 @@ const AddressDetails = ({
1409
1385
  }),
1410
1386
  value: flatNo,
1411
1387
  onChange: e => setFlatNo(e.target.value),
1412
- placeholder: t("EKYC_ENTER_FLAT_NO") || "e.g. 45-B"
1388
+ placeholder: t("EKYC_ENTER_FLAT_NO")
1413
1389
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
1414
1390
  style: {
1415
1391
  fontSize: "11px",
@@ -1419,7 +1395,7 @@ const AddressDetails = ({
1419
1395
  letterSpacing: "0.04em",
1420
1396
  marginBottom: "6px"
1421
1397
  }
1422
- }, t("EKYC_BUILDING_TOWER") || "Building / Tower"), /*#__PURE__*/React.createElement(IconInput, {
1398
+ }, t("EKYC_BUILDING_TOWER")), /*#__PURE__*/React.createElement(IconInput, {
1423
1399
  icon: /*#__PURE__*/React.createElement(PropertyHouse, {
1424
1400
  styles: {
1425
1401
  fill: "#0068fa",
@@ -1429,7 +1405,7 @@ const AddressDetails = ({
1429
1405
  }),
1430
1406
  value: building,
1431
1407
  onChange: e => setBuilding(e.target.value),
1432
- placeholder: t("EKYC_ENTER_BUILDING") || "e.g. Tower 4"
1408
+ placeholder: t("EKYC_ENTER_BUILDING")
1433
1409
  }))), /*#__PURE__*/React.createElement("div", {
1434
1410
  style: {
1435
1411
  display: "grid",
@@ -1446,7 +1422,7 @@ const AddressDetails = ({
1446
1422
  letterSpacing: "0.04em",
1447
1423
  marginBottom: "6px"
1448
1424
  }
1449
- }, t("EKYC_LANDMARK") || "Landmark"), /*#__PURE__*/React.createElement(IconInput, {
1425
+ }, t("EKYC_LANDMARK")), /*#__PURE__*/React.createElement(IconInput, {
1450
1426
  icon: /*#__PURE__*/React.createElement(LocationIcon, {
1451
1427
  className: "icon",
1452
1428
  styles: {
@@ -1457,7 +1433,7 @@ const AddressDetails = ({
1457
1433
  }),
1458
1434
  value: landmark,
1459
1435
  onChange: e => setLandmark(e.target.value),
1460
- placeholder: t("EKYC_ENTER_LANDMARK") || "Near Central Park"
1436
+ placeholder: t("EKYC_ENTER_LANDMARK")
1461
1437
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
1462
1438
  style: {
1463
1439
  fontSize: "11px",
@@ -1467,7 +1443,7 @@ const AddressDetails = ({
1467
1443
  letterSpacing: "0.04em",
1468
1444
  marginBottom: "6px"
1469
1445
  }
1470
- }, t("EKYC_PINCODE") || "Pincode"), /*#__PURE__*/React.createElement(IconInput, {
1446
+ }, t("EKYC_PINCODE")), /*#__PURE__*/React.createElement(IconInput, {
1471
1447
  icon: /*#__PURE__*/React.createElement(PincodeIcon, {
1472
1448
  size: 15
1473
1449
  }),
@@ -1475,7 +1451,7 @@ const AddressDetails = ({
1475
1451
  onChange: e => {
1476
1452
  if (/^\d*$/.test(e.target.value)) setPincode(e.target.value);
1477
1453
  },
1478
- placeholder: t("EKYC_ENTER_PINCODE") || "6-digit pincode",
1454
+ placeholder: t("EKYC_ENTER_PINCODE"),
1479
1455
  maxLength: 6
1480
1456
  })))), /*#__PURE__*/React.createElement("hr", {
1481
1457
  style: {
@@ -1491,33 +1467,49 @@ const AddressDetails = ({
1491
1467
  height: "16px"
1492
1468
  }
1493
1469
  }),
1494
- label: t("EKYC_ADMINISTRATIVE_DIVISION") || "Administrative Division"
1495
- }), /*#__PURE__*/React.createElement("div", {
1470
+ label: t("EKYC_ADMINISTRATIVE_DIVISION")
1471
+ }), isMdmsLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
1496
1472
  style: {
1497
1473
  display: "grid",
1498
1474
  gridTemplateColumns: "1fr 1fr",
1499
1475
  gap: "14px",
1500
1476
  marginBottom: "24px"
1501
1477
  }
1502
- }, /*#__PURE__*/React.createElement(AdminCard, {
1503
- bgColor: "#E1F5EE",
1504
- iconBg: "#9FE1CB",
1505
- icon: /*#__PURE__*/React.createElement(FlagIcon, {
1506
- size: 18
1507
- }),
1508
- labelColor: "#0F6E56",
1509
- label: t("EKYC_ASSEMBLY") || "Assembly",
1510
- value: addrDetails.assembly || "AC-12 Chandni Chowk"
1511
- }), /*#__PURE__*/React.createElement(AdminCard, {
1512
- bgColor: "#E6F1FB",
1513
- iconBg: "#B5D4F4",
1514
- icon: /*#__PURE__*/React.createElement(IdCardIcon, {
1515
- size: 18
1516
- }),
1517
- labelColor: "#185FA5",
1518
- label: t("EKYC_WARD") || "Ward",
1519
- value: addrDetails.ward || "WARD-45 Civil Lines"
1520
- })), /*#__PURE__*/React.createElement("hr", {
1478
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
1479
+ style: {
1480
+ fontSize: "11px",
1481
+ fontWeight: "600",
1482
+ color: "#667085",
1483
+ textTransform: "uppercase",
1484
+ letterSpacing: "0.04em",
1485
+ marginBottom: "6px"
1486
+ }
1487
+ }, t("EKYC_ASSEMBLY")), /*#__PURE__*/React.createElement(Dropdown, {
1488
+ option: assemblies,
1489
+ optionKey: "name",
1490
+ selected: assembly,
1491
+ select: val => {
1492
+ setAssembly(val);
1493
+ setWard(null);
1494
+ },
1495
+ t: t
1496
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
1497
+ style: {
1498
+ fontSize: "11px",
1499
+ fontWeight: "600",
1500
+ color: "#667085",
1501
+ textTransform: "uppercase",
1502
+ letterSpacing: "0.04em",
1503
+ marginBottom: "6px"
1504
+ }
1505
+ }, t("EKYC_WARD") || "Block"), /*#__PURE__*/React.createElement(Dropdown, {
1506
+ option: blocks,
1507
+ optionKey: "name",
1508
+ selected: ward,
1509
+ select: setWard,
1510
+ disabled: !assembly,
1511
+ t: t
1512
+ }))), /*#__PURE__*/React.createElement("hr", {
1521
1513
  style: {
1522
1514
  margin: "24px 0",
1523
1515
  border: 0,
@@ -1527,14 +1519,14 @@ const AddressDetails = ({
1527
1519
  icon: /*#__PURE__*/React.createElement(CameraIcon, {
1528
1520
  size: 16
1529
1521
  }),
1530
- label: t("EKYC_DOOR_PHOTO_HEADER") || "Door photo with GPS stamp"
1522
+ label: t("EKYC_DOOR_PHOTO_HEADER")
1531
1523
  }), /*#__PURE__*/React.createElement("div", {
1532
1524
  style: {
1533
1525
  fontSize: "12px",
1534
1526
  color: "#667085",
1535
1527
  marginBottom: "12px"
1536
1528
  }
1537
- }, t("EKYC_REQUIRED_FOR_VERIFICATION") || "Required for verification"), /*#__PURE__*/React.createElement("div", {
1529
+ }, t("EKYC_REQUIRED_FOR_VERIFICATION")), /*#__PURE__*/React.createElement("div", {
1538
1530
  style: {
1539
1531
  backgroundColor: "#FFFAEB",
1540
1532
  border: "0.5px solid #FEDF89",
@@ -1559,12 +1551,12 @@ const AddressDetails = ({
1559
1551
  fontSize: "13px",
1560
1552
  marginBottom: "2px"
1561
1553
  }
1562
- }, t("EKYC_IMPORTANT") || "Important"), /*#__PURE__*/React.createElement("div", {
1554
+ }, t("EKYC_IMPORTANT")), /*#__PURE__*/React.createElement("div", {
1563
1555
  style: {
1564
1556
  fontSize: "12px",
1565
1557
  color: "#92400E"
1566
1558
  }
1567
- }, t("EKYC_CAPTURE_LIVE_CAMERA") || "Capture with live camera for GPS metadata"))), /*#__PURE__*/React.createElement("input", {
1559
+ }, t("EKYC_CAPTURE_LIVE_CAMERA")))), /*#__PURE__*/React.createElement("input", {
1568
1560
  type: "file",
1569
1561
  ref: fileInputRef,
1570
1562
  onChange: handleCapture,
@@ -1620,7 +1612,7 @@ const AddressDetails = ({
1620
1612
  fontSize: "12px",
1621
1613
  color: "#667085"
1622
1614
  }
1623
- }, t("EKYC_CAPTURE_DOOR_IMAGE") || "Capture door image")) : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("img", {
1615
+ }, t("EKYC_CAPTURE_DOOR_IMAGE"))) : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("img", {
1624
1616
  src: doorPhoto,
1625
1617
  alt: "Door",
1626
1618
  style: {
@@ -1652,15 +1644,15 @@ const AddressDetails = ({
1652
1644
  }
1653
1645
  }, /*#__PURE__*/React.createElement(TrashIcon, {
1654
1646
  size: 13
1655
- }), " ", t("EKYC_REMOVE") || "Remove"))), _isSection ? /*#__PURE__*/React.createElement("div", {
1647
+ }), " ", t("EKYC_REMOVE")))), _isSection ? /*#__PURE__*/React.createElement("div", {
1656
1648
  style: {
1657
1649
  marginTop: "24px"
1658
1650
  }
1659
1651
  }, /*#__PURE__*/React.createElement(SubmitBar, {
1660
- label: t("EKYC_COMPLETE_VERIFICATION_AND_PROCEED") || "Complete & Proceed",
1652
+ label: t("EKYC_COMPLETE_VERIFICATION_AND_PROCEED"),
1661
1653
  onSubmit: handleCompleteVerification
1662
1654
  })) : /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
1663
- label: t("EKYC_COMPLETE_VERIFICATION") || "Complete Verification",
1655
+ label: t("EKYC_COMPLETE_VERIFICATION"),
1664
1656
  onSubmit: handleCompleteVerification
1665
1657
  })), /*#__PURE__*/React.createElement("div", {
1666
1658
  style: {
@@ -1688,7 +1680,7 @@ const AddressDetails = ({
1688
1680
  rx: "2"
1689
1681
  }), /*#__PURE__*/React.createElement("path", {
1690
1682
  d: "M7 11V7a5 5 0 0 1 10 0v4"
1691
- })), t("EKYC_SECURE_DATA_NOTICE") || "Your data is encrypted and secure"));
1683
+ })), t("EKYC_SECURE_DATA_NOTICE")));
1692
1684
  if (_isSection) {
1693
1685
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("hr", {
1694
1686
  style: {
@@ -2042,9 +2034,12 @@ const RadioToggleRow = ({
2042
2034
  t: t,
2043
2035
  innerStyles: {
2044
2036
  display: "flex",
2045
- gap: "20px"
2037
+ gap: "20px",
2038
+ alignItems: "center"
2046
2039
  },
2047
2040
  style: {
2041
+ display: "flex",
2042
+ gap: "20px",
2048
2043
  marginBottom: 0
2049
2044
  }
2050
2045
  }));
@@ -2079,6 +2074,9 @@ const AadhaarVerification = () => {
2079
2074
  const [aadhaarLastFour, setAadhaarLastFour] = useState("");
2080
2075
  const [isAadhaarVerified, setIsAadhaarVerified] = useState(false);
2081
2076
  const [isVerifying, setIsVerifying] = useState(false);
2077
+ const [showOtpField, setShowOtpField] = useState(false);
2078
+ const [otp, setOtp] = useState("");
2079
+ const [otpError, setOtpError] = useState(false);
2082
2080
  const [nameCorrect, setNameCorrect] = useState({
2083
2081
  code: "NO",
2084
2082
  name: "CORE_COMMON_NO"
@@ -2102,11 +2100,18 @@ const AadhaarVerification = () => {
2102
2100
  name: "CORE_COMMON_NO"
2103
2101
  }];
2104
2102
  const handleVerifyAadhaar = () => {
2105
- if (aadhaarLastFour.length !== 4 || isVerifying) return;
2103
+ if (aadhaarLastFour.length !== 12 || isVerifying) return;
2106
2104
  setIsVerifying(true);
2107
2105
  setTimeout(() => {
2108
2106
  setIsVerifying(false);
2107
+ setShowOtpField(true);
2108
+ }, 1200);
2109
+ };
2110
+ const handleVerifyOtp = () => {
2111
+ if (otp === "123456") {
2109
2112
  setIsAadhaarVerified(true);
2113
+ setShowOtpField(false);
2114
+ setOtpError(false);
2110
2115
  setShowAddressSection(true);
2111
2116
  setTimeout(() => {
2112
2117
  var _addressSectionRef$cu;
@@ -2115,7 +2120,9 @@ const AadhaarVerification = () => {
2115
2120
  block: "start"
2116
2121
  });
2117
2122
  }, 100);
2118
- }, 1200);
2123
+ } else {
2124
+ setOtpError(true);
2125
+ }
2119
2126
  };
2120
2127
  const handleSaveAndContinue = () => {
2121
2128
  setShowAddressSection(true);
@@ -2176,7 +2183,7 @@ const AadhaarVerification = () => {
2176
2183
  display: "grid",
2177
2184
  gridTemplateColumns: "1fr 1fr",
2178
2185
  gap: "14px",
2179
- marginBottom: "4px"
2186
+ marginBottom: "20px"
2180
2187
  },
2181
2188
  optionalTag: {
2182
2189
  display: "inline-block",
@@ -2320,17 +2327,51 @@ const AadhaarVerification = () => {
2320
2327
  if (val.length <= 12 && /^\d*$/.test(val)) setAadhaarLastFour(val);
2321
2328
  },
2322
2329
  placeholder: t("EKYC_ENTER_LAST_4_DIGIT") || "Enter 12 digits",
2323
- maxLength: 4,
2330
+ maxLength: 12,
2324
2331
  disabled: isAadhaarVerified,
2325
2332
  inputStyle: isAadhaarVerified ? styles.verifiedInput : {}
2326
- }))), !isAadhaarVerified && /*#__PURE__*/React.createElement(SubmitBar, {
2333
+ }))), !isAadhaarVerified && !showOtpField && /*#__PURE__*/React.createElement(SubmitBar, {
2327
2334
  label: isVerifying ? t("EKYC_VERIFYING") || "Verifying..." : t("EKYC_VERIFY_AADHAAR_BTN") || "Verify Aadhaar",
2328
2335
  onSubmit: handleVerifyAadhaar,
2329
- disabled: aadhaarLastFour.length !== 4 || isVerifying,
2336
+ disabled: aadhaarLastFour.length !== 12 || isVerifying,
2330
2337
  style: {
2331
2338
  marginTop: "12px"
2332
2339
  }
2333
- }), isAadhaarVerified && /*#__PURE__*/React.createElement("div", {
2340
+ }), !isAadhaarVerified && showOtpField && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
2341
+ className: "ekyc-field-label",
2342
+ style: {
2343
+ marginTop: "16px"
2344
+ }
2345
+ }, t("EKYC_ENTER_OTP") || "Enter OTP"), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement("div", {
2346
+ className: "field"
2347
+ }, /*#__PURE__*/React.createElement(IconInput$1, {
2348
+ icon: /*#__PURE__*/React.createElement(LockIcon, {
2349
+ size: 15
2350
+ }),
2351
+ value: otp,
2352
+ onChange: e => {
2353
+ const val = e.target.value;
2354
+ if (/^\d*$/.test(val)) {
2355
+ setOtp(val);
2356
+ if (otpError) setOtpError(false);
2357
+ }
2358
+ },
2359
+ placeholder: t("EKYC_ENTER_OTP_PLACEHOLDER") || "Enter 123456",
2360
+ maxLength: 6
2361
+ }))), otpError && /*#__PURE__*/React.createElement("div", {
2362
+ style: {
2363
+ color: "#D4351C",
2364
+ fontSize: "12px",
2365
+ marginTop: "4px"
2366
+ }
2367
+ }, t("EKYC_INVALID_OTP") || "Invalid OTP. Please enter 123456."), /*#__PURE__*/React.createElement(SubmitBar, {
2368
+ label: t("EKYC_VERIFY_OTP_BTN") || "Verify OTP",
2369
+ onSubmit: handleVerifyOtp,
2370
+ disabled: otp.length !== 6,
2371
+ style: {
2372
+ marginTop: "12px"
2373
+ }
2374
+ })), isAadhaarVerified && /*#__PURE__*/React.createElement("div", {
2334
2375
  style: styles.verifiedCard
2335
2376
  }, /*#__PURE__*/React.createElement("div", {
2336
2377
  style: {
@@ -2374,7 +2415,7 @@ const AadhaarVerification = () => {
2374
2415
  style: styles.infoLabel
2375
2416
  }, t("EKYC_AADHAAR") || "Aadhaar"), /*#__PURE__*/React.createElement("div", {
2376
2417
  style: styles.infoValue
2377
- }, "XXXX XXXX ", aadhaarLastFour)), /*#__PURE__*/React.createElement("div", {
2418
+ }, aadhaarLastFour)), /*#__PURE__*/React.createElement("div", {
2378
2419
  style: {
2379
2420
  gridColumn: "span 2"
2380
2421
  }
@@ -2401,6 +2442,7 @@ const AadhaarVerification = () => {
2401
2442
  selected: nameCorrect,
2402
2443
  onSelect: setNameCorrect,
2403
2444
  options: yesNoOptions,
2445
+ sty: true,
2404
2446
  t: t
2405
2447
  }), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement("div", {
2406
2448
  className: "field"
@@ -2409,6 +2451,9 @@ const AadhaarVerification = () => {
2409
2451
  size: 15,
2410
2452
  color: nameCorrect.code === "YES" ? "#64748b" : "#94a3b8"
2411
2453
  }),
2454
+ style: {
2455
+ marginBottom: "12px"
2456
+ },
2412
2457
  value: userName,
2413
2458
  onChange: e => setUserName(e.target.value),
2414
2459
  placeholder: t("EKYC_ENTER_NAME_PLACEHOLDER") || "Enter full name",
@@ -2426,6 +2471,9 @@ const AadhaarVerification = () => {
2426
2471
  size: 15,
2427
2472
  color: mobileChange.code === "YES" ? "#64748b" : "#94a3b8"
2428
2473
  }),
2474
+ style: {
2475
+ marginBottom: "12px"
2476
+ },
2429
2477
  value: mobileNumber,
2430
2478
  onChange: e => setMobileNumber(e.target.value),
2431
2479
  placeholder: "+91 XXXXX XXXXX",
@@ -3063,36 +3111,42 @@ const PropertyInfo = () => {
3063
3111
  },
3064
3112
  onChange: handleFileUpload
3065
3113
  }), /*#__PURE__*/React.createElement("div", {
3066
- onClick: () => fileRef.current.click(),
3067
- onMouseOver: e => e.currentTarget.style.borderColor = "#185FA5",
3068
- onMouseOut: e => e.currentTarget.style.borderColor = "#B5D4F4",
3114
+ onClick: () => pidNumber && fileRef.current.click(),
3115
+ onMouseOver: e => {
3116
+ if (pidNumber) e.currentTarget.style.borderColor = "#185FA5";
3117
+ },
3118
+ onMouseOut: e => {
3119
+ if (pidNumber) e.currentTarget.style.borderColor = "#B5D4F4";
3120
+ },
3069
3121
  style: {
3070
- border: "1.5px dashed #B5D4F4",
3122
+ border: pidNumber ? "1.5px dashed #B5D4F4" : "1.5px dashed #D0D5DD",
3071
3123
  borderRadius: "10px",
3072
3124
  padding: "28px 20px",
3073
3125
  textAlign: "center",
3074
- cursor: "pointer",
3075
- backgroundColor: "#E6F1FB",
3126
+ cursor: pidNumber ? "pointer" : "not-allowed",
3127
+ backgroundColor: pidNumber ? "#E6F1FB" : "#F9FAFB",
3076
3128
  minHeight: "160px",
3077
3129
  display: "flex",
3078
3130
  flexDirection: "column",
3079
3131
  alignItems: "center",
3080
3132
  justifyContent: "center",
3081
3133
  gap: "10px",
3082
- transition: "border-color 0.15s"
3134
+ transition: "all 0.15s",
3135
+ opacity: pidNumber ? 1 : 0.6
3083
3136
  }
3084
3137
  }, /*#__PURE__*/React.createElement("div", {
3085
3138
  style: {
3086
- background: "#fff",
3139
+ background: pidNumber ? "#fff" : "#EAECF0",
3087
3140
  padding: "10px",
3088
3141
  borderRadius: "10px",
3089
- display: "flex"
3142
+ display: "flex",
3143
+ filter: pidNumber ? "none" : "grayscale(100%)"
3090
3144
  }
3091
3145
  }, /*#__PURE__*/React.createElement("svg", {
3092
3146
  width: "32",
3093
3147
  height: "32",
3094
3148
  viewBox: "0 0 24 24",
3095
- fill: "#185FA5"
3149
+ fill: pidNumber ? "#185FA5" : "#98A2B3"
3096
3150
  }, /*#__PURE__*/React.createElement("path", {
3097
3151
  d: "M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13z"
3098
3152
  }), /*#__PURE__*/React.createElement("path", {
@@ -3110,14 +3164,14 @@ const PropertyInfo = () => {
3110
3164
  style: {
3111
3165
  fontSize: "13px",
3112
3166
  fontWeight: "600",
3113
- color: "#185FA5"
3167
+ color: pidNumber ? "#185FA5" : "#98A2B3"
3114
3168
  }
3115
- }, t("EKYC_UPLOAD_PROPERTY_DOC_CTA") || "Tap to upload"), /*#__PURE__*/React.createElement("div", {
3169
+ }, pidNumber ? t("EKYC_UPLOAD_PROPERTY_DOC_CTA") || "Tap to upload" : t("EKYC_ENTER_PID_FIRST_CTA") || "Enter PID to upload"), /*#__PURE__*/React.createElement("div", {
3116
3170
  style: {
3117
3171
  fontSize: "12px",
3118
- color: "#378ADD"
3172
+ color: pidNumber ? "#378ADD" : "#98A2B3"
3119
3173
  }
3120
- }, "PDF only")))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
3174
+ }, pidNumber ? "PDF | Max 5MB" : "Requires PID")))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
3121
3175
  style: {
3122
3176
  fontSize: "11px",
3123
3177
  fontWeight: "600",
@@ -3183,7 +3237,13 @@ const PropertyInfo = () => {
3183
3237
  color: "#667085",
3184
3238
  marginTop: "2px"
3185
3239
  }
3186
- }, t("EKYC_BUILDING_PHOTO") || "Building photo with GPS")) : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("img", {
3240
+ }, t("EKYC_BUILDING_PHOTO") || "Building photo with GPS"), /*#__PURE__*/React.createElement("div", {
3241
+ style: {
3242
+ fontSize: "11px",
3243
+ color: "#98A2B3",
3244
+ marginTop: "2px"
3245
+ }
3246
+ }, "JPG, PNG | Max 2MB")) : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("img", {
3187
3247
  src: buildingPhoto,
3188
3248
  alt: "Building",
3189
3249
  style: {
@@ -3454,7 +3514,7 @@ const ReviewCard = ({
3454
3514
  }
3455
3515
  }, row.value)) : null)));
3456
3516
  const Review = () => {
3457
- var _propertyDetails$conn, _propertyDetails$conn2, _propertyDetails$user, _propertyDetails$noOf;
3517
+ var _propertyDetails$conn3, _propertyDetails$conn4, _propertyDetails$user2, _propertyDetails$noOf2;
3458
3518
  const {
3459
3519
  t
3460
3520
  } = useTranslation();
@@ -3466,8 +3526,84 @@ const Review = () => {
3466
3526
  addressDetails = {},
3467
3527
  propertyDetails = {}
3468
3528
  } = location.state || {};
3469
- const handleSubmit = () => {
3470
- history.push("/digit-ui/employee/ekyc/dashboard");
3529
+ const [isSubmitting, setIsSubmitting] = useState(false);
3530
+ const [toast, setToast] = useState(null);
3531
+ const uploadFile = async (file, tenantId) => {
3532
+ var _res$data, _res$data$files, _res$data$files$;
3533
+ if (!file) return null;
3534
+ const res = await Digit.UploadServices.Filestorage("EKYC", file, tenantId);
3535
+ return (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$files = _res$data.files) === null || _res$data$files === void 0 ? void 0 : (_res$data$files$ = _res$data$files[0]) === null || _res$data$files$ === void 0 ? void 0 : _res$data$files$.fileStoreId) || null;
3536
+ };
3537
+ const dataUrlToFile = (dataUrl, filename) => {
3538
+ const arr = dataUrl.split(",");
3539
+ const mime = arr[0].match(/:(.*?);/)[1];
3540
+ const bstr = atob(arr[1]);
3541
+ let n = bstr.length;
3542
+ const u8arr = new Uint8Array(n);
3543
+ while (n--) u8arr[n] = bstr.charCodeAt(n);
3544
+ return new File([u8arr], filename, {
3545
+ type: mime
3546
+ });
3547
+ };
3548
+ const handleSubmit = async () => {
3549
+ setIsSubmitting(true);
3550
+ setToast(null);
3551
+ try {
3552
+ var _Digit$UserService$ge, _Digit$UserService$ge2, _propertyDetails$user, _propertyDetails$noOf, _propertyDetails$conn, _propertyDetails$conn2;
3553
+ const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
3554
+ const userInfo = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
3555
+ const propertyDocFile = propertyDetails.propertyDocument || null;
3556
+ const propertyDocFileStoreId = await uploadFile(propertyDocFile, tenantId);
3557
+ let buildingImageFileStoreId = null;
3558
+ if (propertyDetails.buildingPhoto) {
3559
+ const photoFile = dataUrlToFile(propertyDetails.buildingPhoto, "building_photo.jpg");
3560
+ buildingImageFileStoreId = await uploadFile(photoFile, tenantId);
3561
+ }
3562
+ const requestBody = {
3563
+ RequestInfo: {
3564
+ apiId: "Rainmaker",
3565
+ ver: "1.0",
3566
+ msgId: `${Date.now()}|${navigator.language || "en_IN"}`,
3567
+ tenantId,
3568
+ authToken: userInfo.access_token || ((_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.access_token) || ""
3569
+ },
3570
+ updateType: "PROPERTY",
3571
+ kno: kNumber,
3572
+ pidNumber: propertyDetails.pidNumber || null,
3573
+ propertyDocumentFileStoreId: propertyDocFileStoreId,
3574
+ buildingImageFileStoreId: buildingImageFileStoreId,
3575
+ userType: ((_propertyDetails$user = propertyDetails.userType) === null || _propertyDetails$user === void 0 ? void 0 : _propertyDetails$user.value) || null,
3576
+ noOfFloor: (_propertyDetails$noOf = propertyDetails.noOfFloors) !== null && _propertyDetails$noOf !== void 0 && _propertyDetails$noOf.value ? parseInt(propertyDetails.noOfFloors.value, 10) : null,
3577
+ typeOfConnection: ((_propertyDetails$conn = propertyDetails.connectionCategory) === null || _propertyDetails$conn === void 0 ? void 0 : _propertyDetails$conn.value) || null,
3578
+ connectionCategory: ((_propertyDetails$conn2 = propertyDetails.connectionType) === null || _propertyDetails$conn2 === void 0 ? void 0 : _propertyDetails$conn2.value) || null,
3579
+ modifiedBy: userInfo.name || userInfo.userName || null
3580
+ };
3581
+ await Digit.CustomService.getResponse({
3582
+ url: "/ekyc-service/user/application/_update",
3583
+ params: {
3584
+ tenantId
3585
+ },
3586
+ body: requestBody,
3587
+ useCache: false,
3588
+ method: "POST"
3589
+ });
3590
+ setToast({
3591
+ type: "success",
3592
+ message: t("EKYC_SUBMIT_SUCCESS") || "Application submitted successfully!"
3593
+ });
3594
+ setTimeout(() => {
3595
+ history.push("/digit-ui/employee/ekyc/dashboard");
3596
+ }, 1800);
3597
+ } catch (err) {
3598
+ var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
3599
+ console.error("eKYC Submit Error:", err);
3600
+ setToast({
3601
+ type: "error",
3602
+ 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$Er = _err$response$data.Errors) === null || _err$response$data$Er === void 0 ? void 0 : (_err$response$data$Er2 = _err$response$data$Er[0]) === null || _err$response$data$Er2 === void 0 ? void 0 : _err$response$data$Er2.message) || t("EKYC_SUBMIT_ERROR") || "Submission failed. Please try again."
3603
+ });
3604
+ } finally {
3605
+ setIsSubmitting(false);
3606
+ }
3471
3607
  };
3472
3608
  const handleEditAadhaar = () => {
3473
3609
  history.push("/digit-ui/employee/ekyc/aadhaar-verification", location.state);
@@ -3478,7 +3614,7 @@ const Review = () => {
3478
3614
  const handleEditProperty = () => {
3479
3615
  history.push("/digit-ui/employee/ekyc/property-info", location.state);
3480
3616
  };
3481
- return /*#__PURE__*/React.createElement("div", {
3617
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
3482
3618
  className: "inbox-container"
3483
3619
  }, /*#__PURE__*/React.createElement("style", null, `
3484
3620
  @keyframes fadeSlideIn {
@@ -3666,7 +3802,7 @@ const Review = () => {
3666
3802
  value: aadhaarDetails.userName || "Rajesh Kumar Singh"
3667
3803
  }, {
3668
3804
  label: t("EKYC_AADHAAR") || "Aadhaar no.",
3669
- value: aadhaarDetails.aadhaarLastFour ? `XXXX XXXX ${aadhaarDetails.aadhaarLastFour}` : "XXXX XXXX 1234"
3805
+ value: aadhaarDetails.aadhaarLastFour ? `${aadhaarDetails.aadhaarLastFour}` : "XXXX XXXX 1234"
3670
3806
  }, {
3671
3807
  label: t("EKYC_MOBILE_NO") || "Mobile no.",
3672
3808
  value: aadhaarDetails.mobileNumber || "XXXXXXXXXX"
@@ -3740,24 +3876,25 @@ const Review = () => {
3740
3876
  value: propertyDetails.pidNumber || null
3741
3877
  }, {
3742
3878
  label: t("EKYC_TYPE_OF_CONNECTION") || "Type of connection",
3743
- value: ((_propertyDetails$conn = propertyDetails.connectionCategory) === null || _propertyDetails$conn === void 0 ? void 0 : _propertyDetails$conn.label) || null
3879
+ value: ((_propertyDetails$conn3 = propertyDetails.connectionCategory) === null || _propertyDetails$conn3 === void 0 ? void 0 : _propertyDetails$conn3.label) || null
3744
3880
  }, {
3745
3881
  label: t("EKYC_CONNECTION_CATEGORY") || "Connection category",
3746
- value: ((_propertyDetails$conn2 = propertyDetails.connectionType) === null || _propertyDetails$conn2 === void 0 ? void 0 : _propertyDetails$conn2.label) || null
3882
+ value: ((_propertyDetails$conn4 = propertyDetails.connectionType) === null || _propertyDetails$conn4 === void 0 ? void 0 : _propertyDetails$conn4.label) || null
3747
3883
  }, {
3748
3884
  label: t("EKYC_USER_TYPE") || "User type",
3749
- value: ((_propertyDetails$user = propertyDetails.userType) === null || _propertyDetails$user === void 0 ? void 0 : _propertyDetails$user.label) || null
3885
+ value: ((_propertyDetails$user2 = propertyDetails.userType) === null || _propertyDetails$user2 === void 0 ? void 0 : _propertyDetails$user2.label) || null
3750
3886
  }, {
3751
3887
  label: t("EKYC_NO_OF_FLOORS") || "No. of floors",
3752
- value: ((_propertyDetails$noOf = propertyDetails.noOfFloors) === null || _propertyDetails$noOf === void 0 ? void 0 : _propertyDetails$noOf.label) || null
3888
+ value: ((_propertyDetails$noOf2 = propertyDetails.noOfFloors) === null || _propertyDetails$noOf2 === void 0 ? void 0 : _propertyDetails$noOf2.label) || null
3753
3889
  }]
3754
3890
  })), /*#__PURE__*/React.createElement("div", {
3755
3891
  style: {
3756
3892
  marginTop: "24px"
3757
3893
  }
3758
3894
  }, /*#__PURE__*/React.createElement(SubmitBar, {
3759
- label: t("ES_COMMON_SUBMIT") || "Submit",
3760
- onSubmit: handleSubmit
3895
+ label: isSubmitting ? t("EKYC_SUBMITTING") || "Submitting..." : t("ES_COMMON_SUBMIT") || "Submit",
3896
+ onSubmit: handleSubmit,
3897
+ disabled: isSubmitting
3761
3898
  })), /*#__PURE__*/React.createElement("div", {
3762
3899
  style: {
3763
3900
  display: "flex",
@@ -3784,7 +3921,12 @@ const Review = () => {
3784
3921
  rx: "2"
3785
3922
  }), /*#__PURE__*/React.createElement("path", {
3786
3923
  d: "M7 11V7a5 5 0 0 1 10 0v4"
3787
- })), t("EKYC_SECURE_DATA_NOTICE") || "Your data is encrypted and secure"))));
3924
+ })), t("EKYC_SECURE_DATA_NOTICE") || "Your data is encrypted and secure")))), toast && /*#__PURE__*/React.createElement(Toast, {
3925
+ label: toast.message,
3926
+ error: toast.type === "error",
3927
+ success: toast.type === "success",
3928
+ onClose: () => setToast(null)
3929
+ }));
3788
3930
  };
3789
3931
 
3790
3932
  const EmployeeApp = ({