@djb25/digit-ui-module-commonpt 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Loader, Header, FormComposer, Toast, Card, CardText, StatusTable, Row, SubmitBar, Banner, RadioButtons, Dropdown, InfoBannerIcon, Localities, ResponseComposer, Modal, KeyNote, OTPInput, CardLabelError, FormStep, UploadFile, DatePicker, CardSubHeader, PDFSvg, LabelFieldPair, CardLabel, MultiUploadWrapper, CardHeader, CardSectionHeader, CheckBox, TextInput, LinkButton, Close as Close$e, BreakLine, Table, TelePhone, DisplayPhotos, EditIcon, ViewsIcon, CheckPoint, ConnectingCheckPoints, ActionBar, Menu, ButtonSelector, AppContainer, BackButton, PrivateRoute, BreadCrumb, DeleteIcon, MobileNumber, TextArea, RadioOrSelect, SearchForm, SearchField, DetailsCard, TickMark, Label, PropertyHouse, EmployeeModuleCard, CitizenHomeCard, PTIcon } from '@djb25/digit-ui-react-components';
1
+ import { Loader, VerticalTimeline, FormComposer, Toast, Card, CardText, StatusTable, Row, SubmitBar, Banner, RadioButtons, Dropdown, InfoBannerIcon, Localities, Header, ResponseComposer, Modal, KeyNote, OTPInput, CardLabelError, FormStep, UploadFile, DatePicker, CardSubHeader, PDFSvg, LabelFieldPair, CardLabel, MultiUploadWrapper, CardHeader, CardSectionHeader, CheckBox, TextInput, LinkButton, Close as Close$e, BreakLine, Table, TelePhone, DisplayPhotos, EditIcon, ViewsIcon, CheckPoint, ConnectingCheckPoints, ActionBar, Menu, ButtonSelector, AppContainer, BackButton, PrivateRoute, BreadCrumb, LayoutWrapper, CollapsibleCardPage, AddressDetails, DeleteIcon, MobileNumber, RadioOrSelect, TextArea, SearchForm, SearchField, DetailsCard, TickMark, Label, PropertyHouse, EmployeeModuleCard, CitizenHomeCard, PTIcon } from '@djb25/digit-ui-react-components';
2
2
  import React, { useState, useEffect, useLayoutEffect, useMemo, useRef, Fragment as Fragment$1, memo, useCallback } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useHistory, useRouteMatch, Switch, Route, Link, useParams } from 'react-router-dom';
@@ -6,64 +6,61 @@ import { useQueryClient } from 'react-query';
6
6
  import { useForm, Controller } from 'react-hook-form';
7
7
 
8
8
  const newConfig = [{
9
- "head": "PT_ASSEMBLY_DET",
10
- "body": [{
11
- "type": "component",
12
- "route": "property-type",
13
- "isMandatory": true,
14
- "component": "CPTPropertyAssemblyDetails",
15
- "texts": {
16
- "headerCaption": "",
17
- "header": "PT_ASSEMBLY_DET",
18
- "cardText": "",
19
- "submitBarLabel": "PT_COMMONS_NEXT"
9
+ head: "PT_LOCATION_DETAILS",
10
+ body: [{
11
+ type: "component",
12
+ route: "property-type",
13
+ isMandatory: true,
14
+ component: "CPTPropertyLocationDetails",
15
+ texts: {
16
+ headerCaption: "",
17
+ header: "PT_LOCATION_DETAILS",
18
+ cardText: "",
19
+ submitBarLabel: "PT_COMMONS_NEXT"
20
20
  },
21
- "nextStep": {
22
- "COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY": "landarea",
23
- "COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY": "PtUnits",
24
- "COMMON_PROPTYPE_VACANT": "area"
21
+ nextStep: {
22
+ COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY: "landarea",
23
+ COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY: "PtUnits",
24
+ COMMON_PROPTYPE_VACANT: "area"
25
25
  },
26
- "key": "assemblyDet",
27
- "withoutLabel": true
26
+ key: "locationDet",
27
+ withoutLabel: true,
28
+ colSpan: "span 2"
28
29
  }]
29
30
  }, {
30
- "head": "PT_LOCATION_DETAILS",
31
- "body": [{
32
- "type": "component",
33
- "route": "property-type",
34
- "isMandatory": true,
35
- "component": "CPTPropertyLocationDetails",
36
- "texts": {
37
- "headerCaption": "",
38
- "header": "PT_LOCATION_DETAILS",
39
- "cardText": "",
40
- "submitBarLabel": "PT_COMMONS_NEXT"
41
- },
42
- "nextStep": {
43
- "COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY": "landarea",
44
- "COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY": "PtUnits",
45
- "COMMON_PROPTYPE_VACANT": "area"
31
+ head: "PT_PROPERTY_WATER_CONNECTION",
32
+ body: [{
33
+ type: "component",
34
+ route: "property-type",
35
+ isMandatory: false,
36
+ component: "PropertyWaterConnection",
37
+ texts: {
38
+ headerCaption: "",
39
+ header: "PT_PROPERTY_WATER_CONNECTION",
40
+ cardText: "",
41
+ submitBarLabel: "PT_COMMONS_NEXT"
46
42
  },
47
- "key": "locationDet",
48
- "withoutLabel": true
43
+ key: "waterConnection",
44
+ withoutLabel: true,
45
+ colSpan: "span 2"
49
46
  }]
50
47
  }, {
51
- "head": "PT_OWNERSHIP_DETAILS",
52
- "body": [{
53
- "type": "component",
54
- "route": "institutional-owner-address",
55
- "isMandatory": true,
56
- "component": "CPTPropertyOwnerDetails",
57
- "texts": {
58
- "headerCaption": "PT_OWNERS_DETAILS",
59
- "header": "PT_OWNERS_ADDRESS",
60
- "cardText": "",
61
- "submitBarLabel": "PT_COMMON_NEXT"
48
+ head: "PT_OWNERSHIP_DETAILS",
49
+ body: [{
50
+ type: "component",
51
+ route: "institutional-owner-address",
52
+ isMandatory: false,
53
+ component: "CPTPropertyOwnerDetails",
54
+ texts: {
55
+ headerCaption: "PT_OWNERS_DETAILS",
56
+ header: "PT_OWNERS_ADDRESS",
57
+ cardText: "",
58
+ submitBarLabel: "PT_COMMON_NEXT"
62
59
  },
63
- "key": "owners",
64
- "withoutLabel": true,
65
- "nextStep": "institutional-proof-of-identity",
66
- "hideInEmployee": true
60
+ key: "owners",
61
+ withoutLabel: true,
62
+ nextStep: "institutional-proof-of-identity",
63
+ colSpan: "span 2"
67
64
  }]
68
65
  }];
69
66
 
@@ -5900,161 +5897,41 @@ var lodash = createCommonjsModule(function (module, exports) {
5900
5897
  }).call(commonjsGlobal);
5901
5898
  });
5902
5899
 
5903
- const CreatePropertyForm = ({
5904
- config,
5905
- onSelect,
5906
- value,
5907
- userType,
5908
- redirectUrl
5909
- }) => {
5910
- var _Digit$Hooks$pt$useTe;
5911
- const [showToast, setShowToast] = useState(null);
5912
- const tenantId = Digit.ULBService.getCurrentTenantId();
5913
- const tenants = Digit.Hooks.pt.useTenants();
5914
- const {
5915
- t
5916
- } = useTranslation();
5917
- const location = useLocation();
5918
- const [canSubmit, setCanSubmit] = useState(false);
5919
- const defaultValues = {
5920
- ...value
5921
- };
5922
- const history = useHistory();
5923
- const match = useRouteMatch();
5924
- sessionStorage.setItem("VisitedCommonPTSearch", true);
5925
- sessionStorage.setItem("VisitedLightCreate", true);
5926
- const isMobile = window.Digit.Utils.browser.isMobile();
5927
- let allCities = (_Digit$Hooks$pt$useTe = Digit.Hooks.pt.useTenants()) === null || _Digit$Hooks$pt$useTe === void 0 ? void 0 : _Digit$Hooks$pt$useTe.sort((a, b) => {
5928
- var _a$i18nKey, _a$i18nKey$localeComp;
5929
- return a === null || a === void 0 ? void 0 : (_a$i18nKey = a.i18nKey) === null || _a$i18nKey === void 0 ? void 0 : (_a$i18nKey$localeComp = _a$i18nKey.localeCompare) === null || _a$i18nKey$localeComp === void 0 ? void 0 : _a$i18nKey$localeComp.call(_a$i18nKey, b === null || b === void 0 ? void 0 : b.i18nKey);
5930
- });
5931
- if (window.location.href.includes("obps")) {
5932
- allCities = Digit.SessionStorage.get("OBPS_TENANTS");
5933
- }
5934
- if (window.location.href.includes("fsm")) {
5935
- allCities = Digit.SessionStorage.get("FSM_TENANTS");
5936
- }
5937
- const [formValue, setFormValue] = useState("");
5938
- const [cityCode, setCityCode] = useState("");
5939
- let enableSkip = userType == "employee" ? false : (config === null || config === void 0 ? void 0 : config.isSkipEnabled) || sessionStorage.getItem("skipenabled");
5940
- const [mutationHappened, setMutationHappened, clear] = Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED", false);
5941
- const [successData, setsuccessData, clearSuccessData] = Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA", {});
5942
- const {
5943
- data: commonFields,
5944
- isLoading
5945
- } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "PropertyTax", "CommonFieldsConfig");
5946
- useEffect(() => {
5947
- setMutationHappened(false);
5948
- clearSuccessData();
5949
- }, []);
5950
- if (isLoading) {
5951
- return /*#__PURE__*/React.createElement(Loader, null);
5952
- }
5953
- const onSubmit = async () => {
5954
- var _formValue$owners, _formValue$owners$own, _formValue$owners2, _formValue$owners2$, _formValue$owners2$$o, _formValue$owners2$$o2, _formValue$owners3;
5955
- if ((formValue !== null && formValue !== void 0 && (_formValue$owners = formValue.owners) !== null && _formValue$owners !== void 0 && (_formValue$owners$own = _formValue$owners.ownershipCategory) !== null && _formValue$owners$own !== void 0 && _formValue$owners$own.includes("MULTIPLEOWNERS") || formValue !== null && formValue !== void 0 && (_formValue$owners2 = formValue.owners) !== null && _formValue$owners2 !== void 0 && (_formValue$owners2$ = _formValue$owners2[0]) !== null && _formValue$owners2$ !== void 0 && (_formValue$owners2$$o = _formValue$owners2$.ownershipCategory) !== null && _formValue$owners2$$o !== void 0 && (_formValue$owners2$$o2 = _formValue$owners2$$o.code) !== null && _formValue$owners2$$o2 !== void 0 && _formValue$owners2$$o2.includes("MULTIPLEOWNERS")) && (formValue === null || formValue === void 0 ? void 0 : (_formValue$owners3 = formValue.owners) === null || _formValue$owners3 === void 0 ? void 0 : _formValue$owners3.length) == 1) {
5956
- setShowToast({
5957
- key: true,
5958
- label: "PT_COMMON_ONE_MORE_OWNER_INFROMATION_REQUIRED"
5959
- });
5960
- } else {
5961
- if (onSelect) {
5962
- onSelect('cptNewProperty', {
5963
- property: formValue
5964
- });
5965
- } else {
5966
- if (userType === 'employee') {
5967
- history.push(`${match.path}/save-property?redirectToUrl=${redirectUrl}`, {
5968
- data: formValue,
5969
- prevState: {
5970
- ...(location === null || location === void 0 ? void 0 : location.state)
5971
- }
5972
- });
5973
- } else {
5974
- var _formValue$owners4, _formValue$owners4$;
5975
- history.replace(`/digit-ui/citizen/commonPt/property/citizen-otp`, {
5976
- mobileNumber: formValue === null || formValue === void 0 ? void 0 : (_formValue$owners4 = formValue.owners) === null || _formValue$owners4 === void 0 ? void 0 : (_formValue$owners4$ = _formValue$owners4[0]) === null || _formValue$owners4$ === void 0 ? void 0 : _formValue$owners4$.mobileNumber,
5977
- redirectBackTo: '/digit-ui/citizen/commonPt/property/new-application/save-property',
5978
- redirectData: formValue
5979
- });
5980
- }
5981
- }
5982
- }
5983
- };
5984
- const onSkip = () => {
5985
- onSelect("isSkip", true);
5986
- };
5987
- const onFormValueChange = (setValue, data, formState) => {
5988
- if (!lodash.isEqual(data, formValue)) {
5989
- setFormValue(data);
5990
- }
5991
- if (data.assemblyDet && data.locationDet && data.owners && !Object.keys(formState === null || formState === void 0 ? void 0 : formState.errors).length) {
5992
- setCanSubmit(true);
5993
- } else {
5994
- setCanSubmit(false);
5995
- }
5996
- };
5997
- const getHeaderLabel = () => {
5998
- var _url$split, _url$split$, _url$split$$split;
5999
- let url = window.location.href;
6000
- let moduleName = url === null || url === void 0 ? void 0 : (_url$split = url.split("=")) === null || _url$split === void 0 ? void 0 : (_url$split$ = _url$split[1]) === null || _url$split$ === void 0 ? void 0 : (_url$split$$split = _url$split$.split("/")) === null || _url$split$$split === void 0 ? void 0 : _url$split$$split[3];
6001
- if (moduleName) return t(`ES_COMMON_CREATE_PROPERTY_HEADER_${moduleName === null || moduleName === void 0 ? void 0 : moduleName.toUpperCase()}`);else return t('ES_COMMON_CREATE_PROPERTY_HEADER');
6002
- };
6003
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
6004
- style: {
6005
- marginLeft: "12px"
6006
- }
6007
- }, /*#__PURE__*/React.createElement(Header, {
6008
- styles: window.location.href.includes("citizen") ? {
6009
- paddingLeft: "0px",
6010
- marginLeft: "0px"
6011
- } : {}
6012
- }, t(getHeaderLabel()))), /*#__PURE__*/React.createElement(FormComposer, {
6013
- onSkip: onSkip,
6014
- showSkip: enableSkip,
6015
- skipStyle: isMobile ? {} : {
6016
- textAlign: "right",
6017
- marginRight: "55px"
6018
- },
6019
- sectionHeadStyle: {
6020
- marginBottom: "16px"
6021
- },
6022
- onSubmit: onSubmit,
6023
- noBoxShadow: true,
6024
- inline: true,
6025
- config: newConfig,
6026
- label: t('SUBMIT'),
6027
- isDisabled: !canSubmit,
6028
- defaultValues: defaultValues,
6029
- onFormValueChange: onFormValueChange
6030
- }), showToast && /*#__PURE__*/React.createElement(Toast, {
6031
- error: showToast.key,
6032
- label: t(showToast.label),
6033
- onClose: () => {
6034
- setShowToast(null);
6035
- }
6036
- }));
6037
- };
6038
-
6039
5900
  const setAddressDetailsLW = data => {
6040
- var _locationDet$cityCode, _locationDet$locality;
5901
+ var _address$city, _address$city2, _address$locality, _address$locality2, _address$locality3, _address$locality4, _address$zro, _address$addressType;
6041
5902
  let {
6042
- locationDet
5903
+ locationDet,
5904
+ propertyAddress
6043
5905
  } = data;
5906
+ let address = (Array.isArray(locationDet) ? locationDet[0] : locationDet) || (Array.isArray(propertyAddress) ? propertyAddress[0] : propertyAddress);
5907
+ console.log(address, "address_debug");
5908
+ if (!address) return data;
6044
5909
  let propAddress = {
6045
- city: locationDet === null || locationDet === void 0 ? void 0 : (_locationDet$cityCode = locationDet.cityCode) === null || _locationDet$cityCode === void 0 ? void 0 : _locationDet$cityCode.name,
6046
- doorNo: locationDet === null || locationDet === void 0 ? void 0 : locationDet.houseDoorNo,
6047
- street: locationDet === null || locationDet === void 0 ? void 0 : locationDet.buildingColonyName,
6048
- landmark: locationDet === null || locationDet === void 0 ? void 0 : locationDet.landmarkName,
5910
+ city: (address === null || address === void 0 ? void 0 : (_address$city = address.city) === null || _address$city === void 0 ? void 0 : _address$city.code) || (address === null || address === void 0 ? void 0 : (_address$city2 = address.city) === null || _address$city2 === void 0 ? void 0 : _address$city2.name) || (address === null || address === void 0 ? void 0 : address.city),
5911
+ houseNo: (address === null || address === void 0 ? void 0 : address.houseNo) || (address === null || address === void 0 ? void 0 : address.houseDoorNo) || (address === null || address === void 0 ? void 0 : address.doorNo),
5912
+ street: (address === null || address === void 0 ? void 0 : address.street) || (address === null || address === void 0 ? void 0 : address.buildingColonyName) || (address === null || address === void 0 ? void 0 : address.streetName),
5913
+ landmark: (address === null || address === void 0 ? void 0 : address.landmark) || (address === null || address === void 0 ? void 0 : address.landmarkName),
5914
+ pincode: (address === null || address === void 0 ? void 0 : address.pincode) || (address === null || address === void 0 ? void 0 : address.pinCode),
5915
+ latitude: (address === null || address === void 0 ? void 0 : address.latitude) || (address === null || address === void 0 ? void 0 : address.Latitude),
5916
+ longitude: (address === null || address === void 0 ? void 0 : address.longitude) || (address === null || address === void 0 ? void 0 : address.Longitude),
6049
5917
  locality: {
6050
- code: (locationDet === null || locationDet === void 0 ? void 0 : (_locationDet$locality = locationDet.locality) === null || _locationDet$locality === void 0 ? void 0 : _locationDet$locality.code) || "NA"
6051
- }
5918
+ code: (address === null || address === void 0 ? void 0 : (_address$locality = address.locality) === null || _address$locality === void 0 ? void 0 : _address$locality.code) || (address === null || address === void 0 ? void 0 : (_address$locality2 = address.locality) === null || _address$locality2 === void 0 ? void 0 : _address$locality2.name) || (address === null || address === void 0 ? void 0 : address.locality),
5919
+ latitude: address === null || address === void 0 ? void 0 : (_address$locality3 = address.locality) === null || _address$locality3 === void 0 ? void 0 : _address$locality3.latitude,
5920
+ longitude: address === null || address === void 0 ? void 0 : (_address$locality4 = address.locality) === null || _address$locality4 === void 0 ? void 0 : _address$locality4.longitude
5921
+ },
5922
+ addressLine1: address === null || address === void 0 ? void 0 : address.addressLine1,
5923
+ addressLine2: address === null || address === void 0 ? void 0 : address.addressLine2,
5924
+ assembly: (address === null || address === void 0 ? void 0 : address.assembly) || (address === null || address === void 0 ? void 0 : address.Assembly),
5925
+ block: address === null || address === void 0 ? void 0 : address.block,
5926
+ zone: address === null || address === void 0 ? void 0 : address.zone,
5927
+ zro: (address === null || address === void 0 ? void 0 : (_address$zro = address.zro) === null || _address$zro === void 0 ? void 0 : _address$zro.code) || (address === null || address === void 0 ? void 0 : address.zro),
5928
+ addressType: (address === null || address === void 0 ? void 0 : (_address$addressType = address.addressType) === null || _address$addressType === void 0 ? void 0 : _address$addressType.code) || (address === null || address === void 0 ? void 0 : address.addressType)
6052
5929
  };
6053
5930
  data.address = propAddress;
6054
5931
  return data;
6055
5932
  };
6056
5933
  const setOwnerDetailsLW = data => {
6057
- var _data$owners, _data$owners$;
5934
+ var _data$owners, _data$owners$, _data$ownershipCatego3;
6058
5935
  const {
6059
5936
  locationDet,
6060
5937
  owners
@@ -6062,14 +5939,15 @@ const setOwnerDetailsLW = data => {
6062
5939
  let institution = {},
6063
5940
  owner = [],
6064
5941
  document = [];
6065
- data.ownershipCategory = data === null || data === void 0 ? void 0 : (_data$owners = data.owners) === null || _data$owners === void 0 ? void 0 : (_data$owners$ = _data$owners[0]) === null || _data$owners$ === void 0 ? void 0 : _data$owners$.ownershipCategory;
6066
- if (data.ownershipCategory.includes("INSTITUTIONALPRIVATE") || data.ownershipCategory.includes("INSTITUTIONALGOVERNMENT")) {
6067
- var _owners$14, _owners$15, _owners$16, _owners$16$institutio, _owners$16$institutio2, _owners$16$institutio3, _owners$17, _locationDet$cityCode2, _owners$18, _owners$19, _owners$20, _owners$21, _owners$22, _owners$23, _owners$24;
5942
+ data.ownershipCategory = (data === null || data === void 0 ? void 0 : (_data$owners = data.owners) === null || _data$owners === void 0 ? void 0 : (_data$owners$ = _data$owners[0]) === null || _data$owners$ === void 0 ? void 0 : _data$owners$.ownershipCategory) || "INDIVIDUAL.SINGLEOWNER";
5943
+ const ownershipCategoryCode = typeof data.ownershipCategory === "string" ? data.ownershipCategory : (_data$ownershipCatego3 = data.ownershipCategory) === null || _data$ownershipCatego3 === void 0 ? void 0 : _data$ownershipCatego3.code;
5944
+ if (ownershipCategoryCode !== null && ownershipCategoryCode !== void 0 && ownershipCategoryCode.includes("INSTITUTIONALPRIVATE") || ownershipCategoryCode !== null && ownershipCategoryCode !== void 0 && ownershipCategoryCode.includes("INSTITUTIONALGOVERNMENT")) {
5945
+ var _owners$14, _owners$15, _owners$16, _owners$16$institutio, _owners$16$institutio2, _owners$16$institutio3, _owners$17, _locationDet$city, _owners$18, _owners$19, _owners$20, _owners$21, _owners$22, _owners$23, _owners$24;
6068
5946
  institution.designation = owners === null || owners === void 0 ? void 0 : (_owners$14 = owners[0]) === null || _owners$14 === void 0 ? void 0 : _owners$14.designation;
6069
5947
  institution.name = owners === null || owners === void 0 ? void 0 : (_owners$15 = owners[0]) === null || _owners$15 === void 0 ? void 0 : _owners$15.institutionName;
6070
5948
  institution.type = owners === null || owners === void 0 ? void 0 : (_owners$16 = owners[0]) === null || _owners$16 === void 0 ? void 0 : (_owners$16$institutio = _owners$16.institutionType) === null || _owners$16$institutio === void 0 ? void 0 : (_owners$16$institutio2 = _owners$16$institutio.code) === null || _owners$16$institutio2 === void 0 ? void 0 : (_owners$16$institutio3 = _owners$16$institutio2.split(".")) === null || _owners$16$institutio3 === void 0 ? void 0 : _owners$16$institutio3[1];
6071
5949
  institution.landlineNumber = owners === null || owners === void 0 ? void 0 : (_owners$17 = owners[0]) === null || _owners$17 === void 0 ? void 0 : _owners$17.altContactNumber;
6072
- institution.tenantId = locationDet === null || locationDet === void 0 ? void 0 : (_locationDet$cityCode2 = locationDet.cityCode) === null || _locationDet$cityCode2 === void 0 ? void 0 : _locationDet$cityCode2.code;
5950
+ institution.tenantId = (locationDet === null || locationDet === void 0 ? void 0 : (_locationDet$city = locationDet.city) === null || _locationDet$city === void 0 ? void 0 : _locationDet$city.code) || (locationDet === null || locationDet === void 0 ? void 0 : locationDet.city);
6073
5951
  owner.push({
6074
5952
  altContactNumber: owners === null || owners === void 0 ? void 0 : (_owners$18 = owners[0]) === null || _owners$18 === void 0 ? void 0 : _owners$18.altContactNumber,
6075
5953
  permanentAddress: owners === null || owners === void 0 ? void 0 : (_owners$19 = owners[0]) === null || _owners$19 === void 0 ? void 0 : _owners$19.permanentAddress,
@@ -6083,88 +5961,96 @@ const setOwnerDetailsLW = data => {
6083
5961
  });
6084
5962
  data.institution = institution;
6085
5963
  data.owners = owner;
6086
- } else {
5964
+ } else if (owners && owners.length > 0) {
6087
5965
  owners.map(own => {
6088
- var _own$gender, _owners$25, _own$ownerType, _own$relationship;
5966
+ var _own$gender, _own$gender2, _own$ownerType, _own$relationship;
6089
5967
  owner.push({
6090
5968
  emailId: own === null || own === void 0 ? void 0 : own.emailId,
6091
5969
  fatherOrHusbandName: own === null || own === void 0 ? void 0 : own.fatherOrHusbandName,
6092
- gender: own === null || own === void 0 ? void 0 : (_own$gender = own.gender) === null || _own$gender === void 0 ? void 0 : _own$gender.value,
6093
- sameAsPropertyAddress: (own === null || own === void 0 ? void 0 : own.isCorrespondenceAddress) || (owners === null || owners === void 0 ? void 0 : (_owners$25 = owners[0]) === null || _owners$25 === void 0 ? void 0 : _owners$25.isCoresAddr),
5970
+ gender: (own === null || own === void 0 ? void 0 : (_own$gender = own.gender) === null || _own$gender === void 0 ? void 0 : _own$gender.code) || (own === null || own === void 0 ? void 0 : (_own$gender2 = own.gender) === null || _own$gender2 === void 0 ? void 0 : _own$gender2.value) || (own === null || own === void 0 ? void 0 : own.gender),
5971
+ sameAsPropertyAddress: (own === null || own === void 0 ? void 0 : own.isCorrespondenceAddress) || (own === null || own === void 0 ? void 0 : own.isCoresAddr),
6094
5972
  mobileNumber: own === null || own === void 0 ? void 0 : own.mobileNumber,
6095
5973
  name: own === null || own === void 0 ? void 0 : own.name,
6096
- ownerType: (own === null || own === void 0 ? void 0 : (_own$ownerType = own.ownerType) === null || _own$ownerType === void 0 ? void 0 : _own$ownerType.code) || "NONE",
5974
+ ownerType: (own === null || own === void 0 ? void 0 : (_own$ownerType = own.ownerType) === null || _own$ownerType === void 0 ? void 0 : _own$ownerType.code) || (own === null || own === void 0 ? void 0 : own.ownerType) || "NONE",
6097
5975
  permanentAddress: own === null || own === void 0 ? void 0 : own.permanentAddress,
6098
- relationship: own === null || own === void 0 ? void 0 : (_own$relationship = own.relationship) === null || _own$relationship === void 0 ? void 0 : _own$relationship.code,
6099
- documents: document
5976
+ relationship: (own === null || own === void 0 ? void 0 : (_own$relationship = own.relationship) === null || _own$relationship === void 0 ? void 0 : _own$relationship.code) || (own === null || own === void 0 ? void 0 : own.relationship),
5977
+ documents: (own === null || own === void 0 ? void 0 : own.documents) || document
6100
5978
  });
6101
5979
  });
6102
5980
  data.owners = owner;
5981
+ } else if (data !== null && data !== void 0 && data.applicant && data !== null && data !== void 0 && data.contact) {
5982
+ var _useDetails$gender;
5983
+ const {
5984
+ applicant,
5985
+ contact,
5986
+ useDetails
5987
+ } = data;
5988
+ owner.push({
5989
+ name: `${applicant.firstName}${applicant.middleName ? ` ${applicant.middleName}` : ""}${applicant.lastName ? ` ${applicant.lastName}` : ""}`,
5990
+ mobileNumber: contact.mobileNumber,
5991
+ gender: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$gender = useDetails.gender) === null || _useDetails$gender === void 0 ? void 0 : _useDetails$gender.code) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.gender) || "MALE",
5992
+ fatherOrHusbandName: applicant.ParentorSpouse || "NA",
5993
+ relationship: "FATHER",
5994
+ ownerType: "NONE",
5995
+ status: "ACTIVE"
5996
+ });
5997
+ data.owners = owner;
6103
5998
  }
6104
5999
  return data;
6105
6000
  };
6106
- const getUsageTypeLW = data => {
6107
- var _data$isResdential;
6108
- if ((data === null || data === void 0 ? void 0 : (_data$isResdential = data.isResdential) === null || _data$isResdential === void 0 ? void 0 : _data$isResdential.code) == "RESIDENTIAL") {
6109
- var _data$isResdential2;
6110
- return data === null || data === void 0 ? void 0 : (_data$isResdential2 = data.isResdential) === null || _data$isResdential2 === void 0 ? void 0 : _data$isResdential2.code;
6111
- } else {
6112
- var _data$usageCategory;
6113
- return data === null || data === void 0 ? void 0 : (_data$usageCategory = data.usageCategory) === null || _data$usageCategory === void 0 ? void 0 : _data$usageCategory.code;
6114
- }
6115
- };
6116
6001
  const setPropertyDetailsLW = data => {
6117
- var _assemblyDet$Building;
6002
+ var _useDetails$propertyT, _useDetails$propertyC, _useDetails$noOfFloor, _useDetails$noOfFloor2, _useDetails$noOfFloor3, _useDetails$noOfFloor4, _useDetails$noOfFloor5, _useDetails$noOfFloor6, _useDetails$noOfFloor7;
6118
6003
  let propertyDetails = {};
6119
6004
  const {
6120
- assemblyDet
6005
+ waterConnection,
6006
+ useDetails: topUseDetails
6121
6007
  } = data;
6008
+ const useDetails = (waterConnection === null || waterConnection === void 0 ? void 0 : waterConnection.useDetails) || topUseDetails;
6122
6009
  propertyDetails = {
6123
- propertyType: assemblyDet === null || assemblyDet === void 0 ? void 0 : (_assemblyDet$Building = assemblyDet.BuildingType) === null || _assemblyDet$Building === void 0 ? void 0 : _assemblyDet$Building.code,
6124
- usageCategory: getUsageTypeLW(assemblyDet),
6125
- landArea: parseInt(assemblyDet === null || assemblyDet === void 0 ? void 0 : assemblyDet.floorarea),
6126
- superBuiltUpArea: parseInt(assemblyDet === null || assemblyDet === void 0 ? void 0 : assemblyDet.constructionArea)
6010
+ propertyType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyT = useDetails.propertyType) === null || _useDetails$propertyT === void 0 ? void 0 : _useDetails$propertyT.code) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.propertyType),
6011
+ usageCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC = useDetails.propertyCategory) === null || _useDetails$propertyC === void 0 ? void 0 : _useDetails$propertyC.code) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.propertyCategory),
6012
+ landArea: parseFloat(useDetails === null || useDetails === void 0 ? void 0 : useDetails.plotArea),
6013
+ superBuiltUpArea: parseFloat(useDetails === null || useDetails === void 0 ? void 0 : useDetails.builtUpArea),
6014
+ noOfFloors: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$noOfFloor = useDetails.noOfFloors) === null || _useDetails$noOfFloor === void 0 ? void 0 : _useDetails$noOfFloor.code) === "BASEMENT" ? 0 : parseInt((useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$noOfFloor2 = useDetails.noOfFloors) === null || _useDetails$noOfFloor2 === void 0 ? void 0 : (_useDetails$noOfFloor3 = _useDetails$noOfFloor2.code) === null || _useDetails$noOfFloor3 === void 0 ? void 0 : (_useDetails$noOfFloor4 = _useDetails$noOfFloor3.split("_")) === null || _useDetails$noOfFloor4 === void 0 ? void 0 : _useDetails$noOfFloor4[0]) || (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$noOfFloor5 = useDetails.noOfFloors) === null || _useDetails$noOfFloor5 === void 0 ? void 0 : (_useDetails$noOfFloor6 = _useDetails$noOfFloor5.split) === null || _useDetails$noOfFloor6 === void 0 ? void 0 : (_useDetails$noOfFloor7 = _useDetails$noOfFloor6.call(_useDetails$noOfFloor5, "_")) === null || _useDetails$noOfFloor7 === void 0 ? void 0 : _useDetails$noOfFloor7[0])) || 1
6127
6015
  };
