@mseva/digit-ui-module-ptr 1.3.4-UAT.10 → 1.3.4-UAT.12

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.
@@ -7684,9 +7684,18 @@ const PTRCitizenPet = ({
7684
7684
  return gt.name === (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$3 = apiDataCheck[0]) === null || _apiDataCheck$3 === void 0 ? void 0 : (_apiDataCheck$3$petDe = _apiDataCheck$3.petDetails) === null || _apiDataCheck$3$petDe === void 0 ? void 0 : _apiDataCheck$3$petDe.petGender);
7685
7685
  })) || null;
7686
7686
  const pathParts = window.location.pathname.split("/");
7687
- const id = pathParts[pathParts.length - 1];
7688
- const checkNumber = pathParts[pathParts.length - 2];
7689
- const checkForRenew = id == "renew-application";
7687
+ const startIndex = pathParts.findIndex(part => part === "new-application");
7688
+ let id = null;
7689
+ if (startIndex !== -1) {
7690
+ const nextPart = pathParts[startIndex + 1];
7691
+ if (nextPart !== null && nextPart !== void 0 && nextPart.startsWith("PB-PTR-")) {
7692
+ id = nextPart;
7693
+ } else if (nextPart === "PL") {
7694
+ id = pathParts.slice(startIndex + 1, startIndex + 5).join("/");
7695
+ }
7696
+ }
7697
+ id = id ? decodeURIComponent(id) : null;
7698
+ const checkForRenew = window.location.pathname.includes("renew-application");
7690
7699
  const today = new Date();
7691
7700
  const todayStr = today.toISOString().split("T")[0];
7692
7701
  const minVaccineDate = new Date();
@@ -7712,7 +7721,7 @@ const PTRCitizenPet = ({
7712
7721
  return new Date(dateStr).getTime();
7713
7722
  }
7714
7723
  const onSubmit = async data => {
7715
- var _currentStepData$Crea, _currentStepData$appl, _data$petType, _data$breedType, _data$petGender, _currentStepData$resp;
7724
+ var _currentStepData$Crea, _currentStepData$appl, _data$petType, _data$breedType, _data$petGender, _currentStepData$owne, _currentStepData$resp;
7716
7725
  if (validateStep) {
7717
7726
  const validationErrors = validateStep(data);
7718
7727
  if (Object.keys(validationErrors).length > 0) return;
@@ -7750,9 +7759,9 @@ const PTRCitizenPet = ({
7750
7759
  },
7751
7760
  address: {
7752
7761
  pincode,
7753
- addressId: currentStepData.ownerDetails.address
7762
+ addressLine1: currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.address
7754
7763
  },
7755
- previousApplicationNumber: checkNumber ? checkNumber : null,
7764
+ previousApplicationNumber: id ? id : null,
7756
7765
  applicationType: checkForRenew ? "RENEWAPPLICATION" : "NEWAPPLICATION",
7757
7766
  ownerName: name,
7758
7767
  fatherName: filteredOwnerDetails === null || filteredOwnerDetails === void 0 ? void 0 : filteredOwnerDetails.fatherOrHusbandName,
@@ -7779,7 +7788,7 @@ const PTRCitizenPet = ({
7779
7788
  address: {
7780
7789
  ...existing.address,
7781
7790
  pincode: pick(pincode, (_existing$address = existing.address) === null || _existing$address === void 0 ? void 0 : _existing$address.pincode),
7782
- addressId: pick(currentStepData.ownerDetails.address, (_existing$address2 = existing.address) === null || _existing$address2 === void 0 ? void 0 : _existing$address2.addressId),
7791
+ addressLine1: pick(currentStepData.ownerDetails.address, (_existing$address2 = existing.address) === null || _existing$address2 === void 0 ? void 0 : _existing$address2.addressLine1),
7783
7792
  tenantId
7784
7793
  },
7785
7794
  petDetails: {
@@ -7910,7 +7919,7 @@ const PTRCitizenPet = ({
7910
7919
  totalYears: years + months / 12
7911
7920
  };
7912
7921
  };
7913
- const AGE_REGEX = /^(?:(?:[1-9]|[1-3][0-9])(?:\.(?:[1-9]|1[01]))?|40(?:\.0?)?|0?\.(?:[1-9]|1[01]))$/;
7922
+ const AGE_REGEX = /^(?:(?:[1-9]|[1-3][0-9])(?:\.(?:0|[1-9]|1[01]))?|40(?:\.0?)?|0?\.(?:[1-9]|1[01]))$/;
7914
7923
  const petAgeVal = watch("petAge");
7915
7924
  useEffect(() => {
7916
7925
  if (!petAgeVal) return;
@@ -20883,7 +20892,7 @@ const PTRApplicationDetails = () => {
20883
20892
  }, t("WS_COMMON_TABLE_COL_ADDRESS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
20884
20893
  className: "border-none",
20885
20894
  label: t("PTR_ADDRESS"),
20886
- text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.addressId) || t("CS_NA")
20895
+ text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.addressLine1) || t("CS_NA")
20887
20896
  }), /*#__PURE__*/React.createElement(Row, {
20888
20897
  className: "border-none",
20889
20898
  label: t("PTR_PINCODE"),