@djb25/digit-ui-module-wt 1.0.39 → 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
 
@@ -16210,7 +16262,7 @@ const WTEditApplicationModal = ({
16210
16262
  const [formData, setFormData] = useState({});
16211
16263
  useEffect(() => {
16212
16264
  if (applicationData) {
16213
- 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;
16214
16266
  setFormData({
16215
16267
  name: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$appl = applicationData.applicantDetail) === null || _applicationData$appl === void 0 ? void 0 : _applicationData$appl.name) || "",
16216
16268
  mobileNumber: (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$appl2 = applicationData.applicantDetail) === null || _applicationData$appl2 === void 0 ? void 0 : _applicationData$appl2.mobileNumber) || "",
@@ -16228,7 +16280,16 @@ const WTEditApplicationModal = ({
16228
16280
  waterQuantity: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.waterQuantity) || "",
16229
16281
  description: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.description) || "",
16230
16282
  deliveryDate: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.deliveryDate) || "",
16231
- 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) || ""
16232
16293
  });
16233
16294
  }
16234
16295
  }, [applicationData]);
@@ -16305,6 +16366,42 @@ const WTEditApplicationModal = ({
16305
16366
  key: "description",
16306
16367
  fullWidth: true
16307
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
+ }]
16308
16405
  }];
16309
16406
  return /*#__PURE__*/React.createElement(Modal, {
16310
16407
  headerBarMain: /*#__PURE__*/React.createElement("h1", {
@@ -24164,7 +24261,38 @@ const ApplicationDetails$1 = () => {
24164
24261
  };
24165
24262
  useEffect(() => {
24166
24263
  if (applicationDetails) {
24167
- 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);
24168
24296
  }
24169
24297
  }, [applicationDetails]);
24170
24298
  useEffect(() => {
@@ -24195,32 +24323,7 @@ const ApplicationDetails$1 = () => {
24195
24323
  margin: "0px",
24196
24324
  fontSize: "32px"
24197
24325
  }
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, {
24326
+ }, t("BOOKING_DETAILS"))), showEditModal && /*#__PURE__*/React.createElement(WTEditApplicationModal, {
24224
24327
  t: t,
24225
24328
  applicationData: appDetailsToShow === null || appDetailsToShow === void 0 ? void 0 : (_appDetailsToShow$app = appDetailsToShow.applicationData) === null || _appDetailsToShow$app === void 0 ? void 0 : _appDetailsToShow$app.applicationData,
24226
24329
  closeModal: () => setShowEditModal(false)
@@ -25789,9 +25892,12 @@ const EmergencyFixedPointRequestDetails = ({
25789
25892
  });
25790
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) || "");
25791
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) || "");
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) || "");
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]);
25793
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) || "");
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) || "");
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
+ }));
25795
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);
25796
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);
25797
25903
  const [file, setFile] = useState(null);
@@ -25878,15 +25984,12 @@ const EmergencyFixedPointRequestDetails = ({
25878
25984
  value: `${data.value}`
25879
25985
  });