6128
6016
  data.propertyDetails = propertyDetails;
6129
6017
  return data;
6130
6018
  };
6131
6019
  const convertToPropertyLightWeight = (data = {}) => {
6132
- var _data, _data$owners2, _data$owners2$, _data2, _data2$assemblyDet, _data2$assemblyDet$us;
6133
- let propertyType = data.PropertyType;
6134
- let noOfFloors = 1;
6135
- let ownershipCategory = (_data = data) === null || _data === void 0 ? void 0 : (_data$owners2 = _data.owners) === null || _data$owners2 === void 0 ? void 0 : (_data$owners2$ = _data$owners2[0]) === null || _data$owners2$ === void 0 ? void 0 : _data$owners2$.ownershipCategory;
6020
+ var _data$propertyDetails, _data$propertyDetails2, _data, _data$owners2, _data$owners2$, _data$propertyDetails3, _data$propertyDetails4, _data$waterConnection, _data$waterConnection2, _data$waterConnection3, _data$waterConnection4, _data$waterConnection5, _data$waterConnection6, _data$waterConnection7, _data$waterConnection8, _data$waterConnection9, _data$waterConnection0, _data$waterConnection1, _data$waterConnection10, _data$waterConnection11, _data$waterConnection12, _data$waterConnection13, _data$waterConnection14, _data$waterConnection15, _data$waterConnection16;
6136
6021
  data = setOwnerDetailsLW(data);
6137
6022
  data = setAddressDetailsLW(data);
6138
6023
  data = setPropertyDetailsLW(data);
6024
+ let propertyType = (_data$propertyDetails = data.propertyDetails) === null || _data$propertyDetails === void 0 ? void 0 : _data$propertyDetails.propertyType;
6025
+ let noOfFloors = ((_data$propertyDetails2 = data.propertyDetails) === null || _data$propertyDetails2 === void 0 ? void 0 : _data$propertyDetails2.noOfFloors) || 1;
6026
+ let ownershipCategory = (_data = data) === null || _data === void 0 ? void 0 : (_data$owners2 = _data.owners) === null || _data$owners2 === void 0 ? void 0 : (_data$owners2$ = _data$owners2[0]) === null || _data$owners2$ === void 0 ? void 0 : _data$owners2$.ownershipCategory;
6139
6027
  const formdata = {
6140
6028
  Property: {
6141
6029
  tenantId: data.tenantId,
6142
6030
  address: data.address,
6143
6031
  propertyType: propertyType,
6144
6032
  ...data.propertyDetails,
6145
- ownershipCategory: ownershipCategory,
6146
- usageCategory: (_data2 = data) === null || _data2 === void 0 ? void 0 : (_data2$assemblyDet = _data2.assemblyDet) === null || _data2$assemblyDet === void 0 ? void 0 : (_data2$assemblyDet$us = _data2$assemblyDet.usageCategoryMajor) === null || _data2$assemblyDet$us === void 0 ? void 0 : _data2$assemblyDet$us.code,
6147
- owners: [...data.owners.map((owner, index) => {
6148
- var _owner$gender, _owner$ownerType, _owner$relationship, _owner$inistitutetype;
6033
+ ownershipCategory: "INDIVIDUAL.SINGLEOWNER",
6034
+ usageCategory: (_data$propertyDetails3 = data.propertyDetails) === null || _data$propertyDetails3 === void 0 ? void 0 : _data$propertyDetails3.usageCategory,
6035
+ owners: [...(data.owners || []).map((owner, index) => {
6036
+ var _owner$gender, _owner$gender2, _owner$ownerType, _owner$relationship, _owner$inistitutetype;
6149
6037
  return {
6150
6038
  ...owner,
6151
6039
  additionalDetails: {
6152
6040
  ownerSequence: index,
6153
6041
  ownerName: owner === null || owner === void 0 ? void 0 : owner.name
6154
6042
  },
6155
- documents: Object.keys(owner.documents).map(key => {
6156
- const {
6157
- documentType,
6158
- fileStoreId
6159
- } = owner.documents[key];
6043
+ documents: owner.documents ? Array.isArray(owner.documents) ? owner.documents : Object.keys(owner.documents).map(key => {
6044
+ var _doc$documentType;
6045
+ const doc = owner.documents[key];
6160
6046
  return {
6161
- documentType: documentType.code,
6162
- fileStoreId
6047
+ documentType: (doc === null || doc === void 0 ? void 0 : (_doc$documentType = doc.documentType) === null || _doc$documentType === void 0 ? void 0 : _doc$documentType.code) || (doc === null || doc === void 0 ? void 0 : doc.documentType) || "",
6048
+ fileStoreId: (doc === null || doc === void 0 ? void 0 : doc.fileStoreId) || ""
6163
6049
  };
6164
- }),
6165
- gender: (_owner$gender = owner.gender) === null || _owner$gender === void 0 ? void 0 : _owner$gender.code,
6166
- ownerType: ((_owner$ownerType = owner.ownerType) === null || _owner$ownerType === void 0 ? void 0 : _owner$ownerType.code) || "NONE",
6167
- relationship: (_owner$relationship = owner.relationship) === null || _owner$relationship === void 0 ? void 0 : _owner$relationship.code,
6050
+ }) : [],
6051
+ gender: typeof owner.gender === "string" ? owner.gender : ((_owner$gender = owner.gender) === null || _owner$gender === void 0 ? void 0 : _owner$gender.code) || ((_owner$gender2 = owner.gender) === null || _owner$gender2 === void 0 ? void 0 : _owner$gender2.value),
6052
+ ownerType: ((_owner$ownerType = owner.ownerType) === null || _owner$ownerType === void 0 ? void 0 : _owner$ownerType.code) || owner.ownerType || "NONE",
6053
+ relationship: ((_owner$relationship = owner.relationship) === null || _owner$relationship === void 0 ? void 0 : _owner$relationship.code) || owner.relationship,
6168
6054
  inistitutetype: owner === null || owner === void 0 ? void 0 : (_owner$inistitutetype = owner.inistitutetype) === null || _owner$inistitutetype === void 0 ? void 0 : _owner$inistitutetype.value,
6169
6055
  landlineNumber: owner === null || owner === void 0 ? void 0 : owner.altContactNumber,
6170
6056
  status: "ACTIVE"
@@ -6173,27 +6059,35 @@ const convertToPropertyLightWeight = (data = {}) => {
6173
6059
  noOfFloors: noOfFloors,
6174
6060
  additionalDetails: {
6175
6061
  isRainwaterHarvesting: false,
6176
- owners: [...data.owners.map((owner, index) => {
6177
- var _owner$gender2, _owner$ownerType2, _owner$relationship2, _owner$inistitutetype2;
6062
+ propertyType: propertyType,
6063
+ propertyCategory: (_data$propertyDetails4 = data.propertyDetails) === null || _data$propertyDetails4 === void 0 ? void 0 : _data$propertyDetails4.usageCategory,
6064
+ waterConnectionUsageType: (_data$waterConnection = data.waterConnection) === null || _data$waterConnection === void 0 ? void 0 : (_data$waterConnection2 = _data$waterConnection.useDetails) === null || _data$waterConnection2 === void 0 ? void 0 : (_data$waterConnection3 = _data$waterConnection2.WaterConnectionUsageType) === null || _data$waterConnection3 === void 0 ? void 0 : _data$waterConnection3.code,
6065
+ yearOfConstruction: (_data$waterConnection4 = data.waterConnection) === null || _data$waterConnection4 === void 0 ? void 0 : (_data$waterConnection5 = _data$waterConnection4.useDetails) === null || _data$waterConnection5 === void 0 ? void 0 : (_data$waterConnection6 = _data$waterConnection5.SelectYearofConstruction) === null || _data$waterConnection6 === void 0 ? void 0 : _data$waterConnection6.value,
6066
+ numberOfDwellingUnits: (_data$waterConnection7 = data.waterConnection) === null || _data$waterConnection7 === void 0 ? void 0 : (_data$waterConnection8 = _data$waterConnection7.useDetails) === null || _data$waterConnection8 === void 0 ? void 0 : _data$waterConnection8.NumberofDwellingUnits,
6067
+ numberOfRooms: (_data$waterConnection9 = data.waterConnection) === null || _data$waterConnection9 === void 0 ? void 0 : (_data$waterConnection0 = _data$waterConnection9.useDetails) === null || _data$waterConnection0 === void 0 ? void 0 : _data$waterConnection0.NumberofRooms,
6068
+ numberOfFloors: (_data$waterConnection1 = data.waterConnection) === null || _data$waterConnection1 === void 0 ? void 0 : (_data$waterConnection10 = _data$waterConnection1.useDetails) === null || _data$waterConnection10 === void 0 ? void 0 : _data$waterConnection10.NumberofFloors,
6069
+ plotArea: (_data$waterConnection11 = data.waterConnection) === null || _data$waterConnection11 === void 0 ? void 0 : (_data$waterConnection12 = _data$waterConnection11.useDetails) === null || _data$waterConnection12 === void 0 ? void 0 : _data$waterConnection12.plotArea,
6070
+ builtUpArea: (_data$waterConnection13 = data.waterConnection) === null || _data$waterConnection13 === void 0 ? void 0 : (_data$waterConnection14 = _data$waterConnection13.useDetails) === null || _data$waterConnection14 === void 0 ? void 0 : _data$waterConnection14.builtUpArea,
6071
+ numberOfBeds: (_data$waterConnection15 = data.waterConnection) === null || _data$waterConnection15 === void 0 ? void 0 : (_data$waterConnection16 = _data$waterConnection15.useDetails) === null || _data$waterConnection16 === void 0 ? void 0 : _data$waterConnection16.hospitalBeds,
6072
+ owners: [...(data.owners || []).map((owner, index) => {
6073
+ var _owner$gender3, _owner$gender4, _owner$ownerType2, _owner$relationship2, _owner$inistitutetype2;
6178
6074
  return {
6179
6075
  ...owner,
6180
6076
  additionalDetails: {
6181
6077
  ownerSequence: index,
6182
6078
  ownerName: owner === null || owner === void 0 ? void 0 : owner.name
6183
6079
  },
6184
- documents: Object.keys(owner.documents).map(key => {
6185
- const {
6186
- documentType,
6187
- fileStoreId
6188
- } = owner.documents[key];
6080
+ documents: owner.documents ? Array.isArray(owner.documents) ? owner.documents : Object.keys(owner.documents).map(key => {
6081
+ var _doc$documentType2;
6082
+ const doc = owner.documents[key];
6189
6083
  return {
6190
- documentType: documentType.code,
6191
- fileStoreId
6084
+ documentType: (doc === null || doc === void 0 ? void 0 : (_doc$documentType2 = doc.documentType) === null || _doc$documentType2 === void 0 ? void 0 : _doc$documentType2.code) || (doc === null || doc === void 0 ? void 0 : doc.documentType) || "",
6085
+ fileStoreId: (doc === null || doc === void 0 ? void 0 : doc.fileStoreId) || ""
6192
6086
  };
6193
- }),
6194
- gender: (_owner$gender2 = owner.gender) === null || _owner$gender2 === void 0 ? void 0 : _owner$gender2.code,
6195
- ownerType: ((_owner$ownerType2 = owner.ownerType) === null || _owner$ownerType2 === void 0 ? void 0 : _owner$ownerType2.code) || "NONE",
6196
- relationship: (_owner$relationship2 = owner.relationship) === null || _owner$relationship2 === void 0 ? void 0 : _owner$relationship2.code,
6087
+ }) : [],
6088
+ gender: typeof owner.gender === "string" ? owner.gender : ((_owner$gender3 = owner.gender) === null || _owner$gender3 === void 0 ? void 0 : _owner$gender3.code) || ((_owner$gender4 = owner.gender) === null || _owner$gender4 === void 0 ? void 0 : _owner$gender4.value),
6089
+ ownerType: ((_owner$ownerType2 = owner.ownerType) === null || _owner$ownerType2 === void 0 ? void 0 : _owner$ownerType2.code) || owner.ownerType || "NONE",
6090
+ relationship: ((_owner$relationship2 = owner.relationship) === null || _owner$relationship2 === void 0 ? void 0 : _owner$relationship2.code) || owner.relationship,
6197
6091
  inistitutetype: owner === null || owner === void 0 ? void 0 : (_owner$inistitutetype2 = owner.inistitutetype) === null || _owner$inistitutetype2 === void 0 ? void 0 : _owner$inistitutetype2.value,
6198
6092
  landlineNumber: owner === null || owner === void 0 ? void 0 : owner.altContactNumber,
6199
6093
  status: "ACTIVE"
@@ -6205,19 +6099,20 @@ const convertToPropertyLightWeight = (data = {}) => {
6205
6099
  channel: "SYSTEM"
6206
6100
  }
6207
6101
  };
6208
- if (ownershipCategory.includes("INSTITUTIONALPRIVATE") || ownershipCategory.includes("INSTITUTIONALGOVERNMENT")) {
6209
- var _data3;
6210
- formdata.Property.institution = (_data3 = data) === null || _data3 === void 0 ? void 0 : _data3.institution;
6102
+ const ownershipCategoryCode = typeof ownershipCategory === "string" ? ownershipCategory : ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.code;
6103
+ if (ownershipCategoryCode !== null && ownershipCategoryCode !== void 0 && ownershipCategoryCode.includes("INSTITUTIONALPRIVATE") || ownershipCategoryCode !== null && ownershipCategoryCode !== void 0 && ownershipCategoryCode.includes("INSTITUTIONALGOVERNMENT")) {
6104
+ var _data2;
6105
+ formdata.Property.institution = (_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.institution;
6211
6106
  }
6212
6107
  return formdata;
6213
6108
  };
6214
6109
  const convertToUpdatePropertyLightWeight = (data = {}) => {
6215
- var _data4, _formdata$Property, _data5, _formdata$Property3;
6216
- let propertyType = data.PropertyType;
6217
- let noOfFloors = 1;
6110
+ var _data$propertyDetails5, _data$propertyDetails6, _data$waterConnection17, _data$waterConnection18, _data$waterConnection19, _data$waterConnection20, _data$waterConnection21, _data$waterConnection22, _data$waterConnection23, _data$waterConnection24, _data$waterConnection25, _data$waterConnection26, _data$waterConnection27, _data$waterConnection28, _formdata$Property, _data3, _formdata$Property3;
6218
6111
  data = setOwnerDetailsLW(data);
6219
6112
  data = setAddressDetailsLW(data);
6220
6113
  data = setPropertyDetailsLW(data);
6114
+ let propertyType = (_data$propertyDetails5 = data.propertyDetails) === null || _data$propertyDetails5 === void 0 ? void 0 : _data$propertyDetails5.propertyType;
6115
+ let noOfFloors = ((_data$propertyDetails6 = data.propertyDetails) === null || _data$propertyDetails6 === void 0 ? void 0 : _data$propertyDetails6.noOfFloors) || 1;
6221
6116
  const formdata = {
6222
6117
  Property: {
6223
6118
  id: data.id,
@@ -6228,9 +6123,9 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6228
6123
  tenantId: data.tenantId,
6229
6124
  address: data.address,
6230
6125
  propertyType: propertyType,
6231
- ownershipCategory: (_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.ownershipCategory,
6126
+ ownershipCategory: "INDIVIDUAL.SINGLEOWNER",
6232
6127
  owners: [...data.owners.map((owner, index) => {
6233
- var _owner$gender3, _owner$ownerType3, _owner$relationship3, _owner$inistitutetype3;
6128
+ var _owner$gender5, _owner$ownerType3, _owner$relationship3, _owner$inistitutetype3;
6234
6129
  return {
6235
6130
  ...owner,
6236
6131
  additionalDetails: {
@@ -6247,7 +6142,7 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6247
6142
  fileStoreId
6248
6143
  };
6249
6144
  }),
6250
- gender: (_owner$gender3 = owner.gender) === null || _owner$gender3 === void 0 ? void 0 : _owner$gender3.code,
6145
+ gender: (_owner$gender5 = owner.gender) === null || _owner$gender5 === void 0 ? void 0 : _owner$gender5.code,
6251
6146
  ownerType: ((_owner$ownerType3 = owner.ownerType) === null || _owner$ownerType3 === void 0 ? void 0 : _owner$ownerType3.code) || "NONE",
6252
6147
  relationship: (_owner$relationship3 = owner.relationship) === null || _owner$relationship3 === void 0 ? void 0 : _owner$relationship3.code,
6253
6148
  inistitutetype: owner === null || owner === void 0 ? void 0 : (_owner$inistitutetype3 = owner.inistitutetype) === null || _owner$inistitutetype3 === void 0 ? void 0 : _owner$inistitutetype3.value,
@@ -6258,8 +6153,13 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6258
6153
  noOfFloors: noOfFloors,
6259
6154
  additionalDetails: {
6260
6155
  isRainwaterHarvesting: false,
6156
+ waterConnectionUsageType: (_data$waterConnection17 = data.waterConnection) === null || _data$waterConnection17 === void 0 ? void 0 : (_data$waterConnection18 = _data$waterConnection17.useDetails) === null || _data$waterConnection18 === void 0 ? void 0 : (_data$waterConnection19 = _data$waterConnection18.WaterConnectionUsageType) === null || _data$waterConnection19 === void 0 ? void 0 : _data$waterConnection19.code,
6157
+ yearOfConstruction: (_data$waterConnection20 = data.waterConnection) === null || _data$waterConnection20 === void 0 ? void 0 : (_data$waterConnection21 = _data$waterConnection20.useDetails) === null || _data$waterConnection21 === void 0 ? void 0 : (_data$waterConnection22 = _data$waterConnection21.SelectYearofConstruction) === null || _data$waterConnection22 === void 0 ? void 0 : _data$waterConnection22.value,
6158
+ numberOfDwellingUnits: (_data$waterConnection23 = data.waterConnection) === null || _data$waterConnection23 === void 0 ? void 0 : (_data$waterConnection24 = _data$waterConnection23.useDetails) === null || _data$waterConnection24 === void 0 ? void 0 : _data$waterConnection24.NumberofDwellingUnits,
6159
+ numberOfRooms: (_data$waterConnection25 = data.waterConnection) === null || _data$waterConnection25 === void 0 ? void 0 : (_data$waterConnection26 = _data$waterConnection25.useDetails) === null || _data$waterConnection26 === void 0 ? void 0 : _data$waterConnection26.NumberofRooms,
6160
+ hospitalBeds: (_data$waterConnection27 = data.waterConnection) === null || _data$waterConnection27 === void 0 ? void 0 : (_data$waterConnection28 = _data$waterConnection27.useDetails) === null || _data$waterConnection28 === void 0 ? void 0 : _data$waterConnection28.hospitalBeds,
6261
6161
  owners: [...data.owners.map((owner, index) => {
6262
- var _owner$gender4, _owner$ownerType4, _owner$relationship4, _owner$inistitutetype4;
6162
+ var _owner$gender6, _owner$ownerType4, _owner$relationship4, _owner$inistitutetype4;
6263
6163
  return {
6264
6164
  ...owner,
6265
6165
  additionalDetails: {
@@ -6276,7 +6176,7 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6276
6176
  fileStoreId
6277
6177
  };
6278
6178
  }),
6279
- gender: (_owner$gender4 = owner.gender) === null || _owner$gender4 === void 0 ? void 0 : _owner$gender4.code,
6179
+ gender: (_owner$gender6 = owner.gender) === null || _owner$gender6 === void 0 ? void 0 : _owner$gender6.code,
6280
6180
  ownerType: ((_owner$ownerType4 = owner.ownerType) === null || _owner$ownerType4 === void 0 ? void 0 : _owner$ownerType4.code) || "NONE",
6281
6181
  relationship: (_owner$relationship4 = owner.relationship) === null || _owner$relationship4 === void 0 ? void 0 : _owner$relationship4.code,
6282
6182
  inistitutetype: owner === null || owner === void 0 ? void 0 : (_owner$inistitutetype4 = owner.inistitutetype) === null || _owner$inistitutetype4 === void 0 ? void 0 : _owner$inistitutetype4.value,
@@ -6293,7 +6193,7 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6293
6193
  }
6294
6194
  };
6295
6195
  let propertyInitialObject = JSON.parse(sessionStorage.getItem("propertyInitialObject"));
6296
- if (checkArrayLength(propertyInitialObject === null || propertyInitialObject === void 0 ? void 0 : propertyInitialObject.units) && checkIsAnArray((_formdata$Property = formdata.Property) === null || _formdata$Property === void 0 ? void 0 : _formdata$Property.units) && (_data5 = data) !== null && _data5 !== void 0 && _data5.isEditProperty) {
6196
+ if (checkArrayLength(propertyInitialObject === null || propertyInitialObject === void 0 ? void 0 : propertyInitialObject.units) && checkIsAnArray((_formdata$Property = formdata.Property) === null || _formdata$Property === void 0 ? void 0 : _formdata$Property.units) && (_data3 = data) !== null && _data3 !== void 0 && _data3.isEditProperty) {
6297
6197
  var _formdata$Property2;
6298
6198
  propertyInitialObject.units = propertyInitialObject.units.filter(unit => unit.active);
6299
6199
  let oldUnits = propertyInitialObject.units.map(unit => {
@@ -6322,113 +6222,288 @@ const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => {
6322
6222
  return str;
6323
6223
  };
6324
6224
 
6325
- const GetActionMessage = props => {
6326
- const {
6327
- t
6328
- } = useTranslation();
6329
- if (props.isSuccess) {
6330
- return !window.location.href.includes("edit-application") ? window.location.href.includes("employee") ? t("CS_NEW_PROPERTY_APPLICATION_CREATED_SUCCESS") : t("CS_NEW_PROPERTY_APPLICATION_SUBMITTED_SUCCESS") : t("CS_PROPERTY_UPDATE_APPLICATION_SUCCESS");
6331
- } else if (props.isLoading) {
6332
- return !window.location.href.includes("edit-application") ? t("CS_PROPERTY_APPLICATION_PENDING") : t("CS_PROPERTY_UPDATE_APPLICATION_PENDING");
6333
- } else if (!props.isSuccess) {
6334
- return !window.location.href.includes("edit-application") ? t("CS_PROPERTY_APPLICATION_FAILED") : t("CS_PROPERTY_UPDATE_APPLICATION_FAILED");
6335
- }
6336
- };
6337
- const rowContainerStyle = {
6338
- padding: "4px 0px",
6339
- justifyContent: "space-between"
6340
- };
6341
- const BannerPicker = props => {
6342
- var _props$data;
6343
- return /*#__PURE__*/React.createElement(Banner, {
6344
- message: GetActionMessage(props),
6345
- applicationNumber: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.Properties[0].acknowldgementNumber,
6346
- info: props.isSuccess ? props.t("PT_APPLICATION_NO") : "",
6347
- successful: props.isSuccess
6348
- });
6349
- };
6350
- const PTAcknowledgement = ({
6351
- onSuccess,
6225
+ const CreatePropertyForm = ({
6226
+ config,
6352
6227
  onSelect,
6353
- formData,
6354
- redirectUrl,
6355
- userType
6228
+ value,
6229
+ userType,
6230
+ redirectUrl
6356
6231
  }) => {
6357
- var _location$state, _mdmsConfig$PropertyT, _data, _data$locationDet, _data$locationDet2, _data$locationDet2$ci, _data2, _data2$locationDet, _data$locationDet3, _data$locationDet3$ci, _mutation$data6, _mutation$data6$Prope;
6232
+ var _Digit$Hooks$pt$useTe;
6233
+ const [showToast, setShowToast] = useState(null);
6234
+ const tenantId = Digit.ULBService.getCurrentTenantId();
6235
+ const tenants = Digit.Hooks.pt.useTenants();
6358
6236
  const {
6359
6237
  t
6360
6238
  } = useTranslation();
6361
6239
  const location = useLocation();
6362
- const stateId = Digit.ULBService.getStateId();
6363
- const tenantId = Digit.ULBService.getCurrentTenantId();
6240
+ const [canSubmit, setCanSubmit] = useState(true);
6241
+ const defaultValues = {
6242
+ ...value
6243
+ };
6364
6244
  const history = useHistory();
6365
- let data = location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.data;
6366
- if (onSelect) {
6367
- var _formData$cptNewPrope;
6368
- data = formData === null || formData === void 0 ? void 0 : (_formData$cptNewPrope = formData.cptNewProperty) === null || _formData$cptNewPrope === void 0 ? void 0 : _formData$cptNewPrope.property;
6245
+ const match = useRouteMatch();
6246
+ sessionStorage.setItem("VisitedCommonPTSearch", true);
6247
+ sessionStorage.setItem("VisitedLightCreate", true);
6248
+ const isMobile = window.Digit.Utils.browser.isMobile();
6249
+ let allCities = (_Digit$Hooks$pt$useTe = Digit.Hooks.pt.useTenants()) === null || _Digit$Hooks$pt$useTe === void 0 ? void 0 : _Digit$Hooks$pt$useTe.sort((a, b) => {
6250
+ var _a$i18nKey, _a$i18nKey$localeComp;
6251
+ return a === null || a === void 0 ? void 0 : (_a$i18nKey = a.i18nKey) === null || _a$i18nKey === void 0 ? void 0 : (_a$i18nKey$localeComp = _a$i18nKey.localeCompare) === null || _a$i18nKey$localeComp === void 0 ? void 0 : _a$i18nKey$localeComp.call(_a$i18nKey, b === null || b === void 0 ? void 0 : b.i18nKey);
6252
+ });
6253
+ if (window.location.href.includes("obps")) {
6254
+ allCities = Digit.SessionStorage.get("OBPS_TENANTS");
6369
6255
  }
6370
- let createNUpdate = false;
6371
- let {
6372
- data: mdmsConfig,
6373
- isLoading
6374
- } = Digit.Hooks.pt.useMDMS(stateId, "PropertyTax", "PTWorkflow");
6375
- ((mdmsConfig === null || mdmsConfig === void 0 ? void 0 : (_mdmsConfig$PropertyT = mdmsConfig.PropertyTax) === null || _mdmsConfig$PropertyT === void 0 ? void 0 : _mdmsConfig$PropertyT.PTWorkfow) || []).forEach(data => {
6376
- if (data.enable) {
6377
- if (data.businessService.includes("WNS")) {
6378
- createNUpdate = true;
6256
+ if (window.location.href.includes("fsm")) {
6257
+ allCities = Digit.SessionStorage.get("FSM_TENANTS");
6258
+ }
6259
+ const [formValue, setFormValue] = useState("");
6260
+ const [owners, setOwners] = useState([]);
6261
+ useEffect(() => {
6262
+ if (location !== null && location !== void 0 && location.state && (!owners || owners.length === 0)) {
6263
+ var _location$state, _location$state2, _location$state3, _location$state4;
6264
+ const applicant = (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.applicant;
6265
+ const contact = (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.contact;
6266
+ const useDetails = (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.useDetails;
6267
+ const propertyAddress = (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.propertyAddress;
6268
+ if (applicant && contact) {
6269
+ setOwners([{
6270
+ name: `${applicant.firstName}${applicant.middleName ? ` ${applicant.middleName}` : ""}${applicant.lastName ? ` ${applicant.lastName}` : ""}`,
6271
+ mobileNumber: contact.mobileNumber,
6272
+ gender: (useDetails === null || useDetails === void 0 ? void 0 : useDetails.gender) || {
6273
+ code: "MALE",
6274
+ name: "Male"
6275
+ },
6276
+ fatherOrHusbandName: applicant.ParentorSpouse || "NA",
6277
+ relationship: {
6278
+ code: "FATHER",
6279
+ name: "Father"
6280
+ },
6281
+ ownerType: {
6282
+ code: "NONE",
6283
+ name: "None"
6284
+ },
6285
+ ownershipCategory: "INDIVIDUAL.SINGLEOWNER"
6286
+ }]);
6287
+ }
6288
+ if (propertyAddress || useDetails) {
6289
+ const initialFormValue = {
6290
+ locationDet: {
6291
+ cityCode: (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.cityCode) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.city),
6292
+ locality: propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.locality,
6293
+ houseDoorNo: (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.houseNo) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.houseDoorNo),
6294
+ buildingColonyName: (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.street) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.buildingColonyName),
6295
+ landmarkName: (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.landmark) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.landmarkName)
6296
+ },
6297
+ waterConnection: {
6298
+ useDetails: useDetails
6299
+ }
6300
+ };
6301
+ setFormValue(initialFormValue);
6379
6302
  }
6380
6303
  }
6381
- });
6382
- const mutation = Digit.Hooks.pt.usePropertyAPI((_data = data) !== null && _data !== void 0 && (_data$locationDet = _data.locationDet) !== null && _data$locationDet !== void 0 && _data$locationDet.city ? (_data$locationDet2 = data.locationDet) === null || _data$locationDet2 === void 0 ? void 0 : (_data$locationDet2$ci = _data$locationDet2.city) === null || _data$locationDet2$ci === void 0 ? void 0 : _data$locationDet2$ci.code : tenantId, true);
6383
- const mutationForUpdate = Digit.Hooks.pt.usePropertyAPI((_data2 = data) !== null && _data2 !== void 0 && (_data2$locationDet = _data2.locationDet) !== null && _data2$locationDet !== void 0 && _data2$locationDet.city ? (_data$locationDet3 = data.locationDet) === null || _data$locationDet3 === void 0 ? void 0 : (_data$locationDet3$ci = _data$locationDet3.city) === null || _data$locationDet3$ci === void 0 ? void 0 : _data$locationDet3$ci.code : tenantId, false);
6304
+ }, [location === null || location === void 0 ? void 0 : location.state]);
6305
+ const [cityCode, setCityCode] = useState("");
6306
+ let enableSkip = userType == "employee" ? false : (config === null || config === void 0 ? void 0 : config.isSkipEnabled) || sessionStorage.getItem("skipenabled");
6307
+ const [mutationHappened, setMutationHappened, clear] = Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED", false);
6308
+ const [successData, setsuccessData, clearSuccessData] = Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA", {});
6384
6309
  const {
6385
- data: storeData
6386
- } = Digit.Hooks.useStore.getInitData();
6310
+ data: commonFields,
6311
+ isLoading
6312
+ } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "PropertyTax", "CommonFieldsConfig");
6313
+ const mutation = Digit.Hooks.pt.usePropertyAPI(tenantId, true);
6387
6314
  useEffect(() => {
6388
- try {
6389
- var _data3, _data3$locationDet, _data3$locationDet$ci, _formdata$Property;
6390
- let tenant = userType === "employee" ? tenantId : (_data3 = data) === null || _data3 === void 0 ? void 0 : (_data3$locationDet = _data3.locationDet) === null || _data3$locationDet === void 0 ? void 0 : (_data3$locationDet$ci = _data3$locationDet.cityCode) === null || _data3$locationDet$ci === void 0 ? void 0 : _data3$locationDet$ci.code;
6391
- data.tenantId = tenant;
6392
- let formdata = convertToPropertyLightWeight(data);
6393
- formdata.Property.tenantId = (formdata === null || formdata === void 0 ? void 0 : (_formdata$Property = formdata.Property) === null || _formdata$Property === void 0 ? void 0 : _formdata$Property.tenantId) || tenant;
6394
- mutation.mutate(formdata, {
6395
- onSuccess
6396
- });
6397
- if (!createNUpdate) {
6398
- if (!(mutation.isLoading && mutation.isIdle)) {
6399
- if (mutation.isSuccess) {
6400
- setTimeout(() => {
6401
- if (redirectUrl) {
6402
- var _mutation$data, _mutation$data$Proper, _location$state2;
6403
- history.push(`${redirectUrl}?propertyId=${mutation === null || mutation === void 0 ? void 0 : (_mutation$data = mutation.data) === null || _mutation$data === void 0 ? void 0 : (_mutation$data$Proper = _mutation$data.Properties[0]) === null || _mutation$data$Proper === void 0 ? void 0 : _mutation$data$Proper.propertyId}&tenantId=${formdata.Property.tenantId}`, {
6404
- ...(location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.prevState)
6405
- });
6406
- const scrollConst = redirectUrl !== null && redirectUrl !== void 0 && redirectUrl.includes("employee/tl") ? 1600 : 300;
6407
- setTimeout(() => window.scrollTo(0, scrollConst), 400);
6408
- return;
6409
- }
6410
- }, 3000);
6411
- }
6412
- }
6413
- }
6414
- } catch (err) {}
6315
+ setMutationHappened(false);
6316
+ clearSuccessData();
6415
6317
  }, []);
6416
- useEffect(() => {
6417
- var _data4, _data4$locationDet, _data4$locationDet$ci;
6418
- let tenant = userType === "employee" ? tenantId : (_data4 = data) === null || _data4 === void 0 ? void 0 : (_data4$locationDet = _data4.locationDet) === null || _data4$locationDet === void 0 ? void 0 : (_data4$locationDet$ci = _data4$locationDet.city) === null || _data4$locationDet$ci === void 0 ? void 0 : _data4$locationDet$ci.code;
6419
- if (mutation.isSuccess) {
6420
- setTimeout(() => {
6421
- if (redirectUrl) {
6422
- var _mutation$data2, _mutation$data2$Prope, _location$state3;
6423
- history.push(`${redirectUrl}?propertyId=${mutation === null || mutation === void 0 ? void 0 : (_mutation$data2 = mutation.data) === null || _mutation$data2 === void 0 ? void 0 : (_mutation$data2$Prope = _mutation$data2.Properties[0]) === null || _mutation$data2$Prope === void 0 ? void 0 : _mutation$data2$Prope.propertyId}&tenantId=${tenant}`, {
6424
- ...(location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.prevState)
6318
+ if (isLoading) {
6319
+ return /*#__PURE__*/React.createElement(Loader, null);
6320
+ }
6321
+ const onSubmit = async () => {
6322
+ var _formValue$owners, _formValue$owners$own, _formValue$owners2, _formValue$owners2$, _formValue$owners2$$o, _formValue$owners2$$o2, _formValue$owners3;
6323
+ const ownersArray = owners && owners.length > 0 ? owners : formValue === null || formValue === void 0 ? void 0 : formValue.owners;
6324
+ if ((formValue !== null && formValue !== void 0 && (_formValue$owners = formValue.owners) !== null && _formValue$owners !== void 0 && (_formValue$owners$own = _formValue$owners.ownershipCategory) !== null && _formValue$owners$own !== void 0 && _formValue$owners$own.includes("MULTIPLEOWNERS") || formValue !== null && formValue !== void 0 && (_formValue$owners2 = formValue.owners) !== null && _formValue$owners2 !== void 0 && (_formValue$owners2$ = _formValue$owners2[0]) !== null && _formValue$owners2$ !== void 0 && (_formValue$owners2$$o = _formValue$owners2$.ownershipCategory) !== null && _formValue$owners2$$o !== void 0 && (_formValue$owners2$$o2 = _formValue$owners2$$o.code) !== null && _formValue$owners2$$o2 !== void 0 && _formValue$owners2$$o2.includes("MULTIPLEOWNERS")) && (formValue === null || formValue === void 0 ? void 0 : (_formValue$owners3 = formValue.owners) === null || _formValue$owners3 === void 0 ? void 0 : _formValue$owners3.length) == 1) {
6325
+ setShowToast({
6326
+ key: true,
6327
+ label: "PT_COMMON_ONE_MORE_OWNER_INFROMATION_REQUIRED"
6328
+ });
6329
+ } else if (!ownersArray || ownersArray.length === 0) {
6330
+ setShowToast({
6331
+ key: true,
6332
+ label: t("PT_COMMON_OWNER_DETAILS_REQUIRED")
6333
+ });
6334
+ } else {
6335
+ const payload = convertToPropertyLightWeight({
6336
+ ...formValue,
6337
+ owners: ownersArray
6338
+ });
6339
+ payload.Property.tenantId = tenantId;
6340
+ mutation.mutate(payload, {
6341
+ onSuccess: data => {
6342
+ var _data$Properties, _data$Properties$;
6343
+ if (data !== null && data !== void 0 && data.Errors && (data === null || data === void 0 ? void 0 : data.Errors.length) > 0) {
6344
+ var _data$Errors$;
6345
+ setShowToast({
6346
+ key: true,
6347
+ label: (data === null || data === void 0 ? void 0 : (_data$Errors$ = data.Errors[0]) === null || _data$Errors$ === void 0 ? void 0 : _data$Errors$.message) || t("PT_COMMON_FAILED_TO_CREATE_PROPERTY")
6348
+ });
6349
+ return;
6350
+ }
6351
+ setShowToast({
6352
+ key: false,
6353
+ label: `${t("CS_NEW_PROPERTY_APPLICATION_CREATED_SUCCESS")} - ${data === null || data === void 0 ? void 0 : (_data$Properties = data.Properties) === null || _data$Properties === void 0 ? void 0 : (_data$Properties$ = _data$Properties[0]) === null || _data$Properties$ === void 0 ? void 0 : _data$Properties$.propertyId}`
6354
+ });
6355
+ if (onSelect) {
6356
+ var _data$Properties2;
6357
+ onSelect("cptNewProperty", {
6358
+ property: data === null || data === void 0 ? void 0 : (_data$Properties2 = data.Properties) === null || _data$Properties2 === void 0 ? void 0 : _data$Properties2[0]
6359
+ });
6360
+ }
6361
+ },
6362
+ onError: error => {
6363
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
6364
+ setShowToast({
6365
+ key: true,
6366
+ label: (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("PT_COMMON_FAILED_TO_CREATE_PROPERTY")
6425
6367
  });
6426
- const scrollConst = redirectUrl !== null && redirectUrl !== void 0 && redirectUrl.includes("employee/tl") ? 1600 : 300;
6427
- setTimeout(() => window.scrollTo(0, scrollConst), 400);
6428
- return;
6429
6368
  }
6430
- }, 3000);
6369
+ });
6370
+ }
6371
+ };
6372
+ const onSkip = () => {
6373
+ onSelect("isSkip", true);
6374
+ };
6375
+ const onFormValueChange = (setValue, data, formState) => {
6376
+ if (!lodash.isEqual(data, formValue)) {
6377
+ setFormValue(data);
6378
+ }
6379
+ setCanSubmit(true);
6380
+ };
6381
+ const getHeaderLabel = () => {
6382
+ var _url$split, _url$split$, _url$split$$split;
6383
+ let url = window.location.href;
6384
+ let moduleName = url === null || url === void 0 ? void 0 : (_url$split = url.split("=")) === null || _url$split === void 0 ? void 0 : (_url$split$ = _url$split[1]) === null || _url$split$ === void 0 ? void 0 : (_url$split$$split = _url$split$.split("/")) === null || _url$split$$split === void 0 ? void 0 : _url$split$$split[3];
6385
+ if (moduleName) return t(`ES_COMMON_CREATE_PROPERTY_HEADER_${moduleName === null || moduleName === void 0 ? void 0 : moduleName.toUpperCase()}`);else return t("ES_COMMON_CREATE_PROPERTY_HEADER");
6386
+ };
6387
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
6388
+ className: "employee-form-section-wrapper"
6389
+ }, /*#__PURE__*/React.createElement(VerticalTimeline, {
6390
+ config: [{
6391
+ timeLine: [{
6392
+ actions: getHeaderLabel(),
6393
+ currentStep: 1
6394
+ }]
6395
+ }],
6396
+ showFinalStep: false
6397
+ }), /*#__PURE__*/React.createElement(FormComposer, {
6398
+ onSkip: onSkip,
6399
+ showSkip: enableSkip,
6400
+ skipStyle: isMobile ? {} : {
6401
+ textAlign: "right",
6402
+ marginRight: "55px"
6403
+ },
6404
+ onSubmit: onSubmit,
6405
+ noBoxShadow: true,
6406
+ inline: true,
6407
+ config: newConfig,
6408
+ label: t("SUBMIT"),
6409
+ isDisabled: !canSubmit,
6410
+ defaultValues: defaultValues,
6411
+ onFormValueChange: onFormValueChange,
6412
+ noBreakLine: true,
6413
+ noCard: true
6414
+ })), showToast && /*#__PURE__*/React.createElement(Toast, {
6415
+ error: showToast.key,
6416
+ label: showToast.label,
6417
+ onClose: () => {
6418
+ setShowToast(null);
6419
+ }
6420
+ }));
6421
+ };
6422
+
6423
+ const GetActionMessage = props => {
6424
+ const {
6425
+ t
6426
+ } = useTranslation();
6427
+ if (props.isSuccess) {
6428
+ return !window.location.href.includes("edit-application") ? window.location.href.includes("employee") ? t("CS_NEW_PROPERTY_APPLICATION_CREATED_SUCCESS") : t("CS_NEW_PROPERTY_APPLICATION_SUBMITTED_SUCCESS") : t("CS_PROPERTY_UPDATE_APPLICATION_SUCCESS");
6429
+ } else if (props.isLoading) {
6430
+ return !window.location.href.includes("edit-application") ? t("CS_PROPERTY_APPLICATION_PENDING") : t("CS_PROPERTY_UPDATE_APPLICATION_PENDING");
6431
+ } else if (!props.isSuccess) {
6432
+ return !window.location.href.includes("edit-application") ? t("CS_PROPERTY_APPLICATION_FAILED") : t("CS_PROPERTY_UPDATE_APPLICATION_FAILED");
6433
+ }
6434
+ };
6435
+ const rowContainerStyle = {
6436
+ padding: "4px 0px",
6437
+ justifyContent: "space-between"
6438
+ };
6439
+ const BannerPicker = props => {
6440
+ var _props$data;
6441
+ return /*#__PURE__*/React.createElement(Banner, {
6442
+ message: GetActionMessage(props),
6443
+ applicationNumber: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.Properties[0].acknowldgementNumber,
6444
+ info: props.isSuccess ? props.t("PT_APPLICATION_NO") : "",
6445
+ successful: props.isSuccess
6446
+ });
6447
+ };
6448
+ const PTAcknowledgement = ({
6449
+ onSuccess,
6450
+ onSelect,
6451
+ formData,
6452
+ redirectUrl,
6453
+ userType
6454
+ }) => {
6455
+ var _location$state, _location$state2, _mdmsConfig$PropertyT, _data, _data$locationDet, _data$locationDet2, _data$locationDet2$ci, _data2, _data2$locationDet, _data$locationDet3, _data$locationDet3$ci, _responseData$Propert;
6456
+ const {
6457
+ t
6458
+ } = useTranslation();
6459
+ const location = useLocation();
6460
+ const stateId = Digit.ULBService.getStateId();
6461
+ const tenantId = Digit.ULBService.getCurrentTenantId();
6462
+ const history = useHistory();
6463
+ let data = location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.data;
6464
+ if (onSelect) {
6465
+ var _formData$cptNewPrope;
6466
+ data = formData === null || formData === void 0 ? void 0 : (_formData$cptNewPrope = formData.cptNewProperty) === null || _formData$cptNewPrope === void 0 ? void 0 : _formData$cptNewPrope.property;
6467
+ }
6468
+ const propertyFromState = location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.property;
6469
+ let createNUpdate = false;
6470
+ let {
6471
+ data: mdmsConfig,
6472
+ isLoading
6473
+ } = Digit.Hooks.pt.useMDMS(stateId, "PropertyTax", "PTWorkflow");
6474
+ ((mdmsConfig === null || mdmsConfig === void 0 ? void 0 : (_mdmsConfig$PropertyT = mdmsConfig.PropertyTax) === null || _mdmsConfig$PropertyT === void 0 ? void 0 : _mdmsConfig$PropertyT.PTWorkfow) || []).forEach(data => {
6475
+ if (data.enable) {
6476
+ if (data.businessService.includes("WNS")) {
6477
+ createNUpdate = true;
6478
+ }
6431
6479
  }
6480
+ });
6481
+ const mutation = Digit.Hooks.pt.usePropertyAPI((_data = data) !== null && _data !== void 0 && (_data$locationDet = _data.locationDet) !== null && _data$locationDet !== void 0 && _data$locationDet.city ? (_data$locationDet2 = data.locationDet) === null || _data$locationDet2 === void 0 ? void 0 : (_data$locationDet2$ci = _data$locationDet2.city) === null || _data$locationDet2$ci === void 0 ? void 0 : _data$locationDet2$ci.code : tenantId, true);
6482
+ const mutationForUpdate = Digit.Hooks.pt.usePropertyAPI((_data2 = data) !== null && _data2 !== void 0 && (_data2$locationDet = _data2.locationDet) !== null && _data2$locationDet !== void 0 && _data2$locationDet.city ? (_data$locationDet3 = data.locationDet) === null || _data$locationDet3 === void 0 ? void 0 : (_data$locationDet3$ci = _data$locationDet3.city) === null || _data$locationDet3$ci === void 0 ? void 0 : _data$locationDet3$ci.code : tenantId, false);
6483
+ const {
6484
+ data: storeData
6485
+ } = Digit.Hooks.useStore.getInitData();
6486
+ useEffect(() => {
6487
+ if (propertyFromState) return;
6488
+ try {
6489
+ var _data3, _data3$locationDet, _data3$locationDet$ci, _formdata$Property;
6490
+ let tenant = userType === "employee" ? tenantId : (_data3 = data) === null || _data3 === void 0 ? void 0 : (_data3$locationDet = _data3.locationDet) === null || _data3$locationDet === void 0 ? void 0 : (_data3$locationDet$ci = _data3$locationDet.city) === null || _data3$locationDet$ci === void 0 ? void 0 : _data3$locationDet$ci.code;
6491
+ data.tenantId = tenant;
6492
+ let formdata = convertToPropertyLightWeight(data);
6493
+ formdata.Property.tenantId = (formdata === null || formdata === void 0 ? void 0 : (_formdata$Property = formdata.Property) === null || _formdata$Property === void 0 ? void 0 : _formdata$Property.tenantId) || tenant;
6494
+ mutation.mutate(formdata, {
6495
+ onSuccess
6496
+ });
6497
+ if (!createNUpdate) {
6498
+ if (!(mutation.isLoading && mutation.isIdle)) {
6499
+ if (mutation.isSuccess) {}
6500
+ }
6501
+ }
6502
+ } catch (err) {}
6503
+ }, []);
6504
+ useEffect(() => {
6505
+ const queryParams = new URLSearchParams(location.search);
6506
+ const redirectUrlFromQuery = queryParams.get("redirectToUrl");
6432
6507
  }, [mutation]);
6433
6508
  useEffect(() => {
6434
6509
  if (mutation.isSuccess && createNUpdate) {
@@ -6441,58 +6516,54 @@ const PTAcknowledgement = ({
6441
6516
  mutationForUpdate.mutate(formdata, {
6442
6517
  onSuccess
6443
6518
  });
6444
- if (mutationForUpdate.isSuccess) {
6445
- setTimeout(() => {
6446
- if (redirectUrl) {
6447
- var _mutationForUpdate$da, _mutationForUpdate$da2, _mutationForUpdate$da3, _mutationForUpdate$da4, _location$state4;
6448
- history.push(`${redirectUrl}?propertyId=${mutationForUpdate === null || mutationForUpdate === void 0 ? void 0 : (_mutationForUpdate$da = mutationForUpdate.data) === null || _mutationForUpdate$da === void 0 ? void 0 : (_mutationForUpdate$da2 = _mutationForUpdate$da.Properties[0]) === null || _mutationForUpdate$da2 === void 0 ? void 0 : _mutationForUpdate$da2.propertyId}&tenantId=${mutationForUpdate === null || mutationForUpdate === void 0 ? void 0 : (_mutationForUpdate$da3 = mutationForUpdate.data) === null || _mutationForUpdate$da3 === void 0 ? void 0 : (_mutationForUpdate$da4 = _mutationForUpdate$da3.Properties[0]) === null || _mutationForUpdate$da4 === void 0 ? void 0 : _mutationForUpdate$da4.tenantId}`, {
6449
- ...(location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.prevState)
6450
- });
6451
- const scrollConst = redirectUrl !== null && redirectUrl !== void 0 && redirectUrl.includes("employee/tl") ? 1600 : 300;
6452
- setTimeout(() => window.scrollTo(0, scrollConst), 400);
6453
- return;
6454
- }
6455
- }, 3000);
6456
- }
6519
+ if (mutationForUpdate.isSuccess) {}
6457
6520
  } catch (er) {}
6458
6521
  }
6459
6522
  }, [mutation.isSuccess]);
6460
6523
  const onNext = () => {
6461
6524
  if (onSelect) {
6462
6525
  if (mutation.isSuccess) {
6463
- var _mutation$data3, _mutation$data4, _mutation$data5;
6464
- sessionStorage.setItem("Digit_OBPS_PT", JSON.stringify(mutation === null || mutation === void 0 ? void 0 : (_mutation$data3 = mutation.data) === null || _mutation$data3 === void 0 ? void 0 : _mutation$data3.Properties[0]));
6465
- sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(mutation === null || mutation === void 0 ? void 0 : (_mutation$data4 = mutation.data) === null || _mutation$data4 === void 0 ? void 0 : _mutation$data4.Properties[0]));
6526
+ var _mutation$data, _mutation$data2, _mutation$data3;
6527
+ sessionStorage.setItem("Digit_OBPS_PT", JSON.stringify(mutation === null || mutation === void 0 ? void 0 : (_mutation$data = mutation.data) === null || _mutation$data === void 0 ? void 0 : _mutation$data.Properties[0]));
6528
+ sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(mutation === null || mutation === void 0 ? void 0 : (_mutation$data2 = mutation.data) === null || _mutation$data2 === void 0 ? void 0 : _mutation$data2.Properties[0]));
6466
6529
  onSelect("cpt", {
6467
- details: mutation === null || mutation === void 0 ? void 0 : (_mutation$data5 = mutation.data) === null || _mutation$data5 === void 0 ? void 0 : _mutation$data5.Properties[0]
6530
+ details: mutation === null || mutation === void 0 ? void 0 : (_mutation$data3 = mutation.data) === null || _mutation$data3 === void 0 ? void 0 : _mutation$data3.Properties[0]
6468
6531
  });
6469
6532
  }
6470
6533
  }
6471
6534
  };
6472
- return mutation.isLoading || mutation.isIdle ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker, {
6535
+ const isMutationLoading = propertyFromState ? false : mutation.isLoading || mutation.isIdle;
6536
+ const isMutationSuccess = propertyFromState ? true : mutation.isSuccess;
6537
+ const responseData = propertyFromState ? {
6538
+ Properties: [propertyFromState]
6539
+ } : mutation.data;
6540
+ return isMutationLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker, {
6473
6541
  t: t,
6474
- data: mutation.data,
6475
- isSuccess: mutation.isSuccess,
6476
- isLoading: mutation.isIdle || mutation.isLoading
6477
- }), mutation.isSuccess && /*#__PURE__*/React.createElement(CardText, null, window.location.href.includes("employee") ? t("CS_CREATE_PROPERTY_SUCCESS_EMP_RESPONSE") : t("CS_CREATE_PROPERTY_SUCCESS_CITIZEN_RESPONSE")), !mutation.isSuccess && /*#__PURE__*/React.createElement(CardText, null, t("CS_FILE_PROPERTY_FAILED_RESPONSE")), /*#__PURE__*/React.createElement(StatusTable, null, mutation.isSuccess && /*#__PURE__*/React.createElement(Row, {
6542
+ data: responseData,
6543
+ isSuccess: isMutationSuccess,
6544
+ isLoading: isMutationLoading
6545
+ }), isMutationSuccess && /*#__PURE__*/React.createElement(CardText, null, window.location.href.includes("employee") ? t("CS_CREATE_PROPERTY_SUCCESS_EMP_RESPONSE") : t("CS_CREATE_PROPERTY_SUCCESS_CITIZEN_RESPONSE")), !isMutationSuccess && /*#__PURE__*/React.createElement(CardText, null, t("CS_FILE_PROPERTY_FAILED_RESPONSE")), /*#__PURE__*/React.createElement(StatusTable, null, isMutationSuccess && /*#__PURE__*/React.createElement(Row, {
6478
6546
  rowContainerStyle: rowContainerStyle,
6479
6547
  last: true,
6480
6548
  label: t("PT_COMMON_TABLE_COL_PT_ID"),
6481
- text: mutation === null || mutation === void 0 ? void 0 : (_mutation$data6 = mutation.data) === null || _mutation$data6 === void 0 ? void 0 : (_mutation$data6$Prope = _mutation$data6.Properties[0]) === null || _mutation$data6$Prope === void 0 ? void 0 : _mutation$data6$Prope.propertyId,
6549
+ text: responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert = responseData.Properties[0]) === null || _responseData$Propert === void 0 ? void 0 : _responseData$Propert.propertyId,
6482
6550
  textStyle: {
6483
6551
  whiteSpace: "pre",
6484
6552
  width: "200%"
6485
6553
  }
6486
- })), mutation.isSuccess && window.location.href.includes("/citizen/") && (onSelect ? /*#__PURE__*/React.createElement(SubmitBar, {
6554
+ })), isMutationSuccess && (window.location.href.includes("/citizen/") || window.location.href.includes("/employee/")) && (onSelect ? /*#__PURE__*/React.createElement(SubmitBar, {
6487
6555
  label: t("CS_COMMON_PROCEED"),
6488
6556
  onSubmit: onNext
6489
6557
  }) : /*#__PURE__*/React.createElement(SubmitBar, {
6490
6558
  label: t("CS_COMMON_PROCEED"),
6491
6559
  onSubmit: () => {
6492
- if (redirectUrl) {
6493
- var _mutationForUpdate$da5, _mutationForUpdate$da6, _mutationForUpdate$da7, _mutationForUpdate$da8, _location$state5;
6494
- history.push(`${redirectUrl}?propertyId=${mutationForUpdate === null || mutationForUpdate === void 0 ? void 0 : (_mutationForUpdate$da5 = mutationForUpdate.data) === null || _mutationForUpdate$da5 === void 0 ? void 0 : (_mutationForUpdate$da6 = _mutationForUpdate$da5.Properties[0]) === null || _mutationForUpdate$da6 === void 0 ? void 0 : _mutationForUpdate$da6.propertyId}&tenantId=${mutationForUpdate === null || mutationForUpdate === void 0 ? void 0 : (_mutationForUpdate$da7 = mutationForUpdate.data) === null || _mutationForUpdate$da7 === void 0 ? void 0 : (_mutationForUpdate$da8 = _mutationForUpdate$da7.Properties[0]) === null || _mutationForUpdate$da8 === void 0 ? void 0 : _mutationForUpdate$da8.tenantId}`, {
6495
- ...(location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.prevState)
6560
+ const queryParams = new URLSearchParams(location.search);
6561
+ const redirectUrlFromQuery = queryParams.get("redirectToUrl");
6562
+ const finalRedirectUrl = redirectUrl && redirectUrl !== "undefined" ? redirectUrl : redirectUrlFromQuery && redirectUrlFromQuery !== "undefined" ? redirectUrlFromQuery : null;
6563
+ if (finalRedirectUrl) {
6564
+ var _responseData$Propert2, _responseData$Propert3, _location$state3;
6565
+ history.push(`${finalRedirectUrl}?propertyId=${responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert2 = responseData.Properties[0]) === null || _responseData$Propert2 === void 0 ? void 0 : _responseData$Propert2.propertyId}&tenantId=${responseData === null || responseData === void 0 ? void 0 : (_responseData$Propert3 = responseData.Properties[0]) === null || _responseData$Propert3 === void 0 ? void 0 : _responseData$Propert3.tenantId}`, {
6566
+ ...(location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.prevState)
6496
6567
  });
6497
6568
  }
6498
6569
  }
@@ -7653,7 +7724,7 @@ const SearchProperty = ({
7653
7724
  } = Digit.Hooks.pt.usePropertySearchWithDue({
7654
7725
  tenantId: searchData === null || searchData === void 0 ? void 0 : searchData.city,
7655
7726
  filters: searchData === null || searchData === void 0 ? void 0 : searchData.filters,
7656
- auth: true,
7727
+ auth: false,
7657
7728
  configs: {
7658
7729
  enabled: Object.keys(searchData).length > 0,
7659
7730
  retry: false,
@@ -8293,7 +8364,7 @@ const PropertySearchResults = ({
8293
8364
  redirectToUrl,
8294
8365
  searchQuery
8295
8366
  }) => {
8296
- var _result$data, _result$data$Properti, _paymentDetails$data, _paymentDetails$data$, _result$data3, _result$data3$Propert, _modalData$total_due;
8367
+ var _result$data, _result$data2, _properties$map, _paymentDetails$data, _paymentDetails$data$, _ref, _modalData$total_due;
8297
8368
  const {
8298
8369
  t
8299
8370
  } = useTranslation();
@@ -8304,6 +8375,7 @@ const PropertySearchResults = ({
8304
8375
  oldPropertyIds,
8305
8376
  locality,
8306
8377
  city,
8378
+ tenantId: tId,
8307
8379
  doorNo,
8308
8380
  name,
8309
8381
  PToffset
@@ -8335,17 +8407,21 @@ const PropertySearchResults = ({
8335
8407
  setShowModal(false);
8336
8408
  };
8337
8409
  Digit.Hooks.useClickOutside(modalRef, closeModal, modalData);
8338
- if (mobileNumber || searchQuery && searchQuery.mobileNumber) filters.mobileNumber = mobileNumber ? mobileNumber : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber;
8339
- if (propertyIds || searchQuery && searchQuery.propertyIds) filters.propertyIds = propertyIds ? propertyIds : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds;
8340
- if (oldPropertyIds || searchQuery && searchQuery.oldPropertyIds) filters.oldPropertyIds = oldPropertyIds ? oldPropertyIds : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds;
8410
+ const sbm = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNo);
8411
+ const spi = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyId);
8412
+ const sop = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyId);
8413
+ if (mobileNumber || sbm) filters.mobileNumber = mobileNumber ? mobileNumber : sbm;
8414
+ if (propertyIds || spi) filters.propertyIds = propertyIds ? propertyIds : spi;
8415
+ if (oldPropertyIds || sop) filters.oldPropertyIds = oldPropertyIds ? oldPropertyIds : sop;
8341
8416
  if (locality || searchQuery && searchQuery.locality) filters.locality = locality ? locality : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.locality;
8342
8417
  if (doorNo || searchQuery && searchQuery.doorNo) filters.doorNo = doorNo ? doorNo : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.doorNo;
8343
8418
  if (name || searchQuery && searchQuery.name) filters.name = name ? name : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.name;
8344
- if (locality || searchQuery && searchQuery.locality) {
8345
- filters.limit = filter1.limit;
8346
- filters.sortOrder = filter1.sortOrder;
8347
- filters.sortBy = filter1.sortBy;
8348
- filters.offset = filter1.offset;
8419
+ filters.limit = filter1.limit;
8420
+ filters.sortOrder = filter1.sortOrder;
8421
+ filters.sortBy = filter1.sortBy;
8422
+ filters.offset = filter1.offset;
8423
+ if (!filters.status) {
8424
+ filters.status = "ACTIVE,INWORKFLOW";
8349
8425
  }
8350
8426
  const [owners, setOwners, clearOwners] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS", null);
8351
8427
  const [lastPath, setLastPath, clearLastPath] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH", null);
@@ -8359,9 +8435,9 @@ const PropertySearchResults = ({
8359
8435
  _clearParams();
8360
8436
  setLastPath("");
8361
8437
  }, []);
8362
- const auth = true;
8438
+ const auth = false;
8363
8439
  const tenantId = Digit.ULBService.getCurrentTenantId();
8364
- const scity = city ? city : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.city;
8440
+ const scity = city || tId || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.city) || tenantId;
8365
8441
  const searchArgs = scity ? {
8366
8442
  tenantId: scity,
8367
8443
  filters,
@@ -8373,8 +8449,11 @@ const PropertySearchResults = ({
8373
8449
  const result = Digit.Hooks.pt.usePropertySearch(searchArgs, {
8374
8450
  privacy: Digit.Utils.getPrivacyObject()
8375
8451
  });
8376
- const consumerCode = result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : (_result$data$Properti = _result$data.Properties) === null || _result$data$Properti === void 0 ? void 0 : _result$data$Properti.map(a => a.propertyId).join(",");
8377
- console.log("result", result);
8452
+ const properties = (result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.Properties) || (result === null || result === void 0 ? void 0 : (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.properties) || (Array.isArray(result === null || result === void 0 ? void 0 : result.data) ? result === null || result === void 0 ? void 0 : result.data : []);
8453
+ const consumerCode = properties === null || properties === void 0 ? void 0 : (_properties$map = properties.map) === null || _properties$map === void 0 ? void 0 : _properties$map.call(properties, a => a.propertyId || a.id).filter(id => id).join(",");
8454
+ if (result.isSuccess && (!properties || properties.length === 0)) {
8455
+ console.warn("Property Search: No properties found in result.data", result.data);
8456
+ }
8378
8457
  const fetchBillParams = mobileNumber ? {
8379
8458
  mobileNumber,
8380
8459
  consumerCode
@@ -8386,7 +8465,7 @@ const PropertySearchResults = ({
8386
8465
  ...fetchBillParams,
8387
8466
  tenantId: scity
8388
8467
  }, {
8389
- enabled: consumerCode ? true : false,
8468
+ enabled: !!(consumerCode && scity),
8390
8469
  retry: false
8391
8470
  });
8392
8471
  const history = useHistory();
@@ -8398,7 +8477,7 @@ const PropertySearchResults = ({
8398
8477
  if (paymentDetails.isLoading || result.isLoading) {
8399
8478
  return /*#__PURE__*/React.createElement(Loader, null);
8400
8479
  }
8401
- if (result.error || !consumerCode) {
8480
+ if (result.error || result.isSuccess && (!properties || properties.length === 0)) {
8402
8481
  return /*#__PURE__*/React.createElement("div", {
8403
8482
  style: {
8404
8483
  height: "150px"
@@ -8421,18 +8500,16 @@ const PropertySearchResults = ({
8421
8500
  };
8422
8501
  }
8423
8502
  });
8424
- const arr = result === null || result === void 0 ? void 0 : (_result$data3 = result.data) === null || _result$data3 === void 0 ? void 0 : (_result$data3$Propert = _result$data3.Properties) === null || _result$data3$Propert === void 0 ? void 0 : _result$data3$Propert.filter(e => e.status === "ACTIVE");
8425
- console.log("arrarr", arr);
8426
- const searchResults = arr === null || arr === void 0 ? void 0 : arr.map(property => {
8427
- var _sort, _sort$, _addr$locality, _payment$property$pro, _payment$property$pro2, _2, _property$owners, _property$owners$;
8503
+ const searchResults = (_ref = properties || []) === null || _ref === void 0 ? void 0 : _ref.map(property => {
8504
+ var _sort, _sort$, _addr$locality, _addr$locality2, _addr$locality3, _addr$locality4, _payment$property$pro, _payment$property$pro2, _2, _property$owners, _property$owners$;
8428
8505
  let addr = (property === null || property === void 0 ? void 0 : property.address) || {};
8429
8506
  return {
8430
8507
  property_id: property === null || property === void 0 ? void 0 : property.propertyId,
8431
8508
  owner_name: (_sort = ((property === null || property === void 0 ? void 0 : property.owners) || []).sort((a, b) => {
8432
8509
  var _a$additionalDetails, _b$additionalDetails;
8433
- return (a === null || a === void 0 ? void 0 : (_a$additionalDetails = a.additionalDetails) === null || _a$additionalDetails === void 0 ? void 0 : _a$additionalDetails.ownerSequence) - (b === null || b === void 0 ? void 0 : (_b$additionalDetails = b.additionalDetails) === null || _b$additionalDetails === void 0 ? void 0 : _b$additionalDetails.ownerSequence);
8510
+ return ((a === null || a === void 0 ? void 0 : (_a$additionalDetails = a.additionalDetails) === null || _a$additionalDetails === void 0 ? void 0 : _a$additionalDetails.ownerSequence) || 0) - ((b === null || b === void 0 ? void 0 : (_b$additionalDetails = b.additionalDetails) === null || _b$additionalDetails === void 0 ? void 0 : _b$additionalDetails.ownerSequence) || 0);
8434
8511
  })) === null || _sort === void 0 ? void 0 : (_sort$ = _sort[0]) === null || _sort$ === void 0 ? void 0 : _sort$.name,
8435
- property_address: [addr.doorNo || "", addr.buildingName || "", addr.street || "", t(`TENANTS_MOHALLA_${(_addr$locality = addr.locality) === null || _addr$locality === void 0 ? void 0 : _addr$locality.code}`) || "", t(addr.tenantId) || ""].filter(a => a).join(", "),
8512
+ property_address: [addr.doorNo || "", addr.buildingName || "", addr.street || "", t(`TENANTS_MOHALLA_${(_addr$locality = addr.locality) === null || _addr$locality === void 0 ? void 0 : _addr$locality.code}`) !== `TENANTS_MOHALLA_${(_addr$locality2 = addr.locality) === null || _addr$locality2 === void 0 ? void 0 : _addr$locality2.code}` ? t(`TENANTS_MOHALLA_${(_addr$locality3 = addr.locality) === null || _addr$locality3 === void 0 ? void 0 : _addr$locality3.code}`) : ((_addr$locality4 = addr.locality) === null || _addr$locality4 === void 0 ? void 0 : _addr$locality4.name) || "", t(addr.tenantId) || ""].filter(a => a).join(", "),
8436
8513
  total_due: ((_payment$property$pro = payment[property === null || property === void 0 ? void 0 : property.propertyId]) === null || _payment$property$pro === void 0 ? void 0 : _payment$property$pro.total_due) || 0,
8437
8514
  bil_due__date: ((_payment$property$pro2 = payment[property === null || property === void 0 ? void 0 : property.propertyId]) === null || _payment$property$pro2 === void 0 ? void 0 : _payment$property$pro2.bil_due__date) || t("N/A"),
8438
8515
  status: t(property.status),
@@ -8525,7 +8602,7 @@ const PropertySearchResults = ({
8525
8602
  style: {
8526
8603
  marginLeft: "8px"
8527
8604
  }
8528
- }, t(header), " (", searchResults === null || searchResults === void 0 ? void 0 : searchResults.length, ")"), /*#__PURE__*/React.createElement(PrivacyInfoLabel, {
8605
+ }, t(header), " (", searchResults === null || searchResults === void 0 ? void 0 : searchResults.length, ")"), PrivacyInfoLabel && /*#__PURE__*/React.createElement(PrivacyInfoLabel, {
8529
8606
  t: t
8530
8607
  }), /*#__PURE__*/React.createElement(ResponseComposer, {
8531
8608
  data: searchResults,
@@ -8558,7 +8635,7 @@ const PropertySearchResults = ({
8558
8635
  width: "100%"
8559
8636
  },
8560
8637
  label: t("PT_PROCEED_PAYMENT")
8561
- }))) : null, !(searchResults !== null && searchResults !== void 0 && searchResults.length) > 0 && /*#__PURE__*/React.createElement("p", {
8638
+ }))) : null, (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) === 0 && /*#__PURE__*/React.createElement("p", {
8562
8639
  style: {
8563
8640
  marginLeft: "16px",
8564
8641
  marginTop: "16px"
@@ -12902,23 +12979,26 @@ const ActionModal$b = ({
12902
12979
  isSuccess
12903
12980
  } = Digit.Hooks.fsm.useVehiclesSearch({
12904
12981
  tenantId,
12982
+ filters: {
12983
+ vendorId: applicationData === null || applicationData === void 0 ? void 0 : applicationData.vendorId
12984
+ },
12905
12985
  config: {
12906
12986
  enabled: (action === null || action === void 0 ? void 0 : action.state) === "DELIVERY_PENDING" || (action === null || action === void 0 ? void 0 : action.action) === "ASSIGN_VEHICLE_DRIVER"
12907
12987
  }
12908
12988
  });
12909
12989
  let vehicleDescription = [];
12910
12990
  vehicleData === null || vehicleData === void 0 ? void 0 : (_vehicleData$vehicle = vehicleData.vehicle) === null || _vehicleData$vehicle === void 0 ? void 0 : (_vehicleData$vehicle$ = _vehicleData$vehicle.filter(item => {
12911
- var _item$driverData, _item$driver;
12912
- return (item === null || item === void 0 ? void 0 : (_item$driverData = item.driverData) === null || _item$driverData === void 0 ? void 0 : _item$driverData.id) || (item === null || item === void 0 ? void 0 : (_item$driver = item.driver) === null || _item$driver === void 0 ? void 0 : _item$driver.id);
12991
+ var _item$driverData, _item$driver, _item$owner2;
12992
+ return (item === null || item === void 0 ? void 0 : (_item$driverData = item.driverData) === null || _item$driverData === void 0 ? void 0 : _item$driverData.id) || (item === null || item === void 0 ? void 0 : (_item$driver = item.driver) === null || _item$driver === void 0 ? void 0 : _item$driver.id) || (item === null || item === void 0 ? void 0 : (_item$owner2 = item.owner) === null || _item$owner2 === void 0 ? void 0 : _item$owner2.id);
12913
12993
  })) === null || _vehicleData$vehicle$ === void 0 ? void 0 : _vehicleData$vehicle$.map(item => {
12914
- var _item$driverData2, _item$driver2;
12994
+ var _item$driverData2, _item$driver2, _item$owner3;
12915
12995
  vehicleDescription.push({
12916
12996
  code: item === null || item === void 0 ? void 0 : item.registrationNumber,
12917
12997
  name: item === null || item === void 0 ? void 0 : item.registrationNumber,
12918
12998
  i18nKey: item === null || item === void 0 ? void 0 : item.registrationNumber,
12919
12999
  tankerCapacity: item === null || item === void 0 ? void 0 : item.tankCapacity,
12920
13000
  vehicleId: item === null || item === void 0 ? void 0 : item.id,
12921
- driverId: (item === null || item === void 0 ? void 0 : (_item$driverData2 = item.driverData) === null || _item$driverData2 === void 0 ? void 0 : _item$driverData2.ownerId) || (item === null || item === void 0 ? void 0 : (_item$driver2 = item.driver) === null || _item$driver2 === void 0 ? void 0 : _item$driver2.ownerId)
13001
+ driverId: (item === null || item === void 0 ? void 0 : (_item$driverData2 = item.driverData) === null || _item$driverData2 === void 0 ? void 0 : _item$driverData2.ownerId) || (item === null || item === void 0 ? void 0 : (_item$driver2 = item.driver) === null || _item$driver2 === void 0 ? void 0 : _item$driver2.ownerId) || (item === null || item === void 0 ? void 0 : item.ownerId) || (item === null || item === void 0 ? void 0 : (_item$owner3 = item.owner) === null || _item$owner3 === void 0 ? void 0 : _item$owner3.uuid)
12922
13002
  });
12923
13003
  });
12924
13004
  const [config, setConfig] = useState({});
@@ -12987,7 +13067,11 @@ const ActionModal$b = ({
12987
13067
  applicationData.vehicleId = selectVehicle === null || selectVehicle === void 0 ? void 0 : selectVehicle.vehicleId;
12988
13068
  applicationData.driverId = selectVehicle === null || selectVehicle === void 0 ? void 0 : selectVehicle.driverId;
12989
13069
  }
12990
- let requestPayload = businessService === "watertanker" ? {
13070
+ if (businessService === "watertanker-fixedpoint") {
13071
+ workflow.moduleName = "request-service.water_tanker";
13072
+ workflow.businessService = "watertanker-fixedpoint";
13073
+ }
13074
+ let requestPayload = businessService === "watertanker" || businessService === "watertanker-fixedpoint" ? {
12991
13075
  waterTankerBookingDetail: {
12992
13076
  ...applicationData,
12993
13077
  workflow
@@ -13740,7 +13824,7 @@ const NOCDocuments = ({
13740
13824
  }
13741
13825
  }, [nocDocs, commonDocMaping]);
13742
13826
  useEffect(() => {
13743
- if (bpaApplicationStatus === 'NOC_VERIFICATION_INPROGRESS' && (actions === null || actions === void 0 ? void 0 : actions.length) > 0) setCheckEnablingDocs(true);else setCheckEnablingDocs(false);
13827
+ if (bpaApplicationStatus === "NOC_VERIFICATION_INPROGRESS" && (actions === null || actions === void 0 ? void 0 : actions.length) > 0) setCheckEnablingDocs(true);else setCheckEnablingDocs(false);
13744
13828
  }, [applicationData, bpaActionsDetails]);
13745
13829
  return /*#__PURE__*/React.createElement("div", {
13746
13830
  style: {
@@ -13765,9 +13849,9 @@ const NOCDocuments = ({
13765
13849
  label: isEmployee ? `${t(noc === null || noc === void 0 ? void 0 : noc.title)}` : t(noc === null || noc === void 0 ? void 0 : noc.title),
13766
13850
  text: noc !== null && noc !== void 0 && noc.value ? t(noc === null || noc === void 0 ? void 0 : noc.value) : t("CS_NA"),
13767
13851
  textStyle: (noc === null || noc === void 0 ? void 0 : noc.value) == "APPROVED" || (noc === null || noc === void 0 ? void 0 : noc.value) == "AUTO_APPROVED" ? {
13768
- color: "#00703C"
13852
+ color: "#2E9E8F"
13769
13853
  } : {
13770
- color: "#D4351C"
13854
+ color: "#D83A2F"
13771
13855
  }
13772
13856
  });
13773
13857
  } else {
@@ -14319,7 +14403,7 @@ const ScruntinyDetails = ({
14319
14403
  const getTextValues = data => {
14320
14404
  if (data !== null && data !== void 0 && data.value && data !== null && data !== void 0 && data.isTransLate) return /*#__PURE__*/React.createElement("span", {
14321
14405
  style: {
14322
- color: "#00703C"
14406
+ color: "#2E9E8F"
14323
14407
  }
14324
14408
  }, t(data === null || data === void 0 ? void 0 : data.value));else if (data !== null && data !== void 0 && data.value && data !== null && data !== void 0 && data.isTransLate) return t(data === null || data === void 0 ? void 0 : data.value);else if (data !== null && data !== void 0 && data.value) return data === null || data === void 0 ? void 0 : data.value;else t("NA");
14325
14409
  };
@@ -14999,7 +15083,7 @@ const WSFeeEstimation = ({
14999
15083
  var _result$Calculation2, _result$Calculation2$, _result$Calculation2$2;
15000
15084
  result === null || result === void 0 ? void 0 : (_result$Calculation2 = result.Calculation) === null || _result$Calculation2 === void 0 ? void 0 : (_result$Calculation2$ = _result$Calculation2[0]) === null || _result$Calculation2$ === void 0 ? void 0 : (_result$Calculation2$2 = _result$Calculation2$.taxHeadEstimates) === null || _result$Calculation2$2 === void 0 ? void 0 : _result$Calculation2$2.forEach(data => data.amount = data.estimateAmount);
15001
15085
  }
15002
- result.Calculation[0].billSlabData = _.groupBy(result === null || result === void 0 ? void 0 : (_result$Calculation3 = result.Calculation) === null || _result$Calculation3 === void 0 ? void 0 : (_result$Calculation3$ = _result$Calculation3[0]) === null || _result$Calculation3$ === void 0 ? void 0 : _result$Calculation3$.taxHeadEstimates, 'category');
15086
+ result.Calculation[0].billSlabData = _.groupBy(result === null || result === void 0 ? void 0 : (_result$Calculation3 = result.Calculation) === null || _result$Calculation3 === void 0 ? void 0 : (_result$Calculation3$ = _result$Calculation3[0]) === null || _result$Calculation3$ === void 0 ? void 0 : _result$Calculation3$.taxHeadEstimates, "category");
15003
15087
  const values = [{
15004
15088
  title: "WS_APPLICATION_FEE_HEADER",
15005
15089
  value: (_result$Calculation4 = result.Calculation) === null || _result$Calculation4 === void 0 ? void 0 : (_result$Calculation4$ = _result$Calculation4[0]) === null || _result$Calculation4$ === void 0 ? void 0 : _result$Calculation4$.fee
@@ -15045,7 +15129,7 @@ const WSFeeEstimation = ({
15045
15129
  if (targetValueSign == 1) {
15046
15130
  values[value] = e.target.value;
15047
15131
  } else {
15048
- values[value] = '';
15132
+ values[value] = "";
15049
15133
  }
15050
15134
  } else if (isDropDownValue) {
15051
15135
  values[`${value}_data`] = e;
@@ -15060,7 +15144,7 @@ const WSFeeEstimation = ({
15060
15144
  return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", {
15061
15145
  style: {
15062
15146
  lineHeight: "19px",
15063
- maxWidth: "950px",
15147
+ maxWidth: "100%",
15064
15148
  minWidth: "280px"
15065
15149
  }
15066
15150
  }, values && /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement("div", null, values === null || values === void 0 ? void 0 : values.map((value, index) => {
@@ -15091,15 +15175,16 @@ const WSFeeEstimation = ({
15091
15175
  label: `${t(`CS_INBOX_STATUS_FILTER`)}`,
15092
15176
  text: isPaid ? t("WS_COMMON_PAID_LABEL") : t("WS_COMMON_NOT_PAID"),
15093
15177
  textStyle: !isPaid ? {
15094
- color: "#D4351C"
15178
+ color: "#D83A2F"
15095
15179
  } : {
15096
- color: "#00703C"
15180
+ color: "#2E9E8F"
15097
15181
  }
15098
15182
  }))), wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$18 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$18 !== void 0 && _wsAdditionalDetails$18.isAdhocRebate ? /*#__PURE__*/React.createElement("div", {
15099
15183
  onClick: e => {
15100
15184
  showPopUp(true);
15101
15185
  }
15102
15186
  }, /*#__PURE__*/React.createElement("span", {
15187
+ className: "add-details-link hover-button",
15103
15188
  style: {
15104
15189
  cursor: "pointer",
15105
15190
  color: "#a82227"
@@ -15123,14 +15208,16 @@ const WSFeeEstimation = ({
15123
15208
  actionSaveOnSubmit: e => addAdhocRebatePenality(),
15124
15209
  hideSubmit: false,
15125
15210
  popupStyles: {
15126
- overflowY: "auto"
15211
+ overflowY: "auto",
15212
+ background: "#f0f3f7"
15127
15213
  }
15128
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Card, {
15214
+ }, /*#__PURE__*/React.createElement("div", {
15129
15215
  style: {
15130
- padding: "10px 10px 1px 10px",
15131
- margin: "0px 0px 15px 0px"
15216
+ display: "flex",
15217
+ flexDirection: "column",
15218
+ gap: "16px"
15132
15219
  }
15133
- }, /*#__PURE__*/React.createElement(CardSectionHeader, {
15220
+ }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
15134
15221
  style: {
15135
15222
  fontSize: "16px",
15136
15223
  fontWeight: "700",
@@ -15138,7 +15225,7 @@ const WSFeeEstimation = ({
15138
15225
  padding: "0px",
15139
15226
  margin: "0px 0px 10px 0px"
15140
15227
  }
15141
- }, t("PT_AD_PENALTY")), /*#__PURE__*/React.createElement(CardLabel, null, t("PT_TX_HEADS")), /*#__PURE__*/React.createElement("div", {
15228
+ }, t("PT_AD_PENALTY")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_TX_HEADS")), /*#__PURE__*/React.createElement("div", {
15142
15229
  className: "field"
15143
15230
  }, /*#__PURE__*/React.createElement(Dropdown, {
15144
15231
  isMandatory: true,
@@ -15149,9 +15236,7 @@ const WSFeeEstimation = ({
15149
15236
  isPropertyAssess: true,
15150
15237
  name: "adhocPenaltyReason_data",
15151
15238
  t: t
15152
- })), (fields === null || fields === void 0 ? void 0 : (_fields$adhocPenaltyR = fields.adhocPenaltyReason_data) === null || _fields$adhocPenaltyR === void 0 ? void 0 : _fields$adhocPenaltyR.title) === "PT_OTHERS" && /*#__PURE__*/React.createElement("div", {
15153
- className: "field"
15154
- }, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_REASON")), /*#__PURE__*/React.createElement("div", {
15239
+ }))), (fields === null || fields === void 0 ? void 0 : (_fields$adhocPenaltyR = fields.adhocPenaltyReason_data) === null || _fields$adhocPenaltyR === void 0 ? void 0 : _fields$adhocPenaltyR.title) === "PT_OTHERS" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_REASON")), /*#__PURE__*/React.createElement("div", {
15155
15240
  className: "field"
15156
15241
  }, /*#__PURE__*/React.createElement(TextInput, Object.assign({
15157
15242
  style: {
@@ -15168,7 +15253,7 @@ const WSFeeEstimation = ({
15168
15253
  pattern: "^[a-zA-Z ]*$",
15169
15254
  type: "text",
15170
15255
  title: t("TL_NAME_ERROR_MESSAGE")
15171
- })))), /*#__PURE__*/React.createElement(CardLabel, null, t("PT_HEAD_AMT")), /*#__PURE__*/React.createElement("div", {
15256
+ })))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_HEAD_AMT")), /*#__PURE__*/React.createElement("div", {
15172
15257
  className: "field"
15173
15258
  }, /*#__PURE__*/React.createElement(TextInput, Object.assign({
15174
15259
  style: {
@@ -15184,12 +15269,7 @@ const WSFeeEstimation = ({
15184
15269
  isRequired: true,
15185
15270
  pattern: "^[1-9]+[0-9]*$",
15186
15271
  title: t("ERR_DEFAULT_INPUT_FIELD_MSG")
15187
- })))), /*#__PURE__*/React.createElement(Card, {
15188
- style: {
15189
- padding: "10px 10px 1px 10px",
15190
- margin: "0px 0px 15px 0px"
15191
- }
15192
- }, /*#__PURE__*/React.createElement(CardSectionHeader, {
15272
+ }))))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
15193
15273
  style: {
15194
15274
  fontSize: "16px",
15195
15275
  fontWeight: "700",
@@ -15197,7 +15277,7 @@ const WSFeeEstimation = ({
15197
15277
  padding: "0px",
15198
15278
  margin: "0px 0px 10px 0px"
15199
15279
  }
15200
- }, t("PT_AD_REBATE")), /*#__PURE__*/React.createElement(CardLabel, null, t("PT_TX_HEADS")), /*#__PURE__*/React.createElement("div", {
15280
+ }, t("PT_AD_REBATE")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_TX_HEADS")), /*#__PURE__*/React.createElement("div", {
15201
15281
  className: "field"
15202
15282
  }, /*#__PURE__*/React.createElement(Dropdown, {
15203
15283
  isMandatory: true,
@@ -15208,9 +15288,7 @@ const WSFeeEstimation = ({
15208
15288
  name: "adhocRebateReason_data",
15209
15289
  isPropertyAssess: true,
15210
15290
  t: t
15211
- })), (fields === null || fields === void 0 ? void 0 : (_fields$adhocRebateRe = fields.adhocRebateReason_data) === null || _fields$adhocRebateRe === void 0 ? void 0 : _fields$adhocRebateRe.title) === "PT_OTHERS" && /*#__PURE__*/React.createElement("div", {
15212
- className: "field"
15213
- }, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_REASON")), /*#__PURE__*/React.createElement(TextInput, Object.assign({
15291
+ }))), (fields === null || fields === void 0 ? void 0 : (_fields$adhocRebateRe = fields.adhocRebateReason_data) === null || _fields$adhocRebateRe === void 0 ? void 0 : _fields$adhocRebateRe.title) === "PT_OTHERS" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_REASON")), /*#__PURE__*/React.createElement(TextInput, Object.assign({
15214
15292
  style: {
15215
15293
  background: "#FAFAFA"
15216
15294
  },
@@ -15225,7 +15303,7 @@ const WSFeeEstimation = ({
15225
15303
  pattern: "^[a-zA-Z ]*$",
15226
15304
  type: "text",
15227
15305
  title: t("TL_NAME_ERROR_MESSAGE")
15228
- }))), /*#__PURE__*/React.createElement(CardLabel, null, t("PT_HEAD_AMT")), /*#__PURE__*/React.createElement("div", {
15306
+ }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_HEAD_AMT")), /*#__PURE__*/React.createElement("div", {
15229
15307
  className: "field"
15230
15308
  }, /*#__PURE__*/React.createElement(TextInput, Object.assign({
15231
15309
  style: {
@@ -15241,7 +15319,7 @@ const WSFeeEstimation = ({
15241
15319
  isRequired: true,
15242
15320
  pattern: "^[1-9]+[0-9]*$",
15243
15321
  title: t("ERR_DEFAULT_INPUT_FIELD_MSG")
15244
- }))))), " "), showToast && /*#__PURE__*/React.createElement(Toast, {
15322
+ }))))))), showToast && /*#__PURE__*/React.createElement(Toast, {
15245
15323
  style: {
15246
15324
  zIndex: "10000"
15247
15325
  },
@@ -15355,10 +15433,7 @@ const ViewBreakup = ({
15355
15433
  marginTop: "12px"
15356
15434
  }
15357
15435
  }, /*#__PURE__*/React.createElement("span", {
15358
- style: {
15359
- cursor: "pointer",
15360
- color: "#a82227"
15361
- }
15436
+ className: "add-details-link hover-button"
15362
15437
  }, t("WS_PAYMENT_VIEW_BREAKUP"))) : null, popup && /*#__PURE__*/React.createElement(Modal, {
15363
15438
  headerBarMain: /*#__PURE__*/React.createElement(Heading, {
15364
15439
  label: t("WS_CALCULATION_BREAKUP")
@@ -15800,15 +15875,11 @@ function ApplicationDetailsContent({
15800
15875
  oldValue,
15801
15876
  isInfoLabel = false
15802
15877
  }) {
15803
- var _applicationDetails$a2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data19, _workflowDetails$data20;
15878
+ var _applicationDetails$a, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data19, _workflowDetails$data20;
15804
15879
  const {
15805
15880
  t
15806
15881
  } = useTranslation();
15807
- const history = useHistory();
15808
- const location = useLocation();
15809
15882
  const [showPopup, setShowPopup] = useState(false);
15810
- const [selectedData, setSelectedData] = useState(null);
15811
- const searchParams = new URLSearchParams(location.search);
15812
15883
  let {
15813
15884
  id: applicationNo
15814
15885
  } = useParams();
@@ -15844,7 +15915,7 @@ function ApplicationDetailsContent({
15844
15915
  loaded: false,
15845
15916
  canLoad: false
15846
15917
  });
15847
- if ((applicationData === null || applicationData === void 0 ? void 0 : applicationData.status) == "ACTIVE" && !billData.loading && !billData.loaded && !billData.canLoad) {
15918
+ if ((applicationData === null || applicationData === void 0 ? void 0 : applicationData.status) === "ACTIVE" && !billData.loading && !billData.loaded && !billData.canLoad) {
15848
15919
  updateCanFetchBillData({
15849
15920
  loading: false,
15850
15921
  loaded: false,
@@ -15860,7 +15931,7 @@ function ApplicationDetailsContent({
15860
15931
  setBillData((applicationData === null || applicationData === void 0 ? void 0 : applicationData.tenantId) || tenantId, applicationData === null || applicationData === void 0 ? void 0 : applicationData.propertyId, updatefetchBillData, updateCanFetchBillData);
15861
15932
  }
15862
15933
  const convertEpochToDateDMY = dateEpoch => {
15863
- if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") {
15934
+ if (dateEpoch == null || dateEpoch === undefined || dateEpoch === "") {
15864
15935
  return "NA";
15865
15936
  }
15866
15937
  const dateFromApi = new Date(dateEpoch);
@@ -15944,7 +16015,6 @@ function ApplicationDetailsContent({
15944
16015
  const checkLocation = window.location.href.includes("employee/tl") || window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc");
15945
16016
  const isNocLocation = window.location.href.includes("employee/noc");
15946
16017
  const isBPALocation = window.location.href.includes("employee/obps");
15947
- const isWS = window.location.href.includes("employee/ws");
15948
16018
  const getRowStyles = () => {
15949
16019
  if (window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc")) {
15950
16020
  return {
@@ -15983,13 +16053,13 @@ function ApplicationDetailsContent({
15983
16053
  if (window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc") || window.location.href.includes("employee/ws")) {
15984
16054
  return {
15985
16055
  lineHeight: "19px",
15986
- maxWidth: "950px",
16056
+ maxWidth: "100%",
15987
16057
  minWidth: "280px"
15988
16058
  };
15989
16059
  } else if (checkLocation) {
15990
16060
  return {
15991
16061
  lineHeight: "19px",
15992
- maxWidth: "600px",
16062
+ maxWidth: "100%",
15993
16063
  minWidth: "280px"
15994
16064
  };
15995
16065
  } else {
@@ -16037,7 +16107,6 @@ function ApplicationDetailsContent({
16037
16107
  });
16038
16108
  };
16039
16109
  const handleViewClick = data => {
16040
- setSelectedData(data);
16041
16110
  setShowPopup(true);
16042
16111
  };
16043
16112
  return /*#__PURE__*/React.createElement(Card, {
@@ -16052,8 +16121,8 @@ function ApplicationDetailsContent({
16052
16121
  infoClickLable: "WS_CLICK_ON_LABEL",
16053
16122
  infoClickInfoLabel: getClickInfoDetails(),
16054
16123
  infoClickInfoLabel1: getClickInfoDetails1()
16055
- }) : null, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a2 = applicationDetails.applicationDetails) === null || _applicationDetails$a2 === void 0 ? void 0 : _applicationDetails$a2.map((detail, index) => {
16056
- var _detail$title, _detail$values, _detail$additionalDet, _applicationDetails$a3, _applicationDetails$a4, _applicationDetails$a5, _detail$additionalDet2, _applicationDetails$a6, _applicationDetails$a7, _detail$additionalDet3, _detail$additionalDet4, _detail$additionalDet5, _detail$additionalDet6, _detail$additionalDet7, _detail$additionalDet8, _detail$additionalDet9, _detail$additionalDet0, _detail$additionalDet1, _workflowDetails$data, _workflowDetails$data2, _detail$additionalDet10, _detail$additionalDet11, _detail$additionalDet12, _detail$additionalDet13, _detail$additionalDet14, _detail$additionalDet15, _detail$additionalDet16, _detail$additionalDet17, _detail$additionalDet18, _detail$additionalDet19, _detail$additionalDet20, _detail$additionalDet21, _detail$additionalDet22, _detail$additionalDet23, _detail$additionalDet24, _detail$additionalDet25, _detail$additionalDet26, _detail$additionalDet27, _detail$additionalDet28, _detail$additionalDet29;
16124
+ }) : null, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a = applicationDetails.applicationDetails) === null || _applicationDetails$a === void 0 ? void 0 : _applicationDetails$a.map((detail, index) => {
16125
+ var _detail$title, _detail$values, _detail$additionalDet, _applicationDetails$a2, _applicationDetails$a3, _applicationDetails$a4, _detail$additionalDet2, _applicationDetails$a5, _applicationDetails$a6, _detail$additionalDet3, _detail$additionalDet4, _detail$additionalDet5, _detail$additionalDet6, _detail$additionalDet7, _detail$additionalDet8, _detail$additionalDet9, _detail$additionalDet0, _detail$additionalDet1, _workflowDetails$data, _workflowDetails$data2, _detail$additionalDet10, _detail$additionalDet11, _detail$additionalDet12, _detail$additionalDet13, _detail$additionalDet14, _detail$additionalDet15, _detail$additionalDet16, _detail$additionalDet17, _detail$additionalDet18, _detail$additionalDet19, _detail$additionalDet20, _detail$additionalDet21, _detail$additionalDet22, _detail$additionalDet23, _detail$additionalDet24, _detail$additionalDet25, _detail$additionalDet26, _detail$additionalDet27, _detail$additionalDet28, _detail$additionalDet29;
16057
16126
  return /*#__PURE__*/React.createElement(React.Fragment, {
16058
16127
  key: index
16059
16128
  }, /*#__PURE__*/React.createElement("div", {
@@ -16069,7 +16138,7 @@ function ApplicationDetailsContent({
16069
16138
  fontSize: "24px"
16070
16139
  } : {
16071
16140
  marginBottom: "16px",
16072
- marginTop: "32px",
16141
+ marginTop: "16px",
16073
16142
  fontSize: "24px"
16074
16143
  }
16075
16144
  }, t(detail.title), detail !== null && detail !== void 0 && detail.Component ? /*#__PURE__*/React.createElement(detail.Component, null) : null)), (detail === null || detail === void 0 ? void 0 : detail.isTable) && /*#__PURE__*/React.createElement("table", {
@@ -16146,7 +16215,7 @@ function ApplicationDetailsContent({
16146
16215
  }
16147
16216
  }, /*#__PURE__*/React.createElement("button", null, " ", /*#__PURE__*/React.createElement(EditIcon, null), " ")), /*#__PURE__*/React.createElement("div", {
16148
16217
  key: index,
16149
- onClick: () => handleViewClick(element.data),
16218
+ onClick: () => handleViewClick(),
16150
16219
  style: {
16151
16220
  cursor: "pointer"
16152
16221
  }
@@ -16247,8 +16316,8 @@ function ApplicationDetailsContent({
16247
16316
  })))), (detail === null || detail === void 0 ? void 0 : detail.belowComponent) && /*#__PURE__*/React.createElement(detail.belowComponent, null), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet = detail.additionalDetails) === null || _detail$additionalDet === void 0 ? void 0 : _detail$additionalDet.inspectionReport) && /*#__PURE__*/React.createElement(ScruntinyDetails, {
16248
16317
  scrutinyDetails: detail === null || detail === void 0 ? void 0 : detail.additionalDetails,
16249
16318
  paymentsList: paymentsList
16250
- }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a3 = applicationDetails.applicationData) === null || _applicationDetails$a3 === void 0 ? void 0 : (_applicationDetails$a4 = _applicationDetails$a3.additionalDetails) === null || _applicationDetails$a4 === void 0 ? void 0 : (_applicationDetails$a5 = _applicationDetails$a4.fieldinspection_pending) === null || _applicationDetails$a5 === void 0 ? void 0 : _applicationDetails$a5.length) > 0 && (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet2 = detail.additionalDetails) === null || _detail$additionalDet2 === void 0 ? void 0 : _detail$additionalDet2.fiReport) && /*#__PURE__*/React.createElement(InspectionReport, {
16251
- fiReport: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a6 = applicationDetails.applicationData) === null || _applicationDetails$a6 === void 0 ? void 0 : (_applicationDetails$a7 = _applicationDetails$a6.additionalDetails) === null || _applicationDetails$a7 === void 0 ? void 0 : _applicationDetails$a7.fieldinspection_pending
16319
+ }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a2 = applicationDetails.applicationData) === null || _applicationDetails$a2 === void 0 ? void 0 : (_applicationDetails$a3 = _applicationDetails$a2.additionalDetails) === null || _applicationDetails$a3 === void 0 ? void 0 : (_applicationDetails$a4 = _applicationDetails$a3.fieldinspection_pending) === null || _applicationDetails$a4 === void 0 ? void 0 : _applicationDetails$a4.length) > 0 && (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet2 = detail.additionalDetails) === null || _detail$additionalDet2 === void 0 ? void 0 : _detail$additionalDet2.fiReport) && /*#__PURE__*/React.createElement(InspectionReport, {
16320
+ fiReport: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a5 = applicationDetails.applicationData) === null || _applicationDetails$a5 === void 0 ? void 0 : (_applicationDetails$a6 = _applicationDetails$a5.additionalDetails) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.fieldinspection_pending
16252
16321
  }), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet3 = detail.additionalDetails) === null || _detail$additionalDet3 === void 0 ? void 0 : _detail$additionalDet3.floors) && /*#__PURE__*/React.createElement(PropertyFloors, {
16253
16322
  floors: detail === null || detail === void 0 ? void 0 : (_detail$additionalDet4 = detail.additionalDetails) === null || _detail$additionalDet4 === void 0 ? void 0 : _detail$additionalDet4.floors
16254
16323
  }), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet5 = detail.additionalDetails) === null || _detail$additionalDet5 === void 0 ? void 0 : _detail$additionalDet5.owners) && /*#__PURE__*/React.createElement(PropertyOwners, {
@@ -16290,21 +16359,11 @@ function ApplicationDetailsContent({
16290
16359
  }), (detail === null || detail === void 0 ? void 0 : detail.isWaterConnectionDetails) && /*#__PURE__*/React.createElement(WSAdditonalDetails, {
16291
16360
  wsAdditionalDetails: detail,
16292
16361
  oldValue: oldValue
16293
- }), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet23 = detail.additionalDetails) === null || _detail$additionalDet23 === void 0 ? void 0 : _detail$additionalDet23.redirectUrl) && /*#__PURE__*/React.createElement("div", {
16294
- style: {
16295
- fontSize: "16px",
16296
- lineHeight: "24px",
16297
- fontWeight: "400",
16298
- padding: "10px 0px"
16299
- }
16300
- }, /*#__PURE__*/React.createElement(Link, {
16362
+ }), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet23 = detail.additionalDetails) === null || _detail$additionalDet23 === void 0 ? void 0 : _detail$additionalDet23.redirectUrl) && /*#__PURE__*/React.createElement(Link, {
16301
16363
  to: detail === null || detail === void 0 ? void 0 : (_detail$additionalDet24 = detail.additionalDetails) === null || _detail$additionalDet24 === void 0 ? void 0 : (_detail$additionalDet25 = _detail$additionalDet24.redirectUrl) === null || _detail$additionalDet25 === void 0 ? void 0 : _detail$additionalDet25.url
16302
16364
  }, /*#__PURE__*/React.createElement("span", {
16303
- className: "link",
16304
- style: {
16305
- color: "#a82227"
16306
- }
16307
- }, detail === null || detail === void 0 ? void 0 : (_detail$additionalDet26 = detail.additionalDetails) === null || _detail$additionalDet26 === void 0 ? void 0 : (_detail$additionalDet27 = _detail$additionalDet26.redirectUrl) === null || _detail$additionalDet27 === void 0 ? void 0 : _detail$additionalDet27.title))), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet28 = detail.additionalDetails) === null || _detail$additionalDet28 === void 0 ? void 0 : _detail$additionalDet28.estimationDetails) && /*#__PURE__*/React.createElement(WSFeeEstimation, {
16365
+ className: "add-details-link hover-button"
16366
+ }, detail === null || detail === void 0 ? void 0 : (_detail$additionalDet26 = detail.additionalDetails) === null || _detail$additionalDet26 === void 0 ? void 0 : (_detail$additionalDet27 = _detail$additionalDet26.redirectUrl) === null || _detail$additionalDet27 === void 0 ? void 0 : _detail$additionalDet27.title)), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet28 = detail.additionalDetails) === null || _detail$additionalDet28 === void 0 ? void 0 : _detail$additionalDet28.estimationDetails) && /*#__PURE__*/React.createElement(WSFeeEstimation, {
16308
16367
  wsAdditionalDetails: detail,
16309
16368
  workflowDetails: workflowDetails
16310
16369
  }), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet29 = detail.additionalDetails) === null || _detail$additionalDet29 === void 0 ? void 0 : _detail$additionalDet29.estimationDetails) && /*#__PURE__*/React.createElement(ViewBreakup, {
@@ -16994,7 +17053,7 @@ const NewApplication = ({
16994
17053
  const search = useLocation().search;
16995
17054
  const redirectUrl = new URLSearchParams(search).get('redirectToUrl');
16996
17055
  const createProperty = async () => {
16997
- history.push(`${match.path}/acknowledgement`);
17056
+ history.push(`${match.path}/save-property`);
16998
17057
  };
16999
17058
  const onSuccess = () => {
17000
17059
  clearParams();
@@ -17009,7 +17068,6 @@ const NewApplication = ({
17009
17068
  }, /*#__PURE__*/React.createElement(CreatePropertyForm, {
17010
17069
  onSubmit: createProperty,
17011
17070
  value: params,
17012
- redirectUrl: redirectUrl,
17013
17071
  userType: "employee"
17014
17072
  })), /*#__PURE__*/React.createElement(Route, {
17015
17073
  exact: true,
@@ -17017,7 +17075,6 @@ const NewApplication = ({
17017
17075
  }, /*#__PURE__*/React.createElement(PTAcknowledgement, {
17018
17076
  data: params,
17019
17077
  onSuccess: onSuccess,
17020
- redirectUrl: redirectUrl,
17021
17078
  userType: "employee"
17022
17079
  })));
17023
17080
  };
@@ -17243,7 +17300,7 @@ const EmployeeApp = ({
17243
17300
  show: true
17244
17301
  }];
17245
17302
  const locationCheck = window.location.href.includes("/employee/commonpt/new-application");
17246
- return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
17303
+ return /*#__PURE__*/React.createElement("div", {
17247
17304
  className: "ground-container"
17248
17305
  }, /*#__PURE__*/React.createElement("div", {
17249
17306
  style: locationCheck ? {
@@ -17251,7 +17308,7 @@ const EmployeeApp = ({
17251
17308
  } : {}
17252
17309
  }, /*#__PURE__*/React.createElement(BreadCrumb, {
17253
17310
  crumbs: crumbs
17254
- })), /*#__PURE__*/React.createElement(PrivateRoute, {
17311
+ })), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
17255
17312
  exact: true,
17256
17313
  path: `${path}/`,
17257
17314
  component: () => /*#__PURE__*/React.createElement(CommonPTLinks, {
@@ -17260,16 +17317,18 @@ const EmployeeApp = ({
17260
17317
  })
17261
17318
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
17262
17319
  path: `${path}/new-application`,
17263
- component: () => /*#__PURE__*/React.createElement(NewApplication, {
17264
- parentUrl: url
17265
- })
17320
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
17321
+ layoutClass: "action"
17322
+ }, /*#__PURE__*/React.createElement(NewApplication, {
17323
+ path: path
17324
+ }))
17266
17325
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
17267
17326
  path: `${path}/search`,
17268
- component: () => /*#__PURE__*/React.createElement(Search, null)
17327
+ component: Search
17269
17328
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
17270
17329
  path: `${path}/view-property`,
17271
- component: () => /*#__PURE__*/React.createElement(ViewProperty, null)
17272
- }))));
17330
+ component: ViewProperty
17331
+ })));
17273
17332
  };
17274
17333
 
17275
17334
  const PropertyAssemblyDetails = ({
@@ -17283,78 +17342,59 @@ const PropertyAssemblyDetails = ({
17283
17342
  setError,
17284
17343
  clearErrors
17285
17344
  }) => {
17286
- var _formData$usageCatego, _formData$usageCatego2, _Menu$PropertyTax, _Menu1$PropertyTax, _errors$BuildingType, _errors$floorarea, _errors$constructionA, _errors$usageCategory;
17345
+ var _formData$usageCatego, _formData$usageCatego2, _Menu$PropertyTax, _Menu1$PropertyTax, _errors$BuildingType, _errors$BuildingType2, _errors$floorarea, _errors$floorarea2, _errors$constructionA, _errors$constructionA2, _errors$usageCategory, _errors$usageCategory2;
17287
17346
  const [assemblyDetails, setAssemblyDetails] = React.useState({
17288
17347
  ...formData.assemblyDet,
17289
- 'BuildingType': formData === null || formData === void 0 ? void 0 : formData.PropertyType,
17290
- 'floorarea': formData === null || formData === void 0 ? void 0 : formData.landArea,
17291
- 'constructionArea': formData === null || formData === void 0 ? void 0 : formData.constructionArea,
17292
- 'usageCategoryMajor': formData !== null && formData !== void 0 && formData.usageCategoryMajor && (formData === null || formData === void 0 ? void 0 : (_formData$usageCatego = formData.usageCategoryMajor) === null || _formData$usageCatego === void 0 ? void 0 : _formData$usageCatego.code) === "NONRESIDENTIAL.OTHERS" ? {
17348
+ BuildingType: formData === null || formData === void 0 ? void 0 : formData.PropertyType,
17349
+ floorarea: formData === null || formData === void 0 ? void 0 : formData.landArea,
17350
+ constructionArea: formData === null || formData === void 0 ? void 0 : formData.constructionArea,
17351
+ usageCategoryMajor: formData !== null && formData !== void 0 && formData.usageCategoryMajor && (formData === null || formData === void 0 ? void 0 : (_formData$usageCatego = formData.usageCategoryMajor) === null || _formData$usageCatego === void 0 ? void 0 : _formData$usageCatego.code) === "NONRESIDENTIAL.OTHERS" ? {
17293
17352
  code: `${formData === null || formData === void 0 ? void 0 : (_formData$usageCatego2 = formData.usageCategoryMajor) === null || _formData$usageCatego2 === void 0 ? void 0 : _formData$usageCatego2.code}`,
17294
17353
  i18nKey: `PROPERTYTAX_BILLING_SLAB_OTHERS`
17295
17354
  } : formData === null || formData === void 0 ? void 0 : formData.usageCategoryMajor
17296
17355
  });
17297
17356
  const [focusField, setFocusField] = React.useState("");
17298
- const stateId = Digit.ULBService.getStateId();
17357
+ let tenantId = Digit.ULBService.getCurrentTenantId();
17299
17358
  const [isErrors, setIsErrors] = useState(false);
17300
17359
  const isMobile = window.Digit.Utils.browser.isMobile();
17301
17360
  let proptype = [];
17361
+ console.log("Calling usePropertyMDMS with tenantId:", tenantId);
17302
17362
  const {
17303
- data: Menu = {},
17363
+ data: Menu = [],
17304
17364
  isLoading
17305
- } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "PTPropertyType") || {};
17306
- proptype = Menu === null || Menu === void 0 ? void 0 : (_Menu$PropertyTax = Menu.PropertyTax) === null || _Menu$PropertyTax === void 0 ? void 0 : _Menu$PropertyTax.PropertyType;
17365
+ } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", "PTPropertyType") || {};
17366
+ proptype = (Menu === null || Menu === void 0 ? void 0 : (_Menu$PropertyTax = Menu.PropertyTax) === null || _Menu$PropertyTax === void 0 ? void 0 : _Menu$PropertyTax.PropertyType) || (Array.isArray(Menu) ? Menu : []);
17307
17367
  const {
17308
- data: Menu1 = {},
17368
+ data: Menu1 = [],
17309
17369
  isLoading: menuLoading
17310
- } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "UsageCategory") || {};
17311
- let usagecat = [];
17312
- usagecat = (Menu1 === null || Menu1 === void 0 ? void 0 : (_Menu1$PropertyTax = Menu1.PropertyTax) === null || _Menu1$PropertyTax === void 0 ? void 0 : _Menu1$PropertyTax.UsageCategory) || [];
17370
+ } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", "UsageCategory") || {};
17371
+ console.log("UsageCategory Menu Data (transformed):", Menu1);
17372
+ let usagecat = (Menu1 === null || Menu1 === void 0 ? void 0 : (_Menu1$PropertyTax = Menu1.PropertyTax) === null || _Menu1$PropertyTax === void 0 ? void 0 : _Menu1$PropertyTax.UsageCategory) || (Array.isArray(Menu1) ? Menu1 : []);
17313
17373
  function getPropertyTypeMenu(proptype) {
17314
- if (userType === "employee") {
17315
- var _proptype$filter, _proptype$filter$map;
17316
- return proptype === null || proptype === void 0 ? void 0 : (_proptype$filter = proptype.filter(e => e.code === "VACANT" || e.code.split(".").length > 1)) === null || _proptype$filter === void 0 ? void 0 : (_proptype$filter$map = _proptype$filter.map(item => ({
17317
- i18nKey: "COMMON_PROPTYPE_" + stringReplaceAll(item === null || item === void 0 ? void 0 : item.code, ".", "_"),
17318
- code: item === null || item === void 0 ? void 0 : item.code
17319
- }))) === null || _proptype$filter$map === void 0 ? void 0 : _proptype$filter$map.sort((a, b) => a.i18nKey.split("_").pop().localeCompare(b.i18nKey.split("_").pop()));
17320
- } else {
17321
- if (Array.isArray(proptype) && proptype.length > 0) {
17322
- for (i = 0; i < proptype.length; i++) {
17323
- if (i != 1 && i != 4 && Array.isArray(proptype) && proptype.length > 0) menu.push({
17324
- i18nKey: "COMMON_PROPTYPE_" + stringReplaceAll(proptype[i].code, ".", "_"),
17325
- code: proptype[i].code
17326
- });
17327
- }
17374
+ let menu = [];
17375
+ if (Array.isArray(proptype) && proptype.length > 0) {
17376
+ for (let i = 0; i < proptype.length; i++) {
17377
+ if (i != 1 && i != 4) menu.push({
17378
+ i18nKey: "COMMON_PROPTYPE_" + stringReplaceAll(proptype[i].code, ".", "_"),
17379
+ code: proptype[i].code
17380
+ });
17328
17381
  }
17329
- menu.sort((a, b) => a.i18nKey.split("_").pop().localeCompare(b.i18nKey.split("_").pop()));
17330
- return menu;
17331
17382
  }
17383
+ menu.sort((a, b) => a.i18nKey.split("_").pop().localeCompare(b.i18nKey.split("_").pop()));
17384
+ return menu;
17332
17385
  }
17333
17386
  function usageCategoryMajorMenu(usagecat) {
17334
- if (userType === "employee") {
17335
- var _usagecat$filter;
17336
- const catMenu = usagecat === null || usagecat === void 0 ? void 0 : (_usagecat$filter = usagecat.filter(e => (e === null || e === void 0 ? void 0 : e.code.split(".").length) <= 2 && e.code !== "NONRESIDENTIAL")) === null || _usagecat$filter === void 0 ? void 0 : _usagecat$filter.map(item => {
17337
- const arr = item === null || item === void 0 ? void 0 : item.code.split(".");
17338
- if (arr.length == 2) return {
17339
- i18nKey: "PROPERTYTAX_BILLING_SLAB_" + arr[1],
17340
- code: item === null || item === void 0 ? void 0 : item.code
17341
- };else return {
17342
- i18nKey: "PROPERTYTAX_BILLING_SLAB_" + (item === null || item === void 0 ? void 0 : item.code),
17343
- code: item === null || item === void 0 ? void 0 : item.code
17344
- };
17345
- });
17346
- return catMenu;
17347
- } else {
17348
- for (i = 0; i < 10; i++) {
17349
- if (Array.isArray(usagecat) && usagecat.length > 0 && usagecat[i].code.split(".")[0] == "NONRESIDENTIAL" && usagecat[i].code.split(".").length == 2) {
17350
- menu.push({
17351
- i18nKey: "PROPERTYTAX_BILLING_SLAB_" + usagecat[i].code.split(".")[1],
17352
- code: usagecat[i].code
17353
- });
17354
- }
17387
+ let menu = [];
17388
+ for (let i = 0; i < usagecat.length; i++) {
17389
+ var _usagecat$i, _usagecat$i$code, _usagecat$i$code$spli, _usagecat$i2, _usagecat$i2$code, _usagecat$i2$code$spl;
17390
+ if (Array.isArray(usagecat) && usagecat.length > 0 && ((_usagecat$i = usagecat[i]) === null || _usagecat$i === void 0 ? void 0 : (_usagecat$i$code = _usagecat$i.code) === null || _usagecat$i$code === void 0 ? void 0 : (_usagecat$i$code$spli = _usagecat$i$code.split) === null || _usagecat$i$code$spli === void 0 ? void 0 : _usagecat$i$code$spli.call(_usagecat$i$code, ".")[0]) == "NONRESIDENTIAL" && ((_usagecat$i2 = usagecat[i]) === null || _usagecat$i2 === void 0 ? void 0 : (_usagecat$i2$code = _usagecat$i2.code) === null || _usagecat$i2$code === void 0 ? void 0 : (_usagecat$i2$code$spl = _usagecat$i2$code.split) === null || _usagecat$i2$code$spl === void 0 ? void 0 : _usagecat$i2$code$spl.call(_usagecat$i2$code, ".").length) == 2) {
17391
+ menu.push({
17392
+ i18nKey: "PROPERTYTAX_BILLING_SLAB_" + usagecat[i].code.split(".")[1],
17393
+ code: usagecat[i].code
17394
+ });
17355
17395
  }
17356
- return menu;
17357
17396
  }
17397
+ return menu;
17358
17398
  }
17359
17399
  const {
17360
17400
  control,
@@ -17413,8 +17453,8 @@ const PropertyAssemblyDetails = ({
17413
17453
  clearErrors(config.key);
17414
17454
  }
17415
17455
  }, [errors]);
17416
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t('PT_PROP_TYPE')}*`), /*#__PURE__*/React.createElement("div", {
17417
- class: "form-field"
17456
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_PROP_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
17457
+ className: "form-field"
17418
17458
  }, /*#__PURE__*/React.createElement(Controller, {
17419
17459
  name: "BuildingType",
17420
17460
  control: control,
@@ -17434,7 +17474,7 @@ const PropertyAssemblyDetails = ({
17434
17474
  props.onChange(value);
17435
17475
  setAssemblyDetails({
17436
17476
  ...assemblyDetails,
17437
- ['BuildingType']: value
17477
+ ["BuildingType"]: value
17438
17478
  });
17439
17479
  setFocusField("BuildingType");
17440
17480
  },
@@ -17443,9 +17483,9 @@ const PropertyAssemblyDetails = ({
17443
17483
  t: t
17444
17484
  });
17445
17485
  }
17446
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17486
+ }))), (touched === null || touched === void 0 ? void 0 : touched.BuildingType) && (errors === null || errors === void 0 ? void 0 : (_errors$BuildingType = errors.BuildingType) === null || _errors$BuildingType === void 0 ? void 0 : _errors$BuildingType.message) && /*#__PURE__*/React.createElement(CardLabelError, {
17447
17487
  style: errorStyle
17448
- }, touched !== null && touched !== void 0 && touched.BuildingType ? errors === null || errors === void 0 ? void 0 : (_errors$BuildingType = errors.BuildingType) === null || _errors$BuildingType === void 0 ? void 0 : _errors$BuildingType.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_TOT_LAND_AREA")}*`), /*#__PURE__*/React.createElement("div", {
17488
+ }, errors === null || errors === void 0 ? void 0 : (_errors$BuildingType2 = errors.BuildingType) === null || _errors$BuildingType2 === void 0 ? void 0 : _errors$BuildingType2.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_TOT_LAND_AREA")}*`), /*#__PURE__*/React.createElement("div", {
17449
17489
  className: "form-field"
17450
17490
  }, /*#__PURE__*/React.createElement(Controller, {
17451
17491
  name: "floorarea",
@@ -17468,15 +17508,15 @@ const PropertyAssemblyDetails = ({
17468
17508
  props === null || props === void 0 ? void 0 : props.onChange(ev.target.value);
17469
17509
  setAssemblyDetails({
17470
17510
  ...assemblyDetails,
17471
- ['floorarea']: ev.target.value
17511
+ ["floorarea"]: ev.target.value
17472
17512
  });
17473
17513
  setFocusField("floorarea");
17474
17514
  },
17475
17515
  onBlur: props === null || props === void 0 ? void 0 : props.onBlur
17476
17516
  })
17477
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17517
+ }))), (touched === null || touched === void 0 ? void 0 : touched.floorarea) && (errors === null || errors === void 0 ? void 0 : (_errors$floorarea = errors.floorarea) === null || _errors$floorarea === void 0 ? void 0 : _errors$floorarea.message) && /*#__PURE__*/React.createElement(CardLabelError, {
17478
17518
  style: errorStyle
17479
- }, touched !== null && touched !== void 0 && touched.floorarea ? errors === null || errors === void 0 ? void 0 : (_errors$floorarea = errors.floorarea) === null || _errors$floorarea === void 0 ? void 0 : _errors$floorarea.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_TOT_CONSTRUCTION_AREA")}*`), /*#__PURE__*/React.createElement("div", {
17519
+ }, errors === null || errors === void 0 ? void 0 : (_errors$floorarea2 = errors.floorarea) === null || _errors$floorarea2 === void 0 ? void 0 : _errors$floorarea2.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_TOT_CONSTRUCTION_AREA")}*`), /*#__PURE__*/React.createElement("div", {
17480
17520
  className: "form-field"
17481
17521
  }, /*#__PURE__*/React.createElement(Controller, {
17482
17522
  name: "constructionArea",
@@ -17500,19 +17540,19 @@ const PropertyAssemblyDetails = ({
17500
17540
  setFocusField("constructionArea");
17501
17541
  setAssemblyDetails({
17502
17542
  ...assemblyDetails,
17503
- ['constructionArea']: ev.target.value
17543
+ ["constructionArea"]: ev.target.value
17504
17544
  });
17505
17545
  },
17506
17546
  onBlur: props === null || props === void 0 ? void 0 : props.onBlur
17507
17547
  })
17508
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17548
+ }))), (touched === null || touched === void 0 ? void 0 : touched.constructionArea) && (errors === null || errors === void 0 ? void 0 : (_errors$constructionA = errors.constructionArea) === null || _errors$constructionA === void 0 ? void 0 : _errors$constructionA.message) && /*#__PURE__*/React.createElement(CardLabelError, {
17509
17549
  style: isMobile ? {
17510
17550
  ...errorStyle,
17511
17551
  marginLeft: "0px"
17512
17552
  } : {
17513
17553
  ...errorStyle
17514
17554
  }
17515
- }, touched !== null && touched !== void 0 && touched.constructionArea ? errors === null || errors === void 0 ? void 0 : (_errors$constructionA = errors.constructionArea) === null || _errors$constructionA === void 0 ? void 0 : _errors$constructionA.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_ASSESMENT_INFO_USAGE_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
17555
+ }, errors === null || errors === void 0 ? void 0 : (_errors$constructionA2 = errors.constructionArea) === null || _errors$constructionA2 === void 0 ? void 0 : _errors$constructionA2.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_ASSESMENT_INFO_USAGE_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
17516
17556
  className: "form-field"
17517
17557
  }, /*#__PURE__*/React.createElement(Controller, {
17518
17558
  name: "usageCategoryMajor",
@@ -17534,7 +17574,7 @@ const PropertyAssemblyDetails = ({
17534
17574
  setFocusField("usageCategoryMajor");
17535
17575
  setAssemblyDetails({
17536
17576
  ...assemblyDetails,
17537
- ['usageCategoryMajor']: value
17577
+ ["usageCategoryMajor"]: value
17538
17578
  });
17539
17579
  },
17540
17580
  optionKey: "i18nKey",
@@ -17542,12 +17582,130 @@ const PropertyAssemblyDetails = ({
17542
17582
  t: t
17543
17583
  });
17544
17584
  }
17545
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17585
+ }))), (touched === null || touched === void 0 ? void 0 : touched.usageCategoryMajor) && (errors === null || errors === void 0 ? void 0 : (_errors$usageCategory = errors.usageCategoryMajor) === null || _errors$usageCategory === void 0 ? void 0 : _errors$usageCategory.message) && /*#__PURE__*/React.createElement(CardLabelError, {
17546
17586
  style: errorStyle
17547
- }, touched !== null && touched !== void 0 && touched.usageCategoryMajor ? errors === null || errors === void 0 ? void 0 : (_errors$usageCategory = errors.usageCategoryMajor) === null || _errors$usageCategory === void 0 ? void 0 : _errors$usageCategory.message : ""));
17587
+ }, errors === null || errors === void 0 ? void 0 : (_errors$usageCategory2 = errors.usageCategoryMajor) === null || _errors$usageCategory2 === void 0 ? void 0 : _errors$usageCategory2.message));
17548
17588
  };
17549
17589
 
17550
17590
  const PropertyLocationDetails = ({
17591
+ address,
17592
+ actionCancelOnSubmit,
17593
+ isEdit,
17594
+ onSelect,
17595
+ config,
17596
+ formData: formDataProp,
17597
+ ...props
17598
+ }) => {
17599
+ var _formDataProp$cpt, _formDataProp$cpt$det, _formDataProp$cpt3;
17600
+ const {
17601
+ t
17602
+ } = useTranslation();
17603
+ const {
17604
+ data: allCities
17605
+ } = Digit.Hooks.useTenants();
17606
+ const {
17607
+ handleSubmit
17608
+ } = useForm();
17609
+ const [showToast, setShowToast] = useState(null);
17610
+ const [formData, setFormData] = useState({
17611
+ addressType: (address === null || address === void 0 ? void 0 : address.addressType) || "",
17612
+ pincode: (address === null || address === void 0 ? void 0 : address.pinCode) || "",
17613
+ city: (address === null || address === void 0 ? void 0 : address.city) || "",
17614
+ locality: (address === null || address === void 0 ? void 0 : address.locality) || "",
17615
+ streetName: (address === null || address === void 0 ? void 0 : address.streetName) || "",
17616
+ houseNo: (address === null || address === void 0 ? void 0 : address.houseNumber) || "",
17617
+ houseName: (address === null || address === void 0 ? void 0 : address.houseName) || "",
17618
+ landmark: (address === null || address === void 0 ? void 0 : address.landmark) || "",
17619
+ addressLine1: (address === null || address === void 0 ? void 0 : address.address) || "",
17620
+ addressLine2: (address === null || address === void 0 ? void 0 : address.address2) || "",
17621
+ latitude: (address === null || address === void 0 ? void 0 : address.latitude) || "",
17622
+ longitude: (address === null || address === void 0 ? void 0 : address.longitude) || "",
17623
+ assembly: (address === null || address === void 0 ? void 0 : address.assembly) || "",
17624
+ block: (address === null || address === void 0 ? void 0 : address.block) || "",
17625
+ zone: (address === null || address === void 0 ? void 0 : address.zone) || "",
17626
+ zro: (address === null || address === void 0 ? void 0 : address.zro) || ""
17627
+ });
17628
+ const isPropertyFound = !!(formDataProp !== null && formDataProp !== void 0 && (_formDataProp$cpt = formDataProp.cpt) !== null && _formDataProp$cpt !== void 0 && (_formDataProp$cpt$det = _formDataProp$cpt.details) !== null && _formDataProp$cpt$det !== void 0 && _formDataProp$cpt$det.propertyId);
17629
+ useEffect(() => {
17630
+ var _formDataProp$cpt2;
17631
+ if (formDataProp !== null && formDataProp !== void 0 && (_formDataProp$cpt2 = formDataProp.cpt) !== null && _formDataProp$cpt2 !== void 0 && _formDataProp$cpt2.details) {
17632
+ var _addressData$locality, _addressData$geoLocat, _addressData$geoLocat2, _addressData$locality2, _addressData$geoLocat3, _addressData$geoLocat4, _addressData$locality3, _addressData$addition, _addressData$addition2, _addressData$addition3, _addressData$addition4, _addressData$addition5, _addressData$addition6, _addressData$addition7, _addressData$addition8;
17633
+ const details = formDataProp.cpt.details;
17634
+ const addressData = details.address || {};
17635
+ const additionalDetails = details.additionalDetails || {};
17636
+ const localityCode = ((_addressData$locality = addressData.locality) === null || _addressData$locality === void 0 ? void 0 : _addressData$locality.code) || addressData.locality || "";
17637
+ const lat = (_addressData$geoLocat = addressData.geoLocation) !== null && _addressData$geoLocat !== void 0 && _addressData$geoLocat.latitude && ((_addressData$geoLocat2 = addressData.geoLocation) === null || _addressData$geoLocat2 === void 0 ? void 0 : _addressData$geoLocat2.latitude) !== 0 ? addressData.geoLocation.latitude : ((_addressData$locality2 = addressData.locality) === null || _addressData$locality2 === void 0 ? void 0 : _addressData$locality2.latitude) || addressData.latitude || "";
17638
+ const lng = (_addressData$geoLocat3 = addressData.geoLocation) !== null && _addressData$geoLocat3 !== void 0 && _addressData$geoLocat3.longitude && ((_addressData$geoLocat4 = addressData.geoLocation) === null || _addressData$geoLocat4 === void 0 ? void 0 : _addressData$geoLocat4.longitude) !== 0 ? addressData.geoLocation.longitude : ((_addressData$locality3 = addressData.locality) === null || _addressData$locality3 === void 0 ? void 0 : _addressData$locality3.longitude) || addressData.longitude || "";
17639
+ setFormData({
17640
+ pincode: addressData.pincode || "",
17641
+ city: addressData.city || "",
17642
+ locality: localityCode,
17643
+ streetName: addressData.street || "",
17644
+ houseNo: addressData.houseNo || "",
17645
+ landmark: addressData.landmark || "",
17646
+ latitude: lat,
17647
+ longitude: lng,
17648
+ assembly: additionalDetails.assembly || ((_addressData$addition = addressData.additionalDetails) === null || _addressData$addition === void 0 ? void 0 : _addressData$addition.assembly) || "",
17649
+ block: additionalDetails.block || ((_addressData$addition2 = addressData.additionalDetails) === null || _addressData$addition2 === void 0 ? void 0 : _addressData$addition2.block) || "",
17650
+ zone: additionalDetails.zone || ((_addressData$addition3 = addressData.additionalDetails) === null || _addressData$addition3 === void 0 ? void 0 : _addressData$addition3.zone) || "",
17651
+ zro: additionalDetails.zro || ((_addressData$addition4 = addressData.additionalDetails) === null || _addressData$addition4 === void 0 ? void 0 : _addressData$addition4.zro) || "",
17652
+ address: {
17653
+ ...addressData,
17654
+ city: addressData.city || "",
17655
+ pincode: addressData.pincode || "",
17656
+ locality: localityCode,
17657
+ streetName: addressData.street || "",
17658
+ houseNo: addressData.houseNo || "",
17659
+ addressLine1: addressData.street || "",
17660
+ latitude: lat,
17661
+ longitude: lng,
17662
+ zro: additionalDetails.zro || ((_addressData$addition5 = addressData.additionalDetails) === null || _addressData$addition5 === void 0 ? void 0 : _addressData$addition5.zro) || "",
17663
+ assembly: additionalDetails.assembly || ((_addressData$addition6 = addressData.additionalDetails) === null || _addressData$addition6 === void 0 ? void 0 : _addressData$addition6.assembly) || "",
17664
+ block: additionalDetails.block || ((_addressData$addition7 = addressData.additionalDetails) === null || _addressData$addition7 === void 0 ? void 0 : _addressData$addition7.block) || "",
17665
+ zone: additionalDetails.zone || ((_addressData$addition8 = addressData.additionalDetails) === null || _addressData$addition8 === void 0 ? void 0 : _addressData$addition8.zone) || ""
17666
+ }
17667
+ });
17668
+ }
17669
+ }, [formDataProp === null || formDataProp === void 0 ? void 0 : (_formDataProp$cpt3 = formDataProp.cpt) === null || _formDataProp$cpt3 === void 0 ? void 0 : _formDataProp$cpt3.details]);
17670
+ useEffect(() => {
17671
+ if (showToast) {
17672
+ const timer = setTimeout(() => {
17673
+ setShowToast(null);
17674
+ }, 1000);
17675
+ return () => clearTimeout(timer);
17676
+ }
17677
+ }, [showToast]);
17678
+ const {
17679
+ createAddress,
17680
+ updateAddress: updateAddressMutation
17681
+ } = Digit.Hooks.useAddress(null, Digit.ULBService.getCurrentTenantId());
17682
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
17683
+ title: t("PT_LOCATION_DETAILS"),
17684
+ defaultOpen: true
17685
+ }, /*#__PURE__*/React.createElement("div", {
17686
+ style: {
17687
+ boxShadow: "none",
17688
+ ...props.style
17689
+ }
17690
+ }, /*#__PURE__*/React.createElement(AddressDetails, {
17691
+ t: t,
17692
+ formData: formData,
17693
+ onSelect: (key, data) => {
17694
+ setFormData(data);
17695
+ onSelect(key, data);
17696
+ },
17697
+ config: {
17698
+ isCollapsible: false,
17699
+ ...config
17700
+ },
17701
+ isEdit: isEdit,
17702
+ showZRO: true,
17703
+ disable: isPropertyFound,
17704
+ hideNextButton: true
17705
+ })));
17706
+ };
17707
+
17708
+ const PropertyOwnerDetails = ({
17551
17709
  t,
17552
17710
  config,
17553
17711
  onSelect,
@@ -17556,274 +17714,10 @@ const PropertyLocationDetails = ({
17556
17714
  formState,
17557
17715
  ownerIndex,
17558
17716
  setError,
17559
- clearErrors
17717
+ clearErrors,
17718
+ ...props
17560
17719
  }) => {
17561
- var _Digit$UserService$ge, _errors$cityCode, _errors$locality, _errors$houseDoorNo, _errors$buildingColon, _errors$landmarkName;
17562
- let validation = {};
17563
- let allCities = Digit.Hooks.pt.useTenants() ? Digit.Hooks.pt.useTenants() : Digit.Hooks.tl.useTenants();
17564
- if (window.location.href.includes("obps")) {
17565
- allCities = Digit.SessionStorage.get("OBPS_TENANTS");
17566
- }
17567
- if (window.location.href.includes("fsm")) {
17568
- allCities = Digit.SessionStorage.get("FSM_TENANTS");
17569
- console.log("allc", allCities);
17570
- }
17571
- const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
17572
- userType = (userInfo === null || userInfo === void 0 ? void 0 : userInfo.type) == "EMPLOYEE" ? "employee" : "citizen";
17573
- const cityId = userInfo === null || userInfo === void 0 ? void 0 : userInfo.tenantId;
17574
- const cityName = 'TENANT_TENANTS_' + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.tenantId.replace('.', '_').toUpperCase());
17575
- const cityObj = userType === 'employee' ? {
17576
- code: cityId,
17577
- name: t(cityName),
17578
- i18nKey: cityName
17579
- } : null;
17580
- const [locationDetails, setLocationDetails] = React.useState({
17581
- ...(formData === null || formData === void 0 ? void 0 : formData.locationDet),
17582
- cityCode: cityObj,
17583
- locality: formData === null || formData === void 0 ? void 0 : formData.locality,
17584
- houseDoorNo: formData === null || formData === void 0 ? void 0 : formData.houseDoorNo,
17585
- buildingColonyName: formData === null || formData === void 0 ? void 0 : formData.buildingColonyName,
17586
- landmarkName: formData === null || formData === void 0 ? void 0 : formData.landmarkName
17587
- });
17588
- const [isErrors, setIsErrors] = React.useState(false);
17589
- const {
17590
- control,
17591
- formState: {
17592
- errors,
17593
- touched
17594
- },
17595
- trigger,
17596
- watch,
17597
- setError: setLocalError,
17598
- clearErrors: clearLocalErrors,
17599
- setValue,
17600
- getValues
17601
- } = useForm();
17602
- const formValue = watch();
17603
- React.useEffect(() => {
17604
- let hasErrors = false;
17605
- const part = {};
17606
- Object.keys(locationDetails).forEach(key => {
17607
- part[key] = formValue === null || formValue === void 0 ? void 0 : formValue[key];
17608
- });
17609
- if (!lodash.isEqual(part, locationDetails)) {
17610
- Object.keys(locationDetails).forEach(key => {
17611
- if (locationDetails[key]) {
17612
- hasErrors = false;
17613
- clearLocalErrors(key);
17614
- } else {
17615
- hasErrors = true;
17616
- }
17617
- });
17618
- }
17619
- if (hasErrors) {
17620
- setError(config === null || config === void 0 ? void 0 : config.key, {
17621
- type: errors
17622
- });
17623
- } else {
17624
- clearErrors(config === null || config === void 0 ? void 0 : config.key);
17625
- }
17626
- trigger();
17627
- setIsErrors(hasErrors);
17628
- onSelect(config === null || config === void 0 ? void 0 : config.key, locationDetails);
17629
- }, [locationDetails]);
17630
- React.useEffect(() => {
17631
- var _formState$errors$con;
17632
- if (Object.keys(errors).length && !lodash.isEqual(((_formState$errors$con = formState.errors[config.key]) === null || _formState$errors$con === void 0 ? void 0 : _formState$errors$con.type) || {}, errors)) {
17633
- setError(config.key, {
17634
- type: errors
17635
- });
17636
- } else if (!Object.keys(errors).length && formState.errors[config.key] && isErrors) {
17637
- clearErrors(config.key);
17638
- }
17639
- }, [errors]);
17640
- const errorStyle = {
17641
- width: "70%",
17642
- marginLeft: "30%",
17643
- fontSize: "12px",
17644
- marginTop: "-21px"
17645
- };
17646
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t('PT_PROP_CITY')}*`), /*#__PURE__*/React.createElement(Controller, {
17647
- name: "",
17648
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.cityCode,
17649
- control: control,
17650
- rules: {
17651
- required: t("REQUIRED_FIELD")
17652
- },
17653
- render: ({
17654
- value,
17655
- onBlur,
17656
- onChange
17657
- }) => /*#__PURE__*/React.createElement(Dropdown, {
17658
- className: "form-field",
17659
- selected: value,
17660
- disable: userType === "employee",
17661
- option: allCities.sort((a, b) => a.name > b.name ? 1 : b.name > a.name ? -1 : 0),
17662
- select: value => {
17663
- onChange(value);
17664
- setLocationDetails({
17665
- ...locationDetails,
17666
- cityCode: value
17667
- });
17668
- },
17669
- optionKey: "code",
17670
- onBlur: onBlur,
17671
- t: t
17672
- })
17673
- })), /*#__PURE__*/React.createElement(CardLabelError, {
17674
- style: errorStyle
17675
- }, touched !== null && touched !== void 0 && touched.cityCode ? errors === null || errors === void 0 ? void 0 : (_errors$cityCode = errors.cityCode) === null || _errors$cityCode === void 0 ? void 0 : _errors$cityCode.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_PROP_LOCALITY")}*`), /*#__PURE__*/React.createElement("div", {
17676
- className: "form-field"
17677
- }, /*#__PURE__*/React.createElement(Controller, {
17678
- name: "locality",
17679
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.locality,
17680
- control: control,
17681
- rules: {
17682
- required: t("REQUIRED_FIELD")
17683
- },
17684
- render: ({
17685
- value,
17686
- onBlur,
17687
- onChange
17688
- }) => {
17689
- var _locationDetails$city, _locationDetails$city2;
17690
- return /*#__PURE__*/React.createElement(Localities, {
17691
- selectLocality: value => {
17692
- onChange(value);
17693
- setLocationDetails({
17694
- ...locationDetails,
17695
- locality: value
17696
- });
17697
- },
17698
- tenantId: locationDetails === null || locationDetails === void 0 ? void 0 : (_locationDetails$city = locationDetails.cityCode) === null || _locationDetails$city === void 0 ? void 0 : _locationDetails$city.code,
17699
- boundaryType: "revenue",
17700
- keepNull: false,
17701
- optionCardStyles: {
17702
- height: "600px",
17703
- overflow: "auto",
17704
- zIndex: "10"
17705
- },
17706
- selected: value,
17707
- disable: !(locationDetails !== null && locationDetails !== void 0 && (_locationDetails$city2 = locationDetails.cityCode) !== null && _locationDetails$city2 !== void 0 && _locationDetails$city2.code),
17708
- disableLoader: true,
17709
- onBlur: onBlur
17710
- });
17711
- }
17712
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17713
- style: errorStyle
17714
- }, touched !== null && touched !== void 0 && touched.locality ? errors === null || errors === void 0 ? void 0 : (_errors$locality = errors.locality) === null || _errors$locality === void 0 ? void 0 : _errors$locality.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_HOUSE_DOOR_NO")}*`), /*#__PURE__*/React.createElement("div", {
17715
- className: "form-field"
17716
- }, /*#__PURE__*/React.createElement(Controller, {
17717
- name: "houseDoorNo",
17718
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.houseDoorNo,
17719
- control: control,
17720
- rules: {
17721
- required: t("REQUIRED_FIELD"),
17722
- validate: value => /^([a-zA-Z0-9 !@#$%^&*()_+\-={};':\\\\|,.<>/?]){1,64}$/i.test(value) ? true : t("PT_HOUSE_DOOR_NO_ERROR_MESSAGE")
17723
- },
17724
- render: ({
17725
- value,
17726
- onBlur,
17727
- onChange
17728
- }) => /*#__PURE__*/React.createElement(TextInput, Object.assign({
17729
- t: t,
17730
- type: "text",
17731
- isMandatory: false,
17732
- optionKey: "i18nKey",
17733
- name: "houseDoorNo",
17734
- value: value,
17735
- onChange: ev => {
17736
- onChange(ev.target.value);
17737
- setLocationDetails({
17738
- ...locationDetails,
17739
- houseDoorNo: ev.target.value
17740
- });
17741
- },
17742
- onBlur: onBlur
17743
- }, validation = {
17744
- pattern: "^([a-zA-Z0-9 !@#$%^&*()_+\-={};':\\\\|,.<>/?]){1,64}$",
17745
- title: t("PT_HOUSE_DOOR_NO_ERROR_MESSAGE")
17746
- }))
17747
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17748
- style: errorStyle
17749
- }, touched !== null && touched !== void 0 && touched.houseDoorNo ? errors === null || errors === void 0 ? void 0 : (_errors$houseDoorNo = errors.houseDoorNo) === null || _errors$houseDoorNo === void 0 ? void 0 : _errors$houseDoorNo.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_PROPERTY_ADDRESS_STREET_NAME")}*`), /*#__PURE__*/React.createElement("div", {
17750
- className: "form-field"
17751
- }, /*#__PURE__*/React.createElement(Controller, {
17752
- name: "buildingColonyName",
17753
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.buildingColonyName,
17754
- control: control,
17755
- rules: {
17756
- required: t("REQUIRED_FIELD")
17757
- },
17758
- render: ({
17759
- value,
17760
- onChange,
17761
- onBlur
17762
- }) => /*#__PURE__*/React.createElement(TextInput, {
17763
- t: t,
17764
- type: "text",
17765
- isMandatory: false,
17766
- optionKey: "i18nKey",
17767
- name: "buildingColonyName",
17768
- value: value,
17769
- onChange: ev => {
17770
- onChange(ev.target.value);
17771
- setLocationDetails({
17772
- ...locationDetails,
17773
- buildingColonyName: ev.target.value
17774
- });
17775
- },
17776
- onBlur: onBlur
17777
- })
17778
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17779
- style: errorStyle
17780
- }, touched !== null && touched !== void 0 && touched.buildingColonyName ? errors === null || errors === void 0 ? void 0 : (_errors$buildingColon = errors.buildingColonyName) === null || _errors$buildingColon === void 0 ? void 0 : _errors$buildingColon.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_LANDMARK_NAME")}`), /*#__PURE__*/React.createElement("div", {
17781
- className: "form-field"
17782
- }, /*#__PURE__*/React.createElement(Controller, {
17783
- name: "landmarkName",
17784
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.landmarkName,
17785
- control: control,
17786
- rules: {},
17787
- render: ({
17788
- value,
17789
- onChange,
17790
- onBlur
17791
- }) => /*#__PURE__*/React.createElement(TextInput, {
17792
- t: t,
17793
- type: "text",
17794
- isMandatory: false,
17795
- optionKey: "i18nKey",
17796
- name: "landmarkName",
17797
- value: value,
17798
- onChange: ev => {
17799
- onChange(ev.target.value);
17800
- setLocationDetails({
17801
- ...locationDetails,
17802
- landmarkName: ev.target.value
17803
- });
17804
- },
17805
- onBlur: onBlur
17806
- })
17807
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17808
- style: errorStyle
17809
- }, touched !== null && touched !== void 0 && touched.landmarkName ? errors === null || errors === void 0 ? void 0 : (_errors$landmarkName = errors.landmarkName) === null || _errors$landmarkName === void 0 ? void 0 : _errors$landmarkName.message : ""));
17810
- };
17811
-
17812
- const getAddress = (address, t) => {
17813
- return `${address !== null && address !== void 0 && address.houseDoorNo ? `${address === null || address === void 0 ? void 0 : address.houseDoorNo}, ` : ""} ${address !== null && address !== void 0 && address.buildingColonyName ? `${address === null || address === void 0 ? void 0 : address.buildingColonyName}, ` : ""}${address !== null && address !== void 0 && address.landmarkName ? `${address === null || address === void 0 ? void 0 : address.landmarkName}, ` : ""}${t(address === null || address === void 0 ? void 0 : address.locality.i18nkey)}, ${t(address === null || address === void 0 ? void 0 : address.cityCode.i18nKey)},${t(address === null || address === void 0 ? void 0 : address.pincode) ? `${address.pincode}` : " "}`;
17814
- };
17815
- const PropertyOwnerDetails = ({
17816
- t,
17817
- config,
17818
- onSelect,
17819
- userType,
17820
- formData,
17821
- formState,
17822
- ownerIndex,
17823
- setError,
17824
- clearErrors
17825
- }) => {
17826
- var _formData$owners, _formData$owners2, _formData$owners3, _formData$owners4, _formData$owners5, _formData$owners$inde, _formData$owners6, _formData$owners7, _formData$owners8, _formData$owners9, _ownershipCategory$co, _ownershipCategory$co2, _formState$errors, _formState$errors$mul;
17720
+ var _formData$owners, _formData$owners2, _formData$owners3, _formData$owners4, _formData$owners5, _formData$owners$inde, _formData$owners6, _formData$owners7, _formData$owners8, _rawMenu1$PropertyTax, _formData$owners9, _ownershipCategory$co, _ownershipCategory$co2, _formState$errors, _formState$errors$mul;
17827
17721
  const {
17828
17722
  pathname: url
17829
17723
  } = useLocation();
@@ -17831,7 +17725,7 @@ const PropertyOwnerDetails = ({
17831
17725
  const mutationScreen = url.includes("/property-mutation/");
17832
17726
  const isMobile = window.Digit.Utils.browser.isMobile();
17833
17727
  let index = 0;
17834
- const [ownershipCategory, setOwnerCategory] = React.useState("");
17728
+ const [ownershipCategory, setOwnerCategory] = React.useState((formData === null || formData === void 0 ? void 0 : formData.ownershipCategory) || "");
17835
17729
  const [ownerDetails, setOwnerDetails] = React.useState([{
17836
17730
  ...(formData.owners && formData.owners[index]),
17837
17731
  name: formData.owners && formData.owners[index] && formData.owners[index].name || (formData === null || formData === void 0 ? void 0 : (_formData$owners = formData.owners) === null || _formData$owners === void 0 ? void 0 : _formData$owners.name) || "",
@@ -17850,6 +17744,7 @@ const PropertyOwnerDetails = ({
17850
17744
  const isUpdateProperty = (formData === null || formData === void 0 ? void 0 : formData.isUpdateProperty) || false;
17851
17745
  let isEditProperty = (formData === null || formData === void 0 ? void 0 : formData.isEditProperty) || false;
17852
17746
  const stateId = Digit.ULBService.getStateId();
17747
+ const tenantId = Digit.ULBService.getCurrentTenantId();
17853
17748
  const {
17854
17749
  data: Menu
17855
17750
  } = Digit.Hooks.pt.useGenderMDMS(stateId, "common-masters", "GenderType");
@@ -17862,29 +17757,15 @@ const PropertyOwnerDetails = ({
17862
17757
  });
17863
17758
  });
17864
17759
  const {
17865
- data: dropdownData
17866
- } = Digit.Hooks.tl.useTradeLicenseMDMS(stateId, "common-masters", "TLOwnerTypeWithSubtypes", {
17867
- userType
17868
- });
17869
- const {
17870
- data: Menu1,
17760
+ data: rawMenu1,
17871
17761
  isLoading
17872
- } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "OwnerType");
17762
+ } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", "OwnerType");
17763
+ const Menu1 = (rawMenu1 === null || rawMenu1 === void 0 ? void 0 : (_rawMenu1$PropertyTax = rawMenu1.PropertyTax) === null || _rawMenu1$PropertyTax === void 0 ? void 0 : _rawMenu1$PropertyTax.OwnerType) || (Array.isArray(rawMenu1) ? rawMenu1 : []);
17873
17764
  const {
17874
17765
  data: mdmsData,
17875
17766
  isLoading: isMdmsDataLoading
17876
- } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", ["OwnerShipCategory"]);
17767
+ } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["OwnerShipCategory"]);
17877
17768
  const [isCorrespondenceAddress, setIsCorrespondenceAddress] = useState(formData === null || formData === void 0 ? void 0 : (_formData$owners9 = formData.owners) === null || _formData$owners9 === void 0 ? void 0 : _formData$owners9.isCorrespondenceAddress);
17878
- function setCorrespondenceAddress(e, ind) {
17879
- let address = "";
17880
- if (e.target.checked === true) {
17881
- var _formData$searchResul, _formData$searchResul2;
17882
- const locationDet = mutationScreen ? formData === null || formData === void 0 ? void 0 : (_formData$searchResul = formData.searchResult) === null || _formData$searchResul === void 0 ? void 0 : (_formData$searchResul2 = _formData$searchResul.property) === null || _formData$searchResul2 === void 0 ? void 0 : _formData$searchResul2.locationDet : formData === null || formData === void 0 ? void 0 : formData.locationDet;
17883
- address = getAddress(locationDet, t);
17884
- }
17885
- updateState("permanentAddress", ind, address);
17886
- updateState("isCoresAddr", ind, e.target.checked);
17887
- }
17888
17769
  const GuardianOptions = [{
17889
17770
  name: "HUSBAND",
17890
17771
  code: "HUSBAND",
@@ -17937,7 +17818,7 @@ const PropertyOwnerDetails = ({
17937
17818
  setIsErrors(hasErrors);
17938
17819
  onSelect(config === null || config === void 0 ? void 0 : config.key, ownerDetails.map(own => ({
17939
17820
  ...own,
17940
- ownershipCategory: ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.value
17821
+ ownershipCategory: ownershipCategory
17941
17822
  })));
17942
17823
  }, [ownerDetails]);
17943
17824
  useEffect(() => {
@@ -17960,10 +17841,17 @@ const PropertyOwnerDetails = ({
17960
17841
  };
17961
17842
  }));
17962
17843
  };
17844
+ const ownershipCategoryMenu = useMemo(() => {
17845
+ var _mdmsData$PropertyTax, _mdmsData$PropertyTax2, _mdmsData$PropertyTax3;
17846
+ return mdmsData === null || mdmsData === void 0 ? void 0 : (_mdmsData$PropertyTax = mdmsData.PropertyTax) === null || _mdmsData$PropertyTax === void 0 ? void 0 : (_mdmsData$PropertyTax2 = _mdmsData$PropertyTax.OwnerShipCategory) === null || _mdmsData$PropertyTax2 === void 0 ? void 0 : (_mdmsData$PropertyTax3 = _mdmsData$PropertyTax2.filter(e => e.code === "INDIVIDUAL.SINGLEOWNER" || e.code === "INDIVIDUAL.MULTIPLEOWNERS" || e.code.split(".").length === 1 && e.code.includes("INSTITUTIONAL"))) === null || _mdmsData$PropertyTax3 === void 0 ? void 0 : _mdmsData$PropertyTax3.map(item => ({
17847
+ ...item,
17848
+ i18nKey: `PT_OWNERSHIP_CATEGORY_${item.code.replaceAll(".", "_")}`
17849
+ }));
17850
+ }, [mdmsData]);
17963
17851
  const institutionTypeMenu = useMemo(() => {
17964
- var _mdmsData$PropertyTax, _mdmsData$PropertyTax2;
17852
+ var _mdmsData$PropertyTax4, _mdmsData$PropertyTax5;
17965
17853
  const code = ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.code;
17966
- const arr = mdmsData === null || mdmsData === void 0 ? void 0 : (_mdmsData$PropertyTax = mdmsData.PropertyTax) === null || _mdmsData$PropertyTax === void 0 ? void 0 : (_mdmsData$PropertyTax2 = _mdmsData$PropertyTax.OwnerShipCategory) === null || _mdmsData$PropertyTax2 === void 0 ? void 0 : _mdmsData$PropertyTax2.filter(e => {
17854
+ const arr = mdmsData === null || mdmsData === void 0 ? void 0 : (_mdmsData$PropertyTax4 = mdmsData.PropertyTax) === null || _mdmsData$PropertyTax4 === void 0 ? void 0 : (_mdmsData$PropertyTax5 = _mdmsData$PropertyTax4.OwnerShipCategory) === null || _mdmsData$PropertyTax5 === void 0 ? void 0 : _mdmsData$PropertyTax5.filter(e => {
17967
17855
  var _e$code;
17968
17856
  return (e === null || e === void 0 ? void 0 : (_e$code = e.code) === null || _e$code === void 0 ? void 0 : _e$code.split(".")[0]) == (code === null || code === void 0 ? void 0 : code.split(".")[0]);
17969
17857
  });
@@ -17972,10 +17860,10 @@ const PropertyOwnerDetails = ({
17972
17860
  return data === null || data === void 0 ? void 0 : (_data$code = data.code) === null || _data$code === void 0 ? void 0 : (_data$code$split = _data$code.split(".")) === null || _data$code$split === void 0 ? void 0 : _data$code$split[1];
17973
17861
  });
17974
17862
  return arraData === null || arraData === void 0 ? void 0 : arraData.map(e => {
17975
- var _e$code2, _e$code2$split, _e$code3, _e$code3$split, _e$code3$split$;
17863
+ var _e$code2, _e$code2$split, _e$code3;
17976
17864
  return ((_e$code2 = e.code) === null || _e$code2 === void 0 ? void 0 : (_e$code2$split = _e$code2.split(".")) === null || _e$code2$split === void 0 ? void 0 : _e$code2$split[1]) && {
17977
17865
  ...e,
17978
- i18nKey: `COMMON_MASTERS_OWNERSHIPCATEGORY_${(_e$code3 = e.code) === null || _e$code3 === void 0 ? void 0 : (_e$code3$split = _e$code3.split(".")) === null || _e$code3$split === void 0 ? void 0 : (_e$code3$split$ = _e$code3$split[1]) === null || _e$code3$split$ === void 0 ? void 0 : _e$code3$split$.replaceAll(".", "_")}`
17866
+ i18nKey: `PT_OWNERSHIP_CATEGORY_${(_e$code3 = e.code) === null || _e$code3 === void 0 ? void 0 : _e$code3.replaceAll(".", "_")}`
17979
17867
  };
17980
17868
  });
17981
17869
  }, [mdmsData, ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.code]);
@@ -17987,46 +17875,14 @@ const PropertyOwnerDetails = ({
17987
17875
  };
17988
17876
  const ismultiple = ownershipCategory !== null && ownershipCategory !== void 0 && (_ownershipCategory$co = ownershipCategory.code) !== null && _ownershipCategory$co !== void 0 && _ownershipCategory$co.includes("MULTIPLEOWNERS") ? true : false;
17989
17877
  const isInstitutionalOwnerType = ownershipCategory === null || ownershipCategory === void 0 ? void 0 : (_ownershipCategory$co2 = ownershipCategory.code) === null || _ownershipCategory$co2 === void 0 ? void 0 : _ownershipCategory$co2.includes("INSTITUTIONAL");
17990
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
17991
- className: ""
17992
- }, `${t("TL_NEW_OWNER_DETAILS_OWNERSHIP_TYPE_LABEL")}*`), /*#__PURE__*/React.createElement(Controller, {
17993
- name: "ownershipCategory",
17994
- defaultValue: ownershipCategory,
17995
- control: control,
17996
- rules: {
17997
- required: t("REQUIRED_FIELD")
17998
- },
17999
- render: ({
18000
- value,
18001
- onChange,
18002
- onBlur
18003
- }) => /*#__PURE__*/React.createElement(Dropdown, {
18004
- className: "form-field",
18005
- selected: value,
18006
- option: dropdownData,
18007
- select: value => {
18008
- var _value$code;
18009
- if (!(value !== null && value !== void 0 && (_value$code = value.code) !== null && _value$code !== void 0 && _value$code.includes("MULTIPLEOWNERS")) && (ownerDetails === null || ownerDetails === void 0 ? void 0 : ownerDetails.length) > 1) {
18010
- setOwnerDetails([...ownerDetails.filter((own, ind) => ind == 0)]);
18011
- }
18012
- onChange(value);
18013
- setOwnerCategory(value);
18014
- },
18015
- optionKey: "i18nKey",
18016
- onBlur: onBlur,
18017
- t: t
18018
- })
18019
- })), ownerDetails === null || ownerDetails === void 0 ? void 0 : ownerDetails.map((owner, index) => {
18020
- var _errors, _errors2, _errors3, _errors4, _errors5, _errors6, _ownerDetails$index, _ownerDetails$index3, _ownerDetails$index4, _ownerDetails$index5, _errors7, _errors8, _errors9, _errors0, _errors1, _errors10, _ownerDetails$index6, _ownerDetails$index8, _ownerDetails$index9, _ownerDetails$index0;
17878
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
17879
+ title: t("PT_OWNER_DETAILS"),
17880
+ defaultOpen: true,
17881
+ style: props.style
17882
+ }, ownerDetails === null || ownerDetails === void 0 ? void 0 : ownerDetails.map((owner, index) => {
17883
+ var _errors, _errors2, _errors3, _errors4, _errors5, _errors6, _errors7, _errors8, _errors9, _errors0, _errors1, _errors10, _ownerDetails$index, _ownerDetails$index3;
18021
17884
  return /*#__PURE__*/React.createElement("div", {
18022
- style: {
18023
- border: "1px solid #D6D5D4",
18024
- background: "#FAFAFA",
18025
- borderRadius: "4px",
18026
- boxSizing: "border-box",
18027
- margin: "16px 0px",
18028
- padding: "16px 8px"
18029
- }
17885
+ key: index
18030
17886
  }, isMobile && ismultiple && ownerDetails.length > 1 && /*#__PURE__*/React.createElement("div", {
18031
17887
  style: {
18032
17888
  display: "flex",
@@ -18045,245 +17901,9 @@ const PropertyOwnerDetails = ({
18045
17901
  onClick: e => {
18046
17902
  setOwnerDetails([...ownerDetails.filter((own, ind) => ind != index)]);
18047
17903
  }
18048
- })), isInstitutionalOwnerType ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_INSTITUTION_NAME")}*`), /*#__PURE__*/React.createElement("div", {
18049
- className: "form-field"
18050
- }, /*#__PURE__*/React.createElement(Controller, {
18051
- key: "institutionName" + index,
18052
- name: "institutionName" + index,
18053
- defaultValue: owner === null || owner === void 0 ? void 0 : owner.institutionName,
18054
- control: control,
18055
- rules: {
18056
- required: t("REQUIRED_FIELD"),
18057
- validate: value => {
18058
- return /^[a-zA-Z ]*$/i.test(value) ? true : t("PT_NAME_ERROR_MESSAGE");
18059
- }
18060
- },
18061
- render: ({
18062
- value,
18063
- onChange,
18064
- onBlur
18065
- }) => /*#__PURE__*/React.createElement(TextInput, {
18066
- t: t,
18067
- type: "text",
18068
- isMandatory: false,
18069
- optionKey: "i18nKey",
18070
- name: "institutionName" + index,
18071
- value: value,
18072
- onChange: ev => {
18073
- onChange(ev.target.value);
18074
- updateState("institutionName", index, ev.target.value);
18075
- },
18076
- disable: isUpdateProperty || isEditProperty,
18077
- onBlur: onBlur
18078
- })
18079
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18080
- style: errorStyle
18081
- }, touched !== null && touched !== void 0 && touched["institutionName" + index] ? errors === null || errors === void 0 ? void 0 : (_errors = errors["institutionName" + index]) === null || _errors === void 0 ? void 0 : _errors.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
18082
- className: ""
18083
- }, `${t("PT_INSTITUTION_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
18084
- className: "form-field"
18085
- }, /*#__PURE__*/React.createElement(Controller, {
18086
- key: "institutionType" + index,
18087
- name: "institutionType" + index,
18088
- defaultValue: owner === null || owner === void 0 ? void 0 : owner.institutionType,
18089
- control: control,
18090
- rules: {
18091
- required: t("REQUIRED_FIELD")
18092
- },
18093
- render: ({
18094
- value,
18095
- onChange,
18096
- onBlur
18097
- }) => /*#__PURE__*/React.createElement(Dropdown, {
18098
- selected: (institutionTypeMenu === null || institutionTypeMenu === void 0 ? void 0 : institutionTypeMenu.length) === 1 ? Menu1[0] : value,
18099
- disable: (institutionTypeMenu === null || institutionTypeMenu === void 0 ? void 0 : institutionTypeMenu.length) === 1 || editScreen,
18100
- option: institutionTypeMenu ? institutionTypeMenu.sort((a, b) => a.name.localeCompare(b.name)) : [],
18101
- select: value => {
18102
- onChange(value);
18103
- updateState("institutionType", index, value);
18104
- },
18105
- optionKey: "i18nKey",
18106
- t: t,
18107
- onBlur: onBlur
18108
- })
18109
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18110
- style: errorStyle
18111
- }, touched !== null && touched !== void 0 && touched["institutionType" + index] ? errors === null || errors === void 0 ? void 0 : (_errors2 = errors["institutionType" + index]) === null || _errors2 === void 0 ? void 0 : _errors2.message : ""), /*#__PURE__*/React.createElement(CardSectionHeader, null, t("TL_AUTHORIZED_PERSON_DETAILS")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_OWNER_NAME")}*`), /*#__PURE__*/React.createElement("div", {
18112
- className: "form-field"
18113
- }, /*#__PURE__*/React.createElement(Controller, {
18114
- key: "name" + index,
18115
- name: "name" + index,
18116
- defaultValue: owner === null || owner === void 0 ? void 0 : owner.name,
18117
- control: control,
18118
- rules: {
18119
- required: t("REQUIRED_FIELD"),
18120
- validate: value => {
18121
- return /^[a-zA-Z ]+$/i.test(value) ? true : t("PT_NAME_ERROR_MESSAGE");
18122
- }
18123
- },
18124
- render: ({
18125
- value,
18126
- onChange,
18127
- onBlur
18128
- }) => /*#__PURE__*/React.createElement(TextInput, {
18129
- t: t,
18130
- type: "text",
18131
- isMandatory: false,
18132
- optionKey: "i18nKey",
18133
- name: "name" + index,
18134
- value: value,
18135
- onChange: ev => {
18136
- onChange(ev.target.value);
18137
- updateState("name", index, ev.target.value);
18138
- },
18139
- disable: isUpdateProperty || isEditProperty,
18140
- onBlur: onBlur
18141
- })
18142
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18143
- style: errorStyle
18144
- }, touched !== null && touched !== void 0 && touched["name" + index] ? errors === null || errors === void 0 ? void 0 : (_errors3 = errors["name" + index]) === null || _errors3 === void 0 ? void 0 : _errors3.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_LANDLINE_NUMBER_FLOATING_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
18145
- className: "form-field"
18146
- }, /*#__PURE__*/React.createElement(Controller, {
18147
- key: "altContactNumber" + index,
18148
- name: "altContactNumber" + index,
18149
- defaultValue: owner.altContactNumber,
18150
- control: control,
18151
- rules: {
18152
- required: t("REQUIRED_FIELD"),
18153
- validate: value => /^[0-9]{11}$/i.test(value) ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")
18154
- },
18155
- render: ({
18156
- value,
18157
- onChange,
18158
- onBlur
18159
- }) => /*#__PURE__*/React.createElement(MobileNumber, {
18160
- type: "text",
18161
- t: t,
18162
- maxLength: 11,
18163
- value: value,
18164
- name: "altContactNumber" + index,
18165
- onChange: value => {
18166
- onChange(value);
18167
- updateState("altContactNumber", index, value);
18168
- },
18169
- disable: isUpdateProperty || isEditProperty,
18170
- labelStyle: {
18171
- border: "1px solid #000",
18172
- borderRight: "none"
18173
- },
18174
- onBlur: onBlur
18175
- })
18176
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18177
- style: errorStyle
18178
- }, touched !== null && touched !== void 0 && touched["altContactNumber" + index] ? errors === null || errors === void 0 ? void 0 : (_errors4 = errors["altContactNumber" + index]) === null || _errors4 === void 0 ? void 0 : _errors4.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_MOBILE_NUMBER")}*`), /*#__PURE__*/React.createElement("div", {
18179
- className: "form-field"
18180
- }, /*#__PURE__*/React.createElement(Controller, {
18181
- key: "mobileNumber" + index,
18182
- name: "mobileNumber" + index,
18183
- defaultValue: owner.mobileNumber,
18184
- control: control,
18185
- rules: {
18186
- required: t("REQUIRED_FIELD"),
18187
- validate: value => /[6-9]{1}[0-9]{9}/i.test(value) ? true : t("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")
18188
- },
18189
- render: ({
18190
- value,
18191
- onChange,
18192
- onBlur
18193
- }) => /*#__PURE__*/React.createElement(MobileNumber, {
18194
- value: value,
18195
- name: "mobileNumber" + index,
18196
- onChange: value => {
18197
- onChange(value);
18198
- updateState("mobileNumber", index, value);
18199
- },
18200
- disable: isUpdateProperty || isEditProperty,
18201
- labelStyle: {
18202
- border: "1px solid #000",
18203
- borderRight: "none"
18204
- },
18205
- onBlur: onBlur
18206
- })
18207
- })), !isMobile && /*#__PURE__*/React.createElement("div", {
18208
- style: {
18209
- display: "flex",
18210
- justifyContent: "flex-end",
18211
- width: "20%",
18212
- alignSelf: "flex-start"
18213
- }
18214
- }, ismultiple && /*#__PURE__*/React.createElement(LinkButton, {
18215
- label: /*#__PURE__*/React.createElement(DeleteIcon, {
18216
- style: {
18217
- bottom: "0px"
18218
- },
18219
- fill: !(ownerDetails.length == 1) ? "#494848" : "#FAFAFA"
18220
- }),
18221
- style: {
18222
- margin: "0px"
18223
- },
18224
- onClick: e => {
18225
- setOwnerDetails([...ownerDetails.filter((own, ind) => ind != index)]);
18226
- }
18227
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18228
- style: errorStyle
18229
- }, touched !== null && touched !== void 0 && touched["mobileNumber" + index] ? errors === null || errors === void 0 ? void 0 : (_errors5 = errors["mobileNumber" + index]) === null || _errors5 === void 0 ? void 0 : _errors5.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("TL_NEW_DESIG_OWNER_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
18230
- className: "form-field"
18231
- }, /*#__PURE__*/React.createElement(Controller, {
18232
- key: "designation" + index,
18233
- name: "designation" + index,
18234
- defaultValue: owner === null || owner === void 0 ? void 0 : owner.designation,
18235
- control: control,
18236
- rules: {
18237
- required: t("REQUIRED_FIELD"),
18238
- validate: value => {
18239
- return /^[a-zA-Z ]*$/i.test(value) ? true : t("PT_NAME_ERROR_MESSAGE");
18240
- }
18241
- },
18242
- render: ({
18243
- value,
18244
- onChange,
18245
- onBlur
18246
- }) => /*#__PURE__*/React.createElement(TextInput, {
18247
- t: t,
18248
- type: "text",
18249
- isMandatory: false,
18250
- optionKey: "i18nKey",
18251
- name: "designation" + index,
18252
- value: value,
18253
- onChange: ev => {
18254
- onChange(ev.target.value);
18255
- updateState("designation", index, ev.target.value);
18256
- },
18257
- disable: isUpdateProperty || isEditProperty,
18258
- onBlur: onBlur
18259
- })
18260
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18261
- style: errorStyle
18262
- }, touched !== null && touched !== void 0 && touched["designation" + index] ? errors === null || errors === void 0 ? void 0 : (_errors6 = errors["designation" + index]) === null || _errors6 === void 0 ? void 0 : _errors6.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_CORRESPONDANCE_ADDRESS")), /*#__PURE__*/React.createElement("div", {
18263
- className: "form-field"
18264
- }, /*#__PURE__*/React.createElement(TextArea, {
18265
- isMandatory: false,
18266
- optionKey: "i18nKey",
18267
- t: t,
18268
- disabled: (ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index = ownerDetails[index]) === null || _ownerDetails$index === void 0 ? void 0 : _ownerDetails$index.isCoresAddr) === true,
18269
- name: "address" + index,
18270
- onChange: e => {
18271
- var _ownerDetails$index2;
18272
- if (!((ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index2 = ownerDetails[index]) === null || _ownerDetails$index2 === void 0 ? void 0 : _ownerDetails$index2.isCoresAddr) === true)) {
18273
- updateState("permanentAddress", index, e.target.value);
18274
- }
18275
- },
18276
- value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index3 = ownerDetails[index]) === null || _ownerDetails$index3 === void 0 ? void 0 : _ownerDetails$index3.permanentAddress
18277
- }))), /*#__PURE__*/React.createElement(CheckBox, {
18278
- className: "form-field",
18279
- label: `${t("PT_COMMON_SAME_AS_PROPERTY_ADDRESS")}`,
18280
- onChange: e => setCorrespondenceAddress(e, index),
18281
- value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index4 = ownerDetails[index]) === null || _ownerDetails$index4 === void 0 ? void 0 : _ownerDetails$index4.isCoresAddr,
18282
- checked: (ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index5 = ownerDetails[index]) === null || _ownerDetails$index5 === void 0 ? void 0 : _ownerDetails$index5.isCoresAddr) || false,
18283
- style: window.location.href.includes("/citizen/") ? {
18284
- paddingTop: "10px"
18285
- } : {}
18286
- })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_MOBILE_NUMBER")}*`), /*#__PURE__*/React.createElement("div", {
17904
+ })), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
17905
+ className: "formcomposer-section-grid"
17906
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_MOBILE_NUMBER")}*`), /*#__PURE__*/React.createElement("div", {
18287
17907
  className: "form-field"
18288
17908
  }, /*#__PURE__*/React.createElement(Controller, {
18289
17909
  key: "mobileNumber" + index,
@@ -18332,9 +17952,9 @@ const PropertyOwnerDetails = ({
18332
17952
  onClick: e => {
18333
17953
  setOwnerDetails([...ownerDetails.filter((own, ind) => ind != index)]);
18334
17954
  }
18335
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17955
+ }))), (touched === null || touched === void 0 ? void 0 : touched["mobileNumber" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors = errors["mobileNumber" + index]) === null || _errors === void 0 ? void 0 : _errors.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18336
17956
  style: errorStyle
18337
- }, touched !== null && touched !== void 0 && touched["mobileNumber" + index] ? errors === null || errors === void 0 ? void 0 : (_errors7 = errors["mobileNumber" + index]) === null || _errors7 === void 0 ? void 0 : _errors7.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_OWNER_NAME")}*`), /*#__PURE__*/React.createElement("div", {
17957
+ }, errors === null || errors === void 0 ? void 0 : (_errors2 = errors["mobileNumber" + index]) === null || _errors2 === void 0 ? void 0 : _errors2.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_OWNER_NAME")}*`), /*#__PURE__*/React.createElement("div", {
18338
17958
  className: "form-field"
18339
17959
  }, /*#__PURE__*/React.createElement(Controller, {
18340
17960
  key: "name" + index,
@@ -18365,9 +17985,9 @@ const PropertyOwnerDetails = ({
18365
17985
  disable: isUpdateProperty || isEditProperty,
18366
17986
  onBlur: onBlur
18367
17987
  })
18368
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
17988
+ }))), (touched === null || touched === void 0 ? void 0 : touched["name" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors3 = errors["name" + index]) === null || _errors3 === void 0 ? void 0 : _errors3.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18369
17989
  style: errorStyle
18370
- }, touched !== null && touched !== void 0 && touched["name" + index] ? errors === null || errors === void 0 ? void 0 : (_errors8 = errors["name" + index]) === null || _errors8 === void 0 ? void 0 : _errors8.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_GENDER")}*`), /*#__PURE__*/React.createElement("div", {
17990
+ }, errors === null || errors === void 0 ? void 0 : (_errors4 = errors["name" + index]) === null || _errors4 === void 0 ? void 0 : _errors4.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_GENDER")}*`), /*#__PURE__*/React.createElement("div", {
18371
17991
  className: "form-field"
18372
17992
  }, /*#__PURE__*/React.createElement(Controller, {
18373
17993
  key: "gender" + index,
@@ -18395,9 +18015,9 @@ const PropertyOwnerDetails = ({
18395
18015
  isDropDown: window.location.href.includes("/employee") ? true : false,
18396
18016
  onBlur: onBlur
18397
18017
  })
18398
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18018
+ }))), (touched === null || touched === void 0 ? void 0 : touched["gender" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors5 = errors["gender" + index]) === null || _errors5 === void 0 ? void 0 : _errors5.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18399
18019
  style: errorStyle
18400
- }, touched !== null && touched !== void 0 && touched["gender" + index] ? errors === null || errors === void 0 ? void 0 : (_errors9 = errors["gender" + index]) === null || _errors9 === void 0 ? void 0 : _errors9.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_GUARDIAN_NAME")}*`), /*#__PURE__*/React.createElement("div", {
18020
+ }, errors === null || errors === void 0 ? void 0 : (_errors6 = errors["gender" + index]) === null || _errors6 === void 0 ? void 0 : _errors6.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_GUARDIAN_NAME")}*`), /*#__PURE__*/React.createElement("div", {
18401
18021
  className: "form-field"
18402
18022
  }, /*#__PURE__*/React.createElement(Controller, {
18403
18023
  key: "fatherOrHusbandName" + index,
@@ -18426,9 +18046,9 @@ const PropertyOwnerDetails = ({
18426
18046
  disable: isUpdateProperty || isEditProperty,
18427
18047
  onBlur: onBlur
18428
18048
  })
18429
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18049
+ }))), (touched === null || touched === void 0 ? void 0 : touched["fatherOrHusbandName" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors7 = errors["fatherOrHusbandName" + index]) === null || _errors7 === void 0 ? void 0 : _errors7.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18430
18050
  style: errorStyle
18431
- }, touched !== null && touched !== void 0 && touched["fatherOrHusbandName" + index] ? errors === null || errors === void 0 ? void 0 : (_errors0 = errors["fatherOrHusbandName" + index]) === null || _errors0 === void 0 ? void 0 : _errors0.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_RELATIONSHIP")}*`), /*#__PURE__*/React.createElement("div", {
18051
+ }, errors === null || errors === void 0 ? void 0 : (_errors8 = errors["fatherOrHusbandName" + index]) === null || _errors8 === void 0 ? void 0 : _errors8.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_RELATIONSHIP")}*`), /*#__PURE__*/React.createElement("div", {
18432
18052
  className: "form-field"
18433
18053
  }, /*#__PURE__*/React.createElement(Controller, {
18434
18054
  key: "relationship" + index,
@@ -18456,9 +18076,9 @@ const PropertyOwnerDetails = ({
18456
18076
  isDropDown: window.location.href.includes("/employee") ? true : false,
18457
18077
  onBlur: onBlur
18458
18078
  })
18459
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18079
+ }))), (touched === null || touched === void 0 ? void 0 : touched["relationship" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors9 = errors["relationship" + index]) === null || _errors9 === void 0 ? void 0 : _errors9.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18460
18080
  style: errorStyle
18461
- }, touched !== null && touched !== void 0 && touched["relationship" + index] ? errors === null || errors === void 0 ? void 0 : (_errors1 = errors["relationship" + index]) === null || _errors1 === void 0 ? void 0 : _errors1.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
18081
+ }, errors === null || errors === void 0 ? void 0 : (_errors0 = errors["relationship" + index]) === null || _errors0 === void 0 ? void 0 : _errors0.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
18462
18082
  className: ""
18463
18083
  }, `${t("PT_SPECIAL_APPLICANT_CATEGORY")}*`), /*#__PURE__*/React.createElement("div", {
18464
18084
  className: "form-field"
@@ -18486,33 +18106,24 @@ const PropertyOwnerDetails = ({
18486
18106
  t: t,
18487
18107
  onBlur: onBlur
18488
18108
  })
18489
- }))), /*#__PURE__*/React.createElement(CardLabelError, {
18109
+ }))), (touched === null || touched === void 0 ? void 0 : touched["ownerType" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors1 = errors["ownerType" + index]) === null || _errors1 === void 0 ? void 0 : _errors1.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18490
18110
  style: errorStyle
18491
- }, touched !== null && touched !== void 0 && touched["ownerType" + index] ? errors === null || errors === void 0 ? void 0 : (_errors10 = errors["ownerType" + index]) === null || _errors10 === void 0 ? void 0 : _errors10.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_CORRESPONDANCE_ADDRESS")), /*#__PURE__*/React.createElement("div", {
18111
+ }, errors === null || errors === void 0 ? void 0 : (_errors10 = errors["ownerType" + index]) === null || _errors10 === void 0 ? void 0 : _errors10.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_CORRESPONDANCE_ADDRESS")), /*#__PURE__*/React.createElement("div", {
18492
18112
  className: "form-field"
18493
18113
  }, /*#__PURE__*/React.createElement(TextArea, {
18494
18114
  isMandatory: false,
18495
18115
  optionKey: "i18nKey",
18496
18116
  t: t,
18497
- disabled: (ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index6 = ownerDetails[index]) === null || _ownerDetails$index6 === void 0 ? void 0 : _ownerDetails$index6.isCoresAddr) === true,
18117
+ disabled: (ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index = ownerDetails[index]) === null || _ownerDetails$index === void 0 ? void 0 : _ownerDetails$index.isCoresAddr) === true,
18498
18118
  name: "address" + index,
18499
18119
  onChange: e => {
18500
- var _ownerDetails$index7;
18501
- if (!((ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index7 = ownerDetails[index]) === null || _ownerDetails$index7 === void 0 ? void 0 : _ownerDetails$index7.isCoresAddr) === true)) {
18120
+ var _ownerDetails$index2;
18121
+ if (!((ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index2 = ownerDetails[index]) === null || _ownerDetails$index2 === void 0 ? void 0 : _ownerDetails$index2.isCoresAddr) === true)) {
18502
18122
  updateState("permanentAddress", index, e.target.value);
18503
18123
  }
18504
18124
  },
18505
- value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index8 = ownerDetails[index]) === null || _ownerDetails$index8 === void 0 ? void 0 : _ownerDetails$index8.permanentAddress
18506
- }))), /*#__PURE__*/React.createElement(CheckBox, {
18507
- className: "form-field",
18508
- label: `${t("PT_COMMON_SAME_AS_PROPERTY_ADDRESS")}`,
18509
- onChange: e => setCorrespondenceAddress(e, index),
18510
- value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index9 = ownerDetails[index]) === null || _ownerDetails$index9 === void 0 ? void 0 : _ownerDetails$index9.isCoresAddr,
18511
- checked: (ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index0 = ownerDetails[index]) === null || _ownerDetails$index0 === void 0 ? void 0 : _ownerDetails$index0.isCoresAddr) || false,
18512
- style: window.location.href.includes("/citizen/") ? {
18513
- paddingTop: "10px"
18514
- } : {}
18515
- })));
18125
+ value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index3 = ownerDetails[index]) === null || _ownerDetails$index3 === void 0 ? void 0 : _ownerDetails$index3.permanentAddress
18126
+ }))))));
18516
18127
  }), ismultiple ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
18517
18128
  style: {
18518
18129
  display: "flex",
@@ -18546,6 +18157,319 @@ const PropertyOwnerDetails = ({
18546
18157
  }, t(((_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : (_formState$errors$mul = _formState$errors.mulipleOwnerError) === null || _formState$errors$mul === void 0 ? void 0 : _formState$errors$mul.message) || ""))) : null);
18547
18158
  };
18548
18159
 
18160
+ const NUMBER_PATTERN = /^\d+$/;
18161
+ const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
18162
+ const PropertyWaterConnection = ({
18163
+ t,
18164
+ config,
18165
+ onSelect,
18166
+ formData,
18167
+ formState,
18168
+ setError,
18169
+ clearErrors,
18170
+ ...props
18171
+ }) => {
18172
+ var _formData$cpt, _formData$cpt$details, _formData$cpt3, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0;
18173
+ const {
18174
+ control,
18175
+ register,
18176
+ formState: {
18177
+ errors,
18178
+ touched
18179
+ },
18180
+ watch,
18181
+ setValue
18182
+ } = useForm({
18183
+ defaultValues: (formData === null || formData === void 0 ? void 0 : formData[config.key]) || {
18184
+ useDetails: {
18185
+ propertyCategory: null,
18186
+ propertyType: null,
18187
+ WaterConnectionUsageType: null,
18188
+ noOfFloors: null,
18189
+ plotArea: "",
18190
+ builtUpArea: "",
18191
+ SelectYearofConstruction: null,
18192
+ NumberofDwellingUnits: "",
18193
+ NumberofRooms: "",
18194
+ hospitalBeds: ""
18195
+ }
18196
+ }
18197
+ });
18198
+ const tenantId = Digit.ULBService.getCurrentTenantId();
18199
+ const {
18200
+ isLoading: isWSServicesMastersLoading,
18201
+ data: ptServicesMastersData
18202
+ } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["PropertyCategory", "PropertyType", "NoOfFloors", "PropertyNewUsageType"]);
18203
+ const isPropertyFound = !!(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);
18204
+ const formValue = watch();
18205
+ const watchPropertyType = watch("useDetails.propertyType");
18206
+ const watchPropertyCategory = watch("useDetails.propertyCategory");
18207
+ const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
18208
+ const yearOptions = useMemo(() => {
18209
+ const currentYear = new Date().getFullYear();
18210
+ const years = [];
18211
+ for (let i = currentYear; i >= currentYear - 100; i--) {
18212
+ years.push({
18213
+ value: i.toString(),
18214
+ name: i.toString()
18215
+ });
18216
+ }
18217
+ return years;
18218
+ }, []);
18219
+ const categoryOptions = useMemo(() => {
18220
+ var _ptServicesMastersDat, _ptServicesMastersDat2;
18221
+ return 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).map(item => ({
18222
+ code: item.code,
18223
+ name: item.name
18224
+ }));
18225
+ }, [ptServicesMastersData]);
18226
+ const propertyTypeOptions = useMemo(() => {
18227
+ var _ptServicesMastersDat3, _ptServicesMastersDat4;
18228
+ return (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).map(item => ({
18229
+ code: item.code,
18230
+ name: item.name
18231
+ }))) || [];
18232
+ }, [ptServicesMastersData]);
18233
+ const usageTypeOptions = useMemo(() => {
18234
+ var _ptServicesMastersDat5, _ptServicesMastersDat6;
18235
+ return 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).map(item => ({
18236
+ code: item.code,
18237
+ name: item.name
18238
+ }));
18239
+ }, [ptServicesMastersData]);
18240
+ const floorOptions = useMemo(() => {
18241
+ var _ptServicesMastersDat7, _ptServicesMastersDat8;
18242
+ return ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat7 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat7 === void 0 ? void 0 : (_ptServicesMastersDat8 = _ptServicesMastersDat7.NoOfFloors) === null || _ptServicesMastersDat8 === void 0 ? void 0 : _ptServicesMastersDat8.filter(item => item.active).map(item => ({
18243
+ code: item.code,
18244
+ name: item.name
18245
+ }));
18246
+ }, [ptServicesMastersData]);
18247
+ const lastSentValue = React.useRef(null);
18248
+ useEffect(() => {
18249
+ if (!lodash.isEqual(lastSentValue.current, formValue)) {
18250
+ lastSentValue.current = lodash.cloneDeep(formValue);
18251
+ onSelect(config.key, formValue);
18252
+ }
18253
+ }, [formValue, config.key, onSelect]);
18254
+ useEffect(() => {
18255
+ var _formData$cpt2;
18256
+ if (formData !== null && formData !== void 0 && (_formData$cpt2 = formData.cpt) !== null && _formData$cpt2 !== void 0 && _formData$cpt2.details) {
18257
+ const details = formData.cpt.details;
18258
+ const additionalDetails = (details === null || details === void 0 ? void 0 : details.additionalDetails) || {};
18259
+ setValue("useDetails.propertyCategory", (categoryOptions === null || categoryOptions === void 0 ? void 0 : categoryOptions.find(o => o.code === additionalDetails.propertyCategory)) || null);
18260
+ setValue("useDetails.propertyType", (propertyTypeOptions === null || propertyTypeOptions === void 0 ? void 0 : propertyTypeOptions.find(o => o.code === additionalDetails.propertyType)) || null);
18261
+ setValue("useDetails.WaterConnectionUsageType", (usageTypeOptions === null || usageTypeOptions === void 0 ? void 0 : usageTypeOptions.find(o => o.code === additionalDetails.waterConnectionUsageType)) || null);
18262
+ setValue("useDetails.noOfFloors", (floorOptions === null || floorOptions === void 0 ? void 0 : floorOptions.find(o => {
18263
+ var _details$noOfFloors;
18264
+ return o.code === (((_details$noOfFloors = details.noOfFloors) === null || _details$noOfFloors === void 0 ? void 0 : _details$noOfFloors.toString()) || additionalDetails.noOfFloors);
18265
+ })) || null);
18266
+ setValue("useDetails.plotArea", additionalDetails.plotArea || "");
18267
+ setValue("useDetails.builtUpArea", additionalDetails.builtUpArea || "");
18268
+ setValue("useDetails.SelectYearofConstruction", (yearOptions === null || yearOptions === void 0 ? void 0 : yearOptions.find(o => o.value === additionalDetails.yearOfConstruction)) || null);
18269
+ setValue("useDetails.NumberofDwellingUnits", additionalDetails.numberOfDwellingUnits || "");
18270
+ setValue("useDetails.NumberofRooms", additionalDetails.numberOfRooms || "");
18271
+ }
18272
+ }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : _formData$cpt3.details, categoryOptions, propertyTypeOptions, usageTypeOptions, floorOptions, yearOptions, setValue]);
18273
+ const lastErrorState = React.useRef(null);
18274
+ useEffect(() => {
18275
+ const hasErrors = Object.keys(errors).length > 0;
18276
+ if (lastErrorState.current !== hasErrors) {
18277
+ lastErrorState.current = hasErrors;
18278
+ if (hasErrors) {
18279
+ setError(config.key, {
18280
+ type: "custom",
18281
+ message: "Validation failed"
18282
+ });
18283
+ } else {
18284
+ clearErrors(config.key);
18285
+ }
18286
+ }
18287
+ }, [errors, config.key, setError, clearErrors]);
18288
+ const errorStyle = {
18289
+ width: "70%",
18290
+ marginLeft: "30%",
18291
+ fontSize: "12px",
18292
+ marginTop: "-21px"
18293
+ };
18294
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
18295
+ title: t("WS_PROPERTY_AND_WATER_CONNECTION_USE_DETAILS"),
18296
+ defaultOpen: true,
18297
+ style: props.style
18298
+ }, /*#__PURE__*/React.createElement("div", {
18299
+ className: "formcomposer-section-grid"
18300
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PROPERTY_CATEGORY")}*`), /*#__PURE__*/React.createElement("div", {
18301
+ className: "form-field"
18302
+ }, /*#__PURE__*/React.createElement(Controller, {
18303
+ control: control,
18304
+ name: "useDetails.propertyCategory",
18305
+ rules: {
18306
+ required: t("REQUIRED_FIELD")
18307
+ },
18308
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18309
+ option: categoryOptions,
18310
+ optionKey: "name",
18311
+ selected: props.value,
18312
+ select: props.onChange,
18313
+ t: t,
18314
+ onBlur: props.onBlur,
18315
+ disable: isPropertyFound
18316
+ })
18317
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails = errors.useDetails) === null || _errors$useDetails === void 0 ? void 0 : _errors$useDetails.propertyCategory) && /*#__PURE__*/React.createElement(CardLabelError, {
18318
+ style: errorStyle
18319
+ }, errors.useDetails.propertyCategory.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PROPERTY_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
18320
+ className: "form-field"
18321
+ }, /*#__PURE__*/React.createElement(Controller, {
18322
+ control: control,
18323
+ name: "useDetails.propertyType",
18324
+ rules: {
18325
+ required: t("REQUIRED_FIELD")
18326
+ },
18327
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18328
+ option: propertyTypeOptions,
18329
+ optionKey: "name",
18330
+ selected: props.value,
18331
+ select: props.onChange,
18332
+ t: t,
18333
+ onBlur: props.onBlur,
18334
+ disable: isPropertyFound
18335
+ })
18336
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails2 = errors.useDetails) === null || _errors$useDetails2 === void 0 ? void 0 : _errors$useDetails2.propertyType) && /*#__PURE__*/React.createElement(CardLabelError, {
18337
+ style: errorStyle
18338
+ }, errors.useDetails.propertyType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_WATER_CONNECTION_USAGE_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
18339
+ className: "form-field"
18340
+ }, /*#__PURE__*/React.createElement(Controller, {
18341
+ control: control,
18342
+ name: "useDetails.WaterConnectionUsageType",
18343
+ rules: {
18344
+ required: t("REQUIRED_FIELD")
18345
+ },
18346
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18347
+ option: usageTypeOptions,
18348
+ optionKey: "name",
18349
+ selected: props.value,
18350
+ select: props.onChange,
18351
+ t: t,
18352
+ onBlur: props.onBlur,
18353
+ disable: isPropertyFound
18354
+ })
18355
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails3 = errors.useDetails) === null || _errors$useDetails3 === void 0 ? void 0 : _errors$useDetails3.WaterConnectionUsageType) && /*#__PURE__*/React.createElement(CardLabelError, {
18356
+ style: errorStyle
18357
+ }, errors.useDetails.WaterConnectionUsageType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_FLOORS")}*`), /*#__PURE__*/React.createElement("div", {
18358
+ className: "form-field"
18359
+ }, /*#__PURE__*/React.createElement(Controller, {
18360
+ control: control,
18361
+ name: "useDetails.noOfFloors",
18362
+ rules: {
18363
+ required: t("REQUIRED_FIELD")
18364
+ },
18365
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18366
+ option: floorOptions,
18367
+ optionKey: "name",
18368
+ selected: props.value,
18369
+ select: props.onChange,
18370
+ t: t,
18371
+ onBlur: props.onBlur,
18372
+ disable: isPropertyFound
18373
+ })
18374
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails4 = errors.useDetails) === null || _errors$useDetails4 === void 0 ? void 0 : _errors$useDetails4.noOfFloors) && /*#__PURE__*/React.createElement(CardLabelError, {
18375
+ style: errorStyle
18376
+ }, errors.useDetails.noOfFloors.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PLOT_AREA")}*`), /*#__PURE__*/React.createElement("div", {
18377
+ className: "form-field"
18378
+ }, /*#__PURE__*/React.createElement(TextInput, {
18379
+ t: t,
18380
+ inputRef: register({
18381
+ pattern: {
18382
+ value: DECIMAL_PATTERN,
18383
+ message: t("ERR_INVALID_DECIMAL")
18384
+ },
18385
+ required: t("REQUIRED_FIELD")
18386
+ }),
18387
+ name: "useDetails.plotArea",
18388
+ disabled: isPropertyFound
18389
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails5 = errors.useDetails) === null || _errors$useDetails5 === void 0 ? void 0 : _errors$useDetails5.plotArea) && /*#__PURE__*/React.createElement(CardLabelError, {
18390
+ style: errorStyle
18391
+ }, errors.useDetails.plotArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_BUILT_UP_AREA")}*`), /*#__PURE__*/React.createElement("div", {
18392
+ className: "form-field"
18393
+ }, /*#__PURE__*/React.createElement(TextInput, {
18394
+ t: t,
18395
+ inputRef: register({
18396
+ pattern: {
18397
+ value: DECIMAL_PATTERN,
18398
+ message: t("ERR_INVALID_DECIMAL")
18399
+ },
18400
+ required: t("REQUIRED_FIELD")
18401
+ }),
18402
+ name: "useDetails.builtUpArea",
18403
+ disabled: isPropertyFound
18404
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails6 = errors.useDetails) === null || _errors$useDetails6 === void 0 ? void 0 : _errors$useDetails6.builtUpArea) && /*#__PURE__*/React.createElement(CardLabelError, {
18405
+ style: errorStyle
18406
+ }, errors.useDetails.builtUpArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_SELECT_YEAR_OF_CONSTRUCTION")}*`), /*#__PURE__*/React.createElement("div", {
18407
+ className: "form-field"
18408
+ }, /*#__PURE__*/React.createElement(Controller, {
18409
+ control: control,
18410
+ name: "useDetails.SelectYearofConstruction",
18411
+ rules: {
18412
+ required: t("REQUIRED_FIELD")
18413
+ },
18414
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18415
+ option: yearOptions,
18416
+ optionKey: "value",
18417
+ selected: props.value,
18418
+ select: props.onChange,
18419
+ t: t,
18420
+ onBlur: props.onBlur,
18421
+ disable: isPropertyFound
18422
+ })
18423
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails7 = errors.useDetails) === null || _errors$useDetails7 === void 0 ? void 0 : _errors$useDetails7.SelectYearofConstruction) && /*#__PURE__*/React.createElement(CardLabelError, {
18424
+ style: errorStyle
18425
+ }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_DWELLING_UNITS")}*`), /*#__PURE__*/React.createElement("div", {
18426
+ className: "form-field"
18427
+ }, /*#__PURE__*/React.createElement(TextInput, {
18428
+ t: t,
18429
+ inputRef: register({
18430
+ pattern: {
18431
+ value: NUMBER_PATTERN,
18432
+ message: t("ERR_INVALID_NUMBER")
18433
+ },
18434
+ required: t("REQUIRED_FIELD")
18435
+ }),
18436
+ name: "useDetails.NumberofDwellingUnits",
18437
+ disabled: isPropertyFound
18438
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails8 = errors.useDetails) === null || _errors$useDetails8 === void 0 ? void 0 : _errors$useDetails8.NumberofDwellingUnits) && /*#__PURE__*/React.createElement(CardLabelError, {
18439
+ style: errorStyle
18440
+ }, errors.useDetails.NumberofDwellingUnits.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_ROOMS")}*`), /*#__PURE__*/React.createElement("div", {
18441
+ className: "form-field"
18442
+ }, /*#__PURE__*/React.createElement(TextInput, {
18443
+ t: t,
18444
+ inputRef: register({
18445
+ pattern: {
18446
+ value: NUMBER_PATTERN,
18447
+ message: t("ERR_INVALID_NUMBER")
18448
+ },
18449
+ required: t("REQUIRED_FIELD")
18450
+ }),
18451
+ name: "useDetails.NumberofRooms",
18452
+ disabled: isPropertyFound
18453
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.NumberofRooms) && /*#__PURE__*/React.createElement(CardLabelError, {
18454
+ style: errorStyle
18455
+ }, errors.useDetails.NumberofRooms.message), isHospitalProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_BEDS")}*`), /*#__PURE__*/React.createElement("div", {
18456
+ className: "form-field"
18457
+ }, /*#__PURE__*/React.createElement(TextInput, {
18458
+ t: t,
18459
+ inputRef: register({
18460
+ pattern: {
18461
+ value: NUMBER_PATTERN,
18462
+ message: t("ERR_INVALID_NUMBER")
18463
+ },
18464
+ required: isHospitalProperty ? t("REQUIRED_FIELD") : false
18465
+ }),
18466
+ name: "useDetails.hospitalBeds",
18467
+ disabled: isPropertyFound
18468
+ }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.hospitalBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
18469
+ style: errorStyle
18470
+ }, errors.useDetails.hospitalBeds.message)));
18471
+ };
18472
+
18549
18473
  const SwitchComponent = props => {
18550
18474
  return /*#__PURE__*/React.createElement("div", {
18551
18475
  className: "w-fullwidth PropertySearchFormSwitcher"
@@ -18828,7 +18752,7 @@ const getAction = flow => {
18828
18752
  actions = [];
18829
18753
  break;
18830
18754
  case "WS":
18831
- actions = ['WS_COMMON_PROPERTY_DETAILS', 'WS_COMMON_CONNECTION_DETAIL', 'WS_COMMON_DOCUMENT_DETAILS', 'WS_COMMON_SUMMARY'];
18755
+ actions = ['WS_COMMON_CONNECTION_DETAIL', 'WS_COMMON_DOCUMENT_DETAILS', 'WS_COMMON_SUMMARY'];
18832
18756
  break;
18833
18757
  case "TL":
18834
18758
  actions = ['TL_COMMON_TR_DETAILS', 'TL_LOCATION_AND_OWNER_DETAILS', 'TL_DOCUMENT_DETAIL', 'TL_COMMON_SUMMARY'];
@@ -19072,7 +18996,7 @@ const PropertyDetails = ({
19072
18996
  }))));
19073
18997
  };
