@djb25/digit-ui-module-wt 1.0.39 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { TickMark, ArrowDown, MobileNumber, CardLabelError, TextInput, Dropdown, DatePicker, SubmitBar, Card, Table, Loader, Toast, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, CitizenHomeCard, CHBIcon, PropertyHouse, HomeIcon, KeyNote, Modal, CardHeader, FormStep, CardLabel, RadioButtons, UploadFile, TextArea, CheckBox, CardSubHeader, StatusTable, Row, GenericFileIcon, LinkButton, EditIcon, Banner, EmployeeModuleCard, CloseSvg, Label, LinkLabel, ActionBar, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, CustomNameDropdown, MultiSelectDropdown, CollapsibleCardPage as CollapsibleCardPage$1, LabelFieldPair, AddIcon, Menu, CheckSvg, LayoutWrapper, Header, TelePhone, DisplayPhotos, CardSectionHeader, CheckPoint, ConnectingCheckPoints, MultiLink, Localities, RemoveableTag, FormComposer, PDFSvg, MultiUploadWrapper, Close as Close$h, BreakLine, InfoBannerIcon, ViewsIcon, ButtonSelector, LocationIcon, PTIcon, ApplicantDetails, AddressDetails } from '@djb25/digit-ui-react-components';
2
- import React, { useRef, useEffect, useState, useMemo, useCallback, Fragment, useReducer } from 'react';
1
+ import { TickMark, ArrowDown, ViewsIcon, MobileNumber, CardLabelError, TextInput, Dropdown, DatePicker, SubmitBar, Card, Table, Loader, Modal, Toast, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, CitizenHomeCard, CHBIcon, PropertyHouse, HomeIcon, KeyNote, CardHeader, FormStep, CardLabel, RadioButtons, UploadFile, TextArea, CheckBox, CardSubHeader, StatusTable, Row, GenericFileIcon, LinkButton, EditIcon, Banner, EmployeeModuleCard, CloseSvg, Label, LinkLabel, ActionBar, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, CustomNameDropdown, MultiSelectDropdown, CollapsibleCardPage as CollapsibleCardPage$1, LabelFieldPair, AddIcon, Menu, CheckSvg, LayoutWrapper, Header, TelePhone, DisplayPhotos, CardSectionHeader, CheckPoint, ConnectingCheckPoints, MultiLink, Localities, RemoveableTag, FormComposer, PDFSvg, MultiUploadWrapper, Close as Close$h, BreakLine, InfoBannerIcon, ButtonSelector, LocationIcon, PTIcon, ApplicantDetails, AddressDetails } from '@djb25/digit-ui-react-components';
2
+ import React, { useRef, useEffect, useState, useCallback, useMemo, Fragment, useReducer } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useRouteMatch, useHistory, Switch, Route, Redirect, Link, useParams } from 'react-router-dom';
5
5
  import { useQueryClient } from 'react-query';
@@ -693,9 +693,70 @@ 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$owner29, _data$owner30, _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$owner31, _data$owner31$vendor, _data$dispatchDetails3, _data$dispatchDetails4, _data$owner32, _data$owner32$vehicle, _data$dispatchDetails5, _data$dispatchDetails6, _data$owner33, _data$owner33$driver, _data$dispatchDetails7, _data$dispatchDetails8, _data$owner34, _data$owner34$filling, _data$dispatchDetails9, _data$dispatchDetails0, _data$owner35, _data$owner35$vehicle, _data$dispatchDetails1, _data$dispatchDetails10, _data$owner36, _data$owner36$vehicle, _data$owner37, _data$owner38, _data$owner39, _data$owner40, _data$owner41, _data$owner42, _data$address72, _data$address73, _data$address73$addre, _data$address74, _data$address75, _data$address76, _data$address76$city, _data$address76$city$, _data$address77, _data$address77$city, _data$address78, _data$address79, _data$address79$city, _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$address96, _data$address97, _data$requestDetails29;
697
+ const fixedPoint = data === null || data === void 0 ? void 0 : (_data$owner29 = data.owner) === null || _data$owner29 === void 0 ? void 0 : _data$owner29.fixedPoint;
698
+ const applicantDetailFromFP = (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.applicantDetail) || {};
699
+ const addressFromFP = (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.address) || {};
700
+ const formdata = {
701
+ waterTankerBookingDetail: {
702
+ applicantId: (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.applicantId) || (data === null || data === void 0 ? void 0 : (_data$owner30 = data.owner) === null || _data$owner30 === void 0 ? void 0 : _data$owner30.applicantId) || "",
703
+ tenantId: data === null || data === void 0 ? void 0 : data.tenantId,
704
+ 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),
705
+ 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),
706
+ 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),
707
+ 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),
708
+ description: data === null || data === void 0 ? void 0 : (_data$requestDetails25 = data.requestDetails) === null || _data$requestDetails25 === void 0 ? void 0 : _data$requestDetails25.description,
709
+ deliveryDate: data === null || data === void 0 ? void 0 : (_data$requestDetails26 = data.requestDetails) === null || _data$requestDetails26 === void 0 ? void 0 : _data$requestDetails26.deliveryDate,
710
+ deliveryTime: data === null || data === void 0 ? void 0 : (_data$requestDetails27 = data.requestDetails) === null || _data$requestDetails27 === void 0 ? void 0 : _data$requestDetails27.deliveryTime,
711
+ extraCharge: data !== null && data !== void 0 && (_data$requestDetails28 = data.requestDetails) !== null && _data$requestDetails28 !== void 0 && _data$requestDetails28.extraCharge ? "Y" : "N",
712
+ addressDetailId: (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.addressId) || (data === null || data === void 0 ? void 0 : (_data$address71 = data.address) === null || _data$address71 === void 0 ? void 0 : _data$address71.addressDetailId) || "",
713
+ 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$owner31 = data.owner) === null || _data$owner31 === void 0 ? void 0 : (_data$owner31$vendor = _data$owner31.vendor) === null || _data$owner31$vendor === void 0 ? void 0 : _data$owner31$vendor.id) || "",
714
+ 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$owner32 = data.owner) === null || _data$owner32 === void 0 ? void 0 : (_data$owner32$vehicle = _data$owner32.vehicle) === null || _data$owner32$vehicle === void 0 ? void 0 : _data$owner32$vehicle.id) || "",
715
+ 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$owner33 = data.owner) === null || _data$owner33 === void 0 ? void 0 : (_data$owner33$driver = _data$owner33.driver) === null || _data$owner33$driver === void 0 ? void 0 : _data$owner33$driver.id) || "",
716
+ 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$owner34 = data.owner) === null || _data$owner34 === void 0 ? void 0 : (_data$owner34$filling = _data$owner34.fillingPoint) === null || _data$owner34$filling === void 0 ? void 0 : _data$owner34$filling.id) || "",
717
+ 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$owner35 = data.owner) === null || _data$owner35 === void 0 ? void 0 : (_data$owner35$vehicle = _data$owner35.vehicle) === null || _data$owner35$vehicle === void 0 ? void 0 : _data$owner35$vehicle.vehicleType) || "",
718
+ 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$owner36 = data.owner) === null || _data$owner36 === void 0 ? void 0 : (_data$owner36$vehicle = _data$owner36.vehicle) === null || _data$owner36$vehicle === void 0 ? void 0 : _data$owner36$vehicle.capacity) || "",
719
+ applicantDetail: {
720
+ applicantId: (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.applicantId) || (data === null || data === void 0 ? void 0 : (_data$owner37 = data.owner) === null || _data$owner37 === void 0 ? void 0 : _data$owner37.applicantId) || "",
721
+ bookingId: (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.bookingId) || "",
722
+ name: (data === null || data === void 0 ? void 0 : (_data$owner38 = data.owner) === null || _data$owner38 === void 0 ? void 0 : _data$owner38.applicantName) || (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.name) || "",
723
+ mobileNumber: (data === null || data === void 0 ? void 0 : (_data$owner39 = data.owner) === null || _data$owner39 === void 0 ? void 0 : _data$owner39.mobileNumber) || (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.mobileNumber) || "",
724
+ alternateNumber: (data === null || data === void 0 ? void 0 : (_data$owner40 = data.owner) === null || _data$owner40 === void 0 ? void 0 : _data$owner40.alternateNumber) || (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.alternateNumber) || "",
725
+ emailId: (data === null || data === void 0 ? void 0 : (_data$owner41 = data.owner) === null || _data$owner41 === void 0 ? void 0 : _data$owner41.emailId) || (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.emailId) || "",
726
+ gender: (data === null || data === void 0 ? void 0 : (_data$owner42 = data.owner) === null || _data$owner42 === void 0 ? void 0 : _data$owner42.gender) || (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.gender) || null,
727
+ type: "FIXED-POINT",
728
+ fixedPointId: (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.fixedPointId) || ""
729
+ },
730
+ address: {
731
+ applicantId: (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.applicantId) || (applicantDetailFromFP === null || applicantDetailFromFP === void 0 ? void 0 : applicantDetailFromFP.applicantId) || "",
732
+ addressId: (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.addressId) || (data === null || data === void 0 ? void 0 : (_data$address72 = data.address) === null || _data$address72 === void 0 ? void 0 : _data$address72.addressId) || "",
733
+ addressType: (data === null || data === void 0 ? void 0 : (_data$address73 = data.address) === null || _data$address73 === void 0 ? void 0 : (_data$address73$addre = _data$address73.addressType) === null || _data$address73$addre === void 0 ? void 0 : _data$address73$addre.code) || (data === null || data === void 0 ? void 0 : (_data$address74 = data.address) === null || _data$address74 === void 0 ? void 0 : _data$address74.addressType) || "CORRESPONDENCE",
734
+ pincode: (data === null || data === void 0 ? void 0 : (_data$address75 = data.address) === null || _data$address75 === void 0 ? void 0 : _data$address75.pincode) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.pincode) || "",
735
+ city: (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$ = _data$address76$city.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 = _data$address77.city) === null || _data$address77$city === void 0 ? void 0 : _data$address77$city.name) || (data === null || data === void 0 ? void 0 : (_data$address78 = data.address) === null || _data$address78 === void 0 ? void 0 : _data$address78.city) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.city) || "",
736
+ cityCode: (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$ = _data$address79$city.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) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.cityCode) || "DL",
737
+ addressLine1: (data === null || data === void 0 ? void 0 : (_data$address81 = data.address) === null || _data$address81 === void 0 ? void 0 : _data$address81.addressLine1) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.addressLine1) || "",
738
+ addressLine2: (data === null || data === void 0 ? void 0 : (_data$address82 = data.address) === null || _data$address82 === void 0 ? void 0 : _data$address82.addressLine2) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.addressLine2) || "",
739
+ 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) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.locality) || "",
740
+ 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) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.localityCode) || "",
741
+ streetName: (data === null || data === void 0 ? void 0 : (_data$address88 = data.address) === null || _data$address88 === void 0 ? void 0 : _data$address88.streetName) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.streetName) || "",
742
+ houseNo: (data === null || data === void 0 ? void 0 : (_data$address89 = data.address) === null || _data$address89 === void 0 ? void 0 : _data$address89.houseNo) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.houseNo) || "",
743
+ landmark: (data === null || data === void 0 ? void 0 : (_data$address90 = data.address) === null || _data$address90 === void 0 ? void 0 : _data$address90.landmark) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.landmark) || "",
744
+ latitude: (data === null || data === void 0 ? void 0 : (_data$address91 = data.address) === null || _data$address91 === void 0 ? void 0 : _data$address91.latitude) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.latitude) || "",
745
+ longitude: (data === null || data === void 0 ? void 0 : (_data$address92 = data.address) === null || _data$address92 === void 0 ? void 0 : _data$address92.longitude) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.longitude) || "",
746
+ ward: (data === null || data === void 0 ? void 0 : (_data$address93 = data.address) === null || _data$address93 === void 0 ? void 0 : _data$address93.ward) || (data === null || data === void 0 ? void 0 : (_data$address94 = data.address) === null || _data$address94 === void 0 ? void 0 : _data$address94.block) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.ward) || "",
747
+ zone: (data === null || data === void 0 ? void 0 : (_data$address95 = data.address) === null || _data$address95 === void 0 ? void 0 : _data$address95.zone) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.zone) || "",
748
+ constituency: (data === null || data === void 0 ? void 0 : (_data$address96 = data.address) === null || _data$address96 === void 0 ? void 0 : _data$address96.assembly) || (data === null || data === void 0 ? void 0 : (_data$address97 = data.address) === null || _data$address97 === void 0 ? void 0 : _data$address97.constituency) || (addressFromFP === null || addressFromFP === void 0 ? void 0 : addressFromFP.constituency) || ""
749
+ },
750
+ WTfileStoreId: data === null || data === void 0 ? void 0 : (_data$requestDetails29 = data.requestDetails) === null || _data$requestDetails29 === void 0 ? void 0 : _data$requestDetails29.fileStoreId,
751
+ bookingStatus: "BOOKING_CREATED",
752
+ workflow: {
753
+ action: "CREATE",
754
+ comments: "",
755
+ businessService: "watertanker-fixedpoint",
756
+ moduleName: "request-service.water_tanker"
757
+ }
758
+ }
759
+ };
699
760
  return formdata;
