@djb25/digit-ui-module-wt 1.0.38 → 1.0.40

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.
@@ -693,9 +693,61 @@ const fixedPointPayload = data => {
693
693
  };
694
694
  };
695
695
  const emergencyWaterTankerPayload = data => {
696
- const formdata = waterTankerPayload(data);
697
- formdata.waterTankerBookingDetail.workflow.action = "CREATE";
698
- formdata.waterTankerBookingDetail.workflow.businessService = "watertanker-fixedpoint";
696
+ var _data$requestDetails11, _data$requestDetails12, _data$requestDetails13, _data$requestDetails14, _data$requestDetails15, _data$requestDetails16, _data$requestDetails17, _data$requestDetails18, _data$requestDetails19, _data$requestDetails20, _data$requestDetails21, _data$requestDetails22, _data$requestDetails23, _data$requestDetails24, _data$requestDetails25, _data$requestDetails26, _data$requestDetails27, _data$requestDetails28, _data$address71, _data$dispatchDetails, _data$dispatchDetails2, _data$owner29, _data$owner29$vendor, _data$dispatchDetails3, _data$dispatchDetails4, _data$owner30, _data$owner30$vehicle, _data$dispatchDetails5, _data$dispatchDetails6, _data$owner31, _data$owner31$driver, _data$dispatchDetails7, _data$dispatchDetails8, _data$owner32, _data$owner32$filling, _data$dispatchDetails9, _data$dispatchDetails0, _data$owner33, _data$owner33$vehicle, _data$dispatchDetails1, _data$dispatchDetails10, _data$owner34, _data$owner34$vehicle, _data$owner35, _data$owner36, _data$owner37, _data$owner38, _data$address72, _data$address72$addre, _data$address73, _data$address74, _data$address75, _data$address75$city, _data$address75$city$, _data$address76, _data$address76$city, _data$address77, _data$address78, _data$address78$city, _data$address78$city$, _data$address79, _data$address79$city, _data$address80, _data$address81, _data$address82, _data$address83, _data$address83$local, _data$address84, _data$address84$local, _data$address85, _data$address86, _data$address86$local, _data$address87, _data$address88, _data$address89, _data$address90, _data$address91, _data$address92, _data$address93, _data$address94, _data$address95, _data$requestDetails29;
697
+ console.log(data, 'dataaaa');
698
+ const formdata = {
699
+ waterTankerBookingDetail: {
700
+ tenantId: data === null || data === void 0 ? void 0 : data.tenantId,
701
+ tankerType: (data === null || data === void 0 ? void 0 : (_data$requestDetails11 = data.requestDetails) === null || _data$requestDetails11 === void 0 ? void 0 : (_data$requestDetails12 = _data$requestDetails11.tankerType) === null || _data$requestDetails12 === void 0 ? void 0 : _data$requestDetails12.code) || (data === null || data === void 0 ? void 0 : (_data$requestDetails13 = data.requestDetails) === null || _data$requestDetails13 === void 0 ? void 0 : _data$requestDetails13.tankerType),
702
+ waterType: (data === null || data === void 0 ? void 0 : (_data$requestDetails14 = data.requestDetails) === null || _data$requestDetails14 === void 0 ? void 0 : (_data$requestDetails15 = _data$requestDetails14.waterType) === null || _data$requestDetails15 === void 0 ? void 0 : _data$requestDetails15.code) || (data === null || data === void 0 ? void 0 : (_data$requestDetails16 = data.requestDetails) === null || _data$requestDetails16 === void 0 ? void 0 : _data$requestDetails16.waterType),
703
+ tankerQuantity: (data === null || data === void 0 ? void 0 : (_data$requestDetails17 = data.requestDetails) === null || _data$requestDetails17 === void 0 ? void 0 : (_data$requestDetails18 = _data$requestDetails17.tankerQuantity) === null || _data$requestDetails18 === void 0 ? void 0 : _data$requestDetails18.code) || (data === null || data === void 0 ? void 0 : (_data$requestDetails19 = data.requestDetails) === null || _data$requestDetails19 === void 0 ? void 0 : _data$requestDetails19.tankerQuantity),
704
+ waterQuantity: (data === null || data === void 0 ? void 0 : (_data$requestDetails20 = data.requestDetails) === null || _data$requestDetails20 === void 0 ? void 0 : (_data$requestDetails21 = _data$requestDetails20.waterQuantity) === null || _data$requestDetails21 === void 0 ? void 0 : _data$requestDetails21.code) || (data === null || data === void 0 ? void 0 : (_data$requestDetails22 = data.requestDetails) === null || _data$requestDetails22 === void 0 ? void 0 : (_data$requestDetails23 = _data$requestDetails22.waterQuantity) === null || _data$requestDetails23 === void 0 ? void 0 : _data$requestDetails23.value) || (data === null || data === void 0 ? void 0 : (_data$requestDetails24 = data.requestDetails) === null || _data$requestDetails24 === void 0 ? void 0 : _data$requestDetails24.waterQuantity),
705
+ description: data === null || data === void 0 ? void 0 : (_data$requestDetails25 = data.requestDetails) === null || _data$requestDetails25 === void 0 ? void 0 : _data$requestDetails25.description,
706
+ deliveryDate: data === null || data === void 0 ? void 0 : (_data$requestDetails26 = data.requestDetails) === null || _data$requestDetails26 === void 0 ? void 0 : _data$requestDetails26.deliveryDate,
707
+ deliveryTime: data === null || data === void 0 ? void 0 : (_data$requestDetails27 = data.requestDetails) === null || _data$requestDetails27 === void 0 ? void 0 : _data$requestDetails27.deliveryTime,
708
+ extraCharge: data !== null && data !== void 0 && (_data$requestDetails28 = data.requestDetails) !== null && _data$requestDetails28 !== void 0 && _data$requestDetails28.extraCharge ? "Y" : "N",
709
+ addressDetailId: (data === null || data === void 0 ? void 0 : (_data$address71 = data.address) === null || _data$address71 === void 0 ? void 0 : _data$address71.addressDetailId) || "",
710
+ vendorId: (data === null || data === void 0 ? void 0 : (_data$dispatchDetails = data.dispatchDetails) === null || _data$dispatchDetails === void 0 ? void 0 : (_data$dispatchDetails2 = _data$dispatchDetails.vendor) === null || _data$dispatchDetails2 === void 0 ? void 0 : _data$dispatchDetails2.id) || (data === null || data === void 0 ? void 0 : (_data$owner29 = data.owner) === null || _data$owner29 === void 0 ? void 0 : (_data$owner29$vendor = _data$owner29.vendor) === null || _data$owner29$vendor === void 0 ? void 0 : _data$owner29$vendor.id) || "",
711
+ vehicleId: (data === null || data === void 0 ? void 0 : (_data$dispatchDetails3 = data.dispatchDetails) === null || _data$dispatchDetails3 === void 0 ? void 0 : (_data$dispatchDetails4 = _data$dispatchDetails3.vehicle) === null || _data$dispatchDetails4 === void 0 ? void 0 : _data$dispatchDetails4.id) || (data === null || data === void 0 ? void 0 : (_data$owner30 = data.owner) === null || _data$owner30 === void 0 ? void 0 : (_data$owner30$vehicle = _data$owner30.vehicle) === null || _data$owner30$vehicle === void 0 ? void 0 : _data$owner30$vehicle.id) || "",
712
+ driverId: (data === null || data === void 0 ? void 0 : (_data$dispatchDetails5 = data.dispatchDetails) === null || _data$dispatchDetails5 === void 0 ? void 0 : (_data$dispatchDetails6 = _data$dispatchDetails5.driver) === null || _data$dispatchDetails6 === void 0 ? void 0 : _data$dispatchDetails6.id) || (data === null || data === void 0 ? void 0 : (_data$owner31 = data.owner) === null || _data$owner31 === void 0 ? void 0 : (_data$owner31$driver = _data$owner31.driver) === null || _data$owner31$driver === void 0 ? void 0 : _data$owner31$driver.id) || "",
713
+ fillingPointId: (data === null || data === void 0 ? void 0 : (_data$dispatchDetails7 = data.dispatchDetails) === null || _data$dispatchDetails7 === void 0 ? void 0 : (_data$dispatchDetails8 = _data$dispatchDetails7.fillingPoint) === null || _data$dispatchDetails8 === void 0 ? void 0 : _data$dispatchDetails8.id) || (data === null || data === void 0 ? void 0 : (_data$owner32 = data.owner) === null || _data$owner32 === void 0 ? void 0 : (_data$owner32$filling = _data$owner32.fillingPoint) === null || _data$owner32$filling === void 0 ? void 0 : _data$owner32$filling.id) || "",
714
+ vehicleType: (data === null || data === void 0 ? void 0 : (_data$dispatchDetails9 = data.dispatchDetails) === null || _data$dispatchDetails9 === void 0 ? void 0 : (_data$dispatchDetails0 = _data$dispatchDetails9.vehicle) === null || _data$dispatchDetails0 === void 0 ? void 0 : _data$dispatchDetails0.vehicleType) || (data === null || data === void 0 ? void 0 : (_data$owner33 = data.owner) === null || _data$owner33 === void 0 ? void 0 : (_data$owner33$vehicle = _data$owner33.vehicle) === null || _data$owner33$vehicle === void 0 ? void 0 : _data$owner33$vehicle.vehicleType) || "",
715
+ vehicleCapacity: (data === null || data === void 0 ? void 0 : (_data$dispatchDetails1 = data.dispatchDetails) === null || _data$dispatchDetails1 === void 0 ? void 0 : (_data$dispatchDetails10 = _data$dispatchDetails1.vehicle) === null || _data$dispatchDetails10 === void 0 ? void 0 : _data$dispatchDetails10.capacity) || (data === null || data === void 0 ? void 0 : (_data$owner34 = data.owner) === null || _data$owner34 === void 0 ? void 0 : (_data$owner34$vehicle = _data$owner34.vehicle) === null || _data$owner34$vehicle === void 0 ? void 0 : _data$owner34$vehicle.capacity) || "",
716
+ applicantDetail: {
717
+ name: data === null || data === void 0 ? void 0 : (_data$owner35 = data.owner) === null || _data$owner35 === void 0 ? void 0 : _data$owner35.applicantName,
718
+ mobileNumber: data === null || data === void 0 ? void 0 : (_data$owner36 = data.owner) === null || _data$owner36 === void 0 ? void 0 : _data$owner36.mobileNumber,
719
+ alternateNumber: data === null || data === void 0 ? void 0 : (_data$owner37 = data.owner) === null || _data$owner37 === void 0 ? void 0 : _data$owner37.alternateNumber,
720
+ emailId: data === null || data === void 0 ? void 0 : (_data$owner38 = data.owner) === null || _data$owner38 === void 0 ? void 0 : _data$owner38.emailId,
721
+ type: "FIXED-POINT"
722
+ },
723
+ address: {
724
+ addressType: (data === null || data === void 0 ? void 0 : (_data$address72 = data.address) === null || _data$address72 === void 0 ? void 0 : (_data$address72$addre = _data$address72.addressType) === null || _data$address72$addre === void 0 ? void 0 : _data$address72$addre.code) || (data === null || data === void 0 ? void 0 : (_data$address73 = data.address) === null || _data$address73 === void 0 ? void 0 : _data$address73.addressType) || "OTHER",
725
+ pincode: data === null || data === void 0 ? void 0 : (_data$address74 = data.address) === null || _data$address74 === void 0 ? void 0 : _data$address74.pincode,
726
+ city: (data === null || data === void 0 ? void 0 : (_data$address75 = data.address) === null || _data$address75 === void 0 ? void 0 : (_data$address75$city = _data$address75.city) === null || _data$address75$city === void 0 ? void 0 : (_data$address75$city$ = _data$address75$city.city) === null || _data$address75$city$ === void 0 ? void 0 : _data$address75$city$.name) || (data === null || data === void 0 ? void 0 : (_data$address76 = data.address) === null || _data$address76 === void 0 ? void 0 : (_data$address76$city = _data$address76.city) === null || _data$address76$city === void 0 ? void 0 : _data$address76$city.name) || (data === null || data === void 0 ? void 0 : (_data$address77 = data.address) === null || _data$address77 === void 0 ? void 0 : _data$address77.city) || "",
727
+ cityCode: (data === null || data === void 0 ? void 0 : (_data$address78 = data.address) === null || _data$address78 === void 0 ? void 0 : (_data$address78$city = _data$address78.city) === null || _data$address78$city === void 0 ? void 0 : (_data$address78$city$ = _data$address78$city.city) === null || _data$address78$city$ === void 0 ? void 0 : _data$address78$city$.code) || (data === null || data === void 0 ? void 0 : (_data$address79 = data.address) === null || _data$address79 === void 0 ? void 0 : (_data$address79$city = _data$address79.city) === null || _data$address79$city === void 0 ? void 0 : _data$address79$city.code) || (data === null || data === void 0 ? void 0 : (_data$address80 = data.address) === null || _data$address80 === void 0 ? void 0 : _data$address80.cityCode) || "DJB",
728
+ addressLine1: data === null || data === void 0 ? void 0 : (_data$address81 = data.address) === null || _data$address81 === void 0 ? void 0 : _data$address81.addressLine1,
729
+ addressLine2: data === null || data === void 0 ? void 0 : (_data$address82 = data.address) === null || _data$address82 === void 0 ? void 0 : _data$address82.addressLine2,
730
+ locality: (data === null || data === void 0 ? void 0 : (_data$address83 = data.address) === null || _data$address83 === void 0 ? void 0 : (_data$address83$local = _data$address83.locality) === null || _data$address83$local === void 0 ? void 0 : _data$address83$local.i18nKey) || (data === null || data === void 0 ? void 0 : (_data$address84 = data.address) === null || _data$address84 === void 0 ? void 0 : (_data$address84$local = _data$address84.locality) === null || _data$address84$local === void 0 ? void 0 : _data$address84$local.name) || (data === null || data === void 0 ? void 0 : (_data$address85 = data.address) === null || _data$address85 === void 0 ? void 0 : _data$address85.locality) || "",
731
+ localityCode: (data === null || data === void 0 ? void 0 : (_data$address86 = data.address) === null || _data$address86 === void 0 ? void 0 : (_data$address86$local = _data$address86.locality) === null || _data$address86$local === void 0 ? void 0 : _data$address86$local.code) || (data === null || data === void 0 ? void 0 : (_data$address87 = data.address) === null || _data$address87 === void 0 ? void 0 : _data$address87.localityCode) || "",
732
+ streetName: data === null || data === void 0 ? void 0 : (_data$address88 = data.address) === null || _data$address88 === void 0 ? void 0 : _data$address88.streetName,
733
+ houseNo: data === null || data === void 0 ? void 0 : (_data$address89 = data.address) === null || _data$address89 === void 0 ? void 0 : _data$address89.houseNo,
734
+ landmark: data === null || data === void 0 ? void 0 : (_data$address90 = data.address) === null || _data$address90 === void 0 ? void 0 : _data$address90.landmark,
735
+ latitude: data === null || data === void 0 ? void 0 : (_data$address91 = data.address) === null || _data$address91 === void 0 ? void 0 : _data$address91.latitude,
736
+ longitude: data === null || data === void 0 ? void 0 : (_data$address92 = data.address) === null || _data$address92 === void 0 ? void 0 : _data$address92.longitude,
737
+ ward: (data === null || data === void 0 ? void 0 : (_data$address93 = data.address) === null || _data$address93 === void 0 ? void 0 : _data$address93.block) || "",
738
+ zone: (data === null || data === void 0 ? void 0 : (_data$address94 = data.address) === null || _data$address94 === void 0 ? void 0 : _data$address94.zone) || "",
739
+ constituency: (data === null || data === void 0 ? void 0 : (_data$address95 = data.address) === null || _data$address95 === void 0 ? void 0 : _data$address95.assembly) || ""
740
+ },
741
+ WTfileStoreId: data === null || data === void 0 ? void 0 : (_data$requestDetails29 = data.requestDetails) === null || _data$requestDetails29 === void 0 ? void 0 : _data$requestDetails29.fileStoreId,
742
+ bookingStatus: "BOOKING_CREATED",
743
+ workflow: {
744
+ action: "CREATE",
745
+ comments: "",
746
+ businessService: "watertanker-fixedpoint",
747
+ moduleName: "request-service.water_tanker"
748
+ }
749
+ }
750
+ };
699
751
  return formdata;
700
752
  };