19074
18998
 
19075
- const getAddress$1 = (address, t) => {
18999
+ const getAddress = (address, t) => {
19076
19000
  return `${address !== null && address !== void 0 && address.doorNo ? `${address === null || address === void 0 ? void 0 : address.doorNo}, ` : ""} ${address !== null && address !== void 0 && address.street ? `${address === null || address === void 0 ? void 0 : address.street}, ` : ""}${address !== null && address !== void 0 && address.landmark ? `${address === null || address === void 0 ? void 0 : address.landmark}, ` : ""}${t(Digit.Utils.pt.getMohallaLocale(address === null || address === void 0 ? void 0 : address.locality.code, address === null || address === void 0 ? void 0 : address.tenantId))}, ${t(Digit.Utils.pt.getCityLocale(address === null || address === void 0 ? void 0 : address.tenantId))}${address !== null && address !== void 0 && address.pincode && t(address === null || address === void 0 ? void 0 : address.pincode) ? `, ${address.pincode}` : " "}`;
19077
19001
  };
19078
19002
  const PropertySearchNSummary = ({
@@ -19084,7 +19008,7 @@ const PropertySearchNSummary = ({
19084
19008
  formState,
19085
19009
  clearErrors
19086
19010
  }) => {
19087
- var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3, _propertyDetails$Prop3, _propertyDetails$Prop4, _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop7, _propertyDetails$Prop8, _window$location$path, _window$location$path2, _window$location$path3;
19011
+ var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3, _propertyDetails$Prop3, _propertyDetails$Prop4, _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop7, _propertyDetails$Prop8;
19088
19012
  const {
19089
19013
  t
19090
19014
  } = useTranslation();
@@ -19159,11 +19083,10 @@ const PropertySearchNSummary = ({
19159
19083
  if (isEditScreen) {
19160
19084
  return /*#__PURE__*/React.createElement(React.Fragment, null);
19161
19085
  }
19162
- const redirectBackUrl = window.location.pathname;
19163
19086
  let propertyAddress = "";
19164
19087
  if (propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length) {
19165
19088
  var _propertyDetails$Prop2;
19166
- propertyAddress = getAddress$1(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop2 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.address, t);
19089
+ propertyAddress = getAddress(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop2 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.address, t);
19167
19090
  }
19168
19091
  const getInputStyles = () => {
19169
19092
  if (window.location.href.includes("/ws/")) {
@@ -19182,8 +19105,9 @@ const PropertySearchNSummary = ({
19182
19105
  return getOwnersList ? getOwnersList : t("NA");
19183
19106
  };
19184
19107
  if (window.location.href.includes("/ws/")) ;
19185
- return /*#__PURE__*/React.createElement(Card, {
19186
- className: "no-shadow"
19108
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
19109
+ title: t("PT_PROPERTY_DETAILS"),
19110
+ defaultOpen: true
19187
19111
  }, (window.location.href.includes("/tl/") ? !((formData === null || formData === void 0 ? void 0 : (_formData$tradedetils = formData.tradedetils) === null || _formData$tradedetils === void 0 ? void 0 : (_formData$tradedetils2 = _formData$tradedetils[0]) === null || _formData$tradedetils2 === void 0 ? void 0 : (_formData$tradedetils3 = _formData$tradedetils2.structureType) === null || _formData$tradedetils3 === void 0 ? void 0 : _formData$tradedetils3.code) === "MOVABLE") && (isEmpNewApplication || isEmpRenewLicense) : true) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(Label, {
19188
19112
  style: getInputStyles()
19189
19113
  }, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
@@ -19203,7 +19127,8 @@ const PropertySearchNSummary = ({
19203
19127
  style: {
19204
19128
  width: "80%",
19205
19129
  float: "left"
19206
- }
19130
+ },
19131
+ placeholder: `${t("PT_ENTER_PROPERTY_ID")}`
19207
19132
  }), /*#__PURE__*/React.createElement("button", {
19208
19133
  className: "submit-bar",
19209
19134
  type: "button",
@@ -19211,56 +19136,72 @@ const PropertySearchNSummary = ({
19211
19136
  color: "white"
19212
19137
  },
19213
19138
  onClick: searchProperty
19214
- }, `${t("PT_SEARCH")}`))), /*#__PURE__*/React.createElement("span", {
19215
- onClick: () => history.push(`/digit-ui/employee/commonpt/search?redirectToUrl=${redirectBackUrl}&${serachParams}`, {
19216
- ...state
19139
+ }, `${t("PT_SEARCH")}`), /*#__PURE__*/React.createElement("span", {
19140
+ onClick: () => history.push(`/digit-ui/${userType}/${pathname.split("/")[3]}/create-application/create-property`, {
19141
+ ...state,
19142
+ ...formData
19217
19143
  })
19218
- }, /*#__PURE__*/React.createElement(LinkButton, {
19219
- label: t("CPT_SEARCH_PROPERTY"),
19144
+ }, /*#__PURE__*/React.createElement("button", {
19145
+ className: "submit-bar",
19146
+ type: "button",
19220
19147
  style: {
19221
- color: "#a82227",
19222
- display: "inline-block"
19148
+ color: "white"
19223
19149
  }
19224
- })), "\xA0 | \xA0", /*#__PURE__*/React.createElement("span", {
19225
- onClick: () => history.push(`/digit-ui/employee/commonpt/new-application?redirectToUrl=${redirectBackUrl}&${serachParams}`, {
19226
- ...state
19227
- })
19228
- }, /*#__PURE__*/React.createElement(LinkButton, {
19229
- label: t("CPT_CREATE_PROPERTY"),
19150
+ }, t("CPT_CREATE_PROPERTY"))))), propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
19151
+ className: "card-with-background",
19230
19152
  style: {
19231
- color: "#a82227",
19232
- display: "inline-block"
19153
+ margin: "16px 0px",
19154
+ padding: "20px",
19155
+ boxShadow: "none"
19233
19156
  }
19234
- })), propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("header", {
19235
- className: "card-section-header",
19157
+ }, /*#__PURE__*/React.createElement(StatusTable, {
19236
19158
  style: {
19237
- marginBottom: "5px",
19238
- marginTop: "20px"
19159
+ padding: "0",
19160
+ margin: "0"
19239
19161
  }
19240
- }, t("PT_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement("div", {
19162
+ }, /*#__PURE__*/React.createElement("div", {
19241
19163
  className: "formcomposer-section-grid",
19242
19164
  style: isMobile ? {} : {}
19243
19165
  }, /*#__PURE__*/React.createElement(Row, {
19244
19166
  className: "border-none",
19245
19167
  labelStyle: isMobile ? {
19246
19168
  width: "40%"
19247
- } : {},
19169
+ } : {
19170
+ width: "30%",
19171
+ color: "#505a5f",
19172
+ fontWeight: "600"
19173
+ },
19174
+ textStyle: {
19175
+ color: "#000"
19176
+ },
19248
19177
  label: t(`PROPERTY_ID`),
19249
19178
  text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3.propertyId
19250
19179
  }), /*#__PURE__*/React.createElement(Row, {
19251
19180
  className: "border-none",
19252
19181
  labelStyle: isMobile ? {
19253
19182
  width: "40%"
19254
- } : {},
19183
+ } : {
19184
+ width: "30%",
19185
+ color: "#505a5f",
19186
+ fontWeight: "600"
19187
+ },
19188
+ textStyle: {
19189
+ color: "#000"
19190
+ },
19255
19191
  label: t(`OWNER_NAME`),
19256
19192
  text: getOwnerNames(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0])
19257
19193
  }), /*#__PURE__*/React.createElement(Row, {
19258
19194
  className: "border-none",
19259
19195
  labelStyle: isMobile ? {
19260
19196
  width: "40%"
19261
- } : {},
19197
+ } : {
19198
+ width: "30%",
19199
+ color: "#505a5f",
19200
+ fontWeight: "600"
19201
+ },
19262
19202
  textStyle: {
19263
- wordBreak: "break-word"
19203
+ wordBreak: "break-word",
19204
+ color: "#000"
19264
19205
  },
19265
19206
  label: t(`PROPERTY_ADDRESS`),
19266
19207
  text: propertyAddress,
@@ -19284,15 +19225,7 @@ const PropertySearchNSummary = ({
19284
19225
  isArray: false
19285
19226
  }
19286
19227
  }
19287
- }))), /*#__PURE__*/React.createElement(Link, {
19288
- to: `/digit-ui/employee/commonpt/view-property?propertyId=${propertyId}&tenantId=${tenantId}&from=${(_window$location$path = window.location.pathname) !== null && _window$location$path !== void 0 && _window$location$path.includes("employee/ws/new-application") ? "ES_COMMON_WS_NEW_CONNECTION" : (_window$location$path2 = window.location.pathname) !== null && _window$location$path2 !== void 0 && _window$location$path2.includes("employee/ws/modify-application") ? "WS_MODIFY_CONNECTION_BUTTON" : (_window$location$path3 = window.location.pathname) !== null && _window$location$path3 !== void 0 && _window$location$path3.includes("employee/tl/new-application") ? "ES_TITLE_NEW_TRADE_LICESE_APPLICATION" : "WF_EMPLOYEE_NEWTL_RENEWAL_SUBMIT_BUTTON"}`
19289
- }, /*#__PURE__*/React.createElement(LinkButton, {
19290
- label: t("CPT_COMPLETE_PROPERTY_DETAILS"),
19291
- style: {
19292
- color: "#a82227",
19293
- textAlign: "Left"
19294
- }
19295
- }))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
19228
+ }))))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
19296
19229
  isDleteBtn: true,
19297
19230
  labelstyle: {
19298
19231
  width: "100%"
@@ -19339,6 +19272,7 @@ const componentsToRegister = {
19339
19272
  CPTPropertyAssemblyDetails: PropertyAssemblyDetails,
19340
19273
  CPTPropertyLocationDetails: PropertyLocationDetails,
19341
19274
  CPTPropertyOwnerDetails: PropertyOwnerDetails,
19275
+ PropertyWaterConnection,
19342
19276
  CPTKnowYourProperty: KnowYourProperty,
19343
19277
  CPTPropertyDetails: PropertyDetails,
19344
19278
  CPTPropertySearchNSummary: PropertySearchNSummary,