700
761
  };
701
762
 
@@ -749,8 +810,77 @@ const WTSearchApplication = ({
749
810
  moduleCode,
750
811
  isFixedPoint
751
812
  }) => {
813
+ var _tripReportsData$driv;
752
814
  const isMobile = window.Digit.Utils.browser.isMobile();
753
815
  const user = Digit.UserService.getUser().info;
816
+ const [showWorkOrderModal, setShowWorkOrderModal] = useState(false);
817
+ const [selectedVendorForWorkOrder, setSelectedVendorForWorkOrder] = useState(null);
818
+ const handleViewDocument = useCallback(async fileStoreId => {
819
+ if (!fileStoreId) return;
820
+ try {
821
+ const response = await Digit.UploadServices.FileFetchbyid(fileStoreId, tenantId);
822
+ if (response && response.data) {
823
+ const file = new Blob([response.data], {
824
+ type: response.headers["content-type"]
825
+ });
826
+ const fileUrl = URL.createObjectURL(file);
827
+ window.open(fileUrl, "_blank");
828
+ }
829
+ } catch (e) {
830
+ console.error(e);
831
+ }
832
+ }, []);
833
+ const DriverReportColumns = useMemo(() => [{
834
+ Header: t("S.No"),
835
+ accessor: (row, index) => index + 1
836
+ }, {
837
+ Header: t("WT_BOOKING_NO"),
838
+ accessor: "bookingNo"
839
+ }, {
840
+ Header: t("WT_VEHICLE_NO"),
841
+ accessor: "vehicleRegistrationNo"
842
+ }, {
843
+ Header: t("WT_DRIVER_NAME"),
844
+ accessor: "driverName"
845
+ }, {
846
+ Header: t("WT_TANK_CAPACITY"),
847
+ accessor: "tankCapicity"
848
+ }, {
849
+ Header: t("WT_STATUS"),
850
+ accessor: "currentStatus"
851
+ }, {
852
+ Header: t("WT_START_PHOTO"),
853
+ Cell: ({
854
+ row
855
+ }) => row.original.startFileStoreId ? /*#__PURE__*/React.createElement("div", {
856
+ style: {
857
+ color: "#f47738",
858
+ cursor: "pointer",
859
+ display: "inline-block"
860
+ },
861
+ onClick: () => handleViewDocument(row.original.startFileStoreId)
862
+ }, /*#__PURE__*/React.createElement(ViewsIcon, null)) : t("CS_NA")
863
+ }, {
864
+ Header: t("WT_END_PHOTO"),
865
+ Cell: ({
866
+ row
867
+ }) => row.original.endFileStoreId ? /*#__PURE__*/React.createElement("div", {
868
+ style: {
869
+ color: "#f47738",
870
+ cursor: "pointer",
871
+ display: "inline-block"
872
+ },
873
+ onClick: () => handleViewDocument(row.original.endFileStoreId)
874
+ }, /*#__PURE__*/React.createElement(ViewsIcon, null)) : t("CS_NA")
875
+ }], [t, handleViewDocument]);
876
+ const openWorkOrderModal = vendorDetails => {
877
+ setSelectedVendorForWorkOrder(vendorDetails);
878
+ setShowWorkOrderModal(true);
879
+ };
880
+ const closeWorkOrderModal = () => {
881
+ setSelectedVendorForWorkOrder(null);
882
+ setShowWorkOrderModal(false);
883
+ };
754
884
  const defaultValues = {
755
885
  offset: 0,
756
886
  limit: 10,
@@ -787,6 +917,17 @@ const WTSearchApplication = ({
787
917
  enabled: !!isFixedPoint
788
918
  });
789
919
  const fillingPoints = (fillingPointsData === null || fillingPointsData === void 0 ? void 0 : fillingPointsData.fillingPoints) || [];
920
+ const {
921
+ data: tripReportsData,
922
+ isLoading: isTripReportsLoading
923
+ } = Digit.Hooks.wt.useDriverTripReportSearch({
924
+ tenantId,
925
+ filters: {
926
+ bookingNo: selectedVendorForWorkOrder === null || selectedVendorForWorkOrder === void 0 ? void 0 : selectedVendorForWorkOrder.bookingNo
927
+ }
928
+ }, {
929
+ enabled: !!(selectedVendorForWorkOrder !== null && selectedVendorForWorkOrder !== void 0 && selectedVendorForWorkOrder.bookingNo)
930
+ });
790
931
  const GetCell = value => /*#__PURE__*/React.createElement("span", {
791
932
  className: "cell-text"
792
933
  }, value);
@@ -829,6 +970,21 @@ const WTSearchApplication = ({
829
970
  Cell: ({
830
971
  row
831
972
  }) => GetCell(t(row.original["bookingStatus"]))
973
+ }, {
974
+ Header: t("VIEW_REPORTS"),
975
+ disableSortBy: true,
976
+ Cell: ({
977
+ row
978
+ }) => {
979
+ return /*#__PURE__*/React.createElement("button", {
980
+ className: "submit-bar",
981
+ style: {
982
+ backgroundColor: "#417505",
983
+ color: "white"
984
+ },
985
+ onClick: () => openWorkOrderModal(row.original)
986
+ }, t("VIEW_REPORTS"));
987
+ }
832
988
  }], [t, user.type]);
833
989
  const statusOptions = moduleCode === "TP" ? [{
834
990
  i18nKey: "TP_BOOKING_CREATED",
@@ -1073,7 +1229,58 @@ const WTSearchApplication = ({
1073
1229
  id: getValues("sortBy"),
1074
1230
  desc: getValues("sortOrder") === "DESC"
1075
1231
  }]
1076
- }) : (data !== "" || isLoading) && /*#__PURE__*/React.createElement(Loader, null)));
1232
+ }) : (data !== "" || isLoading) && /*#__PURE__*/React.createElement(Loader, null)), showWorkOrderModal && /*#__PURE__*/React.createElement(Modal, {
1233
+ headerBarMain: /*#__PURE__*/React.createElement("h1", {
1234
+ className: "heading-m",
1235
+ style: {
1236
+ margin: 0
1237
+ }
1238
+ }, t("VIEW_DRIVER_TRIP_REPORTS")),
1239
+ headerBarEnd: /*#__PURE__*/React.createElement("div", {
1240
+ className: "icon-bg-secondary",
1241
+ onClick: closeWorkOrderModal,
1242
+ style: {
1243
+ cursor: "pointer"
1244
+ }
1245
+ }, /*#__PURE__*/React.createElement("svg", {
1246
+ xmlns: "http://www.w3.org/2000/svg",
1247
+ viewBox: "0 0 24 24",
1248
+ fill: "#FFFFFF",
1249
+ width: "24",
1250
+ height: "24"
1251
+ }, /*#__PURE__*/React.createElement("path", {
1252
+ d: "M0 0h24v24H0V0z",
1253
+ fill: "none"
1254
+ }), /*#__PURE__*/React.createElement("path", {
1255
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
1256
+ }))),
1257
+ actionCancelLabel: t("CS_COMMON_CLOSE"),
1258
+ actionCancelOnSubmit: closeWorkOrderModal,
1259
+ hideSubmit: true,
1260
+ formId: "modal-action"
1261
+ }, /*#__PURE__*/React.createElement("div", {
1262
+ style: {
1263
+ padding: "16px"
1264
+ }
1265
+ }, isTripReportsLoading ? /*#__PURE__*/React.createElement(Loader, null) : (tripReportsData === null || tripReportsData === void 0 ? void 0 : (_tripReportsData$driv = tripReportsData.driverTripReports) === null || _tripReportsData$driv === void 0 ? void 0 : _tripReportsData$driv.length) > 0 ? /*#__PURE__*/React.createElement(Table, {
1266
+ t: t,
1267
+ data: tripReportsData.driverTripReports,
1268
+ columns: DriverReportColumns,
1269
+ getCellProps: cellInfo => {
1270
+ return {
1271
+ style: {
1272
+ minWidth: "150px",
1273
+ padding: "8px 12px",
1274
+ fontSize: "13.5px"
1275
+ }
1276
+ };
1277
+ }
1278
+ }) : /*#__PURE__*/React.createElement("p", {
1279
+ style: {
1280
+ textAlign: "center",
1281
+ marginTop: "20px"
1282
+ }
1283
+ }, t("ES_VENDOR_NO_WORKORDERS")))));
1077
1284
  };