701
753
 
@@ -2592,19 +2644,6 @@ const InboxLinks = ({
2592
2644
  const {
2593
2645
  t
2594
2646
  } = useTranslation();
2595
- const allLinks = [];
2596
- const [links, setLinks] = useState([]);
2597
- const {
2598
- roles: userRoles
2599
- } = Digit.UserService.getUser().info;
2600
- useEffect(() => {
2601
- let linksToShow = allLinks.filter(e => e.businessService === businessService).filter(({
2602
- roles
2603
- }) => roles.some(e => userRoles.map(({
2604
- code
2605
- }) => code).includes(e)) || !(roles !== null && roles !== void 0 && roles.length));
2606
- setLinks(linksToShow);
2607
- }, []);
2608
2647
  const GetLogo = () => /*#__PURE__*/React.createElement("div", {
2609
2648
  className: "header"
2610
2649
  }, /*#__PURE__*/React.createElement("span", {
@@ -2618,23 +2657,7 @@ const InboxLinks = ({
2618
2657
  className: "filter inboxLinks"
2619
2658
  }, /*#__PURE__*/React.createElement("div", {
2620
2659
  className: "complaint-links-container"
2621
- }, Digit.UserService.getUser().info.type !== "CITIZEN" && GetLogo(), /*#__PURE__*/React.createElement("div", {
2622
- className: "body"
2623
- }, links.map(({
2624
- link,
2625
- text,
2626
- hyperlink: _hyperlink = false,
2627
- roles: _roles = []
2628
- }, index) => {
2629
- return /*#__PURE__*/React.createElement("span", {
2630
- className: "link",
2631
- key: index
2632
- }, _hyperlink ? /*#__PURE__*/React.createElement("a", {
2633
- href: link
2634
- }, text) : /*#__PURE__*/React.createElement(Link, {
2635
- to: link
2636
- }, t(text)));
2637
- }))))
2660
+ }, Digit.UserService.getUser().info.type !== "CITIZEN" && GetLogo()))
2638
2661
  );
2639
2662
  };
2640
2663
 
