@djb25/digit-ui-module-ws 1.0.49 → 1.0.51
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.
- package/dist/index.js +1736 -385
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1737 -386
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1856,6 +1856,29 @@ const checkForNA = function (value) {
|
|
|
1856
1856
|
}
|
|
1857
1857
|
return value && value != null && value !== undefined && value !== "" && value !== "Image" ? value : " NA";
|
|
1858
1858
|
};
|
|
1859
|
+
const WSCalculationPayload = (data, tenantId) => {
|
|
1860
|
+
var _useDetails$colonyNam, _useDetails$categoryT, _useDetails$propertyC, _useDetails$propertyT, _useDetails$propertyC2, _useDetails$WaterConn, _useDetails$noOfFloor;
|
|
1861
|
+
const useDetails = (data === null || data === void 0 ? void 0 : data.useDetails) || data || {};
|
|
1862
|
+
const payload = {
|
|
1863
|
+
connectionType: (data === null || data === void 0 ? void 0 : data.connectionType) || "METERED",
|
|
1864
|
+
colonyCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$colonyNam = useDetails.colonyName) === null || _useDetails$colonyNam === void 0 ? void 0 : _useDetails$colonyNam.code) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.colonyCategory) || "",
|
|
1865
|
+
categoryType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$categoryT = useDetails.categoryType) === null || _useDetails$categoryT === void 0 ? void 0 : _useDetails$categoryT.code) || "",
|
|
1866
|
+
propertyCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC = useDetails.propertyCategory) === null || _useDetails$propertyC === void 0 ? void 0 : _useDetails$propertyC.code) || "",
|
|
1867
|
+
propertyType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyT = useDetails.propertyType) === null || _useDetails$propertyT === void 0 ? void 0 : _useDetails$propertyT.code) || "",
|
|
1868
|
+
usageCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC2 = useDetails.propertyCategory) === null || _useDetails$propertyC2 === void 0 ? void 0 : _useDetails$propertyC2.code) || "",
|
|
1869
|
+
waterConnectionUsageType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$WaterConn = useDetails.WaterConnectionUsageType) === null || _useDetails$WaterConn === void 0 ? void 0 : _useDetails$WaterConn.code) || "",
|
|
1870
|
+
landArea: useDetails !== null && useDetails !== void 0 && useDetails.plotArea ? Number(useDetails.plotArea) : 0,
|
|
1871
|
+
builtUpArea: useDetails !== null && useDetails !== void 0 && useDetails.builtUpArea ? Number(useDetails.builtUpArea) : 0,
|
|
1872
|
+
farArea: useDetails !== null && useDetails !== void 0 && useDetails.farArea ? Number(useDetails.farArea) : 0,
|
|
1873
|
+
numberOfFloors: useDetails !== null && useDetails !== void 0 && (_useDetails$noOfFloor = useDetails.noOfFloors) !== null && _useDetails$noOfFloor !== void 0 && _useDetails$noOfFloor.code ? Number(useDetails.noOfFloors.code) : 0,
|
|
1874
|
+
numberOfStudents: useDetails !== null && useDetails !== void 0 && useDetails.numberOfStudents ? Number(useDetails.numberOfStudents) : 0,
|
|
1875
|
+
numberOfBeds: useDetails !== null && useDetails !== void 0 && useDetails.numberOfBeds ? Number(useDetails.numberOfBeds) : 0
|
|
1876
|
+
};
|
|
1877
|
+
if (useDetails !== null && useDetails !== void 0 && useDetails.NumberofRooms) payload.numberOfRooms = Number(useDetails.NumberofRooms);
|
|
1878
|
+
if (useDetails !== null && useDetails !== void 0 && useDetails.NumberofDwellingUnits) payload.numberOfDwellingUnits = Number(useDetails.NumberofDwellingUnits);
|
|
1879
|
+
if (useDetails !== null && useDetails !== void 0 && useDetails.ServantQuartersRoom) payload.servantQuartersRoom = Number(useDetails.ServantQuartersRoom);
|
|
1880
|
+
return payload;
|
|
1881
|
+
};
|
|
1859
1882
|
|
|
1860
1883
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
1861
1884
|
|
|
@@ -9595,6 +9618,722 @@ const WSDisconnectionResponse$1 = props => {
|
|
|
9595
9618
|
}))));
|
|
9596
9619
|
};
|
|
9597
9620
|
|
|
9621
|
+
const _excluded = ["config", "onSelect", "formData", "formState", "setError", "clearErrors"];
|
|
9622
|
+
const colonyNameOptions = [{
|
|
9623
|
+
code: "A",
|
|
9624
|
+
name: "A"
|
|
9625
|
+
}, {
|
|
9626
|
+
code: "B",
|
|
9627
|
+
name: "B"
|
|
9628
|
+
}, {
|
|
9629
|
+
code: "C",
|
|
9630
|
+
name: "C"
|
|
9631
|
+
}, {
|
|
9632
|
+
code: "D",
|
|
9633
|
+
name: "D"
|
|
9634
|
+
}, {
|
|
9635
|
+
code: "E",
|
|
9636
|
+
name: "E"
|
|
9637
|
+
}, {
|
|
9638
|
+
code: "F",
|
|
9639
|
+
name: "F"
|
|
9640
|
+
}, {
|
|
9641
|
+
code: "G",
|
|
9642
|
+
name: "G"
|
|
9643
|
+
}, {
|
|
9644
|
+
code: "H",
|
|
9645
|
+
name: "H"
|
|
9646
|
+
}];
|
|
9647
|
+
const NUMBER_PATTERN = /^\d+$/;
|
|
9648
|
+
const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
|
|
9649
|
+
const WSCalculation = _ref => {
|
|
9650
|
+
var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0, _errors$useDetails1, _errors$useDetails10, _errors$useDetails11;
|
|
9651
|
+
let config = _ref.config,
|
|
9652
|
+
onSelect = _ref.onSelect,
|
|
9653
|
+
formData = _ref.formData,
|
|
9654
|
+
setError = _ref.setError,
|
|
9655
|
+
clearErrors = _ref.clearErrors,
|
|
9656
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
9657
|
+
const _useForm = reactHookForm.useForm({
|
|
9658
|
+
defaultValues: (formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key]) || {
|
|
9659
|
+
useDetails: {
|
|
9660
|
+
propertyCategory: null,
|
|
9661
|
+
propertyType: null,
|
|
9662
|
+
WaterConnectionUsageType: null,
|
|
9663
|
+
plotArea: "",
|
|
9664
|
+
builtUpArea: "",
|
|
9665
|
+
farArea: "",
|
|
9666
|
+
NumberofDwellingUnits: "",
|
|
9667
|
+
NumberofRooms: "",
|
|
9668
|
+
numberOfBeds: "",
|
|
9669
|
+
numberOfStudents: "",
|
|
9670
|
+
ServantQuartersRoom: "",
|
|
9671
|
+
colonyName: ""
|
|
9672
|
+
}
|
|
9673
|
+
}
|
|
9674
|
+
}),
|
|
9675
|
+
control = _useForm.control,
|
|
9676
|
+
register = _useForm.register,
|
|
9677
|
+
errors = _useForm.formState.errors,
|
|
9678
|
+
watch = _useForm.watch,
|
|
9679
|
+
setValue = _useForm.setValue;
|
|
9680
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
9681
|
+
const _useTranslation = reactI18next.useTranslation(),
|
|
9682
|
+
t = _useTranslation.t;
|
|
9683
|
+
const _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSCalculater({
|
|
9684
|
+
tenantId
|
|
9685
|
+
}),
|
|
9686
|
+
calculateCharges = _Digit$Hooks$ws$useWS.mutate;
|
|
9687
|
+
const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["PropertyCategory", "PropertyType", "PropertyNewUsageType"]),
|
|
9688
|
+
ptServicesMastersData = _Digit$Hooks$pt$usePr.data;
|
|
9689
|
+
const _Digit$Hooks$ws$useMD = Digit.Hooks.ws.useMDMS(tenantId, "ws-services-masters", ["WsCategoryType"]),
|
|
9690
|
+
wsServicesMastersData = _Digit$Hooks$ws$useMD.data;
|
|
9691
|
+
const _useState = React.useState([]),
|
|
9692
|
+
categoryTypeList = _useState[0],
|
|
9693
|
+
setCategoryTypeList = _useState[1];
|
|
9694
|
+
const _useState2 = React.useState(null),
|
|
9695
|
+
calculationData = _useState2[0],
|
|
9696
|
+
setCalculationData = _useState2[1];
|
|
9697
|
+
React.useEffect(() => {
|
|
9698
|
+
var _wsServicesMastersDat;
|
|
9699
|
+
const categories = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat === void 0 ? void 0 : _wsServicesMastersDat.WsCategoryType) || [];
|
|
9700
|
+
categories.forEach(data => data.i18nKey = data.i18nKey || "WS_CATEGORY_" + data.code);
|
|
9701
|
+
setCategoryTypeList(categories);
|
|
9702
|
+
}, [wsServicesMastersData]);
|
|
9703
|
+
React.useEffect(() => {
|
|
9704
|
+
if (props.register) {
|
|
9705
|
+
props.register({
|
|
9706
|
+
name: "cpt"
|
|
9707
|
+
});
|
|
9708
|
+
}
|
|
9709
|
+
}, [props.register]);
|
|
9710
|
+
const formValue = watch();
|
|
9711
|
+
const watchCategoryType = watch("useDetails.categoryType");
|
|
9712
|
+
const watchPropertyType = watch("useDetails.propertyType");
|
|
9713
|
+
const watchPropertyCategory = watch("useDetails.propertyCategory");
|
|
9714
|
+
const watchWaterConnectionUsageType = watch("useDetails.WaterConnectionUsageType");
|
|
9715
|
+
const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
|
|
9716
|
+
const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
|
|
9717
|
+
const isSchoolCollegeProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "School" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "College";
|
|
9718
|
+
const isDwellingUnit = (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL" || (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL";
|
|
9719
|
+
const isServentHouse = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "Apartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "FlatOrApartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "IndividualHouse";
|
|
9720
|
+
const categoryOptions = React.useMemo(() => {
|
|
9721
|
+
var _ptServicesMastersDat, _ptServicesMastersDat2;
|
|
9722
|
+
let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat === void 0 ? void 0 : (_ptServicesMastersDat2 = _ptServicesMastersDat.PropertyCategory) === null || _ptServicesMastersDat2 === void 0 ? void 0 : _ptServicesMastersDat2.filter(item => item.active)) || [];
|
|
9723
|
+
if (watchCategoryType !== null && watchCategoryType !== void 0 && watchCategoryType.code) {
|
|
9724
|
+
options = options.filter(item => item.type === watchCategoryType.code);
|
|
9725
|
+
}
|
|
9726
|
+
return options.map(item => ({
|
|
9727
|
+
code: item.code,
|
|
9728
|
+
name: item.name
|
|
9729
|
+
}));
|
|
9730
|
+
}, [ptServicesMastersData, watchCategoryType]);
|
|
9731
|
+
React.useEffect(() => {
|
|
9732
|
+
if (watchCategoryType && watchPropertyCategory) {
|
|
9733
|
+
const isCategoryValid = categoryOptions.some(opt => opt.code === watchPropertyCategory.code);
|
|
9734
|
+
if (!isCategoryValid) {
|
|
9735
|
+
setValue("useDetails.propertyCategory", null);
|
|
9736
|
+
}
|
|
9737
|
+
}
|
|
9738
|
+
}, [watchCategoryType, categoryOptions, setValue, watchPropertyCategory]);
|
|
9739
|
+
const propertyTypeOptions = React.useMemo(() => {
|
|
9740
|
+
var _ptServicesMastersDat3, _ptServicesMastersDat4;
|
|
9741
|
+
let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat3 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat3 === void 0 ? void 0 : (_ptServicesMastersDat4 = _ptServicesMastersDat3.PropertyType) === null || _ptServicesMastersDat4 === void 0 ? void 0 : _ptServicesMastersDat4.filter(item => item.active)) || [];
|
|
9742
|
+
if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
|
|
9743
|
+
var _watchPropertyCategor;
|
|
9744
|
+
if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor = watchPropertyCategory.code) === null || _watchPropertyCategor === void 0 ? void 0 : _watchPropertyCategor.toUpperCase()) !== "MIXED") {
|
|
9745
|
+
options = options.filter(item => {
|
|
9746
|
+
var _item$type, _watchPropertyCategor2;
|
|
9747
|
+
return ((_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.toUpperCase()) === ((_watchPropertyCategor2 = watchPropertyCategory.code) === null || _watchPropertyCategor2 === void 0 ? void 0 : _watchPropertyCategor2.toUpperCase());
|
|
9748
|
+
});
|
|
9749
|
+
}
|
|
9750
|
+
}
|
|
9751
|
+
return options.map(item => ({
|
|
9752
|
+
code: item.code,
|
|
9753
|
+
name: item.name
|
|
9754
|
+
}));
|
|
9755
|
+
}, [ptServicesMastersData, watchPropertyCategory]);
|
|
9756
|
+
React.useEffect(() => {
|
|
9757
|
+
if (watchPropertyCategory && watchPropertyType) {
|
|
9758
|
+
const isTypeValid = propertyTypeOptions.some(opt => opt.code === watchPropertyType.code);
|
|
9759
|
+
if (!isTypeValid) {
|
|
9760
|
+
setValue("useDetails.propertyType", null);
|
|
9761
|
+
}
|
|
9762
|
+
}
|
|
9763
|
+
}, [watchPropertyCategory, propertyTypeOptions, setValue, watchPropertyType]);
|
|
9764
|
+
const usageTypeOptions = React.useMemo(() => {
|
|
9765
|
+
var _ptServicesMastersDat5, _ptServicesMastersDat6;
|
|
9766
|
+
let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat5 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat5 === void 0 ? void 0 : (_ptServicesMastersDat6 = _ptServicesMastersDat5.PropertyNewUsageType) === null || _ptServicesMastersDat6 === void 0 ? void 0 : _ptServicesMastersDat6.filter(item => item.active)) || [];
|
|
9767
|
+
if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
|
|
9768
|
+
var _watchPropertyCategor3;
|
|
9769
|
+
if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor3 = watchPropertyCategory.code) === null || _watchPropertyCategor3 === void 0 ? void 0 : _watchPropertyCategor3.toUpperCase()) !== "MIXED") {
|
|
9770
|
+
options = options.filter(item => {
|
|
9771
|
+
var _item$type2, _watchPropertyCategor4;
|
|
9772
|
+
return ((_item$type2 = item.type) === null || _item$type2 === void 0 ? void 0 : _item$type2.toUpperCase()) === ((_watchPropertyCategor4 = watchPropertyCategory.code) === null || _watchPropertyCategor4 === void 0 ? void 0 : _watchPropertyCategor4.toUpperCase());
|
|
9773
|
+
});
|
|
9774
|
+
}
|
|
9775
|
+
}
|
|
9776
|
+
return options.map(item => ({
|
|
9777
|
+
code: item.code,
|
|
9778
|
+
name: item.name
|
|
9779
|
+
}));
|
|
9780
|
+
}, [ptServicesMastersData, watchPropertyCategory]);
|
|
9781
|
+
React.useEffect(() => {
|
|
9782
|
+
if (watchPropertyType && watchWaterConnectionUsageType) {
|
|
9783
|
+
const isUsageTypeValid = usageTypeOptions.some(opt => opt.code === watchWaterConnectionUsageType.code);
|
|
9784
|
+
if (!isUsageTypeValid) {
|
|
9785
|
+
setValue("useDetails.WaterConnectionUsageType", null);
|
|
9786
|
+
}
|
|
9787
|
+
}
|
|
9788
|
+
}, [watchPropertyType, usageTypeOptions, setValue, watchWaterConnectionUsageType]);
|
|
9789
|
+
const lastSentValue = React__default.useRef(null);
|
|
9790
|
+
React.useEffect(() => {
|
|
9791
|
+
if (!lodash.isEqual(lastSentValue.current, formValue)) {
|
|
9792
|
+
lastSentValue.current = lodash.cloneDeep(formValue);
|
|
9793
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(config === null || config === void 0 ? void 0 : config.key, formValue);
|
|
9794
|
+
}
|
|
9795
|
+
}, [formValue, config === null || config === void 0 ? void 0 : config.key, onSelect]);
|
|
9796
|
+
React.useEffect(() => {
|
|
9797
|
+
var _formData$cpt;
|
|
9798
|
+
if (formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && _formData$cpt.details) {
|
|
9799
|
+
var _details$usageCategor, _details$landArea, _details$superBuiltUp;
|
|
9800
|
+
const details = formData.cpt.details;
|
|
9801
|
+
const additionalDetails = (details === null || details === void 0 ? void 0 : details.additionalDetails) || {};
|
|
9802
|
+
const catType = additionalDetails.categoryType || ((_details$usageCategor = details.usageCategory) !== null && _details$usageCategor !== void 0 && _details$usageCategor.includes("RESIDENTIAL") ? "DOMESTIC" : "NON_DOMESTIC");
|
|
9803
|
+
setValue("useDetails.categoryType", (categoryTypeList === null || categoryTypeList === void 0 ? void 0 : categoryTypeList.find(o => o.code === catType)) || null);
|
|
9804
|
+
setValue("useDetails.propertyCategory", (categoryOptions === null || categoryOptions === void 0 ? void 0 : categoryOptions.find(o => o.code === (additionalDetails.propertyCategory || details.usageCategory))) || null);
|
|
9805
|
+
setValue("useDetails.propertyType", (propertyTypeOptions === null || propertyTypeOptions === void 0 ? void 0 : propertyTypeOptions.find(o => o.code === (additionalDetails.propertyType || details.propertyType))) || null);
|
|
9806
|
+
setValue("useDetails.WaterConnectionUsageType", (usageTypeOptions === null || usageTypeOptions === void 0 ? void 0 : usageTypeOptions.find(o => o.code === additionalDetails.waterConnectionUsageType)) || null);
|
|
9807
|
+
setValue("useDetails.plotArea", additionalDetails.plotArea || (details === null || details === void 0 ? void 0 : (_details$landArea = details.landArea) === null || _details$landArea === void 0 ? void 0 : _details$landArea.toString()) || "");
|
|
9808
|
+
setValue("useDetails.builtUpArea", additionalDetails.builtUpArea || (details === null || details === void 0 ? void 0 : (_details$superBuiltUp = details.superBuiltUpArea) === null || _details$superBuiltUp === void 0 ? void 0 : _details$superBuiltUp.toString()) || "");
|
|
9809
|
+
setValue("useDetails.NumberofDwellingUnits", additionalDetails.numberOfDwellingUnits || additionalDetails.noOfDwellingUnits || (details === null || details === void 0 ? void 0 : details.noOfDwellingUnits) || "");
|
|
9810
|
+
setValue("useDetails.NumberofRooms", additionalDetails.numberOfRooms || additionalDetails.noOfRooms || (details === null || details === void 0 ? void 0 : details.noOfRooms) || "");
|
|
9811
|
+
setValue("useDetails.colonyName", additionalDetails.colonyName || "");
|
|
9812
|
+
} else if ((formData === null || formData === void 0 ? void 0 : formData.cpt) === null) {
|
|
9813
|
+
setValue("useDetails.categoryType", null);
|
|
9814
|
+
setValue("useDetails.propertyCategory", null);
|
|
9815
|
+
setValue("useDetails.propertyType", null);
|
|
9816
|
+
setValue("useDetails.WaterConnectionUsageType", null);
|
|
9817
|
+
setValue("useDetails.plotArea", "");
|
|
9818
|
+
setValue("useDetails.builtUpArea", "");
|
|
9819
|
+
setValue("useDetails.farArea", "");
|
|
9820
|
+
setValue("useDetails.NumberofDwellingUnits", "");
|
|
9821
|
+
setValue("useDetails.NumberofRooms", "");
|
|
9822
|
+
setValue("useDetails.numberOfBeds", "");
|
|
9823
|
+
setValue("useDetails.numberOfStudents", "");
|
|
9824
|
+
setValue("useDetails.ServantQuartersRoom", "");
|
|
9825
|
+
setValue("useDetails.colonyName", "");
|
|
9826
|
+
}
|
|
9827
|
+
}, [formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.details, formData === null || formData === void 0 ? void 0 : formData.cpt, categoryOptions, propertyTypeOptions, usageTypeOptions, categoryTypeList, setValue]);
|
|
9828
|
+
const lastErrorState = React__default.useRef(null);
|
|
9829
|
+
React.useEffect(() => {
|
|
9830
|
+
const hasErrors = Object.keys(errors).length > 0;
|
|
9831
|
+
if (lastErrorState.current !== hasErrors) {
|
|
9832
|
+
lastErrorState.current = hasErrors;
|
|
9833
|
+
if (hasErrors) {
|
|
9834
|
+
if (setError) setError(config === null || config === void 0 ? void 0 : config.key, {
|
|
9835
|
+
type: "custom",
|
|
9836
|
+
message: "Validation failed"
|
|
9837
|
+
});
|
|
9838
|
+
} else {
|
|
9839
|
+
if (clearErrors) clearErrors(config === null || config === void 0 ? void 0 : config.key);
|
|
9840
|
+
}
|
|
9841
|
+
}
|
|
9842
|
+
}, [errors, config === null || config === void 0 ? void 0 : config.key, setError, clearErrors]);
|
|
9843
|
+
const errorStyle = {
|
|
9844
|
+
width: "70%",
|
|
9845
|
+
marginLeft: "30%",
|
|
9846
|
+
fontSize: "12px",
|
|
9847
|
+
marginTop: "-21px"
|
|
9848
|
+
};
|
|
9849
|
+
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
9850
|
+
const handleSubmit = () => {
|
|
9851
|
+
const payload = WSCalculationPayload(formValue);
|
|
9852
|
+
calculateCharges(payload, {
|
|
9853
|
+
onSuccess: data => {
|
|
9854
|
+
setCalculationData(data);
|
|
9855
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(config === null || config === void 0 ? void 0 : config.key, _extends({}, formValue, {
|
|
9856
|
+
payload,
|
|
9857
|
+
calculationResponse: data
|
|
9858
|
+
}));
|
|
9859
|
+
},
|
|
9860
|
+
onError: error => {
|
|
9861
|
+
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
|
|
9862
|
+
if (setError) setError(config === null || config === void 0 ? void 0 : config.key, {
|
|
9863
|
+
type: "custom",
|
|
9864
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message) || t("WS_CALCULATION_FAILED")
|
|
9865
|
+
});
|
|
9866
|
+
}
|
|
9867
|
+
});
|
|
9868
|
+
};
|
|
9869
|
+
const RenderCalculationDetails = _ref2 => {
|
|
9870
|
+
var _data$Calculation, _calc$calculationDeta, _calc$calculationDeta2, _calc$calculationDeta3, _waterDemandDetail$co, _infraDetail$waterCom, _infraDetail$sewerCom, _infraDetail$grossIFC, _infraDetail$rebateAm, _infraDetail$netIFC;
|
|
9871
|
+
let data = _ref2.data;
|
|
9872
|
+
if (!data) return null;
|
|
9873
|
+
const calc = (_data$Calculation = data.Calculation) === null || _data$Calculation === void 0 ? void 0 : _data$Calculation[0];
|
|
9874
|
+
if (!calc) return null;
|
|
9875
|
+
const propertyDetail = ((_calc$calculationDeta = calc.calculationDetail) === null || _calc$calculationDeta === void 0 ? void 0 : _calc$calculationDeta.propertyDetail) || {};
|
|
9876
|
+
const waterDemandDetail = ((_calc$calculationDeta2 = calc.calculationDetail) === null || _calc$calculationDeta2 === void 0 ? void 0 : _calc$calculationDeta2.waterDemandDetail) || {};
|
|
9877
|
+
const infraDetail = ((_calc$calculationDeta3 = calc.calculationDetail) === null || _calc$calculationDeta3 === void 0 ? void 0 : _calc$calculationDeta3.infrastructureChargeDetail) || {};
|
|
9878
|
+
const taxHeadEstimates = calc.taxHeadEstimates || [];
|
|
9879
|
+
const totalAmount = calc.totalAmount;
|
|
9880
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
9881
|
+
className: "ws-calc-details-wrapper"
|
|
9882
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9883
|
+
className: "ws-calc-detail-card"
|
|
9884
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9885
|
+
className: "ws-calc-detail-card-header"
|
|
9886
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9887
|
+
className: "ws-calc-detail-card-badge"
|
|
9888
|
+
}, "1"), /*#__PURE__*/React__default.createElement("h3", {
|
|
9889
|
+
className: "ws-calc-detail-card-title"
|
|
9890
|
+
}, t("WS_PROPERTY_DETAILS"))), /*#__PURE__*/React__default.createElement("div", {
|
|
9891
|
+
className: "ws-calc-property-box"
|
|
9892
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9893
|
+
className: "ws-calc-grid-3"
|
|
9894
|
+
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9895
|
+
className: "ws-calc-label"
|
|
9896
|
+
}, t("WS_PROPERTY_TYPE")), /*#__PURE__*/React__default.createElement("div", {
|
|
9897
|
+
className: "ws-calc-value"
|
|
9898
|
+
}, propertyDetail.propertyType || "-")), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9899
|
+
className: "ws-calc-label"
|
|
9900
|
+
}, t("WS_PROPERTY_CATEGORY")), /*#__PURE__*/React__default.createElement("div", {
|
|
9901
|
+
className: "ws-calc-value"
|
|
9902
|
+
}, propertyDetail.usageCategory || "-")), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9903
|
+
className: "ws-calc-label"
|
|
9904
|
+
}, t("WS_WATER_CONNECTION_USAGE_TYPE")), /*#__PURE__*/React__default.createElement("div", {
|
|
9905
|
+
className: "ws-calc-value"
|
|
9906
|
+
}, propertyDetail.usageCategory || "-")), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9907
|
+
className: "ws-calc-label"
|
|
9908
|
+
}, t("WS_COLONY_CATEGORY")), /*#__PURE__*/React__default.createElement("div", {
|
|
9909
|
+
className: "ws-calc-pill"
|
|
9910
|
+
}, propertyDetail.colonyCategory || "-"))), /*#__PURE__*/React__default.createElement("hr", {
|
|
9911
|
+
className: "ws-calc-hr"
|
|
9912
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9913
|
+
className: "ws-calc-grid-4"
|
|
9914
|
+
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9915
|
+
className: "ws-calc-label"
|
|
9916
|
+
}, t("WS_LAND_AREA")), /*#__PURE__*/React__default.createElement("div", {
|
|
9917
|
+
className: "ws-calc-value"
|
|
9918
|
+
}, propertyDetail.landArea || 0, " sq. m.")), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9919
|
+
className: "ws-calc-label"
|
|
9920
|
+
}, t("WS_FAR_AREA")), /*#__PURE__*/React__default.createElement("div", {
|
|
9921
|
+
className: "ws-calc-value"
|
|
9922
|
+
}, propertyDetail.farArea || 0, " sq. m.")), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9923
|
+
className: "ws-calc-label"
|
|
9924
|
+
}, t("WS_BUILT_UP_AREA")), /*#__PURE__*/React__default.createElement("div", {
|
|
9925
|
+
className: "ws-calc-value"
|
|
9926
|
+
}, ((_waterDemandDetail$co = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co === void 0 ? void 0 : _waterDemandDetail$co.built_up_area) || 0, " sq. m."))))), /*#__PURE__*/React__default.createElement("div", {
|
|
9927
|
+
className: "ws-calc-detail-card"
|
|
9928
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9929
|
+
className: "ws-calc-detail-card-header"
|
|
9930
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9931
|
+
className: "ws-calc-detail-card-badge"
|
|
9932
|
+
}, "2"), /*#__PURE__*/React__default.createElement("h3", {
|
|
9933
|
+
className: "ws-calc-detail-card-title"
|
|
9934
|
+
}, t("WS_WATER_DEMAND_DETAILS"))), /*#__PURE__*/React__default.createElement("div", {
|
|
9935
|
+
className: "ws-calc-split-card"
|
|
9936
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9937
|
+
className: "ws-calc-split-left"
|
|
9938
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9939
|
+
className: "ws-calc-row"
|
|
9940
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9941
|
+
className: "ws-calc-row-label"
|
|
9942
|
+
}, t("WS_MATCHED_NORM_CODE")), /*#__PURE__*/React__default.createElement("span", {
|
|
9943
|
+
className: "ws-calc-row-value"
|
|
9944
|
+
}, waterDemandDetail.matchedNormCode || "-")), /*#__PURE__*/React__default.createElement("div", {
|
|
9945
|
+
className: "ws-calc-row"
|
|
9946
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9947
|
+
className: "ws-calc-row-label"
|
|
9948
|
+
}, t("WS_MATCHED_NORM_NAME")), /*#__PURE__*/React__default.createElement("span", {
|
|
9949
|
+
className: "ws-calc-row-value-right"
|
|
9950
|
+
}, waterDemandDetail.matchedNormName || "-")), /*#__PURE__*/React__default.createElement("div", {
|
|
9951
|
+
className: "ws-calc-row"
|
|
9952
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9953
|
+
className: "ws-calc-row-label"
|
|
9954
|
+
}, t("WS_FORMULA_USED")), /*#__PURE__*/React__default.createElement("span", {
|
|
9955
|
+
className: "ws-calc-row-value"
|
|
9956
|
+
}, waterDemandDetail.formulaUsed || "-")), /*#__PURE__*/React__default.createElement("div", {
|
|
9957
|
+
className: "ws-calc-row"
|
|
9958
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9959
|
+
className: "ws-calc-row-label"
|
|
9960
|
+
}, t("WS_CALCULATED_OCCUPANCY")), /*#__PURE__*/React__default.createElement("span", {
|
|
9961
|
+
className: "ws-calc-row-value"
|
|
9962
|
+
}, waterDemandDetail.calculatedOccupancy || 0, " Persons")), /*#__PURE__*/React__default.createElement("div", {
|
|
9963
|
+
className: "ws-calc-row-last"
|
|
9964
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9965
|
+
className: "ws-calc-row-label"
|
|
9966
|
+
}, t("WS_LPCD_SELECTED")), /*#__PURE__*/React__default.createElement("span", {
|
|
9967
|
+
className: "ws-calc-row-value"
|
|
9968
|
+
}, waterDemandDetail.chosenLpcd || 0, " LPD"))), /*#__PURE__*/React__default.createElement("div", {
|
|
9969
|
+
className: "ws-calc-split-right"
|
|
9970
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9971
|
+
className: "ws-calc-row"
|
|
9972
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9973
|
+
className: "ws-calc-row-label"
|
|
9974
|
+
}, t("WS_BASE_DEMAND")), /*#__PURE__*/React__default.createElement("span", {
|
|
9975
|
+
className: "ws-calc-row-value"
|
|
9976
|
+
}, waterDemandDetail.baseDemand || 0, " L/day")), /*#__PURE__*/React__default.createElement("div", {
|
|
9977
|
+
className: "ws-calc-row",
|
|
9978
|
+
style: {
|
|
9979
|
+
marginBottom: "24px"
|
|
9980
|
+
}
|
|
9981
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9982
|
+
className: "ws-calc-row-label"
|
|
9983
|
+
}, t("WS_CONTINGENCY")), /*#__PURE__*/React__default.createElement("span", {
|
|
9984
|
+
className: "ws-calc-row-value"
|
|
9985
|
+
}, waterDemandDetail.contingencyPercentage || 0, "%")), /*#__PURE__*/React__default.createElement("div", {
|
|
9986
|
+
className: "ws-calc-highlight-blue"
|
|
9987
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9988
|
+
className: "ws-calc-highlight-blue-label"
|
|
9989
|
+
}, t("WS_TOTAL_WATER_DEMAND")), /*#__PURE__*/React__default.createElement("span", {
|
|
9990
|
+
className: "ws-calc-highlight-blue-value"
|
|
9991
|
+
}, waterDemandDetail.totalWaterDemandLPD || 0, " L/day"))))), /*#__PURE__*/React__default.createElement("div", {
|
|
9992
|
+
className: "ws-calc-detail-card"
|
|
9993
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9994
|
+
className: "ws-calc-detail-card-header"
|
|
9995
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9996
|
+
className: "ws-calc-detail-card-badge"
|
|
9997
|
+
}, "3"), /*#__PURE__*/React__default.createElement("h3", {
|
|
9998
|
+
className: "ws-calc-detail-card-title"
|
|
9999
|
+
}, t("WS_INFRASTRUCTURE_CHARGE_DETAILS"))), /*#__PURE__*/React__default.createElement("div", {
|
|
10000
|
+
className: "ws-calc-split-card"
|
|
10001
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10002
|
+
className: "ws-calc-split-left"
|
|
10003
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10004
|
+
className: "ws-calc-row"
|
|
10005
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10006
|
+
className: "ws-calc-row-label"
|
|
10007
|
+
}, t("WS_COLONY_CATEGORY")), /*#__PURE__*/React__default.createElement("span", {
|
|
10008
|
+
className: "ws-calc-row-value"
|
|
10009
|
+
}, infraDetail.colonyCategory || "-")), /*#__PURE__*/React__default.createElement("div", {
|
|
10010
|
+
className: "ws-calc-row"
|
|
10011
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10012
|
+
className: "ws-calc-row-label"
|
|
10013
|
+
}, t("WS_PLOT_AREA")), /*#__PURE__*/React__default.createElement("span", {
|
|
10014
|
+
className: "ws-calc-row-value"
|
|
10015
|
+
}, infraDetail.plotArea || 0, " sq. m.")), /*#__PURE__*/React__default.createElement("div", {
|
|
10016
|
+
className: "ws-calc-row"
|
|
10017
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10018
|
+
className: "ws-calc-row-label"
|
|
10019
|
+
}, t("WS_MINIMUM_PLOT_AREA")), /*#__PURE__*/React__default.createElement("span", {
|
|
10020
|
+
className: "ws-calc-row-value"
|
|
10021
|
+
}, infraDetail.minimumPlotArea || 0, " sq. m.")), /*#__PURE__*/React__default.createElement("div", {
|
|
10022
|
+
className: "ws-calc-row"
|
|
10023
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10024
|
+
className: "ws-calc-row-label"
|
|
10025
|
+
}, t("WS_WATER_RATE")), /*#__PURE__*/React__default.createElement("span", {
|
|
10026
|
+
className: "ws-calc-row-value"
|
|
10027
|
+
}, "\u20B9 ", infraDetail.waterRatePerLPD || 0, " / LPD")), /*#__PURE__*/React__default.createElement("div", {
|
|
10028
|
+
className: "ws-calc-row-last"
|
|
10029
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10030
|
+
className: "ws-calc-row-label"
|
|
10031
|
+
}, t("WS_SEWER_RATE")), /*#__PURE__*/React__default.createElement("span", {
|
|
10032
|
+
className: "ws-calc-row-value"
|
|
10033
|
+
}, "\u20B9 ", infraDetail.sewerRatePerLPD || 0, " / LPD"))), /*#__PURE__*/React__default.createElement("div", {
|
|
10034
|
+
className: "ws-calc-split-right"
|
|
10035
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10036
|
+
className: "ws-calc-row"
|
|
10037
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10038
|
+
className: "ws-calc-row-label"
|
|
10039
|
+
}, t("WS_WATER_COMPONENT_IFC")), /*#__PURE__*/React__default.createElement("span", {
|
|
10040
|
+
className: "ws-calc-row-value"
|
|
10041
|
+
}, "\u20B9 ", ((_infraDetail$waterCom = infraDetail.waterComponentIFC) === null || _infraDetail$waterCom === void 0 ? void 0 : _infraDetail$waterCom.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React__default.createElement("div", {
|
|
10042
|
+
className: "ws-calc-row"
|
|
10043
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10044
|
+
className: "ws-calc-row-label"
|
|
10045
|
+
}, t("WS_SEWER_COMPONENT_IFC")), /*#__PURE__*/React__default.createElement("span", {
|
|
10046
|
+
className: "ws-calc-row-value"
|
|
10047
|
+
}, "\u20B9 ", ((_infraDetail$sewerCom = infraDetail.sewerComponentIFC) === null || _infraDetail$sewerCom === void 0 ? void 0 : _infraDetail$sewerCom.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React__default.createElement("div", {
|
|
10048
|
+
className: "ws-calc-row"
|
|
10049
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10050
|
+
className: "ws-calc-row-label"
|
|
10051
|
+
}, t("WS_GROSS_IFC")), /*#__PURE__*/React__default.createElement("span", {
|
|
10052
|
+
className: "ws-calc-row-value"
|
|
10053
|
+
}, "\u20B9 ", ((_infraDetail$grossIFC = infraDetail.grossIFC) === null || _infraDetail$grossIFC === void 0 ? void 0 : _infraDetail$grossIFC.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React__default.createElement("div", {
|
|
10054
|
+
className: "ws-calc-row"
|
|
10055
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10056
|
+
className: "ws-calc-row-label"
|
|
10057
|
+
}, t("WS_REBATE"), " (", infraDetail.rebatePercentage || 0, "%)"), /*#__PURE__*/React__default.createElement("span", {
|
|
10058
|
+
className: "ws-calc-row-value-red"
|
|
10059
|
+
}, "- \u20B9 ", ((_infraDetail$rebateAm = infraDetail.rebateAmount) === null || _infraDetail$rebateAm === void 0 ? void 0 : _infraDetail$rebateAm.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React__default.createElement("div", {
|
|
10060
|
+
className: "ws-calc-highlight-green"
|
|
10061
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10062
|
+
className: "ws-calc-highlight-green-label"
|
|
10063
|
+
}, t("WS_NET_INFRASTRUCTURE_CHARGE")), /*#__PURE__*/React__default.createElement("span", {
|
|
10064
|
+
className: "ws-calc-highlight-green-value"
|
|
10065
|
+
}, "\u20B9 ", ((_infraDetail$netIFC = infraDetail.netIFC) === null || _infraDetail$netIFC === void 0 ? void 0 : _infraDetail$netIFC.toLocaleString("en-IN")) || 0))))), /*#__PURE__*/React__default.createElement("div", {
|
|
10066
|
+
className: "ws-calc-detail-card",
|
|
10067
|
+
style: {
|
|
10068
|
+
marginBottom: "0"
|
|
10069
|
+
}
|
|
10070
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10071
|
+
className: "ws-calc-detail-card-header"
|
|
10072
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10073
|
+
className: "ws-calc-detail-card-badge"
|
|
10074
|
+
}, "4"), /*#__PURE__*/React__default.createElement("h3", {
|
|
10075
|
+
className: "ws-calc-detail-card-title"
|
|
10076
|
+
}, t("WS_FEE_SUMMARY"))), /*#__PURE__*/React__default.createElement("div", {
|
|
10077
|
+
className: "ws-calc-split-card",
|
|
10078
|
+
style: {
|
|
10079
|
+
marginBottom: "0"
|
|
10080
|
+
}
|
|
10081
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10082
|
+
className: "ws-calc-split-left",
|
|
10083
|
+
style: {
|
|
10084
|
+
display: "flex",
|
|
10085
|
+
flexDirection: "column",
|
|
10086
|
+
justifyContent: "center"
|
|
10087
|
+
}
|
|
10088
|
+
}, taxHeadEstimates.map((taxHead, index) => {
|
|
10089
|
+
var _taxHead$estimateAmou;
|
|
10090
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
10091
|
+
key: index,
|
|
10092
|
+
className: "ws-calc-row"
|
|
10093
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10094
|
+
className: "ws-calc-row-label"
|
|
10095
|
+
}, t(taxHead.taxHeadCode)), /*#__PURE__*/React__default.createElement("span", {
|
|
10096
|
+
className: "ws-calc-row-value"
|
|
10097
|
+
}, "\u20B9 ", (_taxHead$estimateAmou = taxHead.estimateAmount) === null || _taxHead$estimateAmou === void 0 ? void 0 : _taxHead$estimateAmou.toLocaleString("en-IN")));
|
|
10098
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
10099
|
+
className: "ws-calc-highlight-purple"
|
|
10100
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10101
|
+
className: "ws-calc-highlight-purple-label"
|
|
10102
|
+
}, t("WS_TOTAL_AMOUNT_PAYABLE")), /*#__PURE__*/React__default.createElement("span", {
|
|
10103
|
+
className: "ws-calc-highlight-purple-value"
|
|
10104
|
+
}, "\u20B9 ", totalAmount === null || totalAmount === void 0 ? void 0 : totalAmount.toLocaleString("en-IN")))))));
|
|
10105
|
+
};
|
|
10106
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
10107
|
+
className: "employee-form-section-wrapper"
|
|
10108
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.VerticalTimeline, {
|
|
10109
|
+
config: [{
|
|
10110
|
+
timeLine: [{
|
|
10111
|
+
actions: t("WS_CALCULATION"),
|
|
10112
|
+
currentStep: 1
|
|
10113
|
+
}]
|
|
10114
|
+
}],
|
|
10115
|
+
showFinalStep: false
|
|
10116
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
10117
|
+
style: {
|
|
10118
|
+
flex: 1
|
|
10119
|
+
}
|
|
10120
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CollapsibleCardPage, {
|
|
10121
|
+
title: t("WS_CALCULATION"),
|
|
10122
|
+
defaultOpen: true,
|
|
10123
|
+
style: props.style
|
|
10124
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10125
|
+
className: "formcomposer-section-grid"
|
|
10126
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_CATEGORY_TYPE") + "*"), /*#__PURE__*/React__default.createElement("div", {
|
|
10127
|
+
className: "form-field"
|
|
10128
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
10129
|
+
control: control,
|
|
10130
|
+
name: "useDetails.categoryType",
|
|
10131
|
+
rules: {
|
|
10132
|
+
required: t("REQUIRED_FIELD")
|
|
10133
|
+
},
|
|
10134
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
10135
|
+
option: categoryTypeList,
|
|
10136
|
+
optionKey: "i18nKey",
|
|
10137
|
+
selected: props.value,
|
|
10138
|
+
select: props.onChange,
|
|
10139
|
+
t: t,
|
|
10140
|
+
onBlur: props.onBlur
|
|
10141
|
+
})
|
|
10142
|
+
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails = errors.useDetails) === null || _errors$useDetails === void 0 ? void 0 : _errors$useDetails.categoryType) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10143
|
+
style: errorStyle
|
|
10144
|
+
}, errors.useDetails.categoryType.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_PROPERTY_CATEGORY") + "*"), /*#__PURE__*/React__default.createElement("div", {
|
|
10145
|
+
className: "form-field"
|
|
10146
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
10147
|
+
control: control,
|
|
10148
|
+
name: "useDetails.propertyCategory",
|
|
10149
|
+
rules: {
|
|
10150
|
+
required: t("REQUIRED_FIELD")
|
|
10151
|
+
},
|
|
10152
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
10153
|
+
option: categoryOptions,
|
|
10154
|
+
optionKey: "name",
|
|
10155
|
+
selected: props.value,
|
|
10156
|
+
select: props.onChange,
|
|
10157
|
+
t: t,
|
|
10158
|
+
onBlur: props.onBlur
|
|
10159
|
+
})
|
|
10160
|
+
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails2 = errors.useDetails) === null || _errors$useDetails2 === void 0 ? void 0 : _errors$useDetails2.propertyCategory) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10161
|
+
style: errorStyle
|
|
10162
|
+
}, errors.useDetails.propertyCategory.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_PROPERTY_TYPE") + "*"), /*#__PURE__*/React__default.createElement("div", {
|
|
10163
|
+
className: "form-field"
|
|
10164
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
10165
|
+
control: control,
|
|
10166
|
+
name: "useDetails.propertyType",
|
|
10167
|
+
rules: {
|
|
10168
|
+
required: t("REQUIRED_FIELD")
|
|
10169
|
+
},
|
|
10170
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
10171
|
+
option: propertyTypeOptions,
|
|
10172
|
+
optionKey: "name",
|
|
10173
|
+
selected: props.value,
|
|
10174
|
+
select: props.onChange,
|
|
10175
|
+
t: t,
|
|
10176
|
+
onBlur: props.onBlur
|
|
10177
|
+
})
|
|
10178
|
+
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails3 = errors.useDetails) === null || _errors$useDetails3 === void 0 ? void 0 : _errors$useDetails3.propertyType) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10179
|
+
style: errorStyle
|
|
10180
|
+
}, errors.useDetails.propertyType.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_WATER_CONNECTION_USAGE_TYPE") + "*"), /*#__PURE__*/React__default.createElement("div", {
|
|
10181
|
+
className: "form-field"
|
|
10182
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
10183
|
+
control: control,
|
|
10184
|
+
name: "useDetails.WaterConnectionUsageType",
|
|
10185
|
+
rules: {
|
|
10186
|
+
required: t("REQUIRED_FIELD")
|
|
10187
|
+
},
|
|
10188
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
10189
|
+
option: usageTypeOptions,
|
|
10190
|
+
optionKey: "name",
|
|
10191
|
+
selected: props.value,
|
|
10192
|
+
select: props.onChange,
|
|
10193
|
+
t: t,
|
|
10194
|
+
onBlur: props.onBlur
|
|
10195
|
+
})
|
|
10196
|
+
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails4 = errors.useDetails) === null || _errors$useDetails4 === void 0 ? void 0 : _errors$useDetails4.WaterConnectionUsageType) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10197
|
+
style: errorStyle
|
|
10198
|
+
}, errors.useDetails.WaterConnectionUsageType.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_COLONY_NAME") + "*"), /*#__PURE__*/React__default.createElement("div", {
|
|
10199
|
+
className: "form-field"
|
|
10200
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
10201
|
+
control: control,
|
|
10202
|
+
name: "useDetails.colonyName",
|
|
10203
|
+
rules: {
|
|
10204
|
+
required: t("REQUIRED_FIELD")
|
|
10205
|
+
},
|
|
10206
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
10207
|
+
option: colonyNameOptions,
|
|
10208
|
+
optionKey: "name",
|
|
10209
|
+
selected: props.value,
|
|
10210
|
+
select: props.onChange,
|
|
10211
|
+
t: t,
|
|
10212
|
+
onBlur: props.onBlur
|
|
10213
|
+
})
|
|
10214
|
+
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails5 = errors.useDetails) === null || _errors$useDetails5 === void 0 ? void 0 : _errors$useDetails5.colonyName) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10215
|
+
style: errorStyle
|
|
10216
|
+
}, errors.useDetails.colonyName.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_PLOT_AREA")), /*#__PURE__*/React__default.createElement("div", {
|
|
10217
|
+
className: "form-field"
|
|
10218
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
10219
|
+
t: t,
|
|
10220
|
+
inputRef: register({
|
|
10221
|
+
pattern: {
|
|
10222
|
+
value: DECIMAL_PATTERN,
|
|
10223
|
+
message: t("ERR_INVALID_DECIMAL")
|
|
10224
|
+
}
|
|
10225
|
+
}),
|
|
10226
|
+
name: "useDetails.plotArea"
|
|
10227
|
+
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails6 = errors.useDetails) === null || _errors$useDetails6 === void 0 ? void 0 : _errors$useDetails6.plotArea) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10228
|
+
style: errorStyle
|
|
10229
|
+
}, errors.useDetails.plotArea.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_BUILT_UP_AREA")), /*#__PURE__*/React__default.createElement("div", {
|
|
10230
|
+
className: "form-field"
|
|
10231
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
10232
|
+
t: t,
|
|
10233
|
+
inputRef: register({
|
|
10234
|
+
pattern: {
|
|
10235
|
+
value: DECIMAL_PATTERN,
|
|
10236
|
+
message: t("ERR_INVALID_DECIMAL")
|
|
10237
|
+
}
|
|
10238
|
+
}),
|
|
10239
|
+
name: "useDetails.builtUpArea"
|
|
10240
|
+
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails7 = errors.useDetails) === null || _errors$useDetails7 === void 0 ? void 0 : _errors$useDetails7.builtUpArea) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10241
|
+
style: errorStyle
|
|
10242
|
+
}, errors.useDetails.builtUpArea.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_FAR_AREA")), /*#__PURE__*/React__default.createElement("div", {
|
|
10243
|
+
className: "form-field"
|
|
10244
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
10245
|
+
t: t,
|
|
10246
|
+
inputRef: register({
|
|
10247
|
+
pattern: {
|
|
10248
|
+
value: DECIMAL_PATTERN,
|
|
10249
|
+
message: t("ERR_INVALID_DECIMAL")
|
|
10250
|
+
}
|
|
10251
|
+
}),
|
|
10252
|
+
name: "useDetails.farArea"
|
|
10253
|
+
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails8 = errors.useDetails) === null || _errors$useDetails8 === void 0 ? void 0 : _errors$useDetails8.farArea) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10254
|
+
style: errorStyle
|
|
10255
|
+
}, errors.useDetails.farArea.message), isDwellingUnit ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React__default.createElement("div", {
|
|
10256
|
+
className: "form-field"
|
|
10257
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
10258
|
+
t: t,
|
|
10259
|
+
inputRef: register({
|
|
10260
|
+
pattern: {
|
|
10261
|
+
value: NUMBER_PATTERN,
|
|
10262
|
+
message: t("ERR_INVALID_NUMBER")
|
|
10263
|
+
}
|
|
10264
|
+
}),
|
|
10265
|
+
name: "useDetails.NumberofDwellingUnits"
|
|
10266
|
+
}))) : null, isDwellingUnit && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.NumberofDwellingUnits) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10267
|
+
style: errorStyle
|
|
10268
|
+
}, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_NUMBER_OF_ROOMS") + "*"), /*#__PURE__*/React__default.createElement("div", {
|
|
10269
|
+
className: "form-field"
|
|
10270
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
10271
|
+
t: t,
|
|
10272
|
+
inputRef: register({
|
|
10273
|
+
pattern: {
|
|
10274
|
+
value: NUMBER_PATTERN,
|
|
10275
|
+
message: t("ERR_INVALID_NUMBER")
|
|
10276
|
+
},
|
|
10277
|
+
required: isHotelRestaurantProperty ? t("REQUIRED_FIELD") : false
|
|
10278
|
+
}),
|
|
10279
|
+
name: "useDetails.NumberofRooms"
|
|
10280
|
+
}))) : null, isHotelRestaurantProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofRooms) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10281
|
+
style: errorStyle
|
|
10282
|
+
}, errors.useDetails.NumberofRooms.message), isHospitalProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_NUMBER_OF_BEDS") + "*"), /*#__PURE__*/React__default.createElement("div", {
|
|
10283
|
+
className: "form-field"
|
|
10284
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
10285
|
+
t: t,
|
|
10286
|
+
inputRef: register({
|
|
10287
|
+
pattern: {
|
|
10288
|
+
value: NUMBER_PATTERN,
|
|
10289
|
+
message: t("ERR_INVALID_NUMBER")
|
|
10290
|
+
},
|
|
10291
|
+
required: isHospitalProperty ? t("REQUIRED_FIELD") : false
|
|
10292
|
+
}),
|
|
10293
|
+
name: "useDetails.numberOfBeds"
|
|
10294
|
+
}))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails1 = errors.useDetails) === null || _errors$useDetails1 === void 0 ? void 0 : _errors$useDetails1.numberOfBeds) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10295
|
+
style: errorStyle
|
|
10296
|
+
}, errors.useDetails.numberOfBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React__default.createElement("div", {
|
|
10297
|
+
className: "form-field"
|
|
10298
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
10299
|
+
t: t,
|
|
10300
|
+
inputRef: register({
|
|
10301
|
+
pattern: {
|
|
10302
|
+
value: NUMBER_PATTERN,
|
|
10303
|
+
message: t("ERR_INVALID_NUMBER")
|
|
10304
|
+
}
|
|
10305
|
+
}),
|
|
10306
|
+
name: "useDetails.numberOfStudents"
|
|
10307
|
+
}))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails10 = errors.useDetails) === null || _errors$useDetails10 === void 0 ? void 0 : _errors$useDetails10.numberOfStudents) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10308
|
+
style: errorStyle
|
|
10309
|
+
}, errors.useDetails.numberOfStudents.message), isServentHouse ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_SERVENT_HOUSE")), /*#__PURE__*/React__default.createElement("div", {
|
|
10310
|
+
className: "form-field"
|
|
10311
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
10312
|
+
t: t,
|
|
10313
|
+
inputRef: register({
|
|
10314
|
+
pattern: {
|
|
10315
|
+
value: NUMBER_PATTERN,
|
|
10316
|
+
message: t("ERR_INVALID_NUMBER")
|
|
10317
|
+
}
|
|
10318
|
+
}),
|
|
10319
|
+
name: "useDetails.ServantQuartersRoom"
|
|
10320
|
+
}))) : null, isServentHouse && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.ServantQuartersRoom) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
10321
|
+
style: errorStyle
|
|
10322
|
+
}, errors.useDetails.ServantQuartersRoom.message))), /*#__PURE__*/React__default.createElement("div", {
|
|
10323
|
+
style: {
|
|
10324
|
+
display: "flex",
|
|
10325
|
+
marginTop: "24px",
|
|
10326
|
+
marginBottom: "32px",
|
|
10327
|
+
justifyContent: isMobile ? "center" : "flex-end"
|
|
10328
|
+
}
|
|
10329
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
10330
|
+
label: t("ES_COMMON_CALCULATE"),
|
|
10331
|
+
onSubmit: handleSubmit
|
|
10332
|
+
})), calculationData && /*#__PURE__*/React__default.createElement(RenderCalculationDetails, {
|
|
10333
|
+
data: calculationData
|
|
10334
|
+
})));
|
|
10335
|
+
};
|
|
10336
|
+
|
|
9598
10337
|
const BILLSBreadCrumbs = _ref => {
|
|
9599
10338
|
var _applicationDetails$a, _applicationDetails$a9, _applicationDetails$a0, _applicationDetails$a1, _applicationDetails$a13, _applicationDetails$a14, _reciept_data$Payment2;
|
|
9600
10339
|
const getRecieptSearch = function (tenantId, payments, consumerCodes, receiptKey) {
|
|
@@ -10020,6 +10759,10 @@ const BILLSBreadCrumbs = _ref => {
|
|
|
10020
10759
|
path: "/digit-ui/employee/ws/water/bulk-bil",
|
|
10021
10760
|
label: t("CS_TITLE_BULK_BILL"),
|
|
10022
10761
|
show: location.pathname.includes("/ws/water/bulk-bill") ? true : false
|
|
10762
|
+
}, {
|
|
10763
|
+
path: "/digit-ui/employee/ws/water/calculation",
|
|
10764
|
+
label: t("WS_CALCULATION"),
|
|
10765
|
+
show: location.pathname.includes("/ws/water/calculation") ? true : false
|
|
10023
10766
|
}];
|
|
10024
10767
|
let lastCrumbIndex = findLastIndex(crumbs, "show", true);
|
|
10025
10768
|
crumbs[lastCrumbIndex] = _extends({}, crumbs[lastCrumbIndex], {
|
|
@@ -10046,7 +10789,7 @@ const BILLSBreadCrumbs = _ref => {
|
|
|
10046
10789
|
}));
|
|
10047
10790
|
};
|
|
10048
10791
|
const App$1 = _ref2 => {
|
|
10049
|
-
var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi, _Digit7, _Digit7$ComponentRegi, _Digit8, _Digit8$ComponentRegi, _Digit9, _Digit9$ComponentRegi, _Digit0, _Digit0$ComponentRegi, _Digit1, _Digit1$ComponentRegi, _Digit10, _Digit10$ComponentReg, _Digit11, _Digit11$ComponentReg, _Digit12, _Digit12$ComponentReg, _Digit13, _Digit13$ComponentReg, _Digit14, _Digit14$ComponentReg, _Digit15, _Digit15$ComponentReg, _Digit16, _Digit16$ComponentReg, _Digit17, _Digit17$ComponentReg, _Digit18, _Digit18$ComponentReg, _Digit19, _Digit19$ComponentReg, _Digit20, _Digit20$ComponentReg, _Digit21, _Digit21$ComponentReg, _Digit22, _Digit22$ComponentReg, _Digit23, _Digit23$ComponentReg, _Digit24, _Digit24$ComponentReg, _Digit25, _Digit25$ComponentReg, _Digit26, _Digit26$ComponentReg, _Digit27, _Digit27$ComponentReg, _Digit28, _Digit28$ComponentReg, _Digit29, _Digit29$ComponentReg;
|
|
10792
|
+
var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi, _Digit7, _Digit7$ComponentRegi, _Digit8, _Digit8$ComponentRegi, _Digit9, _Digit9$ComponentRegi, _Digit0, _Digit0$ComponentRegi, _Digit1, _Digit1$ComponentRegi, _Digit10, _Digit10$ComponentReg, _Digit11, _Digit11$ComponentReg, _Digit12, _Digit12$ComponentReg, _Digit13, _Digit13$ComponentReg, _Digit14, _Digit14$ComponentReg, _Digit15, _Digit15$ComponentReg, _Digit16, _Digit16$ComponentReg, _Digit17, _Digit17$ComponentReg, _Digit18, _Digit18$ComponentReg, _Digit19, _Digit19$ComponentReg, _Digit20, _Digit20$ComponentReg, _Digit21, _Digit21$ComponentReg, _Digit22, _Digit22$ComponentReg, _Digit23, _Digit23$ComponentReg, _Digit24, _Digit24$ComponentReg, _Digit25, _Digit25$ComponentReg, _Digit26, _Digit26$ComponentReg, _Digit27, _Digit27$ComponentReg, _Digit28, _Digit28$ComponentReg, _Digit29, _Digit29$ComponentReg, _Digit30, _Digit30$ComponentReg;
|
|
10050
10793
|
let path = _ref2.path;
|
|
10051
10794
|
const location = reactRouterDom.useLocation();
|
|
10052
10795
|
const WSDocsRequired = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("WSDocsRequired");
|
|
@@ -10066,21 +10809,22 @@ const App$1 = _ref2 => {
|
|
|
10066
10809
|
const WSConsumptionDetails = (_Digit13 = Digit) === null || _Digit13 === void 0 ? void 0 : (_Digit13$ComponentReg = _Digit13.ComponentRegistryService) === null || _Digit13$ComponentReg === void 0 ? void 0 : _Digit13$ComponentReg.getComponent("WSConsumptionDetails");
|
|
10067
10810
|
const WSModifyApplication = (_Digit14 = Digit) === null || _Digit14 === void 0 ? void 0 : (_Digit14$ComponentReg = _Digit14.ComponentRegistryService) === null || _Digit14$ComponentReg === void 0 ? void 0 : _Digit14$ComponentReg.getComponent("WSModifyApplication");
|
|
10068
10811
|
const WSEditModifyApplication = (_Digit15 = Digit) === null || _Digit15 === void 0 ? void 0 : (_Digit15$ComponentReg = _Digit15.ComponentRegistryService) === null || _Digit15$ComponentReg === void 0 ? void 0 : _Digit15$ComponentReg.getComponent("WSEditModifyApplication");
|
|
10069
|
-
const
|
|
10070
|
-
const
|
|
10071
|
-
const
|
|
10072
|
-
const
|
|
10073
|
-
const
|
|
10074
|
-
const
|
|
10075
|
-
const
|
|
10076
|
-
const
|
|
10077
|
-
const
|
|
10078
|
-
const
|
|
10079
|
-
const
|
|
10080
|
-
const
|
|
10081
|
-
const
|
|
10082
|
-
const
|
|
10083
|
-
const
|
|
10812
|
+
const WSMutationApplication = (_Digit16 = Digit) === null || _Digit16 === void 0 ? void 0 : (_Digit16$ComponentReg = _Digit16.ComponentRegistryService) === null || _Digit16$ComponentReg === void 0 ? void 0 : _Digit16$ComponentReg.getComponent("WSMutationApplication");
|
|
10813
|
+
const WSDisconnectionApplication = (_Digit17 = Digit) === null || _Digit17 === void 0 ? void 0 : (_Digit17$ComponentReg = _Digit17.ComponentRegistryService) === null || _Digit17$ComponentReg === void 0 ? void 0 : _Digit17$ComponentReg.getComponent("WSDisconnectionApplication");
|
|
10814
|
+
const WSRestorationApplication = (_Digit18 = Digit) === null || _Digit18 === void 0 ? void 0 : (_Digit18$ComponentReg = _Digit18.ComponentRegistryService) === null || _Digit18$ComponentReg === void 0 ? void 0 : _Digit18$ComponentReg.getComponent("WSRestorationApplication");
|
|
10815
|
+
const WSEditApplicationByConfig = (_Digit19 = Digit) === null || _Digit19 === void 0 ? void 0 : (_Digit19$ComponentReg = _Digit19.ComponentRegistryService) === null || _Digit19$ComponentReg === void 0 ? void 0 : _Digit19$ComponentReg.getComponent("WSEditApplicationByConfig");
|
|
10816
|
+
const WSBillIAmendMentInbox = (_Digit20 = Digit) === null || _Digit20 === void 0 ? void 0 : (_Digit20$ComponentReg = _Digit20.ComponentRegistryService) === null || _Digit20$ComponentReg === void 0 ? void 0 : _Digit20$ComponentReg.getComponent("WSBillIAmendMentInbox");
|
|
10817
|
+
const WSGetDisconnectionDetails = (_Digit21 = Digit) === null || _Digit21 === void 0 ? void 0 : (_Digit21$ComponentReg = _Digit21.ComponentRegistryService) === null || _Digit21$ComponentReg === void 0 ? void 0 : _Digit21$ComponentReg.getComponent("WSGetDisconnectionDetails");
|
|
10818
|
+
const WSModifyApplicationDetails = (_Digit22 = Digit) === null || _Digit22 === void 0 ? void 0 : (_Digit22$ComponentReg = _Digit22.ComponentRegistryService) === null || _Digit22$ComponentReg === void 0 ? void 0 : _Digit22$ComponentReg.getComponent("WSModifyApplicationDetails");
|
|
10819
|
+
const WSEditDisconnectionApplication = (_Digit23 = Digit) === null || _Digit23 === void 0 ? void 0 : (_Digit23$ComponentReg = _Digit23.ComponentRegistryService) === null || _Digit23$ComponentReg === void 0 ? void 0 : _Digit23$ComponentReg.getComponent("WSEditDisconnectionApplication");
|
|
10820
|
+
const WSEditDisconnectionByConfig = (_Digit24 = Digit) === null || _Digit24 === void 0 ? void 0 : (_Digit24$ComponentReg = _Digit24.ComponentRegistryService) === null || _Digit24$ComponentReg === void 0 ? void 0 : _Digit24$ComponentReg.getComponent("WSEditDisconnectionByConfig");
|
|
10821
|
+
const WSResubmitDisconnection = (_Digit25 = Digit) === null || _Digit25 === void 0 ? void 0 : (_Digit25$ComponentReg = _Digit25.ComponentRegistryService) === null || _Digit25$ComponentReg === void 0 ? void 0 : _Digit25$ComponentReg.getComponent("WSResubmitDisconnection");
|
|
10822
|
+
const WSSearchIntegrated = (_Digit26 = Digit) === null || _Digit26 === void 0 ? void 0 : (_Digit26$ComponentReg = _Digit26.ComponentRegistryService) === null || _Digit26$ComponentReg === void 0 ? void 0 : _Digit26$ComponentReg.getComponent("WSSearchIntegrated");
|
|
10823
|
+
const WSBulkBillGeneration = (_Digit27 = Digit) === null || _Digit27 === void 0 ? void 0 : (_Digit27$ComponentReg = _Digit27.ComponentRegistryService) === null || _Digit27$ComponentReg === void 0 ? void 0 : _Digit27$ComponentReg.getComponent("WSBulkBillGeneration");
|
|
10824
|
+
const CPTCreateProperty = (_Digit28 = Digit) === null || _Digit28 === void 0 ? void 0 : (_Digit28$ComponentReg = _Digit28.ComponentRegistryService) === null || _Digit28$ComponentReg === void 0 ? void 0 : _Digit28$ComponentReg.getComponent("CPTCreateProperty");
|
|
10825
|
+
const CPTAcknowledgement = (_Digit29 = Digit) === null || _Digit29 === void 0 ? void 0 : (_Digit29$ComponentReg = _Digit29.ComponentRegistryService) === null || _Digit29$ComponentReg === void 0 ? void 0 : _Digit29$ComponentReg.getComponent("CPTAcknowledgement");
|
|
10826
|
+
const WSInfoPage = (_Digit30 = Digit) === null || _Digit30 === void 0 ? void 0 : (_Digit30$ComponentReg = _Digit30.ComponentRegistryService) === null || _Digit30$ComponentReg === void 0 ? void 0 : _Digit30$ComponentReg.getComponent("WSInfoPage");
|
|
10827
|
+
const locationCheck = window.location.href.includes("/employee/ws/new-application") || window.location.href.includes("/employee/ws/modify-application") || window.location.href.includes("/employee/ws/mutation-application") || window.location.href.includes("/employee/ws/edit-application") || window.location.href.includes("/employee/ws/activate-connection") || window.location.href.includes("/employee/ws/application-details") || window.location.href.includes("/employee/ws/modify-details") || window.location.href.includes("/employee/ws/ws-response") || window.location.href.includes("/employee/ws/new-disconnection/application-form") || window.location.href.includes("/employee/ws/ws-disconnection-response") || window.location.href.includes("/employee/ws/consumption-details") || window.location.href.includes("/employee/ws/edit-disconnection-application") || window.location.href.includes("/employee/ws/config-by-disconnection-application") || window.location.href.includes("/employee/ws/resubmit-disconnection-application") || window.location.href.includes("/employee/ws/water/bulk-bill");
|
|
10084
10828
|
const locationCheckReqDocs = window.location.href.includes("/employee/ws/create-application") || window.location.href.includes("/employee/ws/new-disconnection/docsrequired");
|
|
10085
10829
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10086
10830
|
className: "app-container"
|
|
@@ -10220,6 +10964,9 @@ const App$1 = _ref2 => {
|
|
|
10220
10964
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
10221
10965
|
path: path + "/modify-application-edit",
|
|
10222
10966
|
component: WSEditModifyApplication
|
|
10967
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
10968
|
+
path: path + "/mutation-application",
|
|
10969
|
+
component: WSMutationApplication
|
|
10223
10970
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
10224
10971
|
path: path + "/disconnection-application",
|
|
10225
10972
|
component: WSDisconnectionDocsRequired
|
|
@@ -10273,6 +11020,11 @@ const App$1 = _ref2 => {
|
|
|
10273
11020
|
component: props => /*#__PURE__*/React__default.createElement(WSBulkBillGeneration, _extends({}, props, {
|
|
10274
11021
|
parentRoute: path
|
|
10275
11022
|
}))
|
|
11023
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
11024
|
+
path: path + "/water/calculation",
|
|
11025
|
+
component: props => /*#__PURE__*/React__default.createElement(WSCalculation, _extends({}, props, {
|
|
11026
|
+
parentRoute: path
|
|
11027
|
+
}))
|
|
10276
11028
|
}))))));
|
|
10277
11029
|
};
|
|
10278
11030
|
|
|
@@ -15060,7 +15812,7 @@ const WSActivationPageDetails = _ref => {
|
|
|
15060
15812
|
const _useTranslation = reactI18next.useTranslation(),
|
|
15061
15813
|
t = _useTranslation.t;
|
|
15062
15814
|
const filters = getQueryStringParams(location.search);
|
|
15063
|
-
const _ref2 = window.location.href.includes("modify") ? React.useState(formData !== null && formData !== void 0 && formData.activationDetails ? [formData === null || formData === void 0 ? void 0 : (_formData$activationD = formData.activationDetails) === null || _formData$activationD === void 0 ? void 0 : _formData$activationD[0]] : [createActivationDetails()]) : React.useState((formData === null || formData === void 0 ? void 0 : formData.activationDetails) || [createActivationDetails()]),
|
|
15815
|
+
const _ref2 = window.location.href.includes("modify") || window.location.href.includes("mutation") ? React.useState(formData !== null && formData !== void 0 && formData.activationDetails ? [formData === null || formData === void 0 ? void 0 : (_formData$activationD = formData.activationDetails) === null || _formData$activationD === void 0 ? void 0 : _formData$activationD[0]] : [createActivationDetails()]) : React.useState((formData === null || formData === void 0 ? void 0 : formData.activationDetails) || [createActivationDetails()]),
|
|
15064
15816
|
activationDetails = _ref2[0],
|
|
15065
15817
|
setActivationDetails = _ref2[1];
|
|
15066
15818
|
const _useState = React.useState({
|
|
@@ -15160,7 +15912,7 @@ const ConnectionDetails$3 = _props => {
|
|
|
15160
15912
|
trigger();
|
|
15161
15913
|
}, [formData === null || formData === void 0 ? void 0 : (_formData$connectionD = formData.connectionDetails) === null || _formData$connectionD === void 0 ? void 0 : (_formData$connectionD2 = _formData$connectionD[0]) === null || _formData$connectionD2 === void 0 ? void 0 : _formData$connectionD2.connectionType]);
|
|
15162
15914
|
React.useEffect(() => {
|
|
15163
|
-
if (window.location.href.includes("modify")) trigger();
|
|
15915
|
+
if (window.location.href.includes("modify") || window.location.href.includes("mutation")) trigger();
|
|
15164
15916
|
}, [activationDetails, formData === null || formData === void 0 ? void 0 : formData.ConnectionDetails, formData === null || formData === void 0 ? void 0 : formData.ConnectionHolderDetails, formData === null || formData === void 0 ? void 0 : formData.DocumentsRequired, formData === null || formData === void 0 ? void 0 : formData.connectionDetails, formData === null || formData === void 0 ? void 0 : formData.cpt]);
|
|
15165
15917
|
React.useEffect(() => {
|
|
15166
15918
|
var _formState$errors$con;
|
|
@@ -15323,7 +16075,7 @@ const ConnectionDetails$3 = _props => {
|
|
|
15323
16075
|
}
|
|
15324
16076
|
}))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
15325
16077
|
style: errorStyle
|
|
15326
|
-
}, localFormState.touched.connectionExecutionDate ? errors === null || errors === void 0 ? void 0 : (_errors$connectionExe2 = errors.connectionExecutionDate) === null || _errors$connectionExe2 === void 0 ? void 0 : _errors$connectionExe2.message : ""), window.location.href.includes("modify") ? /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
|
|
16078
|
+
}, localFormState.touched.connectionExecutionDate ? errors === null || errors === void 0 ? void 0 : (_errors$connectionExe2 = errors.connectionExecutionDate) === null || _errors$connectionExe2 === void 0 ? void 0 : _errors$connectionExe2.message : ""), window.location.href.includes("modify") || window.location.href.includes("mutation") ? /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
|
|
15327
16079
|
style: isMobile && isEmployee ? {
|
|
15328
16080
|
fontWeight: "700",
|
|
15329
16081
|
width: "100%"
|
|
@@ -20626,18 +21378,18 @@ const WSDjbEmployee = _ref => {
|
|
|
20626
21378
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, FormContent);
|
|
20627
21379
|
};
|
|
20628
21380
|
|
|
20629
|
-
const _excluded = ["t", "config", "onSelect", "formData", "formState", "setError", "clearErrors"];
|
|
20630
|
-
const NUMBER_PATTERN = /^\d+$/;
|
|
20631
|
-
const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
|
|
21381
|
+
const _excluded$1 = ["t", "config", "onSelect", "formData", "formState", "setError", "clearErrors"];
|
|
21382
|
+
const NUMBER_PATTERN$1 = /^\d+$/;
|
|
21383
|
+
const DECIMAL_PATTERN$1 = /^\d+(\.\d{1,2})?$/;
|
|
20632
21384
|
const PropertyWaterConnection = _ref => {
|
|
20633
|
-
var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0, _errors$useDetails1, _errors$useDetails10, _errors$useDetails11;
|
|
21385
|
+
var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0, _errors$useDetails1, _errors$useDetails10, _errors$useDetails11, _errors$useDetails12;
|
|
20634
21386
|
let t = _ref.t,
|
|
20635
21387
|
config = _ref.config,
|
|
20636
21388
|
onSelect = _ref.onSelect,
|
|
20637
21389
|
formData = _ref.formData,
|
|
20638
21390
|
setError = _ref.setError,
|
|
20639
21391
|
clearErrors = _ref.clearErrors,
|
|
20640
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21392
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
20641
21393
|
const _useForm = reactHookForm.useForm({
|
|
20642
21394
|
defaultValues: (formData === null || formData === void 0 ? void 0 : formData[config.key]) || {
|
|
20643
21395
|
useDetails: {
|
|
@@ -20651,8 +21403,9 @@ const PropertyWaterConnection = _ref => {
|
|
|
20651
21403
|
SelectYearofConstruction: null,
|
|
20652
21404
|
NumberofDwellingUnits: "",
|
|
20653
21405
|
NumberofRooms: "",
|
|
20654
|
-
|
|
20655
|
-
|
|
21406
|
+
numberOfBeds: "",
|
|
21407
|
+
numberOfStudents: "",
|
|
21408
|
+
ServantQuartersRoom: ""
|
|
20656
21409
|
}
|
|
20657
21410
|
}
|
|
20658
21411
|
}),
|
|
@@ -20691,6 +21444,8 @@ const PropertyWaterConnection = _ref => {
|
|
|
20691
21444
|
const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
|
|
20692
21445
|
const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
|
|
20693
21446
|
const isSchoolCollegeProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "School" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "College";
|
|
21447
|
+
const isDwellingUnit = (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL" || (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL";
|
|
21448
|
+
const isServentHouse = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "Apartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "FlatOrApartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "IndividualHouse";
|
|
20694
21449
|
const yearOptions = React.useMemo(() => {
|
|
20695
21450
|
const currentYear = new Date().getFullYear();
|
|
20696
21451
|
const years = [];
|
|
@@ -20820,8 +21575,9 @@ const PropertyWaterConnection = _ref => {
|
|
|
20820
21575
|
setValue("useDetails.SelectYearofConstruction", null);
|
|
20821
21576
|
setValue("useDetails.NumberofDwellingUnits", "");
|
|
20822
21577
|
setValue("useDetails.NumberofRooms", "");
|
|
20823
|
-
setValue("useDetails.
|
|
20824
|
-
setValue("useDetails.
|
|
21578
|
+
setValue("useDetails.numberOfBeds", "");
|
|
21579
|
+
setValue("useDetails.numberOfStudents", "");
|
|
21580
|
+
setValue("useDetails.ServantQuartersRoom", "");
|
|
20825
21581
|
}
|
|
20826
21582
|
}, [formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.details, formData === null || formData === void 0 ? void 0 : formData.cpt, categoryOptions, propertyTypeOptions, usageTypeOptions, floorOptions, yearOptions, categoryTypeList, setValue]);
|
|
20827
21583
|
const lastErrorState = React__default.useRef(null);
|
|
@@ -20949,7 +21705,7 @@ const PropertyWaterConnection = _ref => {
|
|
|
20949
21705
|
t: t,
|
|
20950
21706
|
inputRef: register({
|
|
20951
21707
|
pattern: {
|
|
20952
|
-
value: DECIMAL_PATTERN,
|
|
21708
|
+
value: DECIMAL_PATTERN$1,
|
|
20953
21709
|
message: t("ERR_INVALID_DECIMAL")
|
|
20954
21710
|
}
|
|
20955
21711
|
}),
|
|
@@ -20963,7 +21719,7 @@ const PropertyWaterConnection = _ref => {
|
|
|
20963
21719
|
t: t,
|
|
20964
21720
|
inputRef: register({
|
|
20965
21721
|
pattern: {
|
|
20966
|
-
value: DECIMAL_PATTERN,
|
|
21722
|
+
value: DECIMAL_PATTERN$1,
|
|
20967
21723
|
message: t("ERR_INVALID_DECIMAL")
|
|
20968
21724
|
}
|
|
20969
21725
|
}),
|
|
@@ -20977,7 +21733,7 @@ const PropertyWaterConnection = _ref => {
|
|
|
20977
21733
|
t: t,
|
|
20978
21734
|
inputRef: register({
|
|
20979
21735
|
pattern: {
|
|
20980
|
-
value: DECIMAL_PATTERN,
|
|
21736
|
+
value: DECIMAL_PATTERN$1,
|
|
20981
21737
|
message: t("ERR_INVALID_DECIMAL")
|
|
20982
21738
|
}
|
|
20983
21739
|
}),
|
|
@@ -21004,19 +21760,19 @@ const PropertyWaterConnection = _ref => {
|
|
|
21004
21760
|
})
|
|
21005
21761
|
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.SelectYearofConstruction) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
21006
21762
|
style: errorStyle
|
|
21007
|
-
}, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React__default.createElement("div", {
|
|
21763
|
+
}, errors.useDetails.SelectYearofConstruction.message), isDwellingUnit ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React__default.createElement("div", {
|
|
21008
21764
|
className: "form-field"
|
|
21009
21765
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
21010
21766
|
t: t,
|
|
21011
21767
|
inputRef: register({
|
|
21012
21768
|
pattern: {
|
|
21013
|
-
value: NUMBER_PATTERN,
|
|
21769
|
+
value: NUMBER_PATTERN$1,
|
|
21014
21770
|
message: t("ERR_INVALID_NUMBER")
|
|
21015
21771
|
}
|
|
21016
21772
|
}),
|
|
21017
21773
|
name: "useDetails.NumberofDwellingUnits",
|
|
21018
21774
|
disabled: isPropertyFound
|
|
21019
|
-
}))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofDwellingUnits) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
21775
|
+
}))) : null, isDwellingUnit && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofDwellingUnits) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
21020
21776
|
style: errorStyle
|
|
21021
21777
|
}, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_NUMBER_OF_ROOMS") + "*"), /*#__PURE__*/React__default.createElement("div", {
|
|
21022
21778
|
className: "form-field"
|
|
@@ -21024,7 +21780,7 @@ const PropertyWaterConnection = _ref => {
|
|
|
21024
21780
|
t: t,
|
|
21025
21781
|
inputRef: register({
|
|
21026
21782
|
pattern: {
|
|
21027
|
-
value: NUMBER_PATTERN,
|
|
21783
|
+
value: NUMBER_PATTERN$1,
|
|
21028
21784
|
message: t("ERR_INVALID_NUMBER")
|
|
21029
21785
|
},
|
|
21030
21786
|
required: isHotelRestaurantProperty ? t("REQUIRED_FIELD") : false
|
|
@@ -21039,30 +21795,44 @@ const PropertyWaterConnection = _ref => {
|
|
|
21039
21795
|
t: t,
|
|
21040
21796
|
inputRef: register({
|
|
21041
21797
|
pattern: {
|
|
21042
|
-
value: NUMBER_PATTERN,
|
|
21798
|
+
value: NUMBER_PATTERN$1,
|
|
21043
21799
|
message: t("ERR_INVALID_NUMBER")
|
|
21044
21800
|
},
|
|
21045
21801
|
required: isHospitalProperty ? t("REQUIRED_FIELD") : false
|
|
21046
21802
|
}),
|
|
21047
|
-
name: "useDetails.
|
|
21803
|
+
name: "useDetails.numberOfBeds",
|
|
21048
21804
|
disabled: isPropertyFound
|
|
21049
|
-
}))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails10 = errors.useDetails) === null || _errors$useDetails10 === void 0 ? void 0 : _errors$useDetails10.
|
|
21805
|
+
}))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails10 = errors.useDetails) === null || _errors$useDetails10 === void 0 ? void 0 : _errors$useDetails10.numberOfBeds) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
21050
21806
|
style: errorStyle
|
|
21051
|
-
}, errors.useDetails.
|
|
21807
|
+
}, errors.useDetails.numberOfBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React__default.createElement("div", {
|
|
21052
21808
|
className: "form-field"
|
|
21053
21809
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
21054
21810
|
t: t,
|
|
21055
21811
|
inputRef: register({
|
|
21056
21812
|
pattern: {
|
|
21057
|
-
value: NUMBER_PATTERN,
|
|
21813
|
+
value: NUMBER_PATTERN$1,
|
|
21058
21814
|
message: t("ERR_INVALID_NUMBER")
|
|
21059
21815
|
}
|
|
21060
21816
|
}),
|
|
21061
|
-
name: "useDetails.
|
|
21817
|
+
name: "useDetails.numberOfStudents",
|
|
21062
21818
|
disabled: isPropertyFound
|
|
21063
|
-
}))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.
|
|
21819
|
+
}))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.numberOfStudents) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
21064
21820
|
style: errorStyle
|
|
21065
|
-
}, errors.useDetails.
|
|
21821
|
+
}, errors.useDetails.numberOfStudents.message), isServentHouse ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_SERVENT_HOUSE")), /*#__PURE__*/React__default.createElement("div", {
|
|
21822
|
+
className: "form-field"
|
|
21823
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
21824
|
+
t: t,
|
|
21825
|
+
inputRef: register({
|
|
21826
|
+
pattern: {
|
|
21827
|
+
value: NUMBER_PATTERN$1,
|
|
21828
|
+
message: t("ERR_INVALID_NUMBER")
|
|
21829
|
+
}
|
|
21830
|
+
}),
|
|
21831
|
+
name: "useDetails.ServantQuartersRoom",
|
|
21832
|
+
disabled: isPropertyFound
|
|
21833
|
+
}))) : null, isServentHouse && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails12 = errors.useDetails) === null || _errors$useDetails12 === void 0 ? void 0 : _errors$useDetails12.ServantQuartersRoom) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
21834
|
+
style: errorStyle
|
|
21835
|
+
}, errors.useDetails.ServantQuartersRoom.message)));
|
|
21066
21836
|
};
|
|
21067
21837
|
|
|
21068
21838
|
const WSPropertyWaterConnection = props => {
|
|
@@ -22026,7 +22796,7 @@ const SearchFields = _ref => {
|
|
|
22026
22796
|
}, t("CS_COMMON_CLEAR_SEARCH"))));
|
|
22027
22797
|
};
|
|
22028
22798
|
|
|
22029
|
-
const _excluded$
|
|
22799
|
+
const _excluded$2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
|
|
22030
22800
|
_excluded2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"];
|
|
22031
22801
|
const MobileSearchApplication = _ref => {
|
|
22032
22802
|
let Controller = _ref.Controller,
|
|
@@ -22073,7 +22843,7 @@ const MobileSearchApplication = _ref => {
|
|
|
22073
22843
|
let currentlyActiveMobileModal = _ref2.currentlyActiveMobileModal,
|
|
22074
22844
|
searchFormFieldsComponentProps = _ref2.searchFormFieldsComponentProps,
|
|
22075
22845
|
tenantId = _ref2.tenantId,
|
|
22076
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
22846
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
|
|
22077
22847
|
const closeMobilePopupModal = props.closeMobilePopupModal;
|
|
22078
22848
|
switch (currentlyActiveMobileModal) {
|
|
22079
22849
|
case "SearchFormComponent":
|
|
@@ -22508,7 +23278,7 @@ const SearchFields$1 = _ref => {
|
|
|
22508
23278
|
}, t("WS_SEARCH_CONNECTION_RESET_BUTTON"))));
|
|
22509
23279
|
};
|
|
22510
23280
|
|
|
22511
|
-
const _excluded$
|
|
23281
|
+
const _excluded$3 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
|
|
22512
23282
|
_excluded2$1 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"];
|
|
22513
23283
|
const MobileSearchWater = _ref => {
|
|
22514
23284
|
let Controller = _ref.Controller,
|
|
@@ -22553,7 +23323,7 @@ const MobileSearchWater = _ref => {
|
|
|
22553
23323
|
let currentlyActiveMobileModal = _ref2.currentlyActiveMobileModal,
|
|
22554
23324
|
searchFormFieldsComponentProps = _ref2.searchFormFieldsComponentProps,
|
|
22555
23325
|
tenantId = _ref2.tenantId,
|
|
22556
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
23326
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$3);
|
|
22557
23327
|
const closeMobilePopupModal = props.closeMobilePopupModal;
|
|
22558
23328
|
switch (currentlyActiveMobileModal) {
|
|
22559
23329
|
case "SearchFormComponent":
|
|
@@ -23788,6 +24558,10 @@ const WSCard = () => {
|
|
|
23788
24558
|
label: t("WS_WATER_APPLICATION_SEARCH"),
|
|
23789
24559
|
link: "/digit-ui/employee/ws/water/search-application",
|
|
23790
24560
|
roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
|
|
24561
|
+
}, {
|
|
24562
|
+
label: t("WS_CALCULATION"),
|
|
24563
|
+
link: "/digit-ui/employee/ws/water/calculation",
|
|
24564
|
+
roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
|
|
23791
24565
|
}]
|
|
23792
24566
|
};
|
|
23793
24567
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard);
|
|
@@ -28983,8 +29757,10 @@ const WSFeeEstimation = _ref => {
|
|
|
28983
29757
|
};
|
|
28984
29758
|
|
|
28985
29759
|
const ViewBreakup = _ref => {
|
|
28986
|
-
var
|
|
28987
|
-
let wsAdditionalDetails = _ref.wsAdditionalDetails
|
|
29760
|
+
var _breakUpData$calculat, _breakUpData$calculat2, _breakUpData$calculat3, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
|
|
29761
|
+
let wsAdditionalDetails = _ref.wsAdditionalDetails,
|
|
29762
|
+
print = _ref.print,
|
|
29763
|
+
download = _ref.download;
|
|
28988
29764
|
const _useTranslation = reactI18next.useTranslation(),
|
|
28989
29765
|
t = _useTranslation.t;
|
|
28990
29766
|
const _useState = React.useState(false),
|
|
@@ -28993,6 +29769,44 @@ const ViewBreakup = _ref => {
|
|
|
28993
29769
|
const _useState2 = React.useState({}),
|
|
28994
29770
|
breakUpData = _useState2[0],
|
|
28995
29771
|
setBreakUpData = _useState2[1];
|
|
29772
|
+
const breakupRef = React.useRef(null);
|
|
29773
|
+
const formatNumber = function (value, maximumFractionDigits) {
|
|
29774
|
+
if (maximumFractionDigits === void 0) {
|
|
29775
|
+
maximumFractionDigits = 2;
|
|
29776
|
+
}
|
|
29777
|
+
return Number(value || 0).toLocaleString("en-IN", {
|
|
29778
|
+
maximumFractionDigits
|
|
29779
|
+
});
|
|
29780
|
+
};
|
|
29781
|
+
const formatCurrency = value => /*#__PURE__*/React__default.createElement("span", null, "\u20B9", formatNumber(value));
|
|
29782
|
+
const DetailRows = _ref2 => {
|
|
29783
|
+
let rows = _ref2.rows;
|
|
29784
|
+
return rows.map(_ref3 => {
|
|
29785
|
+
let label = _ref3.label,
|
|
29786
|
+
value = _ref3.value,
|
|
29787
|
+
_ref3$currency = _ref3.currency,
|
|
29788
|
+
currency = _ref3$currency === void 0 ? false : _ref3$currency,
|
|
29789
|
+
_ref3$unit = _ref3.unit,
|
|
29790
|
+
unit = _ref3$unit === void 0 ? "" : _ref3$unit,
|
|
29791
|
+
_ref3$isText = _ref3.isText,
|
|
29792
|
+
isText = _ref3$isText === void 0 ? false : _ref3$isText;
|
|
29793
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
|
|
29794
|
+
className: "border-none",
|
|
29795
|
+
rowContainerStyle: {
|
|
29796
|
+
margin: "0px"
|
|
29797
|
+
},
|
|
29798
|
+
labelStyle: {
|
|
29799
|
+
width: "50%"
|
|
29800
|
+
},
|
|
29801
|
+
key: label,
|
|
29802
|
+
label: label,
|
|
29803
|
+
text: currency ? formatCurrency(value) : isText ? value || "-" : "" + formatNumber(value) + unit,
|
|
29804
|
+
textStyle: {
|
|
29805
|
+
textAlign: "right"
|
|
29806
|
+
}
|
|
29807
|
+
});
|
|
29808
|
+
});
|
|
29809
|
+
};
|
|
28996
29810
|
const Heading = props => {
|
|
28997
29811
|
return /*#__PURE__*/React__default.createElement("h1", {
|
|
28998
29812
|
className: "heading-m"
|
|
@@ -29015,21 +29829,244 @@ const ViewBreakup = _ref => {
|
|
|
29015
29829
|
}, /*#__PURE__*/React__default.createElement(Close, null));
|
|
29016
29830
|
};
|
|
29017
29831
|
const onPopupOpen = () => {
|
|
29018
|
-
var _sessionBillFormData$;
|
|
29019
|
-
let breakupData = wsAdditionalDetails.additionalDetails
|
|
29832
|
+
var _wsAdditionalDetails$, _sessionBillFormData$;
|
|
29833
|
+
let breakupData = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$ === void 0 ? void 0 : _wsAdditionalDetails$.data) || {};
|
|
29020
29834
|
const sessionBillData = sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA");
|
|
29021
29835
|
const sessionBillFormData = sessionBillData ? JSON.parse(sessionBillData) : {};
|
|
29022
29836
|
if (sessionBillFormData !== null && sessionBillFormData !== void 0 && (_sessionBillFormData$ = sessionBillFormData.value) !== null && _sessionBillFormData$ !== void 0 && _sessionBillFormData$.totalAmount) breakupData = sessionBillFormData === null || sessionBillFormData === void 0 ? void 0 : sessionBillFormData.value;
|
|
29023
29837
|
setBreakUpData(breakupData);
|
|
29024
29838
|
showPopUp(true);
|
|
29025
29839
|
};
|
|
29840
|
+
const getBreakupReportDetails = () => {
|
|
29841
|
+
var _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4, _wsAdditionalDetails$5, _wsAdditionalDetails$6, _wsAdditionalDetails$7, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3;
|
|
29842
|
+
const amountRows = function (rows) {
|
|
29843
|
+
if (rows === void 0) {
|
|
29844
|
+
rows = [];
|
|
29845
|
+
}
|
|
29846
|
+
return rows.map(row => ({
|
|
29847
|
+
title: t(row === null || row === void 0 ? void 0 : row.taxHeadCode),
|
|
29848
|
+
value: "\u20B9" + formatNumber(row === null || row === void 0 ? void 0 : row.amount)
|
|
29849
|
+
}));
|
|
29850
|
+
};
|
|
29851
|
+
const connectionHolder = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$2 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$2 === void 0 ? void 0 : (_wsAdditionalDetails$3 = _wsAdditionalDetails$2.appDetails) === null || _wsAdditionalDetails$3 === void 0 ? void 0 : (_wsAdditionalDetails$4 = _wsAdditionalDetails$3.connectionHolders) === null || _wsAdditionalDetails$4 === void 0 ? void 0 : _wsAdditionalDetails$4[0];
|
|
29852
|
+
const applicantName = [connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.name, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.middleName, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.lastName].filter(Boolean).join(" ") || "-";
|
|
29853
|
+
const mobileNumber = (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.mobileNumber) || "-";
|
|
29854
|
+
const appNumber = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$5 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$5 === void 0 ? void 0 : (_wsAdditionalDetails$6 = _wsAdditionalDetails$5.data) === null || _wsAdditionalDetails$6 === void 0 ? void 0 : _wsAdditionalDetails$6.applicationNo) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$7 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$7 === void 0 ? void 0 : _wsAdditionalDetails$7.applicationNumber) || "-";
|
|
29855
|
+
return [{
|
|
29856
|
+
title: "Applicant Details",
|
|
29857
|
+
values: [{
|
|
29858
|
+
title: "Application Number",
|
|
29859
|
+
value: appNumber
|
|
29860
|
+
}, {
|
|
29861
|
+
title: "Applicant Name",
|
|
29862
|
+
value: applicantName
|
|
29863
|
+
}, {
|
|
29864
|
+
title: "Mobile Number",
|
|
29865
|
+
value: mobileNumber
|
|
29866
|
+
}]
|
|
29867
|
+
}, {
|
|
29868
|
+
title: t("WS_APPLICATION_FEE_HEADER"),
|
|
29869
|
+
values: amountRows([...((breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab = breakUpData.billSlabData) === null || _breakUpData$billSlab === void 0 ? void 0 : _breakUpData$billSlab.FEE) || []), ...((breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab2 = breakUpData.billSlabData) === null || _breakUpData$billSlab2 === void 0 ? void 0 : _breakUpData$billSlab2.CHARGES) || [])])
|
|
29870
|
+
}, {
|
|
29871
|
+
title: "Property details",
|
|
29872
|
+
values: propertyRows.map(_ref4 => {
|
|
29873
|
+
let label = _ref4.label,
|
|
29874
|
+
value = _ref4.value,
|
|
29875
|
+
currency = _ref4.currency,
|
|
29876
|
+
unit = _ref4.unit,
|
|
29877
|
+
isText = _ref4.isText;
|
|
29878
|
+
return {
|
|
29879
|
+
title: label,
|
|
29880
|
+
value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
|
|
29881
|
+
};
|
|
29882
|
+
})
|
|
29883
|
+
}, {
|
|
29884
|
+
title: "Taxes",
|
|
29885
|
+
values: amountRows(breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : _breakUpData$billSlab3.TAX)
|
|
29886
|
+
}, {
|
|
29887
|
+
title: "Water demand details",
|
|
29888
|
+
values: waterDemandRows.map(_ref5 => {
|
|
29889
|
+
let label = _ref5.label,
|
|
29890
|
+
value = _ref5.value,
|
|
29891
|
+
currency = _ref5.currency,
|
|
29892
|
+
unit = _ref5.unit,
|
|
29893
|
+
isText = _ref5.isText;
|
|
29894
|
+
return {
|
|
29895
|
+
title: label,
|
|
29896
|
+
value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
|
|
29897
|
+
};
|
|
29898
|
+
})
|
|
29899
|
+
}, {
|
|
29900
|
+
title: "Infrastructure charge details",
|
|
29901
|
+
values: infrastructureChargeRows.map(_ref6 => {
|
|
29902
|
+
let label = _ref6.label,
|
|
29903
|
+
value = _ref6.value,
|
|
29904
|
+
currency = _ref6.currency,
|
|
29905
|
+
unit = _ref6.unit,
|
|
29906
|
+
isText = _ref6.isText;
|
|
29907
|
+
return {
|
|
29908
|
+
title: label,
|
|
29909
|
+
value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
|
|
29910
|
+
};
|
|
29911
|
+
})
|
|
29912
|
+
}, {
|
|
29913
|
+
title: "Total",
|
|
29914
|
+
values: [{
|
|
29915
|
+
title: t("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),
|
|
29916
|
+
value: "\u20B9" + formatNumber(breakUpData === null || breakUpData === void 0 ? void 0 : breakUpData.totalAmount)
|
|
29917
|
+
}]
|
|
29918
|
+
}].filter(section => section.values.length > 0);
|
|
29919
|
+
};
|
|
29920
|
+
const generateBreakupReport = mode => {
|
|
29921
|
+
var _Digit$Utils, _Digit$Utils$pdf;
|
|
29922
|
+
const generateReport = (_Digit$Utils = Digit.Utils) === null || _Digit$Utils === void 0 ? void 0 : (_Digit$Utils$pdf = _Digit$Utils.pdf) === null || _Digit$Utils$pdf === void 0 ? void 0 : _Digit$Utils$pdf.generateCalculationBreakupReport;
|
|
29923
|
+
if (typeof generateReport === "function") {
|
|
29924
|
+
return generateReport({
|
|
29925
|
+
tenantId: Digit.ULBService.getCurrentTenantId(),
|
|
29926
|
+
heading: t("WS_CALCULATION_BREAKUP"),
|
|
29927
|
+
details: getBreakupReportDetails(),
|
|
29928
|
+
t,
|
|
29929
|
+
mode
|
|
29930
|
+
});
|
|
29931
|
+
}
|
|
29932
|
+
return mode === "download" ? Digit.Download.PDF(breakupRef, t("WS_CALCULATION_BREAKUP")) : null;
|
|
29933
|
+
};
|
|
29934
|
+
const handleDownload = () => generateBreakupReport("download");
|
|
29935
|
+
const handlePrint = () => {
|
|
29936
|
+
var _Digit$Utils2, _Digit$Utils2$pdf, _breakupRef$current, _window$mSewaApp, _window$mSewaApp$isMs;
|
|
29937
|
+
if ((_Digit$Utils2 = Digit.Utils) !== null && _Digit$Utils2 !== void 0 && (_Digit$Utils2$pdf = _Digit$Utils2.pdf) !== null && _Digit$Utils2$pdf !== void 0 && _Digit$Utils2$pdf.generateCalculationBreakupReport) {
|
|
29938
|
+
return generateBreakupReport("print");
|
|
29939
|
+
}
|
|
29940
|
+
const content = (_breakupRef$current = breakupRef.current) === null || _breakupRef$current === void 0 ? void 0 : _breakupRef$current.innerHTML;
|
|
29941
|
+
if (!content) return;
|
|
29942
|
+
if ((_window$mSewaApp = window.mSewaApp) !== null && _window$mSewaApp !== void 0 && (_window$mSewaApp$isMs = _window$mSewaApp.isMsewaApp) !== null && _window$mSewaApp$isMs !== void 0 && _window$mSewaApp$isMs.call(_window$mSewaApp)) {
|
|
29943
|
+
window.mSewaApp.downloadBase64File(window.btoa(unescape(encodeURIComponent(content))), t("WS_CALCULATION_BREAKUP"));
|
|
29944
|
+
return;
|
|
29945
|
+
}
|
|
29946
|
+
const printWindow = window.open("", "");
|
|
29947
|
+
if (!printWindow) return;
|
|
29948
|
+
printWindow.document.write("<html><body>" + content + "</body></html>");
|
|
29949
|
+
printWindow.document.close();
|
|
29950
|
+
printWindow.focus();
|
|
29951
|
+
printWindow.print();
|
|
29952
|
+
};
|
|
29953
|
+
const propertyDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat = breakUpData.calculationDetail) === null || _breakUpData$calculat === void 0 ? void 0 : _breakUpData$calculat.propertyDetail;
|
|
29954
|
+
const waterDemandDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat2 = breakUpData.calculationDetail) === null || _breakUpData$calculat2 === void 0 ? void 0 : _breakUpData$calculat2.waterDemandDetail;
|
|
29955
|
+
const infrastructureChargeDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat3 = breakUpData.calculationDetail) === null || _breakUpData$calculat3 === void 0 ? void 0 : _breakUpData$calculat3.infrastructureChargeDetail;
|
|
29956
|
+
const propertyRows = propertyDetail ? [{
|
|
29957
|
+
label: "Property ID",
|
|
29958
|
+
value: propertyDetail.propertyId,
|
|
29959
|
+
isText: true
|
|
29960
|
+
}, {
|
|
29961
|
+
label: "Property type",
|
|
29962
|
+
value: propertyDetail.propertyType,
|
|
29963
|
+
isText: true
|
|
29964
|
+
}, {
|
|
29965
|
+
label: "Plot area",
|
|
29966
|
+
value: propertyDetail.landArea,
|
|
29967
|
+
unit: " (sq. meter.)"
|
|
29968
|
+
}, {
|
|
29969
|
+
label: "Built-up area",
|
|
29970
|
+
value: propertyDetail.superBuiltUpArea,
|
|
29971
|
+
unit: " (sq. meter.)"
|
|
29972
|
+
}, {
|
|
29973
|
+
label: "farArea",
|
|
29974
|
+
value: propertyDetail.farArea,
|
|
29975
|
+
isText: true
|
|
29976
|
+
}, {
|
|
29977
|
+
label: "coveredArea",
|
|
29978
|
+
value: propertyDetail.coveredArea,
|
|
29979
|
+
isText: true
|
|
29980
|
+
}, {
|
|
29981
|
+
label: "numberOfDwellingUnits",
|
|
29982
|
+
value: propertyDetail.numberOfDwellingUnits,
|
|
29983
|
+
isText: true
|
|
29984
|
+
}, {
|
|
29985
|
+
label: "numberOfBeds",
|
|
29986
|
+
value: propertyDetail.numberOfBeds,
|
|
29987
|
+
isText: true
|
|
29988
|
+
}, {
|
|
29989
|
+
label: "numberOfRooms",
|
|
29990
|
+
value: propertyDetail.numberOfRooms,
|
|
29991
|
+
isText: true
|
|
29992
|
+
}, {
|
|
29993
|
+
label: "numberOfStudents",
|
|
29994
|
+
value: propertyDetail.numberOfStudents,
|
|
29995
|
+
isText: true
|
|
29996
|
+
}, {
|
|
29997
|
+
label: "numberOfStaff",
|
|
29998
|
+
value: propertyDetail.numberOfStaff,
|
|
29999
|
+
isText: true
|
|
30000
|
+
}, {
|
|
30001
|
+
label: "Usage category",
|
|
30002
|
+
value: propertyDetail.usageCategory,
|
|
30003
|
+
isText: true
|
|
30004
|
+
}] : [];
|
|
30005
|
+
const waterDemandRows = waterDemandDetail ? [{
|
|
30006
|
+
label: "Calculated occupancy",
|
|
30007
|
+
value: waterDemandDetail.calculatedOccupancy,
|
|
30008
|
+
unit: " person"
|
|
30009
|
+
}, {
|
|
30010
|
+
label: "Applied LPCD",
|
|
30011
|
+
value: waterDemandDetail.chosenLpcd,
|
|
30012
|
+
unit: " LPD"
|
|
30013
|
+
}, {
|
|
30014
|
+
label: "Base demand",
|
|
30015
|
+
value: waterDemandDetail.baseDemand,
|
|
30016
|
+
unit: " LPD"
|
|
30017
|
+
}, {
|
|
30018
|
+
label: "Contingency/Floating Occupancy",
|
|
30019
|
+
value: waterDemandDetail.contingencyPercentage,
|
|
30020
|
+
unit: "%"
|
|
30021
|
+
}, {
|
|
30022
|
+
label: "Total water demand",
|
|
30023
|
+
value: waterDemandDetail.totalWaterDemandLPD,
|
|
30024
|
+
unit: " LPD"
|
|
30025
|
+
}] : [];
|
|
30026
|
+
const infrastructureChargeRows = infrastructureChargeDetail ? [{
|
|
30027
|
+
label: "Colony category",
|
|
30028
|
+
value: infrastructureChargeDetail.colonyCategory,
|
|
30029
|
+
isText: true
|
|
30030
|
+
}, {
|
|
30031
|
+
label: "Plot area",
|
|
30032
|
+
value: infrastructureChargeDetail.plotArea,
|
|
30033
|
+
unit: " (sq. meter.)"
|
|
30034
|
+
}, {
|
|
30035
|
+
label: "Water rate",
|
|
30036
|
+
value: infrastructureChargeDetail.waterRatePerLPD,
|
|
30037
|
+
currency: true
|
|
30038
|
+
}, {
|
|
30039
|
+
label: "Sewer rate",
|
|
30040
|
+
value: infrastructureChargeDetail.sewerRatePerLPD,
|
|
30041
|
+
currency: true
|
|
30042
|
+
}, {
|
|
30043
|
+
label: "Water Infra Charges",
|
|
30044
|
+
value: infrastructureChargeDetail.waterComponentIFC,
|
|
30045
|
+
currency: true
|
|
30046
|
+
}, {
|
|
30047
|
+
label: "Sewer Infra Charges",
|
|
30048
|
+
value: infrastructureChargeDetail.sewerComponentIFC,
|
|
30049
|
+
currency: true
|
|
30050
|
+
}, {
|
|
30051
|
+
label: "Rebate",
|
|
30052
|
+
value: infrastructureChargeDetail.rebatePercentage,
|
|
30053
|
+
unit: "%"
|
|
30054
|
+
}, {
|
|
30055
|
+
label: "Rebate amount",
|
|
30056
|
+
value: infrastructureChargeDetail.rebateAmount,
|
|
30057
|
+
currency: true
|
|
30058
|
+
}, {
|
|
30059
|
+
label: "Net IFC",
|
|
30060
|
+
value: infrastructureChargeDetail.netIFC,
|
|
30061
|
+
currency: true
|
|
30062
|
+
}] : [];
|
|
29026
30063
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
29027
30064
|
style: {
|
|
29028
30065
|
lineHeight: "19px",
|
|
29029
30066
|
maxWidth: "950px",
|
|
29030
30067
|
minWidth: "280px"
|
|
29031
30068
|
}
|
|
29032
|
-
}, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$ !== void 0 && _wsAdditionalDetails
|
|
30069
|
+
}, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$8 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$8 !== void 0 && _wsAdditionalDetails$8.isViewBreakup ? /*#__PURE__*/React__default.createElement("div", {
|
|
29033
30070
|
onClick: e => onPopupOpen(),
|
|
29034
30071
|
style: {
|
|
29035
30072
|
marginTop: "12px"
|
|
@@ -29040,6 +30077,9 @@ const ViewBreakup = _ref => {
|
|
|
29040
30077
|
headerBarMain: /*#__PURE__*/React__default.createElement(Heading, {
|
|
29041
30078
|
label: t("WS_CALCULATION_BREAKUP")
|
|
29042
30079
|
}),
|
|
30080
|
+
width: "950px",
|
|
30081
|
+
print: print || handlePrint,
|
|
30082
|
+
download: download || handleDownload,
|
|
29043
30083
|
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn, {
|
|
29044
30084
|
onClick: () => {
|
|
29045
30085
|
showPopUp(false);
|
|
@@ -29055,16 +30095,13 @@ const ViewBreakup = _ref => {
|
|
|
29055
30095
|
popupModuleMianStyles: {
|
|
29056
30096
|
paddingTop: "0px"
|
|
29057
30097
|
}
|
|
29058
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
29059
|
-
|
|
29060
|
-
|
|
29061
|
-
paddingTop: "0px"
|
|
29062
|
-
}
|
|
29063
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
|
|
30098
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
30099
|
+
ref: breakupRef
|
|
30100
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
|
|
29064
30101
|
style: {
|
|
29065
30102
|
margin: "10px 0px"
|
|
29066
30103
|
}
|
|
29067
|
-
}, t("WS_APPLICATION_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$
|
|
30104
|
+
}, t("WS_APPLICATION_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab4 = breakUpData.billSlabData) === null || _breakUpData$billSlab4 === void 0 ? void 0 : (_breakUpData$billSlab5 = _breakUpData$billSlab4.FEE) === null || _breakUpData$billSlab5 === void 0 ? void 0 : _breakUpData$billSlab5.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
|
|
29068
30105
|
className: "border-none",
|
|
29069
30106
|
rowContainerStyle: {
|
|
29070
30107
|
margin: "0px"
|
|
@@ -29078,11 +30115,7 @@ const ViewBreakup = _ref => {
|
|
|
29078
30115
|
textStyle: {
|
|
29079
30116
|
textAlign: "right"
|
|
29080
30117
|
}
|
|
29081
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.
|
|
29082
|
-
style: {
|
|
29083
|
-
margin: "10px 0px"
|
|
29084
|
-
}
|
|
29085
|
-
}, t("WS_SERVICE_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : (_breakUpData$billSlab4 = _breakUpData$billSlab3.CHARGES) === null || _breakUpData$billSlab4 === void 0 ? void 0 : _breakUpData$billSlab4.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
|
|
30118
|
+
})), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab6 = breakUpData.billSlabData) === null || _breakUpData$billSlab6 === void 0 ? void 0 : (_breakUpData$billSlab7 = _breakUpData$billSlab6.CHARGES) === null || _breakUpData$billSlab7 === void 0 ? void 0 : _breakUpData$billSlab7.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
|
|
29086
30119
|
className: "border-none",
|
|
29087
30120
|
rowContainerStyle: {
|
|
29088
30121
|
margin: "0px"
|
|
@@ -29096,7 +30129,7 @@ const ViewBreakup = _ref => {
|
|
|
29096
30129
|
textStyle: {
|
|
29097
30130
|
textAlign: "right"
|
|
29098
30131
|
}
|
|
29099
|
-
})), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$
|
|
30132
|
+
})), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab8 = breakUpData.billSlabData) === null || _breakUpData$billSlab8 === void 0 ? void 0 : (_breakUpData$billSlab9 = _breakUpData$billSlab8.TAX) === null || _breakUpData$billSlab9 === void 0 ? void 0 : _breakUpData$billSlab9.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
|
|
29100
30133
|
className: "border-none",
|
|
29101
30134
|
rowContainerStyle: {
|
|
29102
30135
|
margin: "0px"
|
|
@@ -29110,6 +30143,24 @@ const ViewBreakup = _ref => {
|
|
|
29110
30143
|
textStyle: {
|
|
29111
30144
|
textAlign: "right"
|
|
29112
30145
|
}
|
|
30146
|
+
})), propertyRows.length > 0 && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
|
|
30147
|
+
style: {
|
|
30148
|
+
margin: "10px 0px"
|
|
30149
|
+
}
|
|
30150
|
+
}, "Property details"), /*#__PURE__*/React__default.createElement(DetailRows, {
|
|
30151
|
+
rows: propertyRows
|
|
30152
|
+
})), waterDemandRows.length > 0 && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
|
|
30153
|
+
style: {
|
|
30154
|
+
margin: "10px 0px"
|
|
30155
|
+
}
|
|
30156
|
+
}, "Water demand details"), /*#__PURE__*/React__default.createElement(DetailRows, {
|
|
30157
|
+
rows: waterDemandRows
|
|
30158
|
+
})), infrastructureChargeRows.length > 0 && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
|
|
30159
|
+
style: {
|
|
30160
|
+
margin: "10px 0px"
|
|
30161
|
+
}
|
|
30162
|
+
}, "Infrastructure charge details"), /*#__PURE__*/React__default.createElement(DetailRows, {
|
|
30163
|
+
rows: infrastructureChargeRows
|
|
29113
30164
|
})), /*#__PURE__*/React__default.createElement("hr", {
|
|
29114
30165
|
style: {
|
|
29115
30166
|
color: "#cccccc",
|
|
@@ -29132,7 +30183,7 @@ const ViewBreakup = _ref => {
|
|
|
29132
30183
|
fontWeight: "700",
|
|
29133
30184
|
fontSize: "24px"
|
|
29134
30185
|
}
|
|
29135
|
-
})))));
|
|
30186
|
+
}))))));
|
|
29136
30187
|
};
|
|
29137
30188
|
|
|
29138
30189
|
const checkForNA$1 = value => {
|
|
@@ -33827,7 +34878,7 @@ const WSPropertyLocationDetails = props => {
|
|
|
33827
34878
|
return /*#__PURE__*/React__default.createElement(PropertyLocationDetails, props);
|
|
33828
34879
|
};
|
|
33829
34880
|
|
|
33830
|
-
const _excluded$
|
|
34881
|
+
const _excluded$4 = ["errors"],
|
|
33831
34882
|
_excluded2$2 = ["register", "control", "watch", "setValue", "unregister", "handleSubmit", "formState", "getValues", "reset"];
|
|
33832
34883
|
const ApplicationBillAmendment = () => {
|
|
33833
34884
|
var _data$BillingService, _data$BillingService$, _data$BillingService2, _data$BillingService3, _state, _state$data, _state$data$applicati, _state$data$applicati2, _state$data$applicati3, _billSearchData, _billSearchData$filte, _billSearchData2, _state9, _state9$data, _errors$WS_REDUCED_AM, _errors$WS_ADDITIONAL, _billSearchData3, _errors$effectiveTill, _errors$effectiveTill2, _state12, _state12$data;
|
|
@@ -33884,7 +34935,7 @@ const ApplicationBillAmendment = () => {
|
|
|
33884
34935
|
handleSubmit = _useForm.handleSubmit,
|
|
33885
34936
|
_useForm$formState = _useForm.formState,
|
|
33886
34937
|
errors = _useForm$formState.errors,
|
|
33887
|
-
rest = _objectWithoutPropertiesLoose(_useForm$formState, _excluded$
|
|
34938
|
+
rest = _objectWithoutPropertiesLoose(_useForm$formState, _excluded$4),
|
|
33888
34939
|
getValues = _useForm.getValues,
|
|
33889
34940
|
methods = _objectWithoutPropertiesLoose(_useForm, _excluded2$2);
|
|
33890
34941
|
const _Digit$Hooks$ws$useAp = Digit.Hooks.ws.useApplicationActionsBillAmendUpdate(),
|
|
@@ -34749,8 +35800,8 @@ const DECLARATION_POINTS = ["I understand that sanction of connection does not a
|
|
|
34749
35800
|
const NAME_PATTERN = /^[a-zA-Z\s.'-]{1,50}$/;
|
|
34750
35801
|
const EMAIL_PATTERN = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/;
|
|
34751
35802
|
const MOBILE_PATTERN = /^[6-9][0-9]{9}$/;
|
|
34752
|
-
const NUMBER_PATTERN$
|
|
34753
|
-
const DECIMAL_PATTERN$
|
|
35803
|
+
const NUMBER_PATTERN$2 = /^\d+$/;
|
|
35804
|
+
const DECIMAL_PATTERN$2 = /^\d+(\.\d{1,2})?$/;
|
|
34754
35805
|
const IFSC_PATTERN = /^[A-Z]{4}0[A-Z0-9]{6}$/;
|
|
34755
35806
|
const ACCOUNT_PATTERN = /^[0-9]{9,18}$/;
|
|
34756
35807
|
const COLLAPSIBLE_CONTENT_TAB = "__WS_SECTION_CONTENT__";
|
|
@@ -37019,7 +38070,7 @@ const NewApplication = () => {
|
|
|
37019
38070
|
errorStyle: !!getFieldError("useDetails.plotArea"),
|
|
37020
38071
|
inputRef: register({
|
|
37021
38072
|
pattern: {
|
|
37022
|
-
value: DECIMAL_PATTERN$
|
|
38073
|
+
value: DECIMAL_PATTERN$2,
|
|
37023
38074
|
message: "Enter a valid numeric value."
|
|
37024
38075
|
},
|
|
37025
38076
|
required: "Plot Area is required."
|
|
@@ -37033,7 +38084,7 @@ const NewApplication = () => {
|
|
|
37033
38084
|
errorStyle: !!getFieldError("useDetails.builtUpArea"),
|
|
37034
38085
|
inputRef: register({
|
|
37035
38086
|
pattern: {
|
|
37036
|
-
value: DECIMAL_PATTERN$
|
|
38087
|
+
value: DECIMAL_PATTERN$2,
|
|
37037
38088
|
message: "Enter a valid numeric value."
|
|
37038
38089
|
},
|
|
37039
38090
|
required: "Built Up Area is required."
|
|
@@ -37064,7 +38115,7 @@ const NewApplication = () => {
|
|
|
37064
38115
|
errorStyle: !!getFieldError("useDetails.NumberofDwellingUnits"),
|
|
37065
38116
|
inputRef: register({
|
|
37066
38117
|
pattern: {
|
|
37067
|
-
value: DECIMAL_PATTERN$
|
|
38118
|
+
value: DECIMAL_PATTERN$2,
|
|
37068
38119
|
message: "Enter a valid numeric value."
|
|
37069
38120
|
},
|
|
37070
38121
|
required: "Built Up Area is required."
|
|
@@ -37078,7 +38129,7 @@ const NewApplication = () => {
|
|
|
37078
38129
|
errorStyle: !!getFieldError("useDetails.NumberofRooms"),
|
|
37079
38130
|
inputRef: register({
|
|
37080
38131
|
pattern: {
|
|
37081
|
-
value: DECIMAL_PATTERN$
|
|
38132
|
+
value: DECIMAL_PATTERN$2,
|
|
37082
38133
|
message: "Enter a valid numeric value."
|
|
37083
38134
|
},
|
|
37084
38135
|
required: "Built Up Area is required."
|
|
@@ -37092,7 +38143,7 @@ const NewApplication = () => {
|
|
|
37092
38143
|
errorStyle: !!getFieldError("useDetails.hospitalBeds"),
|
|
37093
38144
|
inputRef: register({
|
|
37094
38145
|
pattern: {
|
|
37095
|
-
value: NUMBER_PATTERN$
|
|
38146
|
+
value: NUMBER_PATTERN$2,
|
|
37096
38147
|
message: "Enter a valid whole number."
|
|
37097
38148
|
},
|
|
37098
38149
|
required: isHospitalProperty ? "No. of Beds is required for Hospital / Nursing Home." : false
|
|
@@ -45853,9 +46904,11 @@ const ActivateConnection = () => {
|
|
|
45853
46904
|
}
|
|
45854
46905
|
}, []);
|
|
45855
46906
|
React.useEffect(() => {
|
|
45856
|
-
if (!isLoading) {
|
|
46907
|
+
if (!isLoading && newConfig && Array.isArray(newConfig)) {
|
|
45857
46908
|
const config = newConfig.find(conf => conf.hideInCitizen);
|
|
45858
|
-
|
|
46909
|
+
if (config) {
|
|
46910
|
+
setConfig(config);
|
|
46911
|
+
}
|
|
45859
46912
|
}
|
|
45860
46913
|
}, [newConfig]);
|
|
45861
46914
|
React.useEffect(() => {
|
|
@@ -46364,16 +47417,18 @@ const EditApplication$1 = () => {
|
|
|
46364
47417
|
}),
|
|
46365
47418
|
propertyDetails = _Digit$Hooks$pt$usePr.data;
|
|
46366
47419
|
React.useEffect(() => {
|
|
46367
|
-
if (!isConfigLoading) {
|
|
46368
|
-
var _config$body;
|
|
47420
|
+
if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
|
|
46369
47421
|
const config = newConfig.find(conf => conf.hideInCitizen && conf.isEdit);
|
|
46370
|
-
config
|
|
46371
|
-
|
|
46372
|
-
|
|
46373
|
-
|
|
46374
|
-
|
|
46375
|
-
|
|
46376
|
-
|
|
47422
|
+
if (config) {
|
|
47423
|
+
var _config$body;
|
|
47424
|
+
config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
|
|
47425
|
+
let bodyDetails = [];
|
|
47426
|
+
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
47427
|
+
if (data !== null && data !== void 0 && data.isEditConnection) bodyDetails.push(data);
|
|
47428
|
+
});
|
|
47429
|
+
config.body = bodyDetails;
|
|
47430
|
+
setConfig(config);
|
|
47431
|
+
}
|
|
46377
47432
|
}
|
|
46378
47433
|
}, [newConfig]);
|
|
46379
47434
|
React.useEffect(() => {
|
|
@@ -47026,19 +48081,21 @@ const ModifyApplication = () => {
|
|
|
47026
48081
|
}),
|
|
47027
48082
|
propertyDetails = _Digit$Hooks$pt$usePr.data;
|
|
47028
48083
|
React.useEffect(() => {
|
|
47029
|
-
if (!isConfigLoading) {
|
|
47030
|
-
var _config$body;
|
|
48084
|
+
if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
|
|
47031
48085
|
const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
|
|
47032
|
-
config
|
|
47033
|
-
|
|
47034
|
-
|
|
47035
|
-
|
|
47036
|
-
|
|
47037
|
-
|
|
47038
|
-
|
|
47039
|
-
|
|
47040
|
-
|
|
47041
|
-
|
|
48086
|
+
if (config) {
|
|
48087
|
+
var _config$body;
|
|
48088
|
+
config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
|
|
48089
|
+
let bodyDetails = [];
|
|
48090
|
+
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
48091
|
+
if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
|
|
48092
|
+
});
|
|
48093
|
+
bodyDetails.forEach(bdyData => {
|
|
48094
|
+
if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
|
|
48095
|
+
});
|
|
48096
|
+
config.body = bodyDetails;
|
|
48097
|
+
setConfig(config);
|
|
48098
|
+
}
|
|
47042
48099
|
}
|
|
47043
48100
|
}, [newConfig]);
|
|
47044
48101
|
React.useEffect(() => {
|
|
@@ -47129,8 +48186,529 @@ const ModifyApplication = () => {
|
|
|
47129
48186
|
};
|
|
47130
48187
|
}
|
|
47131
48188
|
const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
|
|
47132
|
-
return Promise.resolve(convertModifyApplicationDetails(data, details)).then(function (convertAppData) {
|
|
47133
|
-
var _data$ConnectionDetai, _data$ConnectionDetai2, _data$ConnectionDetai3, _data$ConnectionDetai4, _formData;
|
|
48189
|
+
return Promise.resolve(convertModifyApplicationDetails(data, details)).then(function (convertAppData) {
|
|
48190
|
+
var _data$ConnectionDetai, _data$ConnectionDetai2, _data$ConnectionDetai3, _data$ConnectionDetai4, _formData;
|
|
48191
|
+
function _temp6() {
|
|
48192
|
+
const _temp4 = function () {
|
|
48193
|
+
if (serviceType !== "WATER") {
|
|
48194
|
+
const _temp3 = function () {
|
|
48195
|
+
if (sewerageMutation) {
|
|
48196
|
+
setIsEnableLoader(true);
|
|
48197
|
+
return Promise.resolve(sewerageMutation(reqDetails, {
|
|
48198
|
+
onError: (error, variables) => {
|
|
48199
|
+
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2, _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
|
|
48200
|
+
setIsEnableLoader(false);
|
|
48201
|
+
setShowToast({
|
|
48202
|
+
key: "error",
|
|
48203
|
+
message: error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && (_error$response$data = _error$response.data) !== null && _error$response$data !== void 0 && (_error$response$data$ = _error$response$data.Errors) !== null && _error$response$data$ !== void 0 && (_error$response$data$2 = _error$response$data$[0]) !== null && _error$response$data$2 !== void 0 && _error$response$data$2.message ? error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : (_error$response2$data3 = _error$response2$data2[0]) === null || _error$response2$data3 === void 0 ? void 0 : _error$response2$data3.message : error
|
|
48204
|
+
});
|
|
48205
|
+
setTimeout(closeToastOfError, 5000);
|
|
48206
|
+
},
|
|
48207
|
+
onSuccess: function (data, variables) {
|
|
48208
|
+
try {
|
|
48209
|
+
var _data$SewerageConnect;
|
|
48210
|
+
return Promise.resolve(updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : _data$SewerageConnect[0], "SEWERAGE")).then(function (response) {
|
|
48211
|
+
let sewerageConnectionUpdate = {
|
|
48212
|
+
SewerageConnection: response,
|
|
48213
|
+
reconnectRequest: false,
|
|
48214
|
+
disconnectRequest: false
|
|
48215
|
+
};
|
|
48216
|
+
return Promise.resolve(sewerageUpdateMutation(sewerageConnectionUpdate, {
|
|
48217
|
+
onError: (error, variables) => {
|
|
48218
|
+
setIsEnableLoader(false);
|
|
48219
|
+
setShowToast({
|
|
48220
|
+
key: "error",
|
|
48221
|
+
message: error !== null && error !== void 0 && error.message ? error.message : error
|
|
48222
|
+
});
|
|
48223
|
+
setTimeout(closeToastOfError, 5000);
|
|
48224
|
+
},
|
|
48225
|
+
onSuccess: (data, variables) => {
|
|
48226
|
+
var _data$SewerageConnect2, _data$SewerageConnect3;
|
|
48227
|
+
clearSessionFormData();
|
|
48228
|
+
history.push("/digit-ui/employee/ws/ws-response?applicationNumber1=" + (data === null || data === void 0 ? void 0 : (_data$SewerageConnect2 = data.SewerageConnections) === null || _data$SewerageConnect2 === void 0 ? void 0 : (_data$SewerageConnect3 = _data$SewerageConnect2[0]) === null || _data$SewerageConnect3 === void 0 ? void 0 : _data$SewerageConnect3.applicationNo));
|
|
48229
|
+
}
|
|
48230
|
+
})).then(function () {});
|
|
48231
|
+
});
|
|
48232
|
+
} catch (e) {
|
|
48233
|
+
return Promise.reject(e);
|
|
48234
|
+
}
|
|
48235
|
+
}
|
|
48236
|
+
})).then(function () {});
|
|
48237
|
+
}
|
|
48238
|
+
}();
|
|
48239
|
+
if (_temp3 && _temp3.then) return _temp3.then(function () {});
|
|
48240
|
+
}
|
|
48241
|
+
}();
|
|
48242
|
+
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
48243
|
+
}
|
|
48244
|
+
const reqDetails = (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai = data.ConnectionDetails) === null || _data$ConnectionDetai === void 0 ? void 0 : (_data$ConnectionDetai2 = _data$ConnectionDetai[0]) === null || _data$ConnectionDetai2 === void 0 ? void 0 : _data$ConnectionDetai2.serviceName) == "WATER" ? (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai3 = data.ConnectionDetails) === null || _data$ConnectionDetai3 === void 0 ? void 0 : (_data$ConnectionDetai4 = _data$ConnectionDetai3[0]) === null || _data$ConnectionDetai4 === void 0 ? void 0 : _data$ConnectionDetai4.applicationType) === "WATER_RECONNECTION" ? {
|
|
48245
|
+
WaterConnection: convertAppData,
|
|
48246
|
+
reconnectRequest: true,
|
|
48247
|
+
disconnectRequest: false
|
|
48248
|
+
} : {
|
|
48249
|
+
WaterConnection: convertAppData,
|
|
48250
|
+
reconnectRequest: false,
|
|
48251
|
+
disconnectRequest: false
|
|
48252
|
+
} : ((_formData = formData) === null || _formData === void 0 ? void 0 : _formData.applicationType) === "SEWERAGE_RECONNECTION" ? {
|
|
48253
|
+
SewerageConnection: convertAppData,
|
|
48254
|
+
reconnectRequest: true,
|
|
48255
|
+
disconnectRequest: false
|
|
48256
|
+
} : {
|
|
48257
|
+
SewerageConnection: convertAppData,
|
|
48258
|
+
reconnectRequest: false,
|
|
48259
|
+
disconnectRequest: false
|
|
48260
|
+
};
|
|
48261
|
+
const _temp5 = function () {
|
|
48262
|
+
if (serviceType == "WATER") {
|
|
48263
|
+
const _temp2 = function () {
|
|
48264
|
+
if (waterMutation) {
|
|
48265
|
+
setIsEnableLoader(true);
|
|
48266
|
+
return Promise.resolve(waterMutation(reqDetails, {
|
|
48267
|
+
onError: (error, variables) => {
|
|
48268
|
+
var _error$response3, _error$response3$data, _error$response3$data2, _error$response4, _error$response4$data, _error$response4$data2;
|
|
48269
|
+
setIsEnableLoader(false);
|
|
48270
|
+
setShowToast({
|
|
48271
|
+
key: "error",
|
|
48272
|
+
message: error !== null && error !== void 0 && (_error$response3 = error.response) !== null && _error$response3 !== void 0 && (_error$response3$data = _error$response3.data) !== null && _error$response3$data !== void 0 && (_error$response3$data2 = _error$response3$data.Errors) !== null && _error$response3$data2 !== void 0 && _error$response3$data2[0].message ? error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.Errors) === null || _error$response4$data2 === void 0 ? void 0 : _error$response4$data2[0].message : error
|
|
48273
|
+
});
|
|
48274
|
+
setTimeout(closeToastOfError, 5000);
|
|
48275
|
+
},
|
|
48276
|
+
onSuccess: function (data, variables) {
|
|
48277
|
+
try {
|
|
48278
|
+
var _data$WaterConnection;
|
|
48279
|
+
return Promise.resolve(updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : _data$WaterConnection[0], "WATER")).then(function (response) {
|
|
48280
|
+
let waterConnectionUpdate = {
|
|
48281
|
+
WaterConnection: response,
|
|
48282
|
+
reconnectRequest: false,
|
|
48283
|
+
disconnectRequest: false
|
|
48284
|
+
};
|
|
48285
|
+
waterUpdateMutation(waterConnectionUpdate, {
|
|
48286
|
+
onError: (error, variables) => {
|
|
48287
|
+
var _error$response5, _error$response5$data, _error$response5$data2, _error$response6, _error$response6$data, _error$response6$data2;
|
|
48288
|
+
setIsEnableLoader(false);
|
|
48289
|
+
setShowToast({
|
|
48290
|
+
key: "error",
|
|
48291
|
+
message: error !== null && error !== void 0 && (_error$response5 = error.response) !== null && _error$response5 !== void 0 && (_error$response5$data = _error$response5.data) !== null && _error$response5$data !== void 0 && (_error$response5$data2 = _error$response5$data.Errors) !== null && _error$response5$data2 !== void 0 && _error$response5$data2[0].message ? error === null || error === void 0 ? void 0 : (_error$response6 = error.response) === null || _error$response6 === void 0 ? void 0 : (_error$response6$data = _error$response6.data) === null || _error$response6$data === void 0 ? void 0 : (_error$response6$data2 = _error$response6$data.Errors) === null || _error$response6$data2 === void 0 ? void 0 : _error$response6$data2[0].message : error
|
|
48292
|
+
});
|
|
48293
|
+
setTimeout(closeToastOfError, 5000);
|
|
48294
|
+
},
|
|
48295
|
+
onSuccess: (data, variables) => {
|
|
48296
|
+
var _data$WaterConnection2, _data$WaterConnection3;
|
|
48297
|
+
clearSessionFormData();
|
|
48298
|
+
history.push("/digit-ui/employee/ws/ws-response?applicationNumber=" + (data === null || data === void 0 ? void 0 : (_data$WaterConnection2 = data.WaterConnection) === null || _data$WaterConnection2 === void 0 ? void 0 : (_data$WaterConnection3 = _data$WaterConnection2[0]) === null || _data$WaterConnection3 === void 0 ? void 0 : _data$WaterConnection3.applicationNo));
|
|
48299
|
+
}
|
|
48300
|
+
});
|
|
48301
|
+
});
|
|
48302
|
+
} catch (e) {
|
|
48303
|
+
return Promise.reject(e);
|
|
48304
|
+
}
|
|
48305
|
+
}
|
|
48306
|
+
})).then(function () {});
|
|
48307
|
+
}
|
|
48308
|
+
}();
|
|
48309
|
+
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
48310
|
+
}
|
|
48311
|
+
}();
|
|
48312
|
+
return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
|
|
48313
|
+
});
|
|
48314
|
+
}
|
|
48315
|
+
}();
|
|
48316
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
|
|
48317
|
+
} catch (e) {
|
|
48318
|
+
return Promise.reject(e);
|
|
48319
|
+
}
|
|
48320
|
+
};
|
|
48321
|
+
const closeToast = () => {
|
|
48322
|
+
setShowToast(null);
|
|
48323
|
+
};
|
|
48324
|
+
if (enabledLoader || isEnableLoader || isConfigLoading) {
|
|
48325
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
48326
|
+
}
|
|
48327
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
48328
|
+
style: {
|
|
48329
|
+
marginLeft: "15px"
|
|
48330
|
+
}
|
|
48331
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Header, null, t(config.head))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
|
|
48332
|
+
config: config.body,
|
|
48333
|
+
userType: "employee",
|
|
48334
|
+
onFormValueChange: onFormValueChange,
|
|
48335
|
+
label: t("CS_COMMON_SUBMIT"),
|
|
48336
|
+
onSubmit: onSubmit,
|
|
48337
|
+
defaultValues: sessionFormData,
|
|
48338
|
+
appData: appData
|
|
48339
|
+
}), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
48340
|
+
isDleteBtn: true,
|
|
48341
|
+
error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error" ? true : false,
|
|
48342
|
+
label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
|
|
48343
|
+
onClose: closeToast
|
|
48344
|
+
}));
|
|
48345
|
+
};
|
|
48346
|
+
|
|
48347
|
+
const EditModifyApplication = () => {
|
|
48348
|
+
var _state;
|
|
48349
|
+
const _useTranslation = reactI18next.useTranslation(),
|
|
48350
|
+
t = _useTranslation.t;
|
|
48351
|
+
let _useLocation = reactRouterDom.useLocation(),
|
|
48352
|
+
state = _useLocation.state;
|
|
48353
|
+
state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
|
|
48354
|
+
const history = reactRouterDom.useHistory();
|
|
48355
|
+
let filters = getQueryStringParams(location.search);
|
|
48356
|
+
const _useState = React.useState(false),
|
|
48357
|
+
canSubmit = _useState[0],
|
|
48358
|
+
setSubmitValve = _useState[1];
|
|
48359
|
+
const _useState2 = React.useState(null),
|
|
48360
|
+
showToast = _useState2[0],
|
|
48361
|
+
setShowToast = _useState2[1];
|
|
48362
|
+
const _useState3 = React.useState({}),
|
|
48363
|
+
setAppData = _useState3[1];
|
|
48364
|
+
const _useState4 = React.useState({
|
|
48365
|
+
head: "",
|
|
48366
|
+
body: []
|
|
48367
|
+
}),
|
|
48368
|
+
config = _useState4[0],
|
|
48369
|
+
setConfig = _useState4[1];
|
|
48370
|
+
const _useState5 = React.useState(true),
|
|
48371
|
+
enabledLoader = _useState5[0],
|
|
48372
|
+
setEnabledLoader = _useState5[1];
|
|
48373
|
+
const _useState6 = React.useState(false),
|
|
48374
|
+
isAppDetailsPage = _useState6[0],
|
|
48375
|
+
setIsAppDetailsPage = _useState6[1];
|
|
48376
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
48377
|
+
const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
|
|
48378
|
+
const details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
|
|
48379
|
+
const stateId = Digit.ULBService.getStateId();
|
|
48380
|
+
let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
|
|
48381
|
+
newConfig = _Digit$Hooks$ws$useWS.data,
|
|
48382
|
+
isConfigLoading = _Digit$Hooks$ws$useWS.isLoading;
|
|
48383
|
+
const _useState7 = React.useState(new URLSearchParams(reactRouterDom.useLocation().search).get("propertyId")),
|
|
48384
|
+
propertyId = _useState7[0],
|
|
48385
|
+
setPropertyId = _useState7[1];
|
|
48386
|
+
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
|
|
48387
|
+
sessionFormData = _Digit$Hooks$useSessi[0],
|
|
48388
|
+
setSessionFormData = _Digit$Hooks$useSessi[1];
|
|
48389
|
+
const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
|
|
48390
|
+
filters: {
|
|
48391
|
+
propertyIds: propertyId
|
|
48392
|
+
},
|
|
48393
|
+
tenantId: tenantId
|
|
48394
|
+
}, {
|
|
48395
|
+
filters: {
|
|
48396
|
+
propertyIds: propertyId
|
|
48397
|
+
},
|
|
48398
|
+
tenantId: tenantId,
|
|
48399
|
+
enabled: propertyId && propertyId != "" ? true : false
|
|
48400
|
+
}),
|
|
48401
|
+
propertyDetails = _Digit$Hooks$pt$usePr.data;
|
|
48402
|
+
React.useEffect(() => {
|
|
48403
|
+
if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
|
|
48404
|
+
const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
|
|
48405
|
+
if (config) {
|
|
48406
|
+
var _config$body;
|
|
48407
|
+
config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
|
|
48408
|
+
let bodyDetails = [];
|
|
48409
|
+
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
48410
|
+
if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
|
|
48411
|
+
});
|
|
48412
|
+
bodyDetails.forEach(bdyData => {
|
|
48413
|
+
if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
|
|
48414
|
+
});
|
|
48415
|
+
config.body = bodyDetails;
|
|
48416
|
+
setConfig(config);
|
|
48417
|
+
}
|
|
48418
|
+
}
|
|
48419
|
+
}, [newConfig]);
|
|
48420
|
+
React.useEffect(() => {
|
|
48421
|
+
var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
|
|
48422
|
+
!propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
|
|
48423
|
+
}, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
48424
|
+
React.useEffect(function () {
|
|
48425
|
+
try {
|
|
48426
|
+
const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false;
|
|
48427
|
+
const _temp = function (_details$applicationD) {
|
|
48428
|
+
if (details !== null && details !== void 0 && (_details$applicationD = details.applicationData) !== null && _details$applicationD !== void 0 && _details$applicationD.id && !IsDetailsExists) {
|
|
48429
|
+
return Promise.resolve(convertApplicationData(details, serviceType, true, false, t)).then(function (convertAppData) {
|
|
48430
|
+
setSessionFormData(_extends({}, sessionFormData, convertAppData));
|
|
48431
|
+
setAppData(_extends({}, convertAppData));
|
|
48432
|
+
sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
|
|
48433
|
+
});
|
|
48434
|
+
}
|
|
48435
|
+
}();
|
|
48436
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
48437
|
+
} catch (e) {
|
|
48438
|
+
return Promise.reject(e);
|
|
48439
|
+
}
|
|
48440
|
+
}, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
48441
|
+
React.useEffect(() => {
|
|
48442
|
+
var _propertyDetails$Prop;
|
|
48443
|
+
setSessionFormData(_extends({}, sessionFormData, {
|
|
48444
|
+
cpt: {
|
|
48445
|
+
details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop[0]
|
|
48446
|
+
}
|
|
48447
|
+
}));
|
|
48448
|
+
}, [propertyDetails]);
|
|
48449
|
+
React.useEffect(() => {
|
|
48450
|
+
var _sessionFormData$Conn, _sessionFormData$Conn2;
|
|
48451
|
+
if (sessionFormData !== null && sessionFormData !== void 0 && (_sessionFormData$Conn = sessionFormData.ConnectionDetails) !== null && _sessionFormData$Conn !== void 0 && (_sessionFormData$Conn2 = _sessionFormData$Conn[0]) !== null && _sessionFormData$Conn2 !== void 0 && _sessionFormData$Conn2.applicationNo) {
|
|
48452
|
+
setEnabledLoader(false);
|
|
48453
|
+
}
|
|
48454
|
+
}, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
48455
|
+
React.useEffect(() => {
|
|
48456
|
+
const timer = setTimeout(() => {
|
|
48457
|
+
var _sessionFormData$Conn3, _sessionFormData$Conn4, _sessionFormData$Conn5, _sessionFormData$Conn6, _sessionFormData$Conn7;
|
|
48458
|
+
if (isAppDetailsPage) window.location.href = window.location.origin + "/digit-ui/employee/ws/application-details?applicationNumber=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn3 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn3 === void 0 ? void 0 : (_sessionFormData$Conn4 = _sessionFormData$Conn3[0]) === null || _sessionFormData$Conn4 === void 0 ? void 0 : _sessionFormData$Conn4.applicationNo) + "&service=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn5 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn5 === void 0 ? void 0 : (_sessionFormData$Conn6 = _sessionFormData$Conn5[0]) === null || _sessionFormData$Conn6 === void 0 ? void 0 : (_sessionFormData$Conn7 = _sessionFormData$Conn6.serviceName) === null || _sessionFormData$Conn7 === void 0 ? void 0 : _sessionFormData$Conn7.toUpperCase()) + "&mode=MODIFY";
|
|
48459
|
+
}, 3000);
|
|
48460
|
+
return () => clearTimeout(timer);
|
|
48461
|
+
}, [isAppDetailsPage]);
|
|
48462
|
+
const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions(filters === null || filters === void 0 ? void 0 : filters.service),
|
|
48463
|
+
mutate = _Digit$Hooks$ws$useWS2.mutate;
|
|
48464
|
+
const onFormValueChange = (setValue, formData, formState) => {
|
|
48465
|
+
var _formData$cpt, _formData$cpt$details;
|
|
48466
|
+
if (!lodash.isEqual(sessionFormData, formData)) {
|
|
48467
|
+
setSessionFormData(_extends({}, sessionFormData, formData));
|
|
48468
|
+
}
|
|
48469
|
+
if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter(ob => ob.type === "required").length == 0 && !(formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && (_formData$cpt$details = _formData$cpt.details) !== null && _formData$cpt$details !== void 0 && _formData$cpt$details.propertyId)) setSubmitValve(true);else setSubmitValve(!Object.keys(formState.errors).length);
|
|
48470
|
+
};
|
|
48471
|
+
const onSubmit = function (data) {
|
|
48472
|
+
try {
|
|
48473
|
+
const _temp2 = function () {
|
|
48474
|
+
if (!canSubmit) {
|
|
48475
|
+
setShowToast({
|
|
48476
|
+
warning: true,
|
|
48477
|
+
message: "PLEASE_FILL_MANDATORY_DETAILS"
|
|
48478
|
+
});
|
|
48479
|
+
setTimeout(() => {
|
|
48480
|
+
setShowToast(false);
|
|
48481
|
+
}, 3000);
|
|
48482
|
+
} else {
|
|
48483
|
+
const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
|
|
48484
|
+
return Promise.resolve(convertModifyApplicationDetails(data, details, "SUBMIT_APPLICATION")).then(function (convertAppData) {
|
|
48485
|
+
var _data$ConnectionDetai, _data$ConnectionDetai2;
|
|
48486
|
+
const reqDetails = (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai = data.ConnectionDetails) === null || _data$ConnectionDetai === void 0 ? void 0 : (_data$ConnectionDetai2 = _data$ConnectionDetai[0]) === null || _data$ConnectionDetai2 === void 0 ? void 0 : _data$ConnectionDetai2.serviceName) == "WATER" ? {
|
|
48487
|
+
WaterConnection: convertAppData
|
|
48488
|
+
} : {
|
|
48489
|
+
SewerageConnection: convertAppData
|
|
48490
|
+
};
|
|
48491
|
+
if (mutate) {
|
|
48492
|
+
mutate(reqDetails, {
|
|
48493
|
+
onError: (error, variables) => {
|
|
48494
|
+
setShowToast({
|
|
48495
|
+
key: "error",
|
|
48496
|
+
message: error !== null && error !== void 0 && error.message ? error.message : error
|
|
48497
|
+
});
|
|
48498
|
+
setTimeout(closeToastOfError, 5000);
|
|
48499
|
+
},
|
|
48500
|
+
onSuccess: (data, variables) => {
|
|
48501
|
+
setShowToast({
|
|
48502
|
+
key: false,
|
|
48503
|
+
message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"
|
|
48504
|
+
});
|
|
48505
|
+
setIsAppDetailsPage(true);
|
|
48506
|
+
}
|
|
48507
|
+
});
|
|
48508
|
+
}
|
|
48509
|
+
});
|
|
48510
|
+
}
|
|
48511
|
+
}();
|
|
48512
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
48513
|
+
} catch (e) {
|
|
48514
|
+
return Promise.reject(e);
|
|
48515
|
+
}
|
|
48516
|
+
};
|
|
48517
|
+
const closeToast = () => {
|
|
48518
|
+
setShowToast(null);
|
|
48519
|
+
};
|
|
48520
|
+
if (enabledLoader || isConfigLoading) {
|
|
48521
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
48522
|
+
}
|
|
48523
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
48524
|
+
style: {
|
|
48525
|
+
marginLeft: "15px"
|
|
48526
|
+
}
|
|
48527
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Header, null, t(config.head))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
|
|
48528
|
+
config: config.body,
|
|
48529
|
+
userType: "employee",
|
|
48530
|
+
onFormValueChange: onFormValueChange,
|
|
48531
|
+
label: t("CS_COMMON_SUBMIT"),
|
|
48532
|
+
onSubmit: onSubmit,
|
|
48533
|
+
defaultValues: sessionFormData
|
|
48534
|
+
}), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
48535
|
+
error: showToast.key,
|
|
48536
|
+
label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
|
|
48537
|
+
onClose: closeToast,
|
|
48538
|
+
isDleteBtn: true
|
|
48539
|
+
}));
|
|
48540
|
+
};
|
|
48541
|
+
|
|
48542
|
+
const MutationApplication = () => {
|
|
48543
|
+
var _state, _details, _details2, _details2$application;
|
|
48544
|
+
const _useTranslation = reactI18next.useTranslation(),
|
|
48545
|
+
t = _useTranslation.t;
|
|
48546
|
+
let _useLocation = reactRouterDom.useLocation(),
|
|
48547
|
+
state = _useLocation.state;
|
|
48548
|
+
state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
|
|
48549
|
+
const history = reactRouterDom.useHistory();
|
|
48550
|
+
let filters = getQueryStringParams(location.search);
|
|
48551
|
+
const _useState = React.useState(false),
|
|
48552
|
+
canSubmit = _useState[0],
|
|
48553
|
+
setSubmitValve = _useState[1];
|
|
48554
|
+
const _useState2 = React.useState(null),
|
|
48555
|
+
showToast = _useState2[0],
|
|
48556
|
+
setShowToast = _useState2[1];
|
|
48557
|
+
const _useState3 = React.useState({}),
|
|
48558
|
+
appData = _useState3[0],
|
|
48559
|
+
setAppData = _useState3[1];
|
|
48560
|
+
const _useState4 = React.useState({
|
|
48561
|
+
head: "",
|
|
48562
|
+
body: []
|
|
48563
|
+
}),
|
|
48564
|
+
config = _useState4[0],
|
|
48565
|
+
setConfig = _useState4[1];
|
|
48566
|
+
const _useState5 = React.useState(true),
|
|
48567
|
+
enabledLoader = _useState5[0],
|
|
48568
|
+
setEnabledLoader = _useState5[1];
|
|
48569
|
+
const _useState6 = React.useState(false),
|
|
48570
|
+
isAppDetailsPage = _useState6[0];
|
|
48571
|
+
const _useState7 = React.useState(false),
|
|
48572
|
+
isEnableLoader = _useState7[0],
|
|
48573
|
+
setIsEnableLoader = _useState7[1];
|
|
48574
|
+
let tenantId = Digit.ULBService.getCurrentTenantId();
|
|
48575
|
+
const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
|
|
48576
|
+
const stateId = Digit.ULBService.getStateId();
|
|
48577
|
+
let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
|
|
48578
|
+
newConfig = _Digit$Hooks$ws$useWS.data,
|
|
48579
|
+
isConfigLoading = _Digit$Hooks$ws$useWS.isLoading;
|
|
48580
|
+
let details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
|
|
48581
|
+
let _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, (_details = details) === null || _details === void 0 ? void 0 : _details.applicationNo, (_details2 = details) === null || _details2 === void 0 ? void 0 : (_details2$application = _details2.applicationData) === null || _details2$application === void 0 ? void 0 : _details2$application.serviceType, {
|
|
48582
|
+
privacy: Digit.Utils.getPrivacyObject()
|
|
48583
|
+
}),
|
|
48584
|
+
applicationDetails = _Digit$Hooks$ws$useWS2.data;
|
|
48585
|
+
details = applicationDetails;
|
|
48586
|
+
const _useState8 = React.useState(new URLSearchParams(reactRouterDom.useLocation().search).get("propertyId")),
|
|
48587
|
+
propertyId = _useState8[0],
|
|
48588
|
+
setPropertyId = _useState8[1];
|
|
48589
|
+
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
|
|
48590
|
+
sessionFormData = _Digit$Hooks$useSessi[0],
|
|
48591
|
+
setSessionFormData = _Digit$Hooks$useSessi[1],
|
|
48592
|
+
clearSessionFormData = _Digit$Hooks$useSessi[2];
|
|
48593
|
+
const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
|
|
48594
|
+
filters: {
|
|
48595
|
+
propertyIds: propertyId
|
|
48596
|
+
},
|
|
48597
|
+
tenantId: tenantId
|
|
48598
|
+
}, {
|
|
48599
|
+
filters: {
|
|
48600
|
+
propertyIds: propertyId
|
|
48601
|
+
},
|
|
48602
|
+
tenantId: tenantId,
|
|
48603
|
+
enabled: propertyId && propertyId != "" ? true : false,
|
|
48604
|
+
privacy: Digit.Utils.getPrivacyObject()
|
|
48605
|
+
}),
|
|
48606
|
+
propertyDetails = _Digit$Hooks$pt$usePr.data;
|
|
48607
|
+
React.useEffect(() => {
|
|
48608
|
+
if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
|
|
48609
|
+
const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
|
|
48610
|
+
if (config) {
|
|
48611
|
+
var _config$body;
|
|
48612
|
+
config.head = "WS_WATER_AND_SEWERAGE_MUTATION_CONNECTION_LABEL";
|
|
48613
|
+
let bodyDetails = [];
|
|
48614
|
+
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
48615
|
+
if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
|
|
48616
|
+
});
|
|
48617
|
+
bodyDetails.forEach(bdyData => {
|
|
48618
|
+
if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
|
|
48619
|
+
});
|
|
48620
|
+
config.body = bodyDetails;
|
|
48621
|
+
setConfig(config);
|
|
48622
|
+
}
|
|
48623
|
+
}
|
|
48624
|
+
}, [newConfig]);
|
|
48625
|
+
React.useEffect(() => {
|
|
48626
|
+
var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
|
|
48627
|
+
!propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
|
|
48628
|
+
}, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
48629
|
+
React.useEffect(function () {
|
|
48630
|
+
try {
|
|
48631
|
+
const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false;
|
|
48632
|
+
const _temp = function (_details3, _details3$application) {
|
|
48633
|
+
if ((_details3 = details) !== null && _details3 !== void 0 && (_details3$application = _details3.applicationData) !== null && _details3$application !== void 0 && _details3$application.id) {
|
|
48634
|
+
return Promise.resolve(convertApplicationData(details, serviceType, true, undefined, t)).then(function (convertAppData) {
|
|
48635
|
+
setSessionFormData(_extends({}, sessionFormData, convertAppData));
|
|
48636
|
+
setAppData(_extends({}, convertAppData));
|
|
48637
|
+
sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
|
|
48638
|
+
});
|
|
48639
|
+
}
|
|
48640
|
+
}();
|
|
48641
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
48642
|
+
} catch (e) {
|
|
48643
|
+
return Promise.reject(e);
|
|
48644
|
+
}
|
|
48645
|
+
}, [details, applicationDetails]);
|
|
48646
|
+
React.useEffect(() => {
|
|
48647
|
+
var _propertyDetails$Prop;
|
|
48648
|
+
setSessionFormData(_extends({}, sessionFormData, {
|
|
48649
|
+
cpt: {
|
|
48650
|
+
details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop[0]
|
|
48651
|
+
}
|
|
48652
|
+
}));
|
|
48653
|
+
}, [propertyDetails]);
|
|
48654
|
+
React.useEffect(() => {
|
|
48655
|
+
var _sessionFormData$Conn, _sessionFormData$Conn2;
|
|
48656
|
+
if (sessionFormData !== null && sessionFormData !== void 0 && (_sessionFormData$Conn = sessionFormData.ConnectionDetails) !== null && _sessionFormData$Conn !== void 0 && (_sessionFormData$Conn2 = _sessionFormData$Conn[0]) !== null && _sessionFormData$Conn2 !== void 0 && _sessionFormData$Conn2.applicationNo) {
|
|
48657
|
+
setEnabledLoader(false);
|
|
48658
|
+
}
|
|
48659
|
+
}, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
48660
|
+
React.useEffect(() => {
|
|
48661
|
+
const timer = setTimeout(() => {
|
|
48662
|
+
var _sessionFormData$Conn3, _sessionFormData$Conn4, _sessionFormData$Conn5, _sessionFormData$Conn6, _sessionFormData$Conn7;
|
|
48663
|
+
if (isAppDetailsPage) window.location.href = window.location.origin + "/digit-ui/employee/ws/application-details?applicationNumber=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn3 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn3 === void 0 ? void 0 : (_sessionFormData$Conn4 = _sessionFormData$Conn3[0]) === null || _sessionFormData$Conn4 === void 0 ? void 0 : _sessionFormData$Conn4.applicationNo) + "&service=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn5 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn5 === void 0 ? void 0 : (_sessionFormData$Conn6 = _sessionFormData$Conn5[0]) === null || _sessionFormData$Conn6 === void 0 ? void 0 : (_sessionFormData$Conn7 = _sessionFormData$Conn6.serviceName) === null || _sessionFormData$Conn7 === void 0 ? void 0 : _sessionFormData$Conn7.toUpperCase());
|
|
48664
|
+
}, 3000);
|
|
48665
|
+
return () => clearTimeout(timer);
|
|
48666
|
+
}, [isAppDetailsPage]);
|
|
48667
|
+
const _Digit$Hooks$ws$useWa = Digit.Hooks.ws.useWaterCreateAPI("WATER"),
|
|
48668
|
+
waterMutation = _Digit$Hooks$ws$useWa.mutate;
|
|
48669
|
+
const _Digit$Hooks$ws$useWS3 = Digit.Hooks.ws.useWSApplicationActions("WATER");
|
|
48670
|
+
const _Digit$Hooks$ws$useWa2 = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),
|
|
48671
|
+
sewerageMutation = _Digit$Hooks$ws$useWa2.mutate;
|
|
48672
|
+
const _Digit$Hooks$ws$useWS4 = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE");
|
|
48673
|
+
const onFormValueChange = (setValue, formData, formState) => {
|
|
48674
|
+
var _formData$cpt, _formData$cpt$details;
|
|
48675
|
+
if (!lodash.isEqual(sessionFormData, formData)) {
|
|
48676
|
+
setSessionFormData(_extends({}, sessionFormData, formData));
|
|
48677
|
+
}
|
|
48678
|
+
if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter(ob => ob.type === "required").length == 0 && !(formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && (_formData$cpt$details = _formData$cpt.details) !== null && _formData$cpt$details !== void 0 && _formData$cpt$details.propertyId)) setSubmitValve(true);else setSubmitValve(!Object.keys(formState.errors).length);
|
|
48679
|
+
};
|
|
48680
|
+
const onSubmit = function (data) {
|
|
48681
|
+
try {
|
|
48682
|
+
var _data$cpt, _propertyDetails$Prop2;
|
|
48683
|
+
if (!(data !== null && data !== void 0 && (_data$cpt = data.cpt) !== null && _data$cpt !== void 0 && _data$cpt.id) && !(propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop2 = propertyDetails.Properties) !== null && _propertyDetails$Prop2 !== void 0 && _propertyDetails$Prop2[0])) {
|
|
48684
|
+
var _data$cpt2;
|
|
48685
|
+
if (!(data !== null && data !== void 0 && (_data$cpt2 = data.cpt) !== null && _data$cpt2 !== void 0 && _data$cpt2.details) || !propertyDetails) {
|
|
48686
|
+
setShowToast({
|
|
48687
|
+
key: "error",
|
|
48688
|
+
message: "ERR_INVALID_PROPERTY_ID"
|
|
48689
|
+
});
|
|
48690
|
+
return Promise.resolve();
|
|
48691
|
+
}
|
|
48692
|
+
}
|
|
48693
|
+
const _temp7 = function () {
|
|
48694
|
+
if (!canSubmit) {
|
|
48695
|
+
setShowToast({
|
|
48696
|
+
warning: true,
|
|
48697
|
+
message: "PLEASE_FILL_MANDATORY_DETAILS"
|
|
48698
|
+
});
|
|
48699
|
+
setTimeout(() => {
|
|
48700
|
+
setShowToast(false);
|
|
48701
|
+
}, 3000);
|
|
48702
|
+
} else {
|
|
48703
|
+
var _data$cpt3;
|
|
48704
|
+
if (!(data !== null && data !== void 0 && (_data$cpt3 = data.cpt) !== null && _data$cpt3 !== void 0 && _data$cpt3.details)) {
|
|
48705
|
+
var _propertyDetails$Prop3;
|
|
48706
|
+
data.cpt = {
|
|
48707
|
+
details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3[0]
|
|
48708
|
+
};
|
|
48709
|
+
}
|
|
48710
|
+
const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
|
|
48711
|
+
return Promise.resolve(convertModifyApplicationDetails(data, details, "APPLY_MUTATION")).then(function (convertAppData) {
|
|
47134
48712
|
function _temp6() {
|
|
47135
48713
|
const _temp4 = function () {
|
|
47136
48714
|
if (serviceType !== "WATER") {
|
|
@@ -47149,29 +48727,10 @@ const ModifyApplication = () => {
|
|
|
47149
48727
|
},
|
|
47150
48728
|
onSuccess: function (data, variables) {
|
|
47151
48729
|
try {
|
|
47152
|
-
var _data$SewerageConnect;
|
|
47153
|
-
|
|
47154
|
-
|
|
47155
|
-
|
|
47156
|
-
reconnectRequest: false,
|
|
47157
|
-
disconnectRequest: false
|
|
47158
|
-
};
|
|
47159
|
-
return Promise.resolve(sewerageUpdateMutation(sewerageConnectionUpdate, {
|
|
47160
|
-
onError: (error, variables) => {
|
|
47161
|
-
setIsEnableLoader(false);
|
|
47162
|
-
setShowToast({
|
|
47163
|
-
key: "error",
|
|
47164
|
-
message: error !== null && error !== void 0 && error.message ? error.message : error
|
|
47165
|
-
});
|
|
47166
|
-
setTimeout(closeToastOfError, 5000);
|
|
47167
|
-
},
|
|
47168
|
-
onSuccess: (data, variables) => {
|
|
47169
|
-
var _data$SewerageConnect2, _data$SewerageConnect3;
|
|
47170
|
-
clearSessionFormData();
|
|
47171
|
-
history.push("/digit-ui/employee/ws/ws-response?applicationNumber1=" + (data === null || data === void 0 ? void 0 : (_data$SewerageConnect2 = data.SewerageConnections) === null || _data$SewerageConnect2 === void 0 ? void 0 : (_data$SewerageConnect3 = _data$SewerageConnect2[0]) === null || _data$SewerageConnect3 === void 0 ? void 0 : _data$SewerageConnect3.applicationNo));
|
|
47172
|
-
}
|
|
47173
|
-
})).then(function () {});
|
|
47174
|
-
});
|
|
48730
|
+
var _data$SewerageConnect, _data$SewerageConnect2;
|
|
48731
|
+
clearSessionFormData();
|
|
48732
|
+
history.push("/digit-ui/employee/ws/ws-response?applicationNumber1=" + (data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : (_data$SewerageConnect2 = _data$SewerageConnect[0]) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2.applicationNo));
|
|
48733
|
+
return Promise.resolve();
|
|
47175
48734
|
} catch (e) {
|
|
47176
48735
|
return Promise.reject(e);
|
|
47177
48736
|
}
|
|
@@ -47184,18 +48743,11 @@ const ModifyApplication = () => {
|
|
|
47184
48743
|
}();
|
|
47185
48744
|
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
47186
48745
|
}
|
|
47187
|
-
|
|
47188
|
-
|
|
47189
|
-
reconnectRequest: true,
|
|
47190
|
-
disconnectRequest: false
|
|
47191
|
-
} : {
|
|
48746
|
+
convertAppData.applicationType = serviceType == "WATER" ? "MUTATION_WATER_CONNECTION" : "MUTATION_SEWERAGE_CONNECTION";
|
|
48747
|
+
const reqDetails = serviceType == "WATER" ? {
|
|
47192
48748
|
WaterConnection: convertAppData,
|
|
47193
48749
|
reconnectRequest: false,
|
|
47194
48750
|
disconnectRequest: false
|
|
47195
|
-
} : ((_formData = formData) === null || _formData === void 0 ? void 0 : _formData.applicationType) === "SEWERAGE_RECONNECTION" ? {
|
|
47196
|
-
SewerageConnection: convertAppData,
|
|
47197
|
-
reconnectRequest: true,
|
|
47198
|
-
disconnectRequest: false
|
|
47199
48751
|
} : {
|
|
47200
48752
|
SewerageConnection: convertAppData,
|
|
47201
48753
|
reconnectRequest: false,
|
|
@@ -47218,30 +48770,10 @@ const ModifyApplication = () => {
|
|
|
47218
48770
|
},
|
|
47219
48771
|
onSuccess: function (data, variables) {
|
|
47220
48772
|
try {
|
|
47221
|
-
var _data$WaterConnection;
|
|
47222
|
-
|
|
47223
|
-
|
|
47224
|
-
|
|
47225
|
-
reconnectRequest: false,
|
|
47226
|
-
disconnectRequest: false
|
|
47227
|
-
};
|
|
47228
|
-
waterUpdateMutation(waterConnectionUpdate, {
|
|
47229
|
-
onError: (error, variables) => {
|
|
47230
|
-
var _error$response5, _error$response5$data, _error$response5$data2, _error$response6, _error$response6$data, _error$response6$data2;
|
|
47231
|
-
setIsEnableLoader(false);
|
|
47232
|
-
setShowToast({
|
|
47233
|
-
key: "error",
|
|
47234
|
-
message: error !== null && error !== void 0 && (_error$response5 = error.response) !== null && _error$response5 !== void 0 && (_error$response5$data = _error$response5.data) !== null && _error$response5$data !== void 0 && (_error$response5$data2 = _error$response5$data.Errors) !== null && _error$response5$data2 !== void 0 && _error$response5$data2[0].message ? error === null || error === void 0 ? void 0 : (_error$response6 = error.response) === null || _error$response6 === void 0 ? void 0 : (_error$response6$data = _error$response6.data) === null || _error$response6$data === void 0 ? void 0 : (_error$response6$data2 = _error$response6$data.Errors) === null || _error$response6$data2 === void 0 ? void 0 : _error$response6$data2[0].message : error
|
|
47235
|
-
});
|
|
47236
|
-
setTimeout(closeToastOfError, 5000);
|
|
47237
|
-
},
|
|
47238
|
-
onSuccess: (data, variables) => {
|
|
47239
|
-
var _data$WaterConnection2, _data$WaterConnection3;
|
|
47240
|
-
clearSessionFormData();
|
|
47241
|
-
history.push("/digit-ui/employee/ws/ws-response?applicationNumber=" + (data === null || data === void 0 ? void 0 : (_data$WaterConnection2 = data.WaterConnection) === null || _data$WaterConnection2 === void 0 ? void 0 : (_data$WaterConnection3 = _data$WaterConnection2[0]) === null || _data$WaterConnection3 === void 0 ? void 0 : _data$WaterConnection3.applicationNo));
|
|
47242
|
-
}
|
|
47243
|
-
});
|
|
47244
|
-
});
|
|
48773
|
+
var _data$WaterConnection, _data$WaterConnection2;
|
|
48774
|
+
clearSessionFormData();
|
|
48775
|
+
history.push("/digit-ui/employee/ws/ws-response?applicationNumber=" + (data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : (_data$WaterConnection2 = _data$WaterConnection[0]) === null || _data$WaterConnection2 === void 0 ? void 0 : _data$WaterConnection2.applicationNo));
|
|
48776
|
+
return Promise.resolve();
|
|
47245
48777
|
} catch (e) {
|
|
47246
48778
|
return Promise.reject(e);
|
|
47247
48779
|
}
|
|
@@ -47261,6 +48793,9 @@ const ModifyApplication = () => {
|
|
|
47261
48793
|
return Promise.reject(e);
|
|
47262
48794
|
}
|
|
47263
48795
|
};
|
|
48796
|
+
const closeToastOfError = () => {
|
|
48797
|
+
setShowToast(null);
|
|
48798
|
+
};
|
|
47264
48799
|
const closeToast = () => {
|
|
47265
48800
|
setShowToast(null);
|
|
47266
48801
|
};
|
|
@@ -47287,199 +48822,6 @@ const ModifyApplication = () => {
|
|
|
47287
48822
|
}));
|
|
47288
48823
|
};
|
|
47289
48824
|
|
|
47290
|
-
const EditModifyApplication = () => {
|
|
47291
|
-
var _state;
|
|
47292
|
-
const _useTranslation = reactI18next.useTranslation(),
|
|
47293
|
-
t = _useTranslation.t;
|
|
47294
|
-
let _useLocation = reactRouterDom.useLocation(),
|
|
47295
|
-
state = _useLocation.state;
|
|
47296
|
-
state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
|
|
47297
|
-
const history = reactRouterDom.useHistory();
|
|
47298
|
-
let filters = getQueryStringParams(location.search);
|
|
47299
|
-
const _useState = React.useState(false),
|
|
47300
|
-
canSubmit = _useState[0],
|
|
47301
|
-
setSubmitValve = _useState[1];
|
|
47302
|
-
const _useState2 = React.useState(null),
|
|
47303
|
-
showToast = _useState2[0],
|
|
47304
|
-
setShowToast = _useState2[1];
|
|
47305
|
-
const _useState3 = React.useState({}),
|
|
47306
|
-
setAppData = _useState3[1];
|
|
47307
|
-
const _useState4 = React.useState({
|
|
47308
|
-
head: "",
|
|
47309
|
-
body: []
|
|
47310
|
-
}),
|
|
47311
|
-
config = _useState4[0],
|
|
47312
|
-
setConfig = _useState4[1];
|
|
47313
|
-
const _useState5 = React.useState(true),
|
|
47314
|
-
enabledLoader = _useState5[0],
|
|
47315
|
-
setEnabledLoader = _useState5[1];
|
|
47316
|
-
const _useState6 = React.useState(false),
|
|
47317
|
-
isAppDetailsPage = _useState6[0],
|
|
47318
|
-
setIsAppDetailsPage = _useState6[1];
|
|
47319
|
-
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
47320
|
-
const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
|
|
47321
|
-
const details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
|
|
47322
|
-
const stateId = Digit.ULBService.getStateId();
|
|
47323
|
-
let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
|
|
47324
|
-
newConfig = _Digit$Hooks$ws$useWS.data,
|
|
47325
|
-
isConfigLoading = _Digit$Hooks$ws$useWS.isLoading;
|
|
47326
|
-
const _useState7 = React.useState(new URLSearchParams(reactRouterDom.useLocation().search).get("propertyId")),
|
|
47327
|
-
propertyId = _useState7[0],
|
|
47328
|
-
setPropertyId = _useState7[1];
|
|
47329
|
-
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
|
|
47330
|
-
sessionFormData = _Digit$Hooks$useSessi[0],
|
|
47331
|
-
setSessionFormData = _Digit$Hooks$useSessi[1];
|
|
47332
|
-
const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
|
|
47333
|
-
filters: {
|
|
47334
|
-
propertyIds: propertyId
|
|
47335
|
-
},
|
|
47336
|
-
tenantId: tenantId
|
|
47337
|
-
}, {
|
|
47338
|
-
filters: {
|
|
47339
|
-
propertyIds: propertyId
|
|
47340
|
-
},
|
|
47341
|
-
tenantId: tenantId,
|
|
47342
|
-
enabled: propertyId && propertyId != "" ? true : false
|
|
47343
|
-
}),
|
|
47344
|
-
propertyDetails = _Digit$Hooks$pt$usePr.data;
|
|
47345
|
-
React.useEffect(() => {
|
|
47346
|
-
if (!isConfigLoading) {
|
|
47347
|
-
var _config$body;
|
|
47348
|
-
const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
|
|
47349
|
-
config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
|
|
47350
|
-
let bodyDetails = [];
|
|
47351
|
-
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
47352
|
-
if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
|
|
47353
|
-
});
|
|
47354
|
-
bodyDetails.forEach(bdyData => {
|
|
47355
|
-
if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
|
|
47356
|
-
});
|
|
47357
|
-
config.body = bodyDetails;
|
|
47358
|
-
setConfig(config);
|
|
47359
|
-
}
|
|
47360
|
-
}, [newConfig]);
|
|
47361
|
-
React.useEffect(() => {
|
|
47362
|
-
var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
|
|
47363
|
-
!propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
|
|
47364
|
-
}, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
47365
|
-
React.useEffect(function () {
|
|
47366
|
-
try {
|
|
47367
|
-
const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false;
|
|
47368
|
-
const _temp = function (_details$applicationD) {
|
|
47369
|
-
if (details !== null && details !== void 0 && (_details$applicationD = details.applicationData) !== null && _details$applicationD !== void 0 && _details$applicationD.id && !IsDetailsExists) {
|
|
47370
|
-
return Promise.resolve(convertApplicationData(details, serviceType, true, false, t)).then(function (convertAppData) {
|
|
47371
|
-
setSessionFormData(_extends({}, sessionFormData, convertAppData));
|
|
47372
|
-
setAppData(_extends({}, convertAppData));
|
|
47373
|
-
sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
|
|
47374
|
-
});
|
|
47375
|
-
}
|
|
47376
|
-
}();
|
|
47377
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
47378
|
-
} catch (e) {
|
|
47379
|
-
return Promise.reject(e);
|
|
47380
|
-
}
|
|
47381
|
-
}, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
47382
|
-
React.useEffect(() => {
|
|
47383
|
-
var _propertyDetails$Prop;
|
|
47384
|
-
setSessionFormData(_extends({}, sessionFormData, {
|
|
47385
|
-
cpt: {
|
|
47386
|
-
details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop[0]
|
|
47387
|
-
}
|
|
47388
|
-
}));
|
|
47389
|
-
}, [propertyDetails]);
|
|
47390
|
-
React.useEffect(() => {
|
|
47391
|
-
var _sessionFormData$Conn, _sessionFormData$Conn2;
|
|
47392
|
-
if (sessionFormData !== null && sessionFormData !== void 0 && (_sessionFormData$Conn = sessionFormData.ConnectionDetails) !== null && _sessionFormData$Conn !== void 0 && (_sessionFormData$Conn2 = _sessionFormData$Conn[0]) !== null && _sessionFormData$Conn2 !== void 0 && _sessionFormData$Conn2.applicationNo) {
|
|
47393
|
-
setEnabledLoader(false);
|
|
47394
|
-
}
|
|
47395
|
-
}, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
47396
|
-
React.useEffect(() => {
|
|
47397
|
-
const timer = setTimeout(() => {
|
|
47398
|
-
var _sessionFormData$Conn3, _sessionFormData$Conn4, _sessionFormData$Conn5, _sessionFormData$Conn6, _sessionFormData$Conn7;
|
|
47399
|
-
if (isAppDetailsPage) window.location.href = window.location.origin + "/digit-ui/employee/ws/application-details?applicationNumber=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn3 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn3 === void 0 ? void 0 : (_sessionFormData$Conn4 = _sessionFormData$Conn3[0]) === null || _sessionFormData$Conn4 === void 0 ? void 0 : _sessionFormData$Conn4.applicationNo) + "&service=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn5 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn5 === void 0 ? void 0 : (_sessionFormData$Conn6 = _sessionFormData$Conn5[0]) === null || _sessionFormData$Conn6 === void 0 ? void 0 : (_sessionFormData$Conn7 = _sessionFormData$Conn6.serviceName) === null || _sessionFormData$Conn7 === void 0 ? void 0 : _sessionFormData$Conn7.toUpperCase()) + "&mode=MODIFY";
|
|
47400
|
-
}, 3000);
|
|
47401
|
-
return () => clearTimeout(timer);
|
|
47402
|
-
}, [isAppDetailsPage]);
|
|
47403
|
-
const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions(filters === null || filters === void 0 ? void 0 : filters.service),
|
|
47404
|
-
mutate = _Digit$Hooks$ws$useWS2.mutate;
|
|
47405
|
-
const onFormValueChange = (setValue, formData, formState) => {
|
|
47406
|
-
var _formData$cpt, _formData$cpt$details;
|
|
47407
|
-
if (!lodash.isEqual(sessionFormData, formData)) {
|
|
47408
|
-
setSessionFormData(_extends({}, sessionFormData, formData));
|
|
47409
|
-
}
|
|
47410
|
-
if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter(ob => ob.type === "required").length == 0 && !(formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && (_formData$cpt$details = _formData$cpt.details) !== null && _formData$cpt$details !== void 0 && _formData$cpt$details.propertyId)) setSubmitValve(true);else setSubmitValve(!Object.keys(formState.errors).length);
|
|
47411
|
-
};
|
|
47412
|
-
const onSubmit = function (data) {
|
|
47413
|
-
try {
|
|
47414
|
-
const _temp2 = function () {
|
|
47415
|
-
if (!canSubmit) {
|
|
47416
|
-
setShowToast({
|
|
47417
|
-
warning: true,
|
|
47418
|
-
message: "PLEASE_FILL_MANDATORY_DETAILS"
|
|
47419
|
-
});
|
|
47420
|
-
setTimeout(() => {
|
|
47421
|
-
setShowToast(false);
|
|
47422
|
-
}, 3000);
|
|
47423
|
-
} else {
|
|
47424
|
-
const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
|
|
47425
|
-
return Promise.resolve(convertModifyApplicationDetails(data, details, "SUBMIT_APPLICATION")).then(function (convertAppData) {
|
|
47426
|
-
var _data$ConnectionDetai, _data$ConnectionDetai2;
|
|
47427
|
-
const reqDetails = (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai = data.ConnectionDetails) === null || _data$ConnectionDetai === void 0 ? void 0 : (_data$ConnectionDetai2 = _data$ConnectionDetai[0]) === null || _data$ConnectionDetai2 === void 0 ? void 0 : _data$ConnectionDetai2.serviceName) == "WATER" ? {
|
|
47428
|
-
WaterConnection: convertAppData
|
|
47429
|
-
} : {
|
|
47430
|
-
SewerageConnection: convertAppData
|
|
47431
|
-
};
|
|
47432
|
-
if (mutate) {
|
|
47433
|
-
mutate(reqDetails, {
|
|
47434
|
-
onError: (error, variables) => {
|
|
47435
|
-
setShowToast({
|
|
47436
|
-
key: "error",
|
|
47437
|
-
message: error !== null && error !== void 0 && error.message ? error.message : error
|
|
47438
|
-
});
|
|
47439
|
-
setTimeout(closeToastOfError, 5000);
|
|
47440
|
-
},
|
|
47441
|
-
onSuccess: (data, variables) => {
|
|
47442
|
-
setShowToast({
|
|
47443
|
-
key: false,
|
|
47444
|
-
message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"
|
|
47445
|
-
});
|
|
47446
|
-
setIsAppDetailsPage(true);
|
|
47447
|
-
}
|
|
47448
|
-
});
|
|
47449
|
-
}
|
|
47450
|
-
});
|
|
47451
|
-
}
|
|
47452
|
-
}();
|
|
47453
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
47454
|
-
} catch (e) {
|
|
47455
|
-
return Promise.reject(e);
|
|
47456
|
-
}
|
|
47457
|
-
};
|
|
47458
|
-
const closeToast = () => {
|
|
47459
|
-
setShowToast(null);
|
|
47460
|
-
};
|
|
47461
|
-
if (enabledLoader || isConfigLoading) {
|
|
47462
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
47463
|
-
}
|
|
47464
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
47465
|
-
style: {
|
|
47466
|
-
marginLeft: "15px"
|
|
47467
|
-
}
|
|
47468
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Header, null, t(config.head))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
|
|
47469
|
-
config: config.body,
|
|
47470
|
-
userType: "employee",
|
|
47471
|
-
onFormValueChange: onFormValueChange,
|
|
47472
|
-
label: t("CS_COMMON_SUBMIT"),
|
|
47473
|
-
onSubmit: onSubmit,
|
|
47474
|
-
defaultValues: sessionFormData
|
|
47475
|
-
}), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
47476
|
-
error: showToast.key,
|
|
47477
|
-
label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
|
|
47478
|
-
onClose: closeToast,
|
|
47479
|
-
isDleteBtn: true
|
|
47480
|
-
}));
|
|
47481
|
-
};
|
|
47482
|
-
|
|
47483
48825
|
const getPath$5 = (path, params) => {
|
|
47484
48826
|
params && Object.keys(params).map(key => {
|
|
47485
48827
|
path = path.replace(":" + key, params[key]);
|
|
@@ -47722,16 +49064,18 @@ const WSEditApplicationByConfig = () => {
|
|
|
47722
49064
|
}),
|
|
47723
49065
|
propertyDetails = _Digit$Hooks$pt$usePr.data;
|
|
47724
49066
|
React.useEffect(() => {
|
|
47725
|
-
if (!isConfigLoading) {
|
|
47726
|
-
var _config$body;
|
|
49067
|
+
if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
|
|
47727
49068
|
const config = newConfig.find(conf => conf.hideInCitizen && conf.isEditByConfig);
|
|
47728
|
-
config
|
|
47729
|
-
|
|
47730
|
-
|
|
47731
|
-
|
|
47732
|
-
|
|
47733
|
-
|
|
47734
|
-
|
|
49069
|
+
if (config) {
|
|
49070
|
+
var _config$body;
|
|
49071
|
+
config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
|
|
49072
|
+
let bodyDetails = [];
|
|
49073
|
+
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
49074
|
+
if (data !== null && data !== void 0 && data.isEditByConfigConnection) bodyDetails.push(data);
|
|
49075
|
+
});
|
|
49076
|
+
config.body = bodyDetails;
|
|
49077
|
+
setConfig(config);
|
|
49078
|
+
}
|
|
47735
49079
|
}
|
|
47736
49080
|
}, [newConfig]);
|
|
47737
49081
|
React.useEffect(() => {
|
|
@@ -48340,16 +49684,18 @@ const EditDisconnectionByConfig = () => {
|
|
|
48340
49684
|
sessionFormData = _Digit$Hooks$useSessi[0],
|
|
48341
49685
|
setSessionFormData = _Digit$Hooks$useSessi[1];
|
|
48342
49686
|
React.useEffect(() => {
|
|
48343
|
-
if (!isLoading && !isConfigLoading) {
|
|
48344
|
-
var _config$body;
|
|
49687
|
+
if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
|
|
48345
49688
|
const config = newConfig.find(conf => conf.isDisonnectionEdit);
|
|
48346
|
-
config
|
|
48347
|
-
|
|
48348
|
-
|
|
48349
|
-
|
|
48350
|
-
|
|
48351
|
-
|
|
48352
|
-
|
|
49689
|
+
if (config) {
|
|
49690
|
+
var _config$body;
|
|
49691
|
+
config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
|
|
49692
|
+
let bodyDetails = [];
|
|
49693
|
+
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
49694
|
+
if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
|
|
49695
|
+
});
|
|
49696
|
+
config.body = bodyDetails;
|
|
49697
|
+
setConfig(config);
|
|
49698
|
+
}
|
|
48353
49699
|
}
|
|
48354
49700
|
}, [applicationDetails, isLoading, newConfig]);
|
|
48355
49701
|
React.useEffect(function () {
|
|
@@ -48474,16 +49820,18 @@ const EditDisconnectionByConfig$1 = () => {
|
|
|
48474
49820
|
sessionFormData = _Digit$Hooks$useSessi[0],
|
|
48475
49821
|
setSessionFormData = _Digit$Hooks$useSessi[1];
|
|
48476
49822
|
React.useEffect(() => {
|
|
48477
|
-
if (!isLoading && !isConfigLoading) {
|
|
48478
|
-
var _config$body;
|
|
49823
|
+
if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
|
|
48479
49824
|
const config = newConfig.find(conf => conf.isDisonnectionEdit);
|
|
48480
|
-
config
|
|
48481
|
-
|
|
48482
|
-
|
|
48483
|
-
|
|
48484
|
-
|
|
48485
|
-
|
|
48486
|
-
|
|
49825
|
+
if (config) {
|
|
49826
|
+
var _config$body;
|
|
49827
|
+
config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
|
|
49828
|
+
let bodyDetails = [];
|
|
49829
|
+
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
49830
|
+
if (data !== null && data !== void 0 && data.isDisonnectionEditByConfig) bodyDetails.push(data);
|
|
49831
|
+
});
|
|
49832
|
+
config.body = bodyDetails;
|
|
49833
|
+
setConfig(config);
|
|
49834
|
+
}
|
|
48487
49835
|
}
|
|
48488
49836
|
}, [applicationDetails, isLoading, newConfig]);
|
|
48489
49837
|
React.useEffect(function () {
|
|
@@ -48613,16 +49961,18 @@ const ResubmitDisconnection = () => {
|
|
|
48613
49961
|
const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions(serviceType),
|
|
48614
49962
|
mutate = _Digit$Hooks$ws$useWS2.mutate;
|
|
48615
49963
|
React.useEffect(() => {
|
|
48616
|
-
if (!isLoading && !isConfigLoading) {
|
|
48617
|
-
var _config$body;
|
|
49964
|
+
if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
|
|
48618
49965
|
const config = newConfig.find(conf => conf.isDisonnectionEdit);
|
|
48619
|
-
config
|
|
48620
|
-
|
|
48621
|
-
|
|
48622
|
-
|
|
48623
|
-
|
|
48624
|
-
|
|
48625
|
-
|
|
49966
|
+
if (config) {
|
|
49967
|
+
var _config$body;
|
|
49968
|
+
config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
|
|
49969
|
+
let bodyDetails = [];
|
|
49970
|
+
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
49971
|
+
if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
|
|
49972
|
+
});
|
|
49973
|
+
config.body = bodyDetails;
|
|
49974
|
+
setConfig(config);
|
|
49975
|
+
}
|
|
48626
49976
|
}
|
|
48627
49977
|
}, [applicationDetails, isLoading, newConfig]);
|
|
48628
49978
|
React.useEffect(function () {
|
|
@@ -50408,6 +51758,7 @@ const componentsToRegister = {
|
|
|
50408
51758
|
WSConsumptionDetails: ConsumptionDetails,
|
|
50409
51759
|
WSModifyApplication: ModifyApplication,
|
|
50410
51760
|
WSEditModifyApplication: EditModifyApplication,
|
|
51761
|
+
WSMutationApplication: MutationApplication,
|
|
50411
51762
|
WSDisconnectionApplication: DisconnectionApplication,
|
|
50412
51763
|
WSRestorationApplication: DisconnectionApplication$1,
|
|
50413
51764
|
WSEditApplicationByConfig: WSEditApplicationByConfig,
|