1078
1285
 
1079
1286
  const SearchApp = ({
@@ -8027,9 +8234,13 @@ const VendorAssign = ({
8027
8234
  })();
8028
8235
  }, [file]);
8029
8236
  const handleSubmit = () => {
8237
+ var _vendor$owner, _vendor$owner2;
8030
8238
  const payload = {
8031
8239
  vendorWorkOrder: {
8032
8240
  tenantId,
8241
+ name: vendor === null || vendor === void 0 ? void 0 : vendor.name,
8242
+ mobileNumber: vendor === null || vendor === void 0 ? void 0 : (_vendor$owner = vendor.owner) === null || _vendor$owner === void 0 ? void 0 : _vendor$owner.mobileNumber,
8243
+ emailId: vendor === null || vendor === void 0 ? void 0 : (_vendor$owner2 = vendor.owner) === null || _vendor$owner2 === void 0 ? void 0 : _vendor$owner2.emailId,
8033
8244
  vendorId: (vendor === null || vendor === void 0 ? void 0 : vendor.code) || (vendor === null || vendor === void 0 ? void 0 : vendor.id),
8034
8245
  validFrom: new Date(validFrom).getTime(),
8035
8246
  validTo: new Date(validTo).getTime(),
@@ -8718,19 +8929,25 @@ const EmployeeApp = ({
8718
8929
  component: WTEmergencyFixedPointCreate
8719
8930
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
8720
8931
  path: `${path}/fixed-point/booking-details/:id`,
8721
- component: props => /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
8932
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
8933
+ layoutClass: "action"
8934
+ }, /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
8722
8935
  parentRoute: path
8723
- }))
8936
+ })))
8724
8937
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
8725
8938
  path: `${path}/booking-details/:id`,
8726
- component: props => /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
8939
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
8940
+ layoutClass: "normal"
8941
+ }, /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
8727
8942
  parentRoute: path
8728
- }))
8943
+ })))
8729
8944
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
8730
8945
  path: `${path}/bookingsearch/booking-details/:id`,
8731
- component: props => /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
8946
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
8947
+ layoutClass: "normal"
8948
+ }, /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
8732
8949
  parentRoute: path
8733
- }))
8950
+ })))
8734
8951
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
8735
8952
  path: `${path}/my-bookings`,
8736
8953
  component: props => /*#__PURE__*/React.createElement(SearchApp, Object.assign({}, props, {
@@ -16210,7 +16427,7 @@ const WTEditApplicationModal = ({
16210
16427
  const [formData, setFormData] = useState({});
16211
16428
  useEffect(() => {
16212
16429
  if (applicationData) {
16213
- var _applicationData$appl, _applicationData$appl2, _applicationData$appl3, _applicationData$appl4, _applicationData$addr, _applicationData$addr2, _applicationData$addr3, _applicationData$addr4, _applicationData$addr5, _applicationData$addr6;
16430
+ 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;
16214
16431
  setFormData({
16215
16432
  name: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$appl = applicationData.applicantDetail) === null || _applicationData$appl === void 0 ? void 0 : _applicationData$appl.name) || "",
16216
16433
  mobileNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$appl2 = applicationData.applicantDetail) === null || _applicationData$appl2 === void 0 ? void 0 : _applicationData$appl2.mobileNumber) || "",
@@ -16228,7 +16445,16 @@ const WTEditApplicationModal = ({
16228
16445
  waterQuantity: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.waterQuantity) || "",
16229
16446
  description: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.description) || "",
16230
16447
  deliveryDate: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.deliveryDate) || "",
16231
- deliveryTime: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.deliveryTime) || ""
16448
+ deliveryTime: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.deliveryTime) || "",
16449
+ vendorName: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vend = applicationData.vendorDetail) === null || _applicationData$vend === void 0 ? void 0 : _applicationData$vend.name) || "",
16450
+ vendorMobileNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vend2 = applicationData.vendorDetail) === null || _applicationData$vend2 === void 0 ? void 0 : _applicationData$vend2.mobileNumber) || "",
16451
+ vendorAlternateNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vend3 = applicationData.vendorDetail) === null || _applicationData$vend3 === void 0 ? void 0 : _applicationData$vend3.alternateNumber) || "",
16452
+ vendorEmailId: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vend4 = applicationData.vendorDetail) === null || _applicationData$vend4 === void 0 ? void 0 : _applicationData$vend4.emailId) || "",
16453
+ driverName: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$driv = applicationData.driverDetail) === null || _applicationData$driv === void 0 ? void 0 : _applicationData$driv.name) || "",
16454
+ driverMobileNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$driv2 = applicationData.driverDetail) === null || _applicationData$driv2 === void 0 ? void 0 : _applicationData$driv2.mobileNumber) || "",
16455
+ driverAlternateNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$driv3 = applicationData.driverDetail) === null || _applicationData$driv3 === void 0 ? void 0 : _applicationData$driv3.alternateNumber) || "",
16456
+ driverEmailId: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$driv4 = applicationData.driverDetail) === null || _applicationData$driv4 === void 0 ? void 0 : _applicationData$driv4.emailId) || "",
16457
+ fillingPoints: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$vehi = applicationData.vehicleDetail) === null || _applicationData$vehi === void 0 ? void 0 : _applicationData$vehi.fillingPoints) || ""
16232
16458
  });