@@ -4641,6 +4664,25 @@ const calculateDistance = (lat1, lon1, lat2, lon2) => {
4641
4664
  function deg2rad(deg) {
4642
4665
  return deg * (Math.PI / 180);
4643
4666
  }
4667
+ const geocodeAddress = async address => {
4668
+ if (!address || !address.trim()) return null;
4669
+ try {
4670
+ const response = await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(address)}`, {
4671
+ headers: {
4672
+ "Accept-Language": "en",
4673
+ "User-Agent": "Digit-UI-WT-Module"
4674
+ }
4675
+ });
4676
+ if (!response.ok) {
4677
+ throw new Error(`Geocoding failed: ${response.statusText}`);
4678
+ }
4679
+ const data = await response.json();
4680
+ return data;
4681
+ } catch (error) {
4682
+ console.error("Error in geocodeAddress:", error);
4683
+ return null;
4684
+ }
4685
+ };
4644
4686
 
4645
4687
  delete L.Icon.Default.prototype._getIconUrl;
4646
4688
  L.Icon.Default.mergeOptions({
@@ -5232,20 +5274,18 @@ function LiveTrackingSystem() {
5232
5274
  } = Digit.Hooks.fsm.useVendorSearch({
5233
5275
  tenantId,
5234
5276
  filters: {
5235
- status: "ACTIVE"
5277
+ status: "ACTIVE",
5278
+ ...(selectedFillingPoint !== null && selectedFillingPoint !== void 0 && selectedFillingPoint.id ? {
5279
+ fillingPointId: selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.id
5280
+ } : {})
5236
5281
  },
5237
5282
  config: {
5238
5283
  select: data => (data === null || data === void 0 ? void 0 : data.vendor) || []
5239
5284
  }
5240
5285
  });
5241
5286
  const filteredVendorOptions = useMemo(() => {
5242
- if (!vendorOptions || !vendorOptions.length) return [];
5243
- if (!selectedFillingPoint) return vendorOptions;
5244
- return vendorOptions.filter(vendor => {
5245
- var _vendor$fillingPoint;
5246
- return (vendor === null || vendor === void 0 ? void 0 : (_vendor$fillingPoint = vendor.fillingPoint) === null || _vendor$fillingPoint === void 0 ? void 0 : _vendor$fillingPoint.id) === (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.id);
5247
- });
5248
- }, [vendorOptions, selectedFillingPoint]);
5287
+ return vendorOptions || [];
5288
+ }, [vendorOptions]);
5249
5289
  useEffect(() => {
5250
5290
  if (vendorOptions !== null && vendorOptions !== void 0 && vendorOptions.length && Object.keys(drivers).length) {
5251
5291
  var _vendorOptions$, _vendorOptions$2, _vendorOptions$2$driv;
@@ -5354,8 +5394,7 @@ function LiveTrackingSystem() {
5354
5394
  const matchesFillingPoint = !selectedFillingPoint || (() => {
5355
5395
  if (!vendorOptions || !vendorOptions.length) return false;
5356
5396
  return vendorOptions.some(vendor => {
5357
- var _vendor$fillingPoint2, _vendor$drivers2;
5358
- if ((vendor === null || vendor === void 0 ? void 0 : (_vendor$fillingPoint2 = vendor.fillingPoint) === null || _vendor$fillingPoint2 === void 0 ? void 0 : _vendor$fillingPoint2.id) !== (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.id)) return false;
5397
+ var _vendor$drivers2;
5359
5398
  return (_vendor$drivers2 = vendor.drivers) === null || _vendor$drivers2 === void 0 ? void 0 : _vendor$drivers2.some(d => {
5360
5399
  var _d$owner5, _d$owner6, _d$owner7, _d$owner8;
5361
5400
  return ((_d$owner5 = d.owner) === null || _d$owner5 === void 0 ? void 0 : _d$owner5.mobileNumber) === driver.driverId || ((_d$owner6 = d.owner) === null || _d$owner6 === void 0 ? void 0 : _d$owner6.uuid) === driver.driverId || d.id === driver.driverId || String((_d$owner7 = d.owner) === null || _d$owner7 === void 0 ? void 0 : _d$owner7.mobileNumber) === String(driver.driverId) || String((_d$owner8 = d.owner) === null || _d$owner8 === void 0 ? void 0 : _d$owner8.uuid) === String(driver.driverId);
@@ -6154,6 +6193,9 @@ const AddFixFillAddress = ({
6154
6193
  const [longitude, setLongitude] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address12 = formData.address) === null || _formData$address12 === void 0 ? void 0 : _formData$address12.longitude) || "");
6155
6194
  const [selectedAddress, setSelectedAddress] = useState("");
6156
6195
  const [showPincodeSuggestions, setShowPincodeSuggestions] = useState(false);
6196
+ const [loading, setLoading] = useState(false);
6197
+ const [error, setError] = useState(null);
6198
+ const [geocodedAddress, setGeocodedAddress] = useState(null);
6157
6199
  const isInitialized = useRef(!isEdit);
6158
6200
  const lastSyncedAddress = useRef(null);
6159
6201
  const lastBookingId = useRef(null);
@@ -6276,8 +6318,8 @@ const AddFixFillAddress = ({
6276
6318
  setAddressLine2(addressData.addressLine2 || "");
6277
6319
  setAddressType(allOptions.find(a => a.code === addressData.addressType) || addressData.addressType || allOptions.find(a => a.code === "PERMANENT"));
6278
6320
  setZone(addressData.zone || "");
6279
- setBlock(addressData.block || "");
6280
- setAssembly(addressData.assembly || "");
6321
+ setBlock(addressData.block || addressData.ward || "");
6322
+ setAssembly(addressData.assembly || addressData.constituency || "");
6281
6323
  setLatitude(addressData.latitude || "");
6282
6324
  setLongitude(addressData.longitude || "");
6283
6325
  if ((structuredLocality === null || structuredLocality === void 0 ? void 0 : structuredLocality.length) > 0 || !addressData.cityCode) {
@@ -6318,6 +6360,38 @@ const AddFixFillAddress = ({
6318
6360
  setAddressType(allOptions.find(a => a.code === selectedAddress.addressType));
6319
6361
  }
6320
6362
  }, [selectedAddress, structuredLocality]);
6363
+ const getLatLng = async () => {
6364
+ try {
6365
+ setLoading(true);
6366
+ setError(null);
6367
+ const parts = [houseNo, streetName, addressLine1, addressLine2, (locality === null || locality === void 0 ? void 0 : locality.name) || (typeof locality === "string" ? locality : ""), (city === null || city === void 0 ? void 0 : city.name) || (typeof city === "string" ? city : ""), pincode].filter(Boolean);
6368
+ const fullAddress = parts.join(", ");
6369
+ if (!fullAddress.trim()) {
6370
+ setError(t("WT_ENTER_ADDRESS_DETAILS_FIRST"));
6371
+ setLoading(false);
6372
+ return;
6373
+ }
6374
+ const data = await geocodeAddress(fullAddress);
6375
+ if (data && data.length > 0) {
6376
+ setLatitude(data[0].lat);
6377
+ setLongitude(data[0].lon);
6378
+ setGeocodedAddress(data[0].display_name);
6379
+ } else {
6380
+ setError(t("WT_LOCATION_NOT_FOUND"));
6381
+ }
6382
+ } catch (err) {
6383
+ setError(t("WT_GEOCODING_ERROR"));
6384
+ } finally {
6385
+ setLoading(false);
6386
+ }
6387
+ };
6388
+ useEffect(() => {
6389
+ if (!addressLine1 || addressLine1.trim().length < 5) return;
6390
+ const timer = setTimeout(() => {
6391
+ getLatLng();
6392
+ }, 1000);
6393
+ return () => clearTimeout(timer);
6394
+ }, [addressLine1]);
6321
6395
  useEffect(() => {
6322
6396
  if (!onSelect || !isInitialized.current) return;
6323
6397
  const currentAddress = {
@@ -6365,9 +6439,7 @@ const AddFixFillAddress = ({
6365
6439
  style: {
6366
6440
  width: "100%"
6367
6441
  }
6368
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("CITY"), " ", /*#__PURE__*/React.createElement("span", {
6369
- className: "astericColor"
6370
- }, "*")), /*#__PURE__*/React.createElement(Dropdown, {
6442
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("CITY")), /*#__PURE__*/React.createElement(Dropdown, {
6371
6443
  selected: city,
6372
6444
  select: setCity,
6373
6445
  option: allCities || [],
@@ -6378,9 +6450,7 @@ const AddFixFillAddress = ({
6378
6450
  style: {
6379
6451
  position: "relative"
6380
6452
  }
6381
- }, /*#__PURE__*/React.createElement(CardLabel, null, t("PINCODE"), " ", /*#__PURE__*/React.createElement("span", {
6382
- className: "astericColor"
6383
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6453
+ }, /*#__PURE__*/React.createElement(CardLabel, null, t("PINCODE")), /*#__PURE__*/React.createElement(TextInput, {
6384
6454
  value: pincode,
6385
6455
  onChange: e => {
6386
6456
  const newPin = e.target.value.replace(/\D/g, "").slice(0, 6);
@@ -6427,9 +6497,7 @@ const AddFixFillAddress = ({
6427
6497
  setPincode(p.code);
6428
6498
  setShowPincodeSuggestions(false);
6429
6499
  }
6430
- }, p.code)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LOCALITY"), " ", /*#__PURE__*/React.createElement("span", {
6431
- className: "astericColor"
6432
- }, "*")), /*#__PURE__*/React.createElement(Dropdown, {
6500
+ }, p.code)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LOCALITY")), /*#__PURE__*/React.createElement(Dropdown, {
6433
6501
  selected: locality,
6434
6502
  select: val => {
6435
6503
  setLocality(val);
@@ -6446,84 +6514,63 @@ const AddFixFillAddress = ({
6446
6514
  t: t,
6447
6515
  style: {
6448
6516
  width: "100%"
6449
- }
6450
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("HOUSE_NO"), /*#__PURE__*/React.createElement("span", {
6451
- className: "astericColor"
6452
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6517
+ },
6518
+ isSearchable: true
6519
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("HOUSE_NO")), /*#__PURE__*/React.createElement(TextInput, {
6453
6520
  value: houseNo,
6454
6521
  onChange: e => setHouseNo(e.target.value),
6455
6522
  style: {
6456
6523
  width: "100%"
6457
6524
  }
6458
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("STREET_NAME"), " ", /*#__PURE__*/React.createElement("span", {
6459
- className: "astericColor"
6460
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6525
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("STREET_NAME")), /*#__PURE__*/React.createElement(TextInput, {
6461
6526
  value: streetName,
6462
6527
  onChange: e => setStreetName(e.target.value),
6463
6528
  style: {
6464
6529
  width: "100%"
6465
6530
  }
6466
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE1"), " ", /*#__PURE__*/React.createElement("span", {
6467
- className: "astericColor"
6468
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6531
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE1")), /*#__PURE__*/React.createElement(TextInput, {
6469
6532
  value: addressLine1,
6470
6533
  onChange: e => setAddressLine1(e.target.value),
6471
6534
  style: {
6472
6535
  width: "100%"
6473
6536
  }
6474
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE2"), " ", /*#__PURE__*/React.createElement("span", {
6475
- className: "astericColor"
6476
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6537
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE2")), /*#__PURE__*/React.createElement(TextInput, {
6477
6538
  value: addressLine2,
6478
6539
  onChange: e => setAddressLine2(e.target.value),
6479
6540
  style: {
6480
6541
  width: "100%"
6481
6542
  }
6482
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("BLOCK"), " ", /*#__PURE__*/React.createElement("span", {
6483
- className: "astericColor"
6484
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6543
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("BLOCK")), /*#__PURE__*/React.createElement(TextInput, {
6485
6544
  value: block,
6486
6545
  onChange: e => setBlock(e.target.value),
6487
6546
  style: {
6488
6547
  width: "100%"
6489
6548
  }
6490
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ZONE"), " ", /*#__PURE__*/React.createElement("span", {
6491
- className: "astericColor"
6492
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6549
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ZONE")), /*#__PURE__*/React.createElement(TextInput, {
6493
6550
  value: zone,
6494
6551
  onChange: e => setZone(e.target.value),
6495
6552
  style: {
6496
6553
  width: "100%"
6497
6554
  }
6498
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ASSEMBLY_CONSTITUENCY"), " ", /*#__PURE__*/React.createElement("span", {
6499
- className: "astericColor"
6500
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6501
- value: assembly,
6502
- onChange: e => setAssembly(e.target.value),
6503
- style: {
6504
- width: "100%"
6505
- }
6506
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LATITUDE"), " ", /*#__PURE__*/React.createElement("span", {
6507
- className: "astericColor"
6508
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6555
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LATITUDE")), /*#__PURE__*/React.createElement(TextInput, {
6509
6556
  value: latitude,
6510
6557
  onChange: e => setLatitude(e.target.value),
6511
6558
  style: {
6512
6559
  width: "100%"
6513
6560
  }
6514
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LONGITUDE"), " ", /*#__PURE__*/React.createElement("span", {
6515
- className: "astericColor"
6516
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6561
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LONGITUDE")), /*#__PURE__*/React.createElement(TextInput, {
6517
6562
  value: longitude,
6518
6563
  onChange: e => setLongitude(e.target.value),
6519
6564
  style: {
6520
6565
  width: "100%"
6521
6566
  }
6522
- })), /*#__PURE__*/React.createElement("div", {
6567
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ASSEMBLY_CONSTITUENCY")), /*#__PURE__*/React.createElement(TextInput, {
6568
+ value: assembly,
6569
+ onChange: e => setAssembly(e.target.value),
6523
6570
  style: {
6524
- gridColumn: "span 2"
6571
+ width: "100%"
6525
6572
  }
6526
- }, /*#__PURE__*/React.createElement(CardLabel, null, t("LANDMARK")), /*#__PURE__*/React.createElement(TextInput, {
6573
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LANDMARK")), /*#__PURE__*/React.createElement(TextInput, {
6527
6574
  value: landmark,
6528
6575
  onChange: e => setLandmark(e.target.value),
6529
6576
  style: {
@@ -6533,7 +6580,7 @@ const AddFixFillAddress = ({
6533
6580
  };
6534
6581
 
6535
6582
  const AddFillingPointAddress = () => {
6536
- var _formData$owner, _formData$owner2, _formData$owner3, _formData$owner4, _formData$owner5, _formData$owner6, _formData$owner7, _formData$owner8, _formData$owner9, _formData$address, _formData$address2, _formData$address3, _formData$address4, _formData$address5, _formData$address6, _formData$address7, _formData$address8, _formData$address9;
6583
+ var _formData$owner, _formData$owner2, _formData$owner3, _formData$owner4, _formData$owner5, _formData$owner6, _formData$owner7, _formData$owner8, _formData$owner9, _formData$address, _formData$address2, _formData$address3, _formData$address4, _formData$address5, _formData$address6, _formData$address7;
6537
6584
  const {
6538
6585
  t
6539
6586
  } = useTranslation();
@@ -6636,14 +6683,14 @@ const AddFillingPointAddress = () => {
6636
6683
  });
6637
6684
  };
6638
6685
  const isMobile = window.Digit.Utils.browser.isMobile();
6639
- const isFormDisabled = !(formData !== null && formData !== void 0 && (_formData$owner = formData.owner) !== null && _formData$owner !== void 0 && _formData$owner.aeName) || !(formData !== null && formData !== void 0 && (_formData$owner2 = formData.owner) !== null && _formData$owner2 !== void 0 && _formData$owner2.aeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner3 = formData.owner) !== null && _formData$owner3 !== void 0 && _formData$owner3.aeEmail) || !(formData !== null && formData !== void 0 && (_formData$owner4 = formData.owner) !== null && _formData$owner4 !== void 0 && _formData$owner4.jeName) || !(formData !== null && formData !== void 0 && (_formData$owner5 = formData.owner) !== null && _formData$owner5 !== void 0 && _formData$owner5.jeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner6 = formData.owner) !== null && _formData$owner6 !== void 0 && _formData$owner6.jeEmail) || !(formData !== null && formData !== void 0 && (_formData$owner7 = formData.owner) !== null && _formData$owner7 !== void 0 && _formData$owner7.eeName) || !(formData !== null && formData !== void 0 && (_formData$owner8 = formData.owner) !== null && _formData$owner8 !== void 0 && _formData$owner8.eeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner9 = formData.owner) !== null && _formData$owner9 !== void 0 && _formData$owner9.eeEmail) || !(formData !== null && formData !== void 0 && (_formData$address = formData.address) !== null && _formData$address !== void 0 && _formData$address.houseNo) || !(formData !== null && formData !== void 0 && (_formData$address2 = formData.address) !== null && _formData$address2 !== void 0 && _formData$address2.streetName) || !(formData !== null && formData !== void 0 && (_formData$address3 = formData.address) !== null && _formData$address3 !== void 0 && _formData$address3.addressLine1) || !(formData !== null && formData !== void 0 && (_formData$address4 = formData.address) !== null && _formData$address4 !== void 0 && _formData$address4.addressLine2) || !(formData !== null && formData !== void 0 && (_formData$address5 = formData.address) !== null && _formData$address5 !== void 0 && _formData$address5.city) || !(formData !== null && formData !== void 0 && (_formData$address6 = formData.address) !== null && _formData$address6 !== void 0 && _formData$address6.locality) || !(formData !== null && formData !== void 0 && (_formData$address7 = formData.address) !== null && _formData$address7 !== void 0 && _formData$address7.latitude) || !(formData !== null && formData !== void 0 && (_formData$address8 = formData.address) !== null && _formData$address8 !== void 0 && _formData$address8.longitude) || !(formData !== null && formData !== void 0 && (_formData$address9 = formData.address) !== null && _formData$address9 !== void 0 && _formData$address9.pincode);
6686
+ const isFormDisabled = !(formData !== null && formData !== void 0 && (_formData$owner = formData.owner) !== null && _formData$owner !== void 0 && _formData$owner.aeName) || !(formData !== null && formData !== void 0 && (_formData$owner2 = formData.owner) !== null && _formData$owner2 !== void 0 && _formData$owner2.aeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner3 = formData.owner) !== null && _formData$owner3 !== void 0 && _formData$owner3.aeEmail) || !(formData !== null && formData !== void 0 && (_formData$owner4 = formData.owner) !== null && _formData$owner4 !== void 0 && _formData$owner4.jeName) || !(formData !== null && formData !== void 0 && (_formData$owner5 = formData.owner) !== null && _formData$owner5 !== void 0 && _formData$owner5.jeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner6 = formData.owner) !== null && _formData$owner6 !== void 0 && _formData$owner6.jeEmail) || !(formData !== null && formData !== void 0 && (_formData$owner7 = formData.owner) !== null && _formData$owner7 !== void 0 && _formData$owner7.eeName) || !(formData !== null && formData !== void 0 && (_formData$owner8 = formData.owner) !== null && _formData$owner8 !== void 0 && _formData$owner8.eeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner9 = formData.owner) !== null && _formData$owner9 !== void 0 && _formData$owner9.eeEmail) || !(formData !== null && formData !== void 0 && (_formData$address = formData.address) !== null && _formData$address !== void 0 && _formData$address.addressLine1) || !(formData !== null && formData !== void 0 && (_formData$address2 = formData.address) !== null && _formData$address2 !== void 0 && _formData$address2.addressLine2) || !(formData !== null && formData !== void 0 && (_formData$address3 = formData.address) !== null && _formData$address3 !== void 0 && _formData$address3.city) || !(formData !== null && formData !== void 0 && (_formData$address4 = formData.address) !== null && _formData$address4 !== void 0 && _formData$address4.locality) || !(formData !== null && formData !== void 0 && (_formData$address5 = formData.address) !== null && _formData$address5 !== void 0 && _formData$address5.latitude) || !(formData !== null && formData !== void 0 && (_formData$address6 = formData.address) !== null && _formData$address6 !== void 0 && _formData$address6.longitude) || !(formData !== null && formData !== void 0 && (_formData$address7 = formData.address) !== null && _formData$address7 !== void 0 && _formData$address7.pincode);
6640
6687
  if (isEditLoading) return /*#__PURE__*/React.createElement(Loader, null);
6641
6688
  return /*#__PURE__*/React.createElement("div", {
6642
6689
  className: "employee-form-section-wrapper"
6643
6690
  }, /*#__PURE__*/React.createElement(VerticalTimeline, {
6644
6691
  config: [{
6645
6692
  timeLine: [{
6646
- actions: "Add Filling Point",
6693
+ actions: editId ? "Update Filling Point" : "Add Filling Point",
6647
6694
  currentStep: 1
6648
6695
  }]
6649
6696
  }],
@@ -6720,7 +6767,7 @@ const AddFixPointAddress = () => {
6720
6767
  return ((_item$applicantDetail = item.applicantDetail) === null || _item$applicantDetail === void 0 ? void 0 : _item$applicantDetail.applicantId) === editId;
6721
6768
  });
6722
6769
  if (data) {
6723
- var _data$applicantDetail, _data$applicantDetail2, _data$applicantDetail3, _data$applicantDetail4, _data$applicantDetail5, _data$address, _data$address2;
6770
+ var _data$applicantDetail, _data$applicantDetail2, _data$applicantDetail3, _data$applicantDetail4, _data$applicantDetail5, _data$address, _data$address2, _data$address3, _data$address4, _data$address5, _data$address6;
6724
6771
  setFormData({
6725
6772
  owner: {
6726
6773
  name: (_data$applicantDetail = data.applicantDetail) === null || _data$applicantDetail === void 0 ? void 0 : _data$applicantDetail.name,
@@ -6732,7 +6779,9 @@ const AddFixPointAddress = () => {
6732
6779
  address: {
6733
6780
  ...data.address,
6734
6781
  addressId: (_data$address = data.address) === null || _data$address === void 0 ? void 0 : _data$address.addressId,
6735
- applicantId: (_data$address2 = data.address) === null || _data$address2 === void 0 ? void 0 : _data$address2.applicantId
6782
+ applicantId: (_data$address2 = data.address) === null || _data$address2 === void 0 ? void 0 : _data$address2.applicantId,
6783
+ block: ((_data$address3 = data.address) === null || _data$address3 === void 0 ? void 0 : _data$address3.ward) || ((_data$address4 = data.address) === null || _data$address4 === void 0 ? void 0 : _data$address4.block),
6784
+ assembly: ((_data$address5 = data.address) === null || _data$address5 === void 0 ? void 0 : _data$address5.constituency) || ((_data$address6 = data.address) === null || _data$address6 === void 0 ? void 0 : _data$address6.assembly)
6736
6785
  },
6737
6786
  bookingId: data.bookingId,
6738
6787
  bookingNo: data.bookingNo,
@@ -6795,7 +6844,7 @@ const AddFixPointAddress = () => {
6795
6844
  }, /*#__PURE__*/React.createElement(VerticalTimeline, {
6796
6845
  config: [{
6797
6846
  timeLine: [{
6798
- actions: "Add Fixed Point",
6847
+ actions: editId ? "Update Fixed Point" : "Add Fixed Point",
6799
6848
  currentStep: 1
6800
6849
  }]
6801
6850
  }],
@@ -7104,6 +7153,7 @@ const SearchFillingPointAddress = () => {
7104
7153
  const [fixedPointStatus, setFixedPointStatus] = useState(null);
7105
7154
  const [appliedFixedPointStatus, setAppliedFixedPointStatus] = useState(null);
7106
7155
  const [searchParams, setSearchParams] = useState({});
7156
+ const [selectedFillingPoint, setSelectedFillingPoint] = useState(null);
7107
7157
  const [toast, setToast] = useState(null);
7108
7158
  const [showLocalityModal, setShowLocalityModal] = useState(false);
7109
7159
  const [selectedLocalityRow, setSelectedLocalityRow] = useState(null);
@@ -7208,6 +7258,7 @@ const SearchFillingPointAddress = () => {
7208
7258
  setStatus(null);
7209
7259
  setFixedPointStatus(null);
7210
7260
  setAppliedFixedPointStatus(null);
7261
+ setSelectedFillingPoint(null);
7211
7262
  setSearchParams({});
7212
7263
  };
7213
7264
  const onTabChange = tab => {
@@ -7235,7 +7286,8 @@ const SearchFillingPointAddress = () => {
7235
7286
  name: searchValue
7236
7287
  }),
7237
7288
  mobileNumber: mobileNumber,
7238
- status: selectedTab === "FILLING_POINT" ? status === null || status === void 0 ? void 0 : status.code : null
7289
+ status: selectedTab === "FILLING_POINT" ? status === null || status === void 0 ? void 0 : status.code : null,
7290
+ fillingPointId: (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.id) || (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.bookingId) || (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.fillingPointId) || (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.uuid)
7239
7291
  };
7240
7292
  setAppliedFixedPointStatus(fixedPointStatus);
7241
7293
  setSearchParams(filters);
@@ -7553,8 +7605,15 @@ const SearchFillingPointAddress = () => {
7553
7605
  }, {
7554
7606
  Header: t("WT_FILLING_POINT"),
7555
7607
  exportAccessor: row => {
7556
- var _row$fillingpointmeta2, _row$fillingPoint, _row$fillingPointDeta, _row$fillingPointDeta2;
7557
- return (row === null || row === void 0 ? void 0 : row.fillingPointId) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta2 = row.fillingpointmetadata) === null || _row$fillingpointmeta2 === void 0 ? void 0 : _row$fillingpointmeta2.fillingPointId) || (row === null || row === void 0 ? void 0 : row.fillingPtName) || (row === null || row === void 0 ? void 0 : row.filling_pt_name) || (row !== null && row !== void 0 && row.fillingPoint && typeof row.fillingPoint === "object" ? (_row$fillingPoint = row.fillingPoint) === null || _row$fillingPoint === void 0 ? void 0 : _row$fillingPoint.id : row === null || row === void 0 ? void 0 : row.fillingPoint) || (row === null || row === void 0 ? void 0 : (_row$fillingPointDeta = row.fillingPointDetail) === null || _row$fillingPointDeta === void 0 ? void 0 : _row$fillingPointDeta.id) || (row === null || row === void 0 ? void 0 : (_row$fillingPointDeta2 = row.fillingPointDetail) === null || _row$fillingPointDeta2 === void 0 ? void 0 : _row$fillingPointDeta2.bookingId) || "NA";
7608
+ var _row$fillingpointmeta2, _row$fillingPoint, _row$fillingPointDeta, _row$fillingPointDeta2, _row$fillingPoint2, _row$fillingpointmeta3;
7609
+ const rowFpId = String((row === null || row === void 0 ? void 0 : row.fillingPointId) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta2 = row.fillingpointmetadata) === null || _row$fillingpointmeta2 === void 0 ? void 0 : _row$fillingpointmeta2.fillingPointId) || (row === null || row === void 0 ? void 0 : row.fillingPtName) || (row === null || row === void 0 ? void 0 : row.filling_pt_name) || (row !== null && row !== void 0 && row.fillingPoint && typeof row.fillingPoint === "object" ? (_row$fillingPoint = row.fillingPoint) === null || _row$fillingPoint === void 0 ? void 0 : _row$fillingPoint.id : row === null || row === void 0 ? void 0 : row.fillingPoint) || (row === null || row === void 0 ? void 0 : (_row$fillingPointDeta = row.fillingPointDetail) === null || _row$fillingPointDeta === void 0 ? void 0 : _row$fillingPointDeta.id) || (row === null || row === void 0 ? void 0 : (_row$fillingPointDeta2 = row.fillingPointDetail) === null || _row$fillingPointDeta2 === void 0 ? void 0 : _row$fillingPointDeta2.bookingId) || "");
7610
+ const found = allFillingPoints === null || allFillingPoints === void 0 ? void 0 : allFillingPoints.find(fp => {
7611
+ var _fp$fillingpointmetad2;
7612
+ const fpId = String(fp.id || fp.bookingId || fp.fillingPointId || fp.uuid || ((_fp$fillingpointmetad2 = fp.fillingpointmetadata) === null || _fp$fillingpointmetad2 === void 0 ? void 0 : _fp$fillingpointmetad2.fillingPointId));
7613
+ return fpId === rowFpId && rowFpId !== "undefined" && rowFpId !== "null" && rowFpId !== "";
7614
+ });
7615
+ const name = (found === null || found === void 0 ? void 0 : found.fillingPointName) || (row === null || row === void 0 ? void 0 : row.fillingPointName) || (row === null || row === void 0 ? void 0 : (_row$fillingPoint2 = row.fillingPoint) === null || _row$fillingPoint2 === void 0 ? void 0 : _row$fillingPoint2.fillingPointName) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta3 = row.fillingpointmetadata) === null || _row$fillingpointmeta3 === void 0 ? void 0 : _row$fillingpointmeta3.fillingPointName) || (row === null || row === void 0 ? void 0 : row.fillingPtName) || (row === null || row === void 0 ? void 0 : row.filling_pt_name);
7616
+ return name && name !== "undefined" && name !== "null" ? name : rowFpId && rowFpId !== "undefined" && rowFpId !== "null" ? rowFpId : "NA";
7558
7617
  }
7559
7618
  }];
7560
7619
  }
@@ -7636,6 +7695,15 @@ const SearchFillingPointAddress = () => {
7636
7695
  selected: fixedPointStatus,
7637
7696
  select: setFixedPointStatus,
7638
7697
  t: t
7698
+ })), selectedTab === "FIXED_POINT" && /*#__PURE__*/React.createElement("div", {
7699
+ className: "finance-mainlayout-col1"
7700
+ }, /*#__PURE__*/React.createElement(Label, null, t("WT_FILLING_POINT")), /*#__PURE__*/React.createElement(Dropdown, {
7701
+ option: allFillingPoints,
7702
+ optionKey: "fillingPointName",
7703
+ selected: selectedFillingPoint,
7704
+ select: setSelectedFillingPoint,
7705
+ t: t,
7706
+ placeholder: t("ES_COMMON_STATUS")
7639
7707
  })), selectedTab === "FILLING_POINT" && /*#__PURE__*/React.createElement("div", {
7640
7708
  className: "finance-mainlayout-col1"
7641
7709
  }, /*#__PURE__*/React.createElement(Label, null, t("WT_FILLING_POINT_DESIGNATION")), /*#__PURE__*/React.createElement(Dropdown, {
@@ -7643,7 +7711,8 @@ const SearchFillingPointAddress = () => {
7643
7711
  optionKey: "i18nKey",
7644
7712
  selected: status,
7645
7713
  select: setStatus,
7646
- t: t
7714
+ t: t,
7715
+ placeholder: t("ES_COMMON_STATUS")
7647
7716
  })), /*#__PURE__*/React.createElement("div", {
7648
7717
  className: "finance-mainlayout-col1"
7649
7718
  }, /*#__PURE__*/React.createElement(Label, null, "\xA0"), /*#__PURE__*/React.createElement("span", {
@@ -16193,7 +16262,7 @@ const WTEditApplicationModal = ({
16193
16262
  const [formData, setFormData] = useState({});
16194
16263
  useEffect(() => {
16195
16264
  if (applicationData) {
16196
- var _applicationData$appl, _applicationData$appl2, _applicationData$appl3, _applicationData$appl4, _applicationData$addr, _applicationData$addr2, _applicationData$addr3, _applicationData$addr4, _applicationData$addr5, _applicationData$addr6;
16265
+ var _applicationData$appl, _applicationData$appl2, _applicationData$appl3, _applicationData$appl4, _applicationData$addr, _applicationData$addr2, _applicationData$addr3, _applicationData$addr4, _applicationData$addr5, _applicationData$addr6, _applicationData$vend, _applicationData$vend2, _applicationData$vend3, _applicationData$vend4, _applicationData$driv, _applicationData$driv2, _applicationData$driv3, _applicationData$driv4, _applicationData$vehi;
16197
16266
  setFormData({
16198
16267
  name: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$appl = applicationData.applicantDetail) === null || _applicationData$appl === void 0 ? void 0 : _applicationData$appl.name) || "",
16199
16268
  mobileNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$appl2 = applicationData.applicantDetail) === null || _applicationData$appl2 === void 0 ? void 0 : _applicationData$appl2.mobileNumber) || "",
@@ -16211,7 +16280,16 @@ const WTEditApplicationModal = ({
16211
16280
  waterQuantity: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.waterQuantity) || "",
16212
16281
  description: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.description) || "",
16213
16282
  deliveryDate: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.deliveryDate) || "",
16214
- deliveryTime: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.deliveryTime) || ""
16283
+ deliveryTime: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.deliveryTime) || "",
16284
+ vendorName: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vend = applicationData.vendorDetail) === null || _applicationData$vend === void 0 ? void 0 : _applicationData$vend.name) || "",
16285
+ vendorMobileNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vend2 = applicationData.vendorDetail) === null || _applicationData$vend2 === void 0 ? void 0 : _applicationData$vend2.mobileNumber) || "",
16286
+ vendorAlternateNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vend3 = applicationData.vendorDetail) === null || _applicationData$vend3 === void 0 ? void 0 : _applicationData$vend3.alternateNumber) || "",
16287
+ vendorEmailId: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vend4 = applicationData.vendorDetail) === null || _applicationData$vend4 === void 0 ? void 0 : _applicationData$vend4.emailId) || "",
16288
+ driverName: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$driv = applicationData.driverDetail) === null || _applicationData$driv === void 0 ? void 0 : _applicationData$driv.name) || "",
16289
+ driverMobileNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$driv2 = applicationData.driverDetail) === null || _applicationData$driv2 === void 0 ? void 0 : _applicationData$driv2.mobileNumber) || "",
16290
+ driverAlternateNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$driv3 = applicationData.driverDetail) === null || _applicationData$driv3 === void 0 ? void 0 : _applicationData$driv3.alternateNumber) || "",
16291
+ driverEmailId: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$driv4 = applicationData.driverDetail) === null || _applicationData$driv4 === void 0 ? void 0 : _applicationData$driv4.emailId) || "",
16292
+ fillingPoints: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vehi = applicationData.vehicleDetail) === null || _applicationData$vehi === void 0 ? void 0 : _applicationData$vehi.fillingPoints) || ""
16215
16293
  });
16216
16294
  }
16217
16295
  }, [applicationData]);
@@ -16288,6 +16366,42 @@ const WTEditApplicationModal = ({
16288
16366
  key: "description",
16289
16367
  fullWidth: true
16290
16368
  }]
16369
+ }, {
16370
+ title: "WT_VENDOR_DETAILS",
16371
+ fields: [{
16372
+ label: "WT_VENDOR_NAME",
16373
+ key: "vendorName"
16374
+ }, {
16375
+ label: "WT_MOBILE_NUMBER",
16376
+ key: "vendorMobileNumber"
16377
+ }, {
16378
+ label: "WT_ALT_MOBILE_NUMBER",
16379
+ key: "vendorAlternateNumber"
16380
+ }, {
16381
+ label: "WT_EMAIL_ID",
16382
+ key: "vendorEmailId"
16383
+ }]
16384
+ }, {
16385
+ title: "WT_DRIVER_DETAILS",
16386
+ fields: [{
16387
+ label: "WT_DRIVER_NAME",
16388
+ key: "driverName"
16389
+ }, {
16390
+ label: "WT_MOBILE_NUMBER",
16391
+ key: "driverMobileNumber"
16392
+ }, {
16393
+ label: "WT_ALT_MOBILE_NUMBER",
16394
+ key: "driverAlternateNumber"
16395
+ }, {
16396
+ label: "WT_EMAIL_ID",
16397
+ key: "driverEmailId"
16398
+ }]
16399
+ }, {
16400
+ title: "WT_VEHICLE_DETAILS",
16401
+ fields: [{
16402
+ label: "WT_FILLING_POINTS",
16403
+ key: "fillingPoints"
16404
+ }]
16291
16405
  }];
16292
16406
  return /*#__PURE__*/React.createElement(Modal, {
16293
16407
  headerBarMain: /*#__PURE__*/React.createElement("h1", {
@@ -24147,7 +24261,38 @@ const ApplicationDetails$1 = () => {
24147
24261
  };
24148
24262
  useEffect(() => {
24149
24263
  if (applicationDetails) {
24150
- setAppDetailsToShow(lodash.cloneDeep(applicationDetails));
24264
+ var _details$applicationD;
24265
+ let details = lodash.cloneDeep(applicationDetails);
24266
+ if ((details === null || details === void 0 ? void 0 : (_details$applicationD = details.applicationDetails) === null || _details$applicationD === void 0 ? void 0 : _details$applicationD.length) > 0) {
24267
+ details.applicationDetails[0].Component = () => /*#__PURE__*/React.createElement("div", {
24268
+ onClick: () => setShowEditModal(true),
24269
+ style: {
24270
+ float: "right",
24271
+ display: "flex",
24272
+ alignItems: "center",
24273
+ cursor: "pointer",
24274
+ color: "#f47738",
24275
+ gap: "8px",
24276
+ padding: "4px 12px",
24277
+ backgroundColor: "#fff",
24278
+ borderRadius: "4px",
24279
+ border: "1px solid #f47738",
24280
+ transition: "all 0.2s ease"
24281
+ }
24282
+ }, /*#__PURE__*/React.createElement(EditIcon, {
24283
+ style: {
24284
+ fill: "#f47738",
24285
+ width: "16px",
24286
+ height: "16px"
24287
+ }
24288
+ }), /*#__PURE__*/React.createElement("span", {
24289
+ style: {
24290
+ fontWeight: "600",
24291
+ fontSize: "14px"
24292
+ }
24293
+ }, t("WT_EDIT_FIELDS")));
24294
+ }
24295
+ setAppDetailsToShow(details);
24151
24296
  }
24152
24297
  }, [applicationDetails]);
24153
24298
  useEffect(() => {
@@ -24178,32 +24323,7 @@ const ApplicationDetails$1 = () => {
24178
24323
  margin: "0px",
24179
24324
  fontSize: "32px"
24180
24325
  }
24181
- }, t("BOOKING_DETAILS")), /*#__PURE__*/React.createElement("div", {
24182
- onClick: () => setShowEditModal(true),
24183
- style: {
24184
- display: "flex",
24185
- alignItems: "center",
24186
- cursor: "pointer",
24187
- color: "#f47738",
24188
- gap: "8px",
24189
- padding: "8px 16px",
24190
- backgroundColor: "#fff",
24191
- borderRadius: "4px",
24192
- border: "1px solid #f47738",
24193
- transition: "all 0.2s ease"
24194
- }
24195
- }, /*#__PURE__*/React.createElement(EditIcon, {
24196
- style: {
24197
- fill: "#f47738",
24198
- width: "20px",
24199
- height: "20px"
24200
- }
24201
- }), /*#__PURE__*/React.createElement("span", {
24202
- style: {
24203
- fontWeight: "600",
24204
- fontSize: "16px"
24205
- }
24206
- }, t("WT_EDIT_FIELDS")))), showEditModal && /*#__PURE__*/React.createElement(WTEditApplicationModal, {
24326
+ }, t("BOOKING_DETAILS"))), showEditModal && /*#__PURE__*/React.createElement(WTEditApplicationModal, {
24207
24327
  t: t,
24208
24328
  applicationData: appDetailsToShow === null || appDetailsToShow === void 0 ? void 0 : (_appDetailsToShow$app = appDetailsToShow.applicationData) === null || _appDetailsToShow$app === void 0 ? void 0 : _appDetailsToShow$app.applicationData,
24209
24329
  closeModal: () => setShowEditModal(false)
@@ -25772,9 +25892,12 @@ const EmergencyFixedPointRequestDetails = ({
25772
25892
  });
25773
25893
  const [waterQuantity, setwaterQuantity] = useState((formData === null || formData === void 0 ? void 0 : (_formData$requestDeta3 = formData.requestDetails) === null || _formData$requestDeta3 === void 0 ? void 0 : _formData$requestDeta3.waterQuantity) || "");
25774
25894
  const [waterType, setWaterType] = useState((formData === null || formData === void 0 ? void 0 : (_formData$requestDeta4 = formData.requestDetails) === null || _formData$requestDeta4 === void 0 ? void 0 : _formData$requestDeta4.waterType) || "");
25775
- const [deliveryDate, setdeliveryDate] = useState((formData === null || formData === void 0 ? void 0 : (_formData$requestDeta5 = formData.requestDetails) === null || _formData$requestDeta5 === void 0 ? void 0 : _formData$requestDeta5.deliveryDate) || "");
25895
+ const [deliveryDate, setdeliveryDate] = useState((formData === null || formData === void 0 ? void 0 : (_formData$requestDeta5 = formData.requestDetails) === null || _formData$requestDeta5 === void 0 ? void 0 : _formData$requestDeta5.deliveryDate) || new Date().toISOString().split("T")[0]);
25776
25896
  const [description, setdescription] = useState((formData === null || formData === void 0 ? void 0 : (_formData$requestDeta6 = formData.requestDetails) === null || _formData$requestDeta6 === void 0 ? void 0 : _formData$requestDeta6.description) || "");
25777
- const [deliveryTime, setdeliveryTime] = useState((formData === null || formData === void 0 ? void 0 : (_formData$requestDeta7 = formData.requestDetails) === null || _formData$requestDeta7 === void 0 ? void 0 : _formData$requestDeta7.deliveryTime) || "");
25897
+ const [deliveryTime, setdeliveryTime] = useState((formData === null || formData === void 0 ? void 0 : (_formData$requestDeta7 = formData.requestDetails) === null || _formData$requestDeta7 === void 0 ? void 0 : _formData$requestDeta7.deliveryTime) || new Date().toLocaleTimeString("en-GB", {
25898
+ hour: "2-digit",
25899
+ minute: "2-digit"
25900
+ }));
25778
25901
  const [extraCharge, setextraCharge] = useState((formData === null || formData === void 0 ? void 0 : (_formData$requestDeta8 = formData.requestDetails) === null || _formData$requestDeta8 === void 0 ? void 0 : _formData$requestDeta8.extraCharge) || false);
25779
25902
  const [uploadedFile, setUploadedFile] = useState((formData === null || formData === void 0 ? void 0 : (_formData$requestDeta9 = formData.requestDetails) === null || _formData$requestDeta9 === void 0 ? void 0 : _formData$requestDeta9.fileStoreId) || null);
25780
25903
  const [file, setFile] = useState(null);
@@ -25861,15 +25984,12 @@ const EmergencyFixedPointRequestDetails = ({
25861
25984
  value: `${data.value}`
25862
25985
  });
25863
25986
  });
25864
- const VehicleDetails = Vehicle.map(data => {
25865
- if (tankerType.code === data.vehicleType) {
25866
- return {
25867
- i18nKey: data.capacityName,
25868
- code: data.code,
25869
- value: data.capacityName
25870
- };
25871
- }
25872
- }).filter(item => item !== undefined);
25987
+ const VehicleDetails = Vehicle.filter(data => (tankerType === null || tankerType === void 0 ? void 0 : tankerType.code) === data.vehicleType).map(data => ({
25988
+ i18nKey: `${data.capacityName}`,
25989
+ code: `${data.code}`,
25990
+ value: `${data.value}`,
25991
+ capacity: `${data.capacity}`
25992
+ }));
25873
25993
  const TimeInput = () => {
25874
25994
  return /*#__PURE__*/React.createElement("div", {
25875
25995
  className: "flex items-center"
@@ -26104,7 +26224,7 @@ const WTEmergencyFixedPointCheckPage = ({
26104
26224
  onSubmit,
26105
26225
  value: _value = {}
26106
26226
  }) => {
26107
- var _serviceType$serviceT, _serviceType$serviceT2, _address$city, _address$city$city, _address$locality, _requestDetails$tanke, _requestDetails$water, _requestDetails$tanke2, _requestDetails$water2, _serviceType$serviceT3, _toiletRequestDetails, _serviceType$serviceT4, _treePruningRequestDe;
26227
+ var _serviceType$serviceT, _serviceType$serviceT2, _owner$isExistingFixe, _address$city, _address$city$city, _address$locality, _dispatchDetails$fill, _dispatchDetails$vend, _dispatchDetails$vehi, _dispatchDetails$driv, _requestDetails$tanke, _requestDetails$water, _requestDetails$tanke2, _requestDetails$water2, _serviceType$serviceT3, _toiletRequestDetails, _serviceType$serviceT4, _treePruningRequestDe;
26108
26228
  const {
26109
26229
  t
26110
26230
  } = useTranslation();
@@ -26114,6 +26234,7 @@ const WTEmergencyFixedPointCheckPage = ({
26114
26234
  const {
26115
26235
  owner,
26116
26236
  requestDetails,
26237
+ dispatchDetails,
26117
26238
  address,
26118
26239
  serviceType,
26119
26240
  toiletRequestDetails,
@@ -26144,7 +26265,7 @@ const WTEmergencyFixedPointCheckPage = ({
26144
26265
  marginBottom: "30px"
26145
26266
  }
26146
26267
  }, /*#__PURE__*/React.createElement(Row, {
26147
- label: t("COMMON_APPLICANT_NAME"),
26268
+ label: (owner === null || owner === void 0 ? void 0 : (_owner$isExistingFixe = owner.isExistingFixedPoint) === null || _owner$isExistingFixe === void 0 ? void 0 : _owner$isExistingFixe.code) === "YES" || (owner === null || owner === void 0 ? void 0 : owner.type) === "FIXED-POINT" ? t("WT_FIXED_POINT_DELIVERY_POINT", "Fixed Point/Delivery Point") : t("COMMON_APPLICANT_NAME"),
26148
26269
  text: `${t(checkForNA(owner === null || owner === void 0 ? void 0 : owner.applicantName))}`,
26149
26270
  actionButton: /*#__PURE__*/React.createElement(ActionButton$1, {
26150
26271
  jumpTo: `${baseUrl}/fp-applicant-details`
@@ -26190,6 +26311,26 @@ const WTEmergencyFixedPointCheckPage = ({
26190
26311
  }), /*#__PURE__*/React.createElement(Row, {
26191
26312
  label: t("STREET_NAME"),
26192
26313
  text: `${t(checkForNA(address === null || address === void 0 ? void 0 : address.streetName))}`
26314
+ })), /*#__PURE__*/React.createElement(CardSubHeader, null, t("WT_DISPATCH_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
26315
+ style: {
26316
+ marginTop: "30px",
26317
+ marginBottom: "30px"
26318
+ }
26319
+ }, /*#__PURE__*/React.createElement(Row, {
26320
+ label: t("WT_FILLING_POINT"),
26321
+ text: `${t(checkForNA(dispatchDetails === null || dispatchDetails === void 0 ? void 0 : (_dispatchDetails$fill = dispatchDetails.fillingPoint) === null || _dispatchDetails$fill === void 0 ? void 0 : _dispatchDetails$fill.name))}`,
26322
+ actionButton: /*#__PURE__*/React.createElement(ActionButton$1, {
26323
+ jumpTo: `${baseUrl}/fp-dispatch-details`
26324
+ })
26325
+ }), /*#__PURE__*/React.createElement(Row, {
26326
+ label: t("WT_VENDOR"),
26327
+ text: `${t(checkForNA(dispatchDetails === null || dispatchDetails === void 0 ? void 0 : (_dispatchDetails$vend = dispatchDetails.vendor) === null || _dispatchDetails$vend === void 0 ? void 0 : _dispatchDetails$vend.name))}`
26328
+ }), /*#__PURE__*/React.createElement(Row, {
26329
+ label: t("WT_VEHICLE"),
26330
+ text: `${t(checkForNA(dispatchDetails === null || dispatchDetails === void 0 ? void 0 : (_dispatchDetails$vehi = dispatchDetails.vehicle) === null || _dispatchDetails$vehi === void 0 ? void 0 : _dispatchDetails$vehi.name))}`
26331
+ }), /*#__PURE__*/React.createElement(Row, {
26332
+ label: t("WT_DRIVER"),
26333
+ text: `${t(checkForNA(dispatchDetails === null || dispatchDetails === void 0 ? void 0 : (_dispatchDetails$driv = dispatchDetails.driver) === null || _dispatchDetails$driv === void 0 ? void 0 : _dispatchDetails$driv.name))}`
26193
26334
  })), isWaterTankerService && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("WT_REQUEST_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
26194
26335
  style: {
26195
26336
  marginTop: "30px",
@@ -26579,7 +26720,7 @@ const fixedPointConfig = [{
26579
26720
  head: "ES_TITILE_OWNER_DETAILS",
26580
26721
  body: [{
26581
26722
  route: "fp-applicant-details",
26582
- component: "ApplicantDetails",
26723
+ component: "EmergencyFixedPointApplicantDetails",
26583
26724
  withoutLabel: true,
26584
26725
  key: "owner",
26585
26726
  type: "component",
@@ -26603,7 +26744,7 @@ const fixedPointConfig = [{
26603
26744
  key: "address",
26604
26745
  type: "component",
26605
26746
  isMandatory: true,
26606
- nextStep: "fp-request-details",
26747
+ nextStep: "fp-dispatch-details",
26607
26748
  texts: {
26608
26749
  submitBarLabel: "COMMON_SAVE_NEXT",
26609
26750
  header: "ES_ADDRESS_DETAILS"
@@ -26613,11 +26754,30 @@ const fixedPointConfig = [{
26613
26754
  actions: "ES_ADDRESS_DETAILS"
26614
26755
  }]
26615
26756
  }]
26757
+ }, {
26758
+ head: "WT_DISPATCH_DETAILS",
26759
+ body: [{
26760
+ route: "fp-dispatch-details",
26761
+ component: "EmergencyFixedPointDispatchDetails",
26762
+ withoutLabel: true,
26763
+ key: "dispatchDetails",
26764
+ type: "component",
26765
+ isMandatory: true,
26766
+ nextStep: "fp-request-details",
26767
+ texts: {
26768
+ submitBarLabel: "COMMON_SAVE_NEXT",
26769
+ header: "WT_DISPATCH_DETAILS"
26770
+ },
26771
+ timeLine: [{
26772
+ currentStep: 3,
26773
+ actions: "WT_DISPATCH_DETAILS"
26774
+ }]
26775
+ }]
26616
26776
  }, {
26617
26777
  head: "FP_REQUEST_DETAILS",
26618
26778
  body: [{
26619
26779
  route: "fp-request-details",
26620
- component: "RequestDetails",
26780
+ component: "EmergencyFixedPointRequestDetails",
26621
26781
  withoutLabel: true,
26622
26782
  key: "requestDetails",
26623
26783
  type: "component",
@@ -26628,7 +26788,7 @@ const fixedPointConfig = [{
26628
26788
  header: "WT_REQUEST_DETAILS"
26629
26789
  },
26630
26790
  timeLine: [{
26631
- currentStep: 3,
26791
+ currentStep: 4,
26632
26792
  actions: "ES_REQUEST_DETAILS"
26633
26793
  }]
26634
26794
  }]
@@ -26704,6 +26864,24 @@ const WTEmergencyFixedPointCreate = () => {
26704
26864
  history.push(`${match.path}/fp-wt-acknowledgement`);
26705
26865
  };
26706
26866
  function handleSelect(key, data, skipStep, index, isAddMultiple = false) {
26867
+ if (key === "multiple") {
26868
+ let newParams = {
26869
+ ...params
26870
+ };
26871
+ Object.keys(data).forEach(k => {
26872
+ if (k !== "navigationKey" && k !== "silent") {
26873
+ newParams[k] = {
26874
+ ...newParams[k],
26875
+ ...data[k]
26876
+ };
26877
+ }
26878
+ });
26879
+ setParams(newParams);
26880
+ if (data.silent) return;
26881
+ const navigationKey = data.navigationKey || Object.keys(data)[0];
26882
+ goNext(skipStep, index, isAddMultiple, navigationKey);
26883
+ return;
26884
+ }
26707
26885
  if (key === "owners") {
26708
26886
  let owners = params.owners || [];
26709
26887
  owners[index] = data;
@@ -26731,7 +26909,7 @@ const WTEmergencyFixedPointCreate = () => {
26731
26909
  clearParams();
26732
26910
  queryClient.invalidateQueries("FP_Create");
26733
26911
  };
26734
- const formStepRoutes = ["fp-applicant-details", "fp-address-details", "fp-request-details"];
26912
+ const formStepRoutes = ["fp-applicant-details", "fp-address-details", "fp-dispatch-details", "fp-request-details"];
26735
26913
  const isFormStep = formStepRoutes.some(route => pathname.includes(route));
26736
26914
  const sectionRefs = useRef({});
26737
26915
  useEffect(() => {
@@ -26826,6 +27004,465 @@ const WTEmergencyFixedPointCreate = () => {
26826
27004
  }))))));
26827
27005
  };
26828
27006
 
27007
+ const EmergencyFixedPointApplicantDetails = ({
27008
+ t,
27009
+ config,
27010
+ onSelect,
27011
+ formData
27012
+ }) => {
27013
+ var _formData$owner, _formData$infodetails, _formData$infodetails2, _formData$infodetails3, _formData$owner2, _formData$infodetails4, _formData$infodetails5, _formData$infodetails6, _formData$owner3, _formData$owner4, _formData$owner5, _formData$owner5$requ, _formData$owner6, _formData$infodetails7, _formData$infodetails8, _formData$infodetails9, _formData$owner7, _formData$infodetails0, _formData$infodetails1, _formData$infodetails10, _formData$owner8, _formData$owner9, _formData$owner0, _formData$owner1, _fixedPointsData$wate, _config$additionaFiel, _config$additionaFiel2, _config$additionaFiel3, _config$additionaFiel4, _config$additionaFiel5, _config$additionaFiel6, _config$additionaFiel7;
27014
+ const user = Digit.UserService.getUser().info;
27015
+ const inputStyles = {
27016
+ width: user.type === "EMPLOYEE" ? "100%" : "86%"
27017
+ };
27018
+ let validation = {};
27019
+ const [applicantName, setName] = useState((user.type === "EMPLOYEE" ? "" : user === null || user === void 0 ? void 0 : user.name) || (formData === null || formData === void 0 ? void 0 : (_formData$owner = formData.owner) === null || _formData$owner === void 0 ? void 0 : _formData$owner.applicantName) || (formData === null || formData === void 0 ? void 0 : (_formData$infodetails = formData.infodetails) === null || _formData$infodetails === void 0 ? void 0 : (_formData$infodetails2 = _formData$infodetails.existingDataSet) === null || _formData$infodetails2 === void 0 ? void 0 : (_formData$infodetails3 = _formData$infodetails2.owner) === null || _formData$infodetails3 === void 0 ? void 0 : _formData$infodetails3.applicantName) || "");
27020
+ const [mobileNumber, setMobileNumber] = useState((user.type === "EMPLOYEE" ? "" : user === null || user === void 0 ? void 0 : user.mobileNumber) || (formData === null || formData === void 0 ? void 0 : (_formData$owner2 = formData.owner) === null || _formData$owner2 === void 0 ? void 0 : _formData$owner2.mobileNumber) || (formData === null || formData === void 0 ? void 0 : (_formData$infodetails4 = formData.infodetails) === null || _formData$infodetails4 === void 0 ? void 0 : (_formData$infodetails5 = _formData$infodetails4.existingDataSet) === null || _formData$infodetails5 === void 0 ? void 0 : (_formData$infodetails6 = _formData$infodetails5.owner) === null || _formData$infodetails6 === void 0 ? void 0 : _formData$infodetails6.mobileNumber) || "");
27021
+ const [gender, setGender] = useState((formData === null || formData === void 0 ? void 0 : (_formData$owner3 = formData.owner) === null || _formData$owner3 === void 0 ? void 0 : _formData$owner3.gender) || "");
27022
+ const [dateOfBirth, setDateofBirth] = useState((formData === null || formData === void 0 ? void 0 : (_formData$owner4 = formData.owner) === null || _formData$owner4 === void 0 ? void 0 : _formData$owner4.dateOfBirth) || (formData === null || formData === void 0 ? void 0 : (_formData$owner5 = formData.owner) === null || _formData$owner5 === void 0 ? void 0 : (_formData$owner5$requ = _formData$owner5.requestDetails) === null || _formData$owner5$requ === void 0 ? void 0 : _formData$owner5$requ.applicantName) || "");
27023
+ const [emailId, setEmail] = useState((user.type === "EMPLOYEE" ? "" : user === null || user === void 0 ? void 0 : user.emailId) || (formData === null || formData === void 0 ? void 0 : (_formData$owner6 = formData.owner) === null || _formData$owner6 === void 0 ? void 0 : _formData$owner6.emailId) || (formData === null || formData === void 0 ? void 0 : (_formData$infodetails7 = formData.infodetails) === null || _formData$infodetails7 === void 0 ? void 0 : (_formData$infodetails8 = _formData$infodetails7.existingDataSet) === null || _formData$infodetails8 === void 0 ? void 0 : (_formData$infodetails9 = _formData$infodetails8.owner) === null || _formData$infodetails9 === void 0 ? void 0 : _formData$infodetails9.emailId) || "");
27024
+ const [alternateNumber, setAltMobileNumber] = useState((formData === null || formData === void 0 ? void 0 : (_formData$owner7 = formData.owner) === null || _formData$owner7 === void 0 ? void 0 : _formData$owner7.alternateNumber) || (formData === null || formData === void 0 ? void 0 : (_formData$infodetails0 = formData.infodetails) === null || _formData$infodetails0 === void 0 ? void 0 : (_formData$infodetails1 = _formData$infodetails0.existingDataSet) === null || _formData$infodetails1 === void 0 ? void 0 : (_formData$infodetails10 = _formData$infodetails1.owner) === null || _formData$infodetails10 === void 0 ? void 0 : _formData$infodetails10.alternateNumber) || "");
27025
+ const [guardianName, setGuardian] = useState((formData === null || formData === void 0 ? void 0 : (_formData$owner8 = formData.owner) === null || _formData$owner8 === void 0 ? void 0 : _formData$owner8.guardianName) || "");
27026
+ const [relationShipType, setRelationShipType] = useState((formData === null || formData === void 0 ? void 0 : (_formData$owner9 = formData.owner) === null || _formData$owner9 === void 0 ? void 0 : _formData$owner9.relationShipType) || "");
27027
+ const [fixedPoint, setFixedPoint] = useState((formData === null || formData === void 0 ? void 0 : (_formData$owner0 = formData.owner) === null || _formData$owner0 === void 0 ? void 0 : _formData$owner0.fixedPoint) || "");
27028
+ const [autoPopulatedAddress, setAutoPopulatedAddress] = useState(null);
27029
+ const handleFixedPointSelect = selected => {
27030
+ setFixedPoint(selected);
27031
+ if (selected && typeof selected === "object") {
27032
+ const applicant = selected.applicantDetail;
27033
+ if (applicant) {
27034
+ setName(applicant.name || applicantName);
27035
+ setMobileNumber(applicant.mobileNumber || mobileNumber);
27036
+ setAltMobileNumber(applicant.alternateNumber || alternateNumber);
27037
+ setEmail(applicant.emailId || emailId);
27038
+ }
27039
+ const addr = selected.address;
27040
+ if (addr) {
27041
+ const addressData = {
27042
+ houseNo: addr.houseNo || "",
27043
+ streetName: addr.streetName || "",
27044
+ addressLine1: addr.addressLine1 || "",
27045
+ addressLine2: addr.addressLine2 || "",
27046
+ landmark: addr.landmark || "",
27047
+ city: addr.city || "",
27048
+ cityCode: addr.cityCode || "",
27049
+ locality: addr.locality || "",
27050
+ localityCode: addr.localityCode || "",
27051
+ pincode: addr.pincode ? addr.pincode.toString().split(".")[0] : ""
27052
+ };
27053
+ setAutoPopulatedAddress(addressData);
27054
+ onSelect("multiple", {
27055
+ address: addressData,
27056
+ silent: true
27057
+ });
27058
+ }
27059
+ } else {
27060
+ setAutoPopulatedAddress(null);
27061
+ }
27062
+ };
27063
+ const [isExistingFixedPoint, setIsExistingFixedPoint] = useState((formData === null || formData === void 0 ? void 0 : (_formData$owner1 = formData.owner) === null || _formData$owner1 === void 0 ? void 0 : _formData$owner1.isExistingFixedPoint) || {
27064
+ code: "YES",
27065
+ name: "Yes",
27066
+ i18nKey: "YES"
27067
+ });
27068
+ const existingFixedPointOptions = [{
27069
+ code: "YES",
27070
+ name: "Yes",
27071
+ i18nKey: "YES"
27072
+ }, {
27073
+ code: "NO",
27074
+ name: "No",
27075
+ i18nKey: "NO"
27076
+ }];
27077
+ const handleExistingFixedPointSelect = selected => {
27078
+ setIsExistingFixedPoint(selected);
27079
+ setFixedPoint("");
27080
+ };
27081
+ function setOwnerEmail(e) {
27082
+ setEmail(e.target.value);
27083
+ }
27084
+ function setMobileNo(e) {
27085
+ setMobileNumber(e.target.value);
27086
+ }
27087
+ function setAltMobileNo(e) {
27088
+ setAltMobileNumber(e.target.value);
27089
+ }
27090
+ function setGuardiansName(e) {
27091
+ setGuardian(e.target.value);
27092
+ }
27093
+ function setBirthDate(e) {
27094
+ setDateofBirth(e.target.value);
27095
+ }
27096
+ const tenantId = Digit.ULBService.getCurrentTenantId();
27097
+ const {
27098
+ data: fixedPointsData
27099
+ } = Digit.Hooks.wt.useFixedPointSearchAPI({
27100
+ tenantId,
27101
+ filters: {
27102
+ limit: 1000
27103
+ }
27104
+ }, {
27105
+ enabled: true
27106
+ });
27107
+ const fixedPointOptions = (fixedPointsData === null || fixedPointsData === void 0 ? void 0 : (_fixedPointsData$wate = fixedPointsData.waterTankerBookingDetail) === null || _fixedPointsData$wate === void 0 ? void 0 : _fixedPointsData$wate.map(fp => {
27108
+ var _fp$applicantDetail, _fp$applicantDetail2;
27109
+ return {
27110
+ ...fp,
27111
+ name: (fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail = fp.applicantDetail) === null || _fp$applicantDetail === void 0 ? void 0 : _fp$applicantDetail.name) || (fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail2 = fp.applicantDetail) === null || _fp$applicantDetail2 === void 0 ? void 0 : _fp$applicantDetail2.fixedPointId) || "NA"
27112
+ };
27113
+ })) || [];
27114
+ const {
27115
+ data: applicantGender
27116
+ } = Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(), "common-masters", [{
27117
+ name: "GenderType"
27118
+ }], {
27119
+ select: data => {
27120
+ var _data$commonMasters;
27121
+ const formattedData = data === null || data === void 0 ? void 0 : (_data$commonMasters = data["common-masters"]) === null || _data$commonMasters === void 0 ? void 0 : _data$commonMasters["GenderType"];
27122
+ return formattedData;
27123
+ }
27124
+ });
27125
+ let genderOptions = [];
27126
+ applicantGender && applicantGender.map(genderoption => {
27127
+ if (genderoption.code !== "TRANSGENDER") genderOptions.push({
27128
+ i18nKey: `${genderoption.code}`,
27129
+ code: `${genderoption.code}`,
27130
+ name: `${genderoption.code}`
27131
+ });
27132
+ });
27133
+ const GuardianOptions = [{
27134
+ name: "Husband",
27135
+ code: "HUSBAND",
27136
+ i18nKey: "COMMON_HUSBAND"
27137
+ }, {
27138
+ name: "Father",
27139
+ code: "FATHER",
27140
+ i18nKey: "COMMON_FATHER"
27141
+ }];
27142
+ const goNext = () => {
27143
+ let owner = formData.owner;
27144
+ let finalApplicantName = "";
27145
+ if ((isExistingFixedPoint === null || isExistingFixedPoint === void 0 ? void 0 : isExistingFixedPoint.code) === "YES") {
27146
+ var _fixedPoint$applicant;
27147
+ finalApplicantName = (fixedPoint === null || fixedPoint === void 0 ? void 0 : (_fixedPoint$applicant = fixedPoint.applicantDetail) === null || _fixedPoint$applicant === void 0 ? void 0 : _fixedPoint$applicant.applicantId) || (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.applicantId) || "";
27148
+ } else {
27149
+ finalApplicantName = typeof fixedPoint === "string" ? fixedPoint : (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.name) || "";
27150
+ }
27151
+ let applicantDetails = {
27152
+ ...owner,
27153
+ applicantName: finalApplicantName,
27154
+ mobileNumber,
27155
+ gender,
27156
+ dateOfBirth,
27157
+ alternateNumber,
27158
+ relationShipType,
27159
+ guardianName,
27160
+ emailId,
27161
+ fixedPoint,
27162
+ isExistingFixedPoint
27163
+ };
27164
+ if (autoPopulatedAddress) {
27165
+ onSelect("multiple", {
27166
+ owner: applicantDetails,
27167
+ address: autoPopulatedAddress,
27168
+ navigationKey: config.key
27169
+ });
27170
+ } else {
27171
+ onSelect(config.key, applicantDetails, false);
27172
+ }
27173
+ };
27174
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
27175
+ config: config,
27176
+ onSelect: goNext,
27177
+ t: t,
27178
+ isDisabled: !fixedPoint || !mobileNumber || config !== null && config !== void 0 && (_config$additionaFiel = config.additionaFields) !== null && _config$additionaFiel !== void 0 && _config$additionaFiel.guardianName ? !guardianName : config !== null && config !== void 0 && (_config$additionaFiel2 = config.additionaFields) !== null && _config$additionaFiel2 !== void 0 && _config$additionaFiel2.dateofBirth ? !dateOfBirth : config !== null && config !== void 0 && (_config$additionaFiel3 = config.additionaFields) !== null && _config$additionaFiel3 !== void 0 && _config$additionaFiel3.gender ? !gender : null,
27179
+ className: "search-form-wrapper"
27180
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
27181
+ className: "form-field wns-search-field"
27182
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_EXISTING_FIXED_POINT", "Existing Fixed Point/Delivery Point?")}`, " ", /*#__PURE__*/React.createElement("span", {
27183
+ className: "astericColor"
27184
+ }, "*")), /*#__PURE__*/React.createElement(RadioButtons, {
27185
+ t: t,
27186
+ options: existingFixedPointOptions,
27187
+ optionsKey: "i18nKey",
27188
+ name: "isExistingFixedPoint",
27189
+ value: isExistingFixedPoint,
27190
+ selectedOption: isExistingFixedPoint,
27191
+ onSelect: handleExistingFixedPointSelect,
27192
+ style: {
27193
+ display: "flex",
27194
+ gap: "30px",
27195
+ marginBottom: "0px"
27196
+ },
27197
+ innerStyles: {
27198
+ minWidth: "24%",
27199
+ marginBottom: "0px"
27200
+ }
27201
+ })), /*#__PURE__*/React.createElement("div", {
27202
+ className: "form-field wns-search-field"
27203
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Fixed Point/Delivery Point")}`), (isExistingFixedPoint === null || isExistingFixedPoint === void 0 ? void 0 : isExistingFixedPoint.code) === "YES" ? /*#__PURE__*/React.createElement(Dropdown, {
27204
+ className: "form-field",
27205
+ selected: fixedPoint,
27206
+ option: fixedPointOptions,
27207
+ select: handleFixedPointSelect,
27208
+ optionKey: "name",
27209
+ t: t,
27210
+ name: "fixedPoint",
27211
+ placeholder: t("WT_SELECT_FIXED_POINT", "Select Fixed Point")
27212
+ }) : /*#__PURE__*/React.createElement(TextInput, {
27213
+ t: t,
27214
+ type: "text",
27215
+ isMandatory: false,
27216
+ name: "fixedPointText",
27217
+ value: typeof fixedPoint === "string" ? fixedPoint : (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.name) || "",
27218
+ onChange: e => setFixedPoint(e.target.value),
27219
+ style: inputStyles,
27220
+ placeholder: t("WT_ENTER_FIXED_POINT", "Enter Fixed Point")
27221
+ })), config !== null && config !== void 0 && (_config$additionaFiel4 = config.additionaFields) !== null && _config$additionaFiel4 !== void 0 && _config$additionaFiel4.gender ? /*#__PURE__*/React.createElement("div", {
27222
+ className: "form-field wns-search-field"
27223
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_GENDER")}`, " ", /*#__PURE__*/React.createElement("span", {
27224
+ className: "astericColor"
27225
+ }, "*")), /*#__PURE__*/React.createElement(RadioButtons, {
27226
+ t: t,
27227
+ options: genderOptions,
27228
+ style: {
27229
+ display: "flex",
27230
+ flexWrap: "wrap",
27231
+ maxHeight: "30px"
27232
+ },
27233
+ innerStyles: {
27234
+ minWidth: "24%"
27235
+ },
27236
+ optionsKey: "i18nKey",
27237
+ name: `gender`,
27238
+ value: gender,
27239
+ selectedOption: gender,
27240
+ onSelect: setGender,
27241
+ labelKey: "i18nKey",
27242
+ isPTFlow: true
27243
+ })) : null, /*#__PURE__*/React.createElement("div", {
27244
+ className: "form-field wns-search-field"
27245
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_MOBILE_NUMBER")}`, " ", /*#__PURE__*/React.createElement("span", {
27246
+ className: "astericColor"
27247
+ }, "*")), /*#__PURE__*/React.createElement(MobileNumber, Object.assign({
27248
+ value: mobileNumber,
27249
+ name: "mobileNumber",
27250
+ onChange: value => setMobileNo({
27251
+ target: {
27252
+ value
27253
+ }
27254
+ })
27255
+ }, {
27256
+ required: true,
27257
+ pattern: "[6-9]{1}[0-9]{9}",
27258
+ type: "tel",
27259
+ title: t("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")
27260
+ }))), /*#__PURE__*/React.createElement("div", {
27261
+ className: "form-field wns-search-field"
27262
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_ALT_MOBILE_NUMBER")}`), /*#__PURE__*/React.createElement(MobileNumber, Object.assign({
27263
+ value: alternateNumber,
27264
+ name: "alternateNumber",
27265
+ onChange: value => setAltMobileNo({
27266
+ target: {
27267
+ value
27268
+ }
27269
+ })
27270
+ }, {
27271
+ required: false,
27272
+ pattern: "[6-9]{1}[0-9]{9}",
27273
+ type: "tel",
27274
+ title: t("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")
27275
+ }))), config !== null && config !== void 0 && (_config$additionaFiel5 = config.additionaFields) !== null && _config$additionaFiel5 !== void 0 && _config$additionaFiel5.dateofBirth ? /*#__PURE__*/React.createElement("div", {
27276
+ className: "form-field wns-search-field"
27277
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_BIRTH_DATE")}`, " ", /*#__PURE__*/React.createElement("span", {
27278
+ className: "astericColor"
27279
+ }, "*")), /*#__PURE__*/React.createElement(TextInput, {
27280
+ t: t,
27281
+ type: "date",
27282
+ isMandatory: false,
27283
+ optionKey: "i18nKey",
27284
+ name: "dateOfBirth",
27285
+ value: dateOfBirth,
27286
+ onChange: setBirthDate,
27287
+ style: inputStyles,
27288
+ max: new Date().toISOString().split("T")[0],
27289
+ rules: {
27290
+ required: t("CORE_COMMON_REQUIRED_ERRMSG"),
27291
+ validDate: val => /^\d{4}-\d{2}-\d{2}$/.test(val) ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")
27292
+ }
27293
+ })) : null, config !== null && config !== void 0 && (_config$additionaFiel6 = config.additionaFields) !== null && _config$additionaFiel6 !== void 0 && _config$additionaFiel6.guardianName ? /*#__PURE__*/React.createElement("div", {
27294
+ className: "form-field wns-search-field"
27295
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_GUARDIAN")}`, " ", /*#__PURE__*/React.createElement("span", {
27296
+ className: "astericColor"
27297
+ }, "*")), /*#__PURE__*/React.createElement(TextInput, Object.assign({
27298
+ t: t,
27299
+ type: "text",
27300
+ isMandatory: false,
27301
+ optionKey: "i18nKey",
27302
+ name: "guardianName",
27303
+ style: inputStyles,
27304
+ value: guardianName,
27305
+ onChange: setGuardiansName,
27306
+ ValidationRequired: true
27307
+ }, validation = {
27308
+ isRequired: true,
27309
+ pattern: "^[a-zA-Z ]+$",
27310
+ type: "tel",
27311
+ title: t("PT_NAME_ERROR_MESSAGE")
27312
+ }))) : null, config !== null && config !== void 0 && (_config$additionaFiel7 = config.additionaFields) !== null && _config$additionaFiel7 !== void 0 && _config$additionaFiel7.guardianName ? /*#__PURE__*/React.createElement("div", {
27313
+ className: "form-field wns-search-field"
27314
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_RELATIONTYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
27315
+ className: "astericColor"
27316
+ }, "*")), /*#__PURE__*/React.createElement(Dropdown, {
27317
+ className: "form-field",
27318
+ selected: relationShipType,
27319
+ option: GuardianOptions,
27320
+ select: setRelationShipType,
27321
+ optionKey: "i18nKey",
27322
+ t: t,
27323
+ name: "relationShipType",
27324
+ placeholder: "Select"
27325
+ })) : null, /*#__PURE__*/React.createElement("div", {
27326
+ className: "form-field wns-search-field"
27327
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_EMAIL_ID")}`), /*#__PURE__*/React.createElement(TextInput, Object.assign({
27328
+ t: t,
27329
+ type: "email",
27330
+ optionKey: "i18nKey",
27331
+ name: "emailId",
27332
+ value: emailId,
27333
+ style: inputStyles,
27334
+ onChange: setOwnerEmail,
27335
+ ValidationRequired: true
27336
+ }, validation = {
27337
+ isRequired: true,
27338
+ pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z]+\\.[a-zA-Z]{3,4}$",
27339
+ type: "email",
27340
+ title: t("PT_NAME_ERROR_MESSAGE")
27341
+ }))))));
27342
+ };
27343
+
27344
+ const EmergencyFixedPointDispatchDetails = ({
27345
+ t,
27346
+ config,
27347
+ onSelect,
27348
+ formData
27349
+ }) => {
27350
+ var _formData$dispatchDet, _formData$dispatchDet2, _formData$dispatchDet3, _formData$dispatchDet4, _fillingPointsData$fi, _vendorData$vendor;
27351
+ const tenantId = Digit.ULBService.getCurrentTenantId();
27352
+ const [fillingPoint, setFillingPoint] = useState((formData === null || formData === void 0 ? void 0 : (_formData$dispatchDet = formData.dispatchDetails) === null || _formData$dispatchDet === void 0 ? void 0 : _formData$dispatchDet.fillingPoint) || "");
27353
+ const [vendor, setVendor] = useState((formData === null || formData === void 0 ? void 0 : (_formData$dispatchDet2 = formData.dispatchDetails) === null || _formData$dispatchDet2 === void 0 ? void 0 : _formData$dispatchDet2.vendor) || "");
27354
+ const [vehicle, setVehicle] = useState((formData === null || formData === void 0 ? void 0 : (_formData$dispatchDet3 = formData.dispatchDetails) === null || _formData$dispatchDet3 === void 0 ? void 0 : _formData$dispatchDet3.vehicle) || "");
27355
+ const [driver, setDriver] = useState((formData === null || formData === void 0 ? void 0 : (_formData$dispatchDet4 = formData.dispatchDetails) === null || _formData$dispatchDet4 === void 0 ? void 0 : _formData$dispatchDet4.driver) || "");
27356
+ const {
27357
+ data: fillingPointsData
27358
+ } = Digit.Hooks.wt.useFillPointSearch({
27359
+ tenantId,
27360
+ filters: {
27361
+ limit: 1000
27362
+ }
27363
+ }, {
27364
+ enabled: true
27365
+ });
27366
+ const fillingPointOptions = (fillingPointsData === null || fillingPointsData === void 0 ? void 0 : (_fillingPointsData$fi = fillingPointsData.fillingPoints) === null || _fillingPointsData$fi === void 0 ? void 0 : _fillingPointsData$fi.map(fp => ({
27367
+ ...fp,
27368
+ name: (fp === null || fp === void 0 ? void 0 : fp.fillingPointName) || "NA"
27369
+ }))) || [];
27370
+ const {
27371
+ data: vendorData
27372
+ } = Digit.Hooks.fsm.useVendorSearch({
27373
+ tenantId,
27374
+ filters: {
27375
+ ...(fillingPoint !== null && fillingPoint !== void 0 && fillingPoint.fillingPointId ? {
27376
+ fillingPointId: fillingPoint.id
27377
+ } : {})
27378
+ },
27379
+ config: {
27380
+ enabled: true
27381
+ }
27382
+ });
27383
+ const vendorOptions = (vendorData === null || vendorData === void 0 ? void 0 : (_vendorData$vendor = vendorData.vendor) === null || _vendorData$vendor === void 0 ? void 0 : _vendorData$vendor.map(v => ({
27384
+ ...v,
27385
+ name: (v === null || v === void 0 ? void 0 : v.name) || (v === null || v === void 0 ? void 0 : v.vendor_id) || "NA"
27386
+ }))) || [];
27387
+ let vehicleOptions = [];
27388
+ let driverOptions = [];
27389
+ if (vendor && typeof vendor === "object") {
27390
+ var _vendor$vehicles, _vendor$drivers;
27391
+ vehicleOptions = ((_vendor$vehicles = vendor.vehicles) === null || _vendor$vehicles === void 0 ? void 0 : _vendor$vehicles.map(veh => ({
27392
+ ...veh,
27393
+ name: (veh === null || veh === void 0 ? void 0 : veh.registrationNumber) || (veh === null || veh === void 0 ? void 0 : veh.type) || "NA"
27394
+ }))) || [];
27395
+ driverOptions = ((_vendor$drivers = vendor.drivers) === null || _vendor$drivers === void 0 ? void 0 : _vendor$drivers.map(drv => ({
27396
+ ...drv,
27397
+ name: (drv === null || drv === void 0 ? void 0 : drv.name) || (drv === null || drv === void 0 ? void 0 : drv.licenseNumber) || "NA"
27398
+ }))) || [];
27399
+ }
27400
+ const handleVendorSelect = selected => {
27401
+ setVendor(selected);
27402
+ setVehicle("");
27403
+ setDriver("");
27404
+ };
27405
+ const goNext = () => {
27406
+ onSelect(config.key, {
27407
+ fillingPoint,
27408
+ vendor,
27409
+ vehicle,
27410
+ driver
27411
+ }, false);
27412
+ };
27413
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
27414
+ config: config,
27415
+ onSelect: goNext,
27416
+ t: t,
27417
+ isDisabled: !fillingPoint || !vendor || !vehicle || !driver,
27418
+ className: "search-form-wrapper"
27419
+ }, /*#__PURE__*/React.createElement("div", {
27420
+ className: "form-field wns-search-field"
27421
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_FILLING_POINT", "Filling Point")}`), /*#__PURE__*/React.createElement(Dropdown, {
27422
+ className: "form-field",
27423
+ selected: fillingPoint,
27424
+ option: fillingPointOptions,
27425
+ select: setFillingPoint,
27426
+ optionKey: "name",
27427
+ t: t,
27428
+ name: "fillingPoint",
27429
+ placeholder: t("WT_SELECT_FILLING_POINT", "Select Filling Point")
27430
+ })), /*#__PURE__*/React.createElement("div", {
27431
+ className: "form-field wns-search-field"
27432
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_VENDOR", "Vendor")}`), /*#__PURE__*/React.createElement(Dropdown, {
27433
+ className: "form-field",
27434
+ selected: vendor,
27435
+ option: vendorOptions,
27436
+ select: handleVendorSelect,
27437
+ optionKey: "name",
27438
+ t: t,
27439
+ name: "vendor",
27440
+ placeholder: t("WT_SELECT_VENDOR", "Select Vendor")
27441
+ })), /*#__PURE__*/React.createElement("div", {
27442
+ className: "form-field wns-search-field"
27443
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_VEHICLE", "Vehicle")}`), /*#__PURE__*/React.createElement(Dropdown, {
27444
+ className: "form-field",
27445
+ selected: vehicle,
27446
+ option: vehicleOptions,
27447
+ select: setVehicle,
27448
+ optionKey: "name",
27449
+ t: t,
27450
+ name: "vehicle",
27451
+ placeholder: t("WT_SELECT_VEHICLE", "Select Vehicle")
27452
+ })), /*#__PURE__*/React.createElement("div", {
27453
+ className: "form-field wns-search-field"
27454
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_DRIVER", "Driver")}`), /*#__PURE__*/React.createElement(Dropdown, {
27455
+ className: "form-field",
27456
+ selected: driver,
27457
+ option: driverOptions,
27458
+ select: setDriver,
27459
+ optionKey: "name",
27460
+ t: t,
27461
+ name: "driver",
27462
+ placeholder: t("WT_SELECT_DRIVER", "Select Driver")
27463
+ }))));
27464
+ };
27465
+
26829
27466
  const WTModule = ({
26830
27467
  stateCode,
26831
27468
  userType,
@@ -26934,7 +27571,9 @@ const componentsToRegister = {
26934
27571
  WTEmergencyFixedPointAcknowledgement,
26935
27572
  MTEmergencyFixedPointAcknowledgement,
26936
27573
  EmergencyFixedPointTPAcknowledgement,
26937
- WTEmergencyFixedPointCreate
27574
+ WTEmergencyFixedPointCreate,
27575
+ EmergencyFixedPointApplicantDetails,
27576
+ EmergencyFixedPointDispatchDetails
26938
27577
  };
26939
27578
  const initWTComponents = () => {
26940
27579
  Object.entries(componentsToRegister).forEach(([key, value]) => {