25880
25986
  });
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);
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
+ }));
25890
25993
  const TimeInput = () => {
25891
25994
  return /*#__PURE__*/React.createElement("div", {
25892
25995
  className: "flex items-center"
@@ -26121,7 +26224,7 @@ const WTEmergencyFixedPointCheckPage = ({
26121
26224
  onSubmit,
26122
26225
  value: _value = {}
26123
26226
  }) => {
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;
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;
26125
26228
  const {
26126
26229
  t
26127
26230
  } = useTranslation();
@@ -26131,6 +26234,7 @@ const WTEmergencyFixedPointCheckPage = ({
26131
26234
  const {
26132
26235
  owner,
26133
26236
  requestDetails,
26237
+ dispatchDetails,
26134
26238
  address,
26135
26239
  serviceType,
26136
26240
  toiletRequestDetails,
@@ -26161,7 +26265,7 @@ const WTEmergencyFixedPointCheckPage = ({
26161
26265
  marginBottom: "30px"
26162
26266
  }
26163
26267
  }, /*#__PURE__*/React.createElement(Row, {
26164
- 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"),
26165
26269
  text: `${t(checkForNA(owner === null || owner === void 0 ? void 0 : owner.applicantName))}`,
26166
26270
  actionButton: /*#__PURE__*/React.createElement(ActionButton$1, {
26167
26271
  jumpTo: `${baseUrl}/fp-applicant-details`
@@ -26207,6 +26311,26 @@ const WTEmergencyFixedPointCheckPage = ({
26207
26311
  }), /*#__PURE__*/React.createElement(Row, {
26208
26312
  label: t("STREET_NAME"),
26209
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))}`
26210
26334
  })), isWaterTankerService && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("WT_REQUEST_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
26211
26335
  style: {
26212
26336
  marginTop: "30px",
@@ -26596,7 +26720,7 @@ const fixedPointConfig = [{
26596
26720
  head: "ES_TITILE_OWNER_DETAILS",
26597
26721
  body: [{
26598
26722
  route: "fp-applicant-details",
26599
- component: "ApplicantDetails",
26723
+ component: "EmergencyFixedPointApplicantDetails",
26600
26724
  withoutLabel: true,
26601
26725
  key: "owner",
26602
26726
  type: "component",
@@ -26620,7 +26744,7 @@ const fixedPointConfig = [{
26620
26744
  key: "address",
26621
26745
  type: "component",
26622
26746
  isMandatory: true,
26623
- nextStep: "fp-request-details",
26747
+ nextStep: "fp-dispatch-details",
26624
26748
  texts: {
26625
26749
  submitBarLabel: "COMMON_SAVE_NEXT",
26626
26750
  header: "ES_ADDRESS_DETAILS"
@@ -26630,11 +26754,30 @@ const fixedPointConfig = [{
26630
26754
  actions: "ES_ADDRESS_DETAILS"
26631
26755
  }]
26632
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
+ }]
26633
26776
  }, {
26634
26777
  head: "FP_REQUEST_DETAILS",
26635
26778
  body: [{
26636
26779
  route: "fp-request-details",
26637
- component: "RequestDetails",
26780
+ component: "EmergencyFixedPointRequestDetails",
26638
26781
  withoutLabel: true,
26639
26782
  key: "requestDetails",
26640
26783
  type: "component",
@@ -26645,7 +26788,7 @@ const fixedPointConfig = [{
26645
26788
  header: "WT_REQUEST_DETAILS"
26646
26789
  },
26647
26790
  timeLine: [{
26648
- currentStep: 3,
26791
+ currentStep: 4,
26649
26792
  actions: "ES_REQUEST_DETAILS"
26650
26793
  }]
26651
26794
  }]
@@ -26721,6 +26864,24 @@ const WTEmergencyFixedPointCreate = () => {
26721
26864
  history.push(`${match.path}/fp-wt-acknowledgement`);
26722
26865
  };
26723
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
+ }
26724
26885
  if (key === "owners") {
26725
26886
  let owners = params.owners || [];
26726
26887
  owners[index] = data;
@@ -26748,7 +26909,7 @@ const WTEmergencyFixedPointCreate = () => {
26748
26909
  clearParams();
26749
26910
  queryClient.invalidateQueries("FP_Create");
26750
26911
  };
26751
- 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"];
26752
26913
  const isFormStep = formStepRoutes.some(route => pathname.includes(route));
26753
26914
  const sectionRefs = useRef({});
26754
26915
  useEffect(() => {
@@ -26843,6 +27004,465 @@ const WTEmergencyFixedPointCreate = () => {
26843
27004
  }))))));
26844
27005
  };
26845
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
+
26846
27466
  const WTModule = ({
26847
27467
  stateCode,
26848
27468
  userType,
@@ -26951,7 +27571,9 @@ const componentsToRegister = {
26951
27571
  WTEmergencyFixedPointAcknowledgement,
26952
27572
  MTEmergencyFixedPointAcknowledgement,
26953
27573
  EmergencyFixedPointTPAcknowledgement,
26954
- WTEmergencyFixedPointCreate
27574
+ WTEmergencyFixedPointCreate,
27575
+ EmergencyFixedPointApplicantDetails,
27576
+ EmergencyFixedPointDispatchDetails
26955
27577
  };
26956
27578
  const initWTComponents = () => {
26957
27579
  Object.entries(componentsToRegister).forEach(([key, value]) => {