16233
16459
  }
16234
16460
  }, [applicationData]);
@@ -16305,6 +16531,42 @@ const WTEditApplicationModal = ({
16305
16531
  key: "description",
16306
16532
  fullWidth: true
16307
16533
  }]
16534
+ }, {
16535
+ title: "WT_VENDOR_DETAILS",
16536
+ fields: [{
16537
+ label: "WT_VENDOR_NAME",
16538
+ key: "vendorName"
16539
+ }, {
16540
+ label: "WT_MOBILE_NUMBER",
16541
+ key: "vendorMobileNumber"
16542
+ }, {
16543
+ label: "WT_ALT_MOBILE_NUMBER",
16544
+ key: "vendorAlternateNumber"
16545
+ }, {
16546
+ label: "WT_EMAIL_ID",
16547
+ key: "vendorEmailId"
16548
+ }]
16549
+ }, {
16550
+ title: "WT_DRIVER_DETAILS",
16551
+ fields: [{
16552
+ label: "WT_DRIVER_NAME",
16553
+ key: "driverName"
16554
+ }, {
16555
+ label: "WT_MOBILE_NUMBER",
16556
+ key: "driverMobileNumber"
16557
+ }, {
16558
+ label: "WT_ALT_MOBILE_NUMBER",
16559
+ key: "driverAlternateNumber"
16560
+ }, {
16561
+ label: "WT_EMAIL_ID",
16562
+ key: "driverEmailId"
16563
+ }]
16564
+ }, {
16565
+ title: "WT_VEHICLE_DETAILS",
16566
+ fields: [{
16567
+ label: "WT_FILLING_POINTS",
16568
+ key: "fillingPoints"
16569
+ }]
16308
16570
  }];
16309
16571
  return /*#__PURE__*/React.createElement(Modal, {
16310
16572
  headerBarMain: /*#__PURE__*/React.createElement("h1", {
@@ -20125,7 +20387,11 @@ const ActionModal$b = ({
20125
20387
  applicationData.vehicleId = selectVehicle === null || selectVehicle === void 0 ? void 0 : selectVehicle.vehicleId;
20126
20388
  applicationData.driverId = selectVehicle === null || selectVehicle === void 0 ? void 0 : selectVehicle.driverId;
20127
20389
  }
20128
- let requestPayload = businessService === "watertanker" ? {
20390
+ if (businessService === "watertanker-fixedpoint") {
20391
+ workflow.moduleName = "request-service.water_tanker";
20392
+ workflow.businessService = "watertanker-fixedpoint";
20393
+ }
20394
+ let requestPayload = businessService === "watertanker" || businessService === "watertanker-fixedpoint" ? {
20129
20395
  waterTankerBookingDetail: {
20130
20396
  ...applicationData,
20131
20397
  workflow
@@ -23192,7 +23458,7 @@ function ApplicationDetailsContent({
23192
23458
  fontSize: "24px"
23193
23459
  } : {
23194
23460
  marginBottom: "16px",
23195
- marginTop: "32px",
23461
+ marginTop: "16px",
23196
23462
  fontSize: "24px"
23197
23463
  }
23198
23464
  }, t(detail.title), detail !== null && detail !== void 0 && detail.Component ? /*#__PURE__*/React.createElement(detail.Component, null) : null)), (detail === null || detail === void 0 ? void 0 : detail.isTable) && /*#__PURE__*/React.createElement("table", {
@@ -24125,6 +24391,7 @@ const ApplicationDetails$1 = () => {
24125
24391
  const {
24126
24392
  t
24127
24393
  } = useTranslation();
24394
+ const location = useLocation();
24128
24395
  const [hideTimeline, setHideTimeline] = React.useState(typeof window !== "undefined" ? window.innerWidth < 768 : false);
24129
24396
  const tenantId = Digit.ULBService.getCurrentTenantId();
24130
24397
  const {
@@ -24134,9 +24401,10 @@ const ApplicationDetails$1 = () => {
24134
24401
  const [appDetailsToShow, setAppDetailsToShow] = useState({});
24135
24402
  const [showEditModal, setShowEditModal] = useState(false);
24136
24403
  const [BusinessService, setBusinessService] = useState("watertanker");
24404
+ const isFixedPoint = location.pathname.includes("/fixed-point/");
24137
24405
  const isWaterTanker = bookingNo === null || bookingNo === void 0 ? void 0 : bookingNo.startsWith("WT");
24138
24406
  const isTreePruning = bookingNo === null || bookingNo === void 0 ? void 0 : bookingNo.startsWith("TP");
24139
- const businessService = isWaterTanker ? "watertanker" : isTreePruning ? "treePruning" : "mobileToilet";
24407
+ const businessService = isFixedPoint ? "watertanker-fixedpoint" : isWaterTanker ? "watertanker" : isTreePruning ? "treePruning" : "mobileToilet";
24140
24408
  const user = Digit.UserService.getUser().info;
24141
24409
  const storageKey = isWaterTanker ? "wt" : isTreePruning ? "tp" : "mt";
24142
24410
  sessionStorage.setItem(storageKey, bookingNo);
@@ -24164,7 +24432,42 @@ const ApplicationDetails$1 = () => {
24164
24432
  };
24165
24433
  useEffect(() => {
24166
24434
  if (applicationDetails) {
24167
- setAppDetailsToShow(lodash.cloneDeep(applicationDetails));
24435
+ var _details$applicationD, _details$applicationD2, _details$applicationD3, _details$applicationD4;
24436
+ let details = lodash.cloneDeep(applicationDetails);
24437
+ const bookingStatus = details === null || details === void 0 ? void 0 : (_details$applicationD = details.applicationData) === null || _details$applicationD === void 0 ? void 0 : (_details$applicationD2 = _details$applicationD.applicationData) === null || _details$applicationD2 === void 0 ? void 0 : _details$applicationD2.bookingStatus;
24438
+ const isDelivered = bookingStatus === "DELIVERED" || bookingStatus === "TANKER_DELIVERED";
24439
+ if ((details === null || details === void 0 ? void 0 : (_details$applicationD3 = details.applicationDetails) === null || _details$applicationD3 === void 0 ? void 0 : _details$applicationD3.length) > 0 && !isDelivered) {
24440
+ details.applicationDetails[0].Component = () => /*#__PURE__*/React.createElement("div", {
24441
+ onClick: () => setShowEditModal(true),
24442
+ style: {
24443
+ float: "right",
24444
+ display: "flex",
24445
+ alignItems: "center",
24446
+ cursor: "pointer",
24447
+ color: "#f47738",
24448
+ gap: "8px",
24449
+ padding: "4px 12px",
24450
+ backgroundColor: "#fff",
24451
+ borderRadius: "4px",
24452
+ border: "1px solid #f47738",
24453
+ transition: "all 0.2s ease"
24454
+ }
24455
+ }, /*#__PURE__*/React.createElement(EditIcon, {
24456
+ style: {
24457
+ fill: "#f47738",
24458
+ width: "16px",
24459
+ height: "16px"
24460
+ }
24461
+ }), /*#__PURE__*/React.createElement("span", {
24462
+ style: {
24463
+ fontWeight: "600",
24464
+ fontSize: "14px"
24465
+ }
24466
+ }, t("WT_EDIT_FIELDS")));
24467
+ } else if ((details === null || details === void 0 ? void 0 : (_details$applicationD4 = details.applicationDetails) === null || _details$applicationD4 === void 0 ? void 0 : _details$applicationD4.length) > 0) {
24468
+ delete details.applicationDetails[0].Component;
24469
+ }
24470
+ setAppDetailsToShow(details);
24168
24471
  }
24169
24472
  }, [applicationDetails]);
24170
24473
  useEffect(() => {
@@ -24174,64 +24477,11 @@ const ApplicationDetails$1 = () => {
24174
24477
  setBusinessService(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data5 = workflowDetails.data) === null || _workflowDetails$data5 === void 0 ? void 0 : _workflowDetails$data5.applicationBusinessService);
24175
24478
  }
24176
24479
  }, [workflowDetails.data]);
24177
- return /*#__PURE__*/React.createElement("div", {
24178
- className: "employee-form-content-with-action-bar",
24179
- style: {
24180
- padding: (user === null || user === void 0 ? void 0 : user.type) === "CITIZEN" ? "0 15px" : "",
24181
- height: "100%"
24182
- }
24183
- }, /*#__PURE__*/React.createElement("div", {
24184
- className: "employee-application-details",
24185
- style: {
24186
- marginBottom: "20px",
24187
- display: "flex",
24188
- justifyContent: "space-between",
24189
- alignItems: "center",
24190
- flexWrap: "wrap",
24191
- gap: "16px"
24192
- }
24193
- }, /*#__PURE__*/React.createElement(Header, {
24194
- styles: {
24195
- margin: "0px",
24196
- fontSize: "32px"
24197
- }
24198
- }, t("BOOKING_DETAILS")), /*#__PURE__*/React.createElement("div", {
24199
- onClick: () => setShowEditModal(true),
24200
- style: {
24201
- display: "flex",
24202
- alignItems: "center",
24203
- cursor: "pointer",
24204
- color: "#f47738",
24205
- gap: "8px",
24206
- padding: "8px 16px",
24207
- backgroundColor: "#fff",
24208
- borderRadius: "4px",
24209
- border: "1px solid #f47738",
24210
- transition: "all 0.2s ease"
24211
- }
24212
- }, /*#__PURE__*/React.createElement(EditIcon, {
24213
- style: {
24214
- fill: "#f47738",
24215
- width: "20px",
24216
- height: "20px"
24217
- }
24218
- }), /*#__PURE__*/React.createElement("span", {
24219
- style: {
24220
- fontWeight: "600",
24221
- fontSize: "16px"
24222
- }
24223
- }, t("WT_EDIT_FIELDS")))), showEditModal && /*#__PURE__*/React.createElement(WTEditApplicationModal, {
24480
+ return /*#__PURE__*/React.createElement(React.Fragment, null, showEditModal && /*#__PURE__*/React.createElement(WTEditApplicationModal, {
24224
24481
  t: t,
24225
24482
  applicationData: appDetailsToShow === null || appDetailsToShow === void 0 ? void 0 : (_appDetailsToShow$app = appDetailsToShow.applicationData) === null || _appDetailsToShow$app === void 0 ? void 0 : _appDetailsToShow$app.applicationData,
24226
24483
  closeModal: () => setShowEditModal(false)
24227
24484
  }), /*#__PURE__*/React.createElement("div", {
24228
- style: {
24229
- display: "flex",
24230
- flexWrap: "wrap",
24231
- gap: "24px",
24232
- height: "100%"
24233
- }
24234
- }, /*#__PURE__*/React.createElement("div", {
24235
24485
  className: `workflow-timeline-wrapper ${hideTimeline ? "hide-workflow" : ""}`,
24236
24486
  style: {
24237
24487
  flex: "1 1 300px",
@@ -24256,7 +24506,7 @@ const ApplicationDetails$1 = () => {
24256
24506
  mutate: mutate,
24257
24507
  workflowDetails: workflowDetails,
24258
24508
  businessService: businessService,
24259
- moduleCode: "request-service",
24509
+ moduleCode: isFixedPoint ? "request-service.water_tanker" : "request-service",
24260
24510
  showToast: showToast,
24261
24511
  setShowToast: setShowToast,
24262
24512
  closeToast: closeToast,
@@ -24268,7 +24518,7 @@ const ApplicationDetails$1 = () => {
24268
24518
  fontSize: "18px"
24269
24519
  },
24270
24520
  showTimeLine: false
24271
- }))));
24521
+ })));
24272
24522
  };
24273
24523
  var ApplicationDetails$2 = React.memo(ApplicationDetails$1);
24274
24524
 
@@ -25789,9 +26039,12 @@ const EmergencyFixedPointRequestDetails = ({
25789
26039
  });
25790
26040
  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) || "");
25791
26041
  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) || "");
25792
- 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) || "");
26042
+ 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]);
25793
26043
  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) || "");
25794
- 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) || "");
26044
+ 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", {
26045
+ hour: "2-digit",
26046
+ minute: "2-digit"
26047
+ }));
25795
26048
  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);
25796
26049
  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);
25797
26050
  const [file, setFile] = useState(null);
@@ -25878,15 +26131,12 @@ const EmergencyFixedPointRequestDetails = ({
25878
26131
  value: `${data.value}`
25879
26132
  });
25880
26133
  });
25881
- const VehicleDetails = Vehicle.map(data => {
25882
- if (tankerType.code === data.vehicleType) {
25883
- return {
25884
- i18nKey: data.capacityName,
25885
- code: data.code,
25886
- value: data.capacityName
25887
- };
25888
- }
25889
- }).filter(item => item !== undefined);
26134
+ const VehicleDetails = Vehicle.filter(data => (tankerType === null || tankerType === void 0 ? void 0 : tankerType.code) === data.vehicleType).map(data => ({
26135
+ i18nKey: `${data.capacityName}`,
26136
+ code: `${data.code}`,
26137
+ value: `${data.value}`,
26138
+ capacity: `${data.capacity}`
26139
+ }));
25890
26140
  const TimeInput = () => {
25891
26141
  return /*#__PURE__*/React.createElement("div", {
25892
26142
  className: "flex items-center"
@@ -26027,6 +26277,7 @@ const EmergencyFixedPointRequestDetails = ({
26027
26277
  value: deliveryDate,
26028
26278
  onChange: setDeliveryDate,
26029
26279
  min: new Date().toISOString().split("T")[0],
26280
+ max: new Date().toISOString().split("T")[0],
26030
26281
  rules: {
26031
26282
  required: t("CORE_COMMON_REQUIRED_ERRMSG"),
26032
26283
  validDate: val => /^\d{4}-\d{2}-\d{2}$/.test(val) ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")
@@ -26121,7 +26372,7 @@ const WTEmergencyFixedPointCheckPage = ({
26121
26372
  onSubmit,
26122
26373
  value: _value = {}
26123
26374
  }) => {
26124
- 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;
26375
+ 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;
26125
26376
  const {
26126
26377
  t
26127
26378
  } = useTranslation();
@@ -26131,6 +26382,7 @@ const WTEmergencyFixedPointCheckPage = ({
26131
26382
  const {
26132
26383
  owner,
26133
26384
  requestDetails,
26385
+ dispatchDetails,
26134
26386
  address,
26135
26387
  serviceType,
26136
26388
  toiletRequestDetails,
@@ -26161,7 +26413,7 @@ const WTEmergencyFixedPointCheckPage = ({
26161
26413
  marginBottom: "30px"
26162
26414
  }
26163
26415
  }, /*#__PURE__*/React.createElement(Row, {
26164
- label: t("COMMON_APPLICANT_NAME"),
26416
+ 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"),
26165
26417
  text: `${t(checkForNA(owner === null || owner === void 0 ? void 0 : owner.applicantName))}`,
26166
26418
  actionButton: /*#__PURE__*/React.createElement(ActionButton$1, {
26167
26419
  jumpTo: `${baseUrl}/fp-applicant-details`
@@ -26207,6 +26459,26 @@ const WTEmergencyFixedPointCheckPage = ({
26207
26459
  }), /*#__PURE__*/React.createElement(Row, {
26208
26460
  label: t("STREET_NAME"),
26209
26461
  text: `${t(checkForNA(address === null || address === void 0 ? void 0 : address.streetName))}`
26462
+ })), /*#__PURE__*/React.createElement(CardSubHeader, null, t("WT_DISPATCH_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
26463
+ style: {
26464
+ marginTop: "30px",
26465
+ marginBottom: "30px"
26466
+ }
26467
+ }, /*#__PURE__*/React.createElement(Row, {
26468
+ label: t("WT_FILLING_POINT"),
26469
+ text: `${t(checkForNA(dispatchDetails === null || dispatchDetails === void 0 ? void 0 : (_dispatchDetails$fill = dispatchDetails.fillingPoint) === null || _dispatchDetails$fill === void 0 ? void 0 : _dispatchDetails$fill.name))}`,
26470
+ actionButton: /*#__PURE__*/React.createElement(ActionButton$1, {
26471
+ jumpTo: `${baseUrl}/fp-dispatch-details`
26472
+ })
26473
+ }), /*#__PURE__*/React.createElement(Row, {
26474
+ label: t("WT_VENDOR"),
26475
+ text: `${t(checkForNA(dispatchDetails === null || dispatchDetails === void 0 ? void 0 : (_dispatchDetails$vend = dispatchDetails.vendor) === null || _dispatchDetails$vend === void 0 ? void 0 : _dispatchDetails$vend.name))}`
26476
+ }), /*#__PURE__*/React.createElement(Row, {
26477
+ label: t("WT_VEHICLE"),
26478
+ text: `${t(checkForNA(dispatchDetails === null || dispatchDetails === void 0 ? void 0 : (_dispatchDetails$vehi = dispatchDetails.vehicle) === null || _dispatchDetails$vehi === void 0 ? void 0 : _dispatchDetails$vehi.name))}`
26479
+ }), /*#__PURE__*/React.createElement(Row, {
26480
+ label: t("WT_DRIVER"),
26481
+ text: `${t(checkForNA(dispatchDetails === null || dispatchDetails === void 0 ? void 0 : (_dispatchDetails$driv = dispatchDetails.driver) === null || _dispatchDetails$driv === void 0 ? void 0 : _dispatchDetails$driv.name))}`
26210
26482
  })), isWaterTankerService && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("WT_REQUEST_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
26211
26483
  style: {
26212
26484
  marginTop: "30px",
@@ -26596,7 +26868,7 @@ const fixedPointConfig = [{
26596
26868
  head: "ES_TITILE_OWNER_DETAILS",
26597
26869
  body: [{
26598
26870
  route: "fp-applicant-details",
26599
- component: "ApplicantDetails",
26871
+ component: "EmergencyFixedPointApplicantDetails",
26600
26872
  withoutLabel: true,
26601
26873
  key: "owner",
26602
26874
  type: "component",
@@ -26620,7 +26892,7 @@ const fixedPointConfig = [{
26620
26892
  key: "address",
26621
26893
  type: "component",
26622
26894
  isMandatory: true,
26623
- nextStep: "fp-request-details",
26895
+ nextStep: "fp-dispatch-details",
26624
26896
  texts: {
26625
26897
  submitBarLabel: "COMMON_SAVE_NEXT",
26626
26898
  header: "ES_ADDRESS_DETAILS"
@@ -26630,11 +26902,30 @@ const fixedPointConfig = [{
26630
26902
  actions: "ES_ADDRESS_DETAILS"
26631
26903
  }]
26632
26904
  }]
26905
+ }, {
26906
+ head: "WT_DISPATCH_DETAILS",
26907
+ body: [{
26908
+ route: "fp-dispatch-details",
26909
+ component: "EmergencyFixedPointDispatchDetails",
26910
+ withoutLabel: true,
26911
+ key: "dispatchDetails",
26912
+ type: "component",
26913
+ isMandatory: true,
26914
+ nextStep: "fp-request-details",
26915
+ texts: {
26916
+ submitBarLabel: "COMMON_SAVE_NEXT",
26917
+ header: "WT_DISPATCH_DETAILS"
26918
+ },
26919
+ timeLine: [{
26920
+ currentStep: 3,
26921
+ actions: "WT_DISPATCH_DETAILS"
26922
+ }]
26923
+ }]
26633
26924
  }, {
26634
26925
  head: "FP_REQUEST_DETAILS",
26635
26926
  body: [{
26636
26927
  route: "fp-request-details",
26637
- component: "RequestDetails",
26928
+ component: "EmergencyFixedPointRequestDetails",
26638
26929
  withoutLabel: true,
26639
26930
  key: "requestDetails",
26640
26931
  type: "component",
@@ -26645,7 +26936,7 @@ const fixedPointConfig = [{
26645
26936
  header: "WT_REQUEST_DETAILS"
26646
26937
  },
26647
26938
  timeLine: [{
26648
- currentStep: 3,
26939
+ currentStep: 4,
26649
26940
  actions: "ES_REQUEST_DETAILS"
26650
26941
  }]
26651
26942
  }]
@@ -26721,6 +27012,24 @@ const WTEmergencyFixedPointCreate = () => {
26721
27012
  history.push(`${match.path}/fp-wt-acknowledgement`);
26722
27013
  };
26723
27014
  function handleSelect(key, data, skipStep, index, isAddMultiple = false) {
27015
+ if (key === "multiple") {
27016
+ let newParams = {
27017
+ ...params
27018
+ };
27019
+ Object.keys(data).forEach(k => {
27020
+ if (k !== "navigationKey" && k !== "silent") {
27021
+ newParams[k] = {
27022
+ ...newParams[k],
27023
+ ...data[k]
27024
+ };
27025
+ }
27026
+ });
27027
+ setParams(newParams);
27028
+ if (data.silent) return;
27029
+ const navigationKey = data.navigationKey || Object.keys(data)[0];
27030
+ goNext(skipStep, index, isAddMultiple, navigationKey);
27031
+ return;
27032
+ }
26724
27033
  if (key === "owners") {
26725
27034
  let owners = params.owners || [];
26726
27035
  owners[index] = data;
@@ -26748,7 +27057,7 @@ const WTEmergencyFixedPointCreate = () => {
26748
27057
  clearParams();
26749
27058
  queryClient.invalidateQueries("FP_Create");
26750
27059
  };
26751
- const formStepRoutes = ["fp-applicant-details", "fp-address-details", "fp-request-details"];
27060
+ const formStepRoutes = ["fp-applicant-details", "fp-address-details", "fp-dispatch-details", "fp-request-details"];
26752
27061
  const isFormStep = formStepRoutes.some(route => pathname.includes(route));
26753
27062
  const sectionRefs = useRef({});
26754
27063
  useEffect(() => {
@@ -26843,6 +27152,465 @@ const WTEmergencyFixedPointCreate = () => {
26843
27152
  }))))));
26844
27153
  };
26845
27154
 
27155
+ const EmergencyFixedPointApplicantDetails = ({
27156
+ t,
27157
+ config,
27158
+ onSelect,
27159
+ formData
27160
+ }) => {
27161
+ 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;
27162
+ const user = Digit.UserService.getUser().info;
27163
+ const inputStyles = {
27164
+ width: user.type === "EMPLOYEE" ? "100%" : "86%"
27165
+ };
27166
+ let validation = {};
27167
+ 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) || "");
27168
+ 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) || "");
27169
+ 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) || "");
27170
+ 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) || "");
27171
+ 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) || "");
27172
+ 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) || "");
27173
+ 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) || "");
27174
+ 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) || "");
27175
+ 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) || "");
27176
+ const [autoPopulatedAddress, setAutoPopulatedAddress] = useState(null);
27177
+ const handleFixedPointSelect = selected => {
27178
+ setFixedPoint(selected);
27179
+ if (selected && typeof selected === "object") {
27180
+ const applicant = selected.applicantDetail;
27181
+ if (applicant) {
27182
+ setName(applicant.name || applicantName);
27183
+ setMobileNumber(applicant.mobileNumber || mobileNumber);
27184
+ setAltMobileNumber(applicant.alternateNumber || alternateNumber);
27185
+ setEmail(applicant.emailId || emailId);
27186
+ }
27187
+ const addr = selected.address;
27188
+ if (addr) {
27189
+ const addressData = {
27190
+ houseNo: addr.houseNo || "",
27191
+ streetName: addr.streetName || "",
27192
+ addressLine1: addr.addressLine1 || "",
27193
+ addressLine2: addr.addressLine2 || "",
27194
+ landmark: addr.landmark || "",
27195
+ city: addr.city || "",
27196
+ cityCode: addr.cityCode || "",
27197
+ locality: addr.locality || "",
27198
+ localityCode: addr.localityCode || "",
27199
+ pincode: addr.pincode ? addr.pincode.toString().split(".")[0] : ""
27200
+ };
27201
+ setAutoPopulatedAddress(addressData);
27202
+ onSelect("multiple", {
27203
+ address: addressData,
27204
+ silent: true
27205
+ });
27206
+ }
27207
+ } else {
27208
+ setAutoPopulatedAddress(null);
27209
+ }
27210
+ };
27211
+ 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) || {
27212
+ code: "YES",
27213
+ name: "Yes",
27214
+ i18nKey: "YES"
27215
+ });
27216
+ const existingFixedPointOptions = [{
27217
+ code: "YES",
27218
+ name: "Yes",
27219
+ i18nKey: "YES"
27220
+ }, {
27221
+ code: "NO",
27222
+ name: "No",
27223
+ i18nKey: "NO"
27224
+ }];
27225
+ const handleExistingFixedPointSelect = selected => {
27226
+ setIsExistingFixedPoint(selected);
27227
+ setFixedPoint("");
27228
+ };
27229
+ function setOwnerEmail(e) {
27230
+ setEmail(e.target.value);
27231
+ }
27232
+ function setMobileNo(e) {
27233
+ setMobileNumber(e.target.value);
27234
+ }
27235
+ function setAltMobileNo(e) {
27236
+ setAltMobileNumber(e.target.value);
27237
+ }
27238
+ function setGuardiansName(e) {
27239
+ setGuardian(e.target.value);
27240
+ }
27241
+ function setBirthDate(e) {
27242
+ setDateofBirth(e.target.value);
27243
+ }
27244
+ const tenantId = Digit.ULBService.getCurrentTenantId();
27245
+ const {
27246
+ data: fixedPointsData
27247
+ } = Digit.Hooks.wt.useFixedPointSearchAPI({
27248
+ tenantId,
27249
+ filters: {
27250
+ limit: 1000
27251
+ }
27252
+ }, {
27253
+ enabled: true
27254
+ });
27255
+ const fixedPointOptions = (fixedPointsData === null || fixedPointsData === void 0 ? void 0 : (_fixedPointsData$wate = fixedPointsData.waterTankerBookingDetail) === null || _fixedPointsData$wate === void 0 ? void 0 : _fixedPointsData$wate.map(fp => {
27256
+ var _fp$applicantDetail, _fp$applicantDetail2;
27257
+ return {
27258
+ ...fp,
27259
+ 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"
27260
+ };
27261
+ })) || [];
27262
+ const {
27263
+ data: applicantGender
27264
+ } = Digit.Hooks.useEnabledMDMS(Digit.ULBService.getStateId(), "common-masters", [{
27265
+ name: "GenderType"
27266
+ }], {
27267
+ select: data => {
27268
+ var _data$commonMasters;
27269
+ const formattedData = data === null || data === void 0 ? void 0 : (_data$commonMasters = data["common-masters"]) === null || _data$commonMasters === void 0 ? void 0 : _data$commonMasters["GenderType"];
27270
+ return formattedData;
27271
+ }
27272
+ });
27273
+ let genderOptions = [];
27274
+ applicantGender && applicantGender.map(genderoption => {
27275
+ if (genderoption.code !== "TRANSGENDER") genderOptions.push({
27276
+ i18nKey: `${genderoption.code}`,
27277
+ code: `${genderoption.code}`,
27278
+ name: `${genderoption.code}`
27279
+ });
27280
+ });
27281
+ const GuardianOptions = [{
27282
+ name: "Husband",
27283
+ code: "HUSBAND",
27284
+ i18nKey: "COMMON_HUSBAND"
27285
+ }, {
27286
+ name: "Father",
27287
+ code: "FATHER",
27288
+ i18nKey: "COMMON_FATHER"
27289
+ }];
27290
+ const goNext = () => {
27291
+ let owner = formData.owner;
27292
+ let finalApplicantName = "";
27293
+ if ((isExistingFixedPoint === null || isExistingFixedPoint === void 0 ? void 0 : isExistingFixedPoint.code) === "YES") {
27294
+ var _fixedPoint$applicant;
27295
+ finalApplicantName = (fixedPoint === null || fixedPoint === void 0 ? void 0 : (_fixedPoint$applicant = fixedPoint.applicantDetail) === null || _fixedPoint$applicant === void 0 ? void 0 : _fixedPoint$applicant.name) || (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.name) || "";
27296
+ } else {
27297
+ finalApplicantName = typeof fixedPoint === "string" ? fixedPoint : (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.name) || "";
27298
+ }
27299
+ let applicantDetails = {
27300
+ ...owner,
27301
+ applicantName: finalApplicantName,
27302
+ mobileNumber,
27303
+ gender,
27304
+ dateOfBirth,
27305
+ alternateNumber,
27306
+ relationShipType,
27307
+ guardianName,
27308
+ emailId,
27309
+ fixedPoint,
27310
+ isExistingFixedPoint
27311
+ };
27312
+ if (autoPopulatedAddress) {
27313
+ onSelect("multiple", {
27314
+ owner: applicantDetails,
27315
+ address: autoPopulatedAddress,
27316
+ navigationKey: config.key
27317
+ });
27318
+ } else {
27319
+ onSelect(config.key, applicantDetails, false);
27320
+ }
27321
+ };
27322
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
27323
+ config: config,
27324
+ onSelect: goNext,
27325
+ t: t,
27326
+ 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,
27327
+ className: "search-form-wrapper"
27328
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
27329
+ className: "form-field wns-search-field"
27330
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_EXISTING_FIXED_POINT", "Existing Fixed Point/Delivery Point?")}`, " ", /*#__PURE__*/React.createElement("span", {
27331
+ className: "astericColor"
27332
+ }, "*")), /*#__PURE__*/React.createElement(RadioButtons, {
27333
+ t: t,
27334
+ options: existingFixedPointOptions,
27335
+ optionsKey: "i18nKey",
27336
+ name: "isExistingFixedPoint",
27337
+ value: isExistingFixedPoint,
27338
+ selectedOption: isExistingFixedPoint,
27339
+ onSelect: handleExistingFixedPointSelect,
27340
+ style: {
27341
+ display: "flex",
27342
+ gap: "30px",
27343
+ marginBottom: "0px"
27344
+ },
27345
+ innerStyles: {
27346
+ minWidth: "24%",
27347
+ marginBottom: "0px"
27348
+ }
27349
+ })), /*#__PURE__*/React.createElement("div", {
27350
+ className: "form-field wns-search-field"
27351
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Fixed Point/Delivery Point")}`), (isExistingFixedPoint === null || isExistingFixedPoint === void 0 ? void 0 : isExistingFixedPoint.code) === "YES" ? /*#__PURE__*/React.createElement(Dropdown, {
27352
+ className: "form-field",
27353
+ selected: fixedPoint,
27354
+ option: fixedPointOptions,
27355
+ select: handleFixedPointSelect,
27356
+ optionKey: "name",
27357
+ t: t,
27358
+ name: "fixedPoint",
27359
+ placeholder: t("WT_SELECT_FIXED_POINT", "Select Fixed Point")
27360
+ }) : /*#__PURE__*/React.createElement(TextInput, {
27361
+ t: t,
27362
+ type: "text",
27363
+ isMandatory: false,
27364
+ name: "fixedPointText",
27365
+ value: typeof fixedPoint === "string" ? fixedPoint : (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.name) || "",
27366
+ onChange: e => setFixedPoint(e.target.value),
27367
+ style: inputStyles,
27368
+ placeholder: t("WT_ENTER_FIXED_POINT", "Enter Fixed Point")
27369
+ })), config !== null && config !== void 0 && (_config$additionaFiel4 = config.additionaFields) !== null && _config$additionaFiel4 !== void 0 && _config$additionaFiel4.gender ? /*#__PURE__*/React.createElement("div", {
27370
+ className: "form-field wns-search-field"
27371
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_GENDER")}`, " ", /*#__PURE__*/React.createElement("span", {
27372
+ className: "astericColor"
27373
+ }, "*")), /*#__PURE__*/React.createElement(RadioButtons, {
27374
+ t: t,
27375
+ options: genderOptions,
27376
+ style: {
27377
+ display: "flex",
27378
+ flexWrap: "wrap",
27379
+ maxHeight: "30px"
27380
+ },
27381
+ innerStyles: {
27382
+ minWidth: "24%"
27383
+ },
27384
+ optionsKey: "i18nKey",
27385
+ name: `gender`,
27386
+ value: gender,
27387
+ selectedOption: gender,
27388
+ onSelect: setGender,
27389
+ labelKey: "i18nKey",
27390
+ isPTFlow: true
27391
+ })) : null, /*#__PURE__*/React.createElement("div", {
27392
+ className: "form-field wns-search-field"
27393
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_MOBILE_NUMBER")}`, " ", /*#__PURE__*/React.createElement("span", {
27394
+ className: "astericColor"
27395
+ }, "*")), /*#__PURE__*/React.createElement(MobileNumber, Object.assign({
27396
+ value: mobileNumber,
27397
+ name: "mobileNumber",
27398
+ onChange: value => setMobileNo({
27399
+ target: {
27400
+ value
27401
+ }
27402
+ })
27403
+ }, {
27404
+ required: true,
27405
+ pattern: "[6-9]{1}[0-9]{9}",
27406
+ type: "tel",
27407
+ title: t("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")
27408
+ }))), /*#__PURE__*/React.createElement("div", {
27409
+ className: "form-field wns-search-field"
27410
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_ALT_MOBILE_NUMBER")}`), /*#__PURE__*/React.createElement(MobileNumber, Object.assign({
27411
+ value: alternateNumber,
27412
+ name: "alternateNumber",
27413
+ onChange: value => setAltMobileNo({
27414
+ target: {
27415
+ value
27416
+ }
27417
+ })
27418
+ }, {
27419
+ required: false,
27420
+ pattern: "[6-9]{1}[0-9]{9}",
27421
+ type: "tel",
27422
+ title: t("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")
27423
+ }))), config !== null && config !== void 0 && (_config$additionaFiel5 = config.additionaFields) !== null && _config$additionaFiel5 !== void 0 && _config$additionaFiel5.dateofBirth ? /*#__PURE__*/React.createElement("div", {
27424
+ className: "form-field wns-search-field"
27425
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_BIRTH_DATE")}`, " ", /*#__PURE__*/React.createElement("span", {
27426
+ className: "astericColor"
27427
+ }, "*")), /*#__PURE__*/React.createElement(TextInput, {
27428
+ t: t,
27429
+ type: "date",
27430
+ isMandatory: false,
27431
+ optionKey: "i18nKey",
27432
+ name: "dateOfBirth",
27433
+ value: dateOfBirth,
27434
+ onChange: setBirthDate,
27435
+ style: inputStyles,
27436
+ max: new Date().toISOString().split("T")[0],
27437
+ rules: {
27438
+ required: t("CORE_COMMON_REQUIRED_ERRMSG"),
27439
+ validDate: val => /^\d{4}-\d{2}-\d{2}$/.test(val) ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")
27440
+ }
27441
+ })) : null, config !== null && config !== void 0 && (_config$additionaFiel6 = config.additionaFields) !== null && _config$additionaFiel6 !== void 0 && _config$additionaFiel6.guardianName ? /*#__PURE__*/React.createElement("div", {
27442
+ className: "form-field wns-search-field"
27443
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_GUARDIAN")}`, " ", /*#__PURE__*/React.createElement("span", {
27444
+ className: "astericColor"
27445
+ }, "*")), /*#__PURE__*/React.createElement(TextInput, Object.assign({
27446
+ t: t,
27447
+ type: "text",
27448
+ isMandatory: false,
27449
+ optionKey: "i18nKey",
27450
+ name: "guardianName",
27451
+ style: inputStyles,
27452
+ value: guardianName,
27453
+ onChange: setGuardiansName,
27454
+ ValidationRequired: true
27455
+ }, validation = {
27456
+ isRequired: true,
27457
+ pattern: "^[a-zA-Z ]+$",
27458
+ type: "tel",
27459
+ title: t("PT_NAME_ERROR_MESSAGE")
27460
+ }))) : null, config !== null && config !== void 0 && (_config$additionaFiel7 = config.additionaFields) !== null && _config$additionaFiel7 !== void 0 && _config$additionaFiel7.guardianName ? /*#__PURE__*/React.createElement("div", {
27461
+ className: "form-field wns-search-field"
27462
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_RELATIONTYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
27463
+ className: "astericColor"
27464
+ }, "*")), /*#__PURE__*/React.createElement(Dropdown, {
27465
+ className: "form-field",
27466
+ selected: relationShipType,
27467
+ option: GuardianOptions,
27468
+ select: setRelationShipType,
27469
+ optionKey: "i18nKey",
27470
+ t: t,
27471
+ name: "relationShipType",
27472
+ placeholder: "Select"
27473
+ })) : null, /*#__PURE__*/React.createElement("div", {
27474
+ className: "form-field wns-search-field"
27475
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_EMAIL_ID")}`), /*#__PURE__*/React.createElement(TextInput, Object.assign({
27476
+ t: t,
27477
+ type: "email",
27478
+ optionKey: "i18nKey",
27479
+ name: "emailId",
27480
+ value: emailId,
27481
+ style: inputStyles,
27482
+ onChange: setOwnerEmail,
27483
+ ValidationRequired: true
27484
+ }, validation = {
27485
+ isRequired: true,
27486
+ pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z]+\\.[a-zA-Z]{3,4}$",
27487
+ type: "email",
27488
+ title: t("PT_NAME_ERROR_MESSAGE")
27489
+ }))))));
27490
+ };
27491
+
27492
+ const EmergencyFixedPointDispatchDetails = ({
27493
+ t,
27494
+ config,
27495
+ onSelect,
27496
+ formData
27497
+ }) => {
27498
+ var _formData$dispatchDet, _formData$dispatchDet2, _formData$dispatchDet3, _formData$dispatchDet4, _fillingPointsData$fi, _vendorData$vendor;
27499
+ const tenantId = Digit.ULBService.getCurrentTenantId();
27500
+ 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) || "");
27501
+ 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) || "");
27502
+ 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) || "");
27503
+ 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) || "");
27504
+ const {
27505
+ data: fillingPointsData
27506
+ } = Digit.Hooks.wt.useFillPointSearch({
27507
+ tenantId,
27508
+ filters: {
27509
+ limit: 1000
27510
+ }
27511
+ }, {
27512
+ enabled: true
27513
+ });
27514
+ const fillingPointOptions = (fillingPointsData === null || fillingPointsData === void 0 ? void 0 : (_fillingPointsData$fi = fillingPointsData.fillingPoints) === null || _fillingPointsData$fi === void 0 ? void 0 : _fillingPointsData$fi.map(fp => ({
27515
+ ...fp,
27516
+ name: (fp === null || fp === void 0 ? void 0 : fp.fillingPointName) || "NA"
27517
+ }))) || [];
27518
+ const {
27519
+ data: vendorData
27520
+ } = Digit.Hooks.fsm.useVendorSearch({
27521
+ tenantId,
27522
+ filters: {
27523
+ ...(fillingPoint !== null && fillingPoint !== void 0 && fillingPoint.fillingPointId ? {
27524
+ fillingPointId: fillingPoint.id
27525
+ } : {})
27526
+ },
27527
+ config: {
27528
+ enabled: true
27529
+ }
27530
+ });
27531
+ const vendorOptions = (vendorData === null || vendorData === void 0 ? void 0 : (_vendorData$vendor = vendorData.vendor) === null || _vendorData$vendor === void 0 ? void 0 : _vendorData$vendor.map(v => ({
27532
+ ...v,
27533
+ name: (v === null || v === void 0 ? void 0 : v.name) || (v === null || v === void 0 ? void 0 : v.vendor_id) || "NA"
27534
+ }))) || [];
27535
+ let vehicleOptions = [];
27536
+ let driverOptions = [];
27537
+ if (vendor && typeof vendor === "object") {
27538
+ var _vendor$vehicles, _vendor$drivers;
27539
+ vehicleOptions = ((_vendor$vehicles = vendor.vehicles) === null || _vendor$vehicles === void 0 ? void 0 : _vendor$vehicles.map(veh => ({
27540
+ ...veh,
27541
+ name: (veh === null || veh === void 0 ? void 0 : veh.registrationNumber) || (veh === null || veh === void 0 ? void 0 : veh.type) || "NA"
27542
+ }))) || [];
27543
+ driverOptions = ((_vendor$drivers = vendor.drivers) === null || _vendor$drivers === void 0 ? void 0 : _vendor$drivers.map(drv => ({
27544
+ ...drv,
27545
+ name: (drv === null || drv === void 0 ? void 0 : drv.name) || (drv === null || drv === void 0 ? void 0 : drv.licenseNumber) || "NA"
27546
+ }))) || [];
27547
+ }
27548
+ const handleVendorSelect = selected => {
27549
+ setVendor(selected);
27550
+ setVehicle("");
27551
+ setDriver("");
27552
+ };
27553
+ const goNext = () => {
27554
+ onSelect(config.key, {
27555
+ fillingPoint,
27556
+ vendor,
27557
+ vehicle,
27558
+ driver
27559
+ }, false);
27560
+ };
27561
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
27562
+ config: config,
27563
+ onSelect: goNext,
27564
+ t: t,
27565
+ isDisabled: !fillingPoint || !vendor || !vehicle || !driver,
27566
+ className: "search-form-wrapper"
27567
+ }, /*#__PURE__*/React.createElement("div", {
27568
+ className: "form-field wns-search-field"
27569
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_FILLING_POINT", "Filling Point")}`), /*#__PURE__*/React.createElement(Dropdown, {
27570
+ className: "form-field",
27571
+ selected: fillingPoint,
27572
+ option: fillingPointOptions,
27573
+ select: setFillingPoint,
27574
+ optionKey: "name",
27575
+ t: t,
27576
+ name: "fillingPoint",
27577
+ placeholder: t("WT_SELECT_FILLING_POINT", "Select Filling Point")
27578
+ })), /*#__PURE__*/React.createElement("div", {
27579
+ className: "form-field wns-search-field"
27580
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_VENDOR", "Vendor")}`), /*#__PURE__*/React.createElement(Dropdown, {
27581
+ className: "form-field",
27582
+ selected: vendor,
27583
+ option: vendorOptions,
27584
+ select: handleVendorSelect,
27585
+ optionKey: "name",
27586
+ t: t,
27587
+ name: "vendor",
27588
+ placeholder: t("WT_SELECT_VENDOR", "Select Vendor")
27589
+ })), /*#__PURE__*/React.createElement("div", {
27590
+ className: "form-field wns-search-field"
27591
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_VEHICLE", "Vehicle")}`), /*#__PURE__*/React.createElement(Dropdown, {
27592
+ className: "form-field",
27593
+ selected: vehicle,
27594
+ option: vehicleOptions,
27595
+ select: setVehicle,
27596
+ optionKey: "name",
27597
+ t: t,
27598
+ name: "vehicle",
27599
+ placeholder: t("WT_SELECT_VEHICLE", "Select Vehicle")
27600
+ })), /*#__PURE__*/React.createElement("div", {
27601
+ className: "form-field wns-search-field"
27602
+ }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_DRIVER", "Driver")}`), /*#__PURE__*/React.createElement(Dropdown, {
27603
+ className: "form-field",
27604
+ selected: driver,
27605
+ option: driverOptions,
27606
+ select: setDriver,
27607
+ optionKey: "name",
27608
+ t: t,
27609
+ name: "driver",
27610
+ placeholder: t("WT_SELECT_DRIVER", "Select Driver")
27611
+ }))));
27612
+ };
27613
+
26846
27614
  const WTModule = ({
26847
27615
  stateCode,
26848
27616
  userType,
@@ -26951,7 +27719,9 @@ const componentsToRegister = {
26951
27719
  WTEmergencyFixedPointAcknowledgement,
26952
27720
  MTEmergencyFixedPointAcknowledgement,
26953
27721
  EmergencyFixedPointTPAcknowledgement,
26954
- WTEmergencyFixedPointCreate
27722
+ WTEmergencyFixedPointCreate,
27723
+ EmergencyFixedPointApplicantDetails,
27724
+ EmergencyFixedPointDispatchDetails
26955
27725
  };
26956
27726
  const initWTComponents = () => {
26957
27727
  Object.entries(componentsToRegister).forEach(([key, value]) => {