@djb25/digit-ui-module-commonpt 1.0.3 → 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,155 +5897,35 @@ 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;
@@ -6062,15 +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;
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";
6066
5943
  const ownershipCategoryCode = typeof data.ownershipCategory === "string" ? data.ownershipCategory : (_data$ownershipCatego3 = data.ownershipCategory) === null || _data$ownershipCatego3 === void 0 ? void 0 : _data$ownershipCatego3.code;
6067
5944
  if (ownershipCategoryCode !== null && ownershipCategoryCode !== void 0 && ownershipCategoryCode.includes("INSTITUTIONALPRIVATE") || ownershipCategoryCode !== null && ownershipCategoryCode !== void 0 && ownershipCategoryCode.includes("INSTITUTIONALGOVERNMENT")) {
6068
- 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;
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;
6069
5946
  institution.designation = owners === null || owners === void 0 ? void 0 : (_owners$14 = owners[0]) === null || _owners$14 === void 0 ? void 0 : _owners$14.designation;
6070
5947
  institution.name = owners === null || owners === void 0 ? void 0 : (_owners$15 = owners[0]) === null || _owners$15 === void 0 ? void 0 : _owners$15.institutionName;
6071
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];
6072
5949
  institution.landlineNumber = owners === null || owners === void 0 ? void 0 : (_owners$17 = owners[0]) === null || _owners$17 === void 0 ? void 0 : _owners$17.altContactNumber;
6073
- 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);
6074
5951
  owner.push({
6075
5952
  altContactNumber: owners === null || owners === void 0 ? void 0 : (_owners$18 = owners[0]) === null || _owners$18 === void 0 ? void 0 : _owners$18.altContactNumber,
6076
5953
  permanentAddress: owners === null || owners === void 0 ? void 0 : (_owners$19 = owners[0]) === null || _owners$19 === void 0 ? void 0 : _owners$19.permanentAddress,
@@ -6084,88 +5961,96 @@ const setOwnerDetailsLW = data => {
6084
5961
  });
6085
5962
  data.institution = institution;
6086
5963
  data.owners = owner;
6087
- } else {
5964
+ } else if (owners && owners.length > 0) {
6088
5965
  owners.map(own => {
6089
- var _own$gender, _owners$25, _own$ownerType, _own$relationship;
5966
+ var _own$gender, _own$gender2, _own$ownerType, _own$relationship;
6090
5967
  owner.push({
6091
5968
  emailId: own === null || own === void 0 ? void 0 : own.emailId,
6092
5969
  fatherOrHusbandName: own === null || own === void 0 ? void 0 : own.fatherOrHusbandName,
6093
- gender: own === null || own === void 0 ? void 0 : (_own$gender = own.gender) === null || _own$gender === void 0 ? void 0 : _own$gender.value,
6094
- 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),
6095
5972
  mobileNumber: own === null || own === void 0 ? void 0 : own.mobileNumber,
6096
5973
  name: own === null || own === void 0 ? void 0 : own.name,
6097
- 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",
6098
5975
  permanentAddress: own === null || own === void 0 ? void 0 : own.permanentAddress,
6099
- relationship: own === null || own === void 0 ? void 0 : (_own$relationship = own.relationship) === null || _own$relationship === void 0 ? void 0 : _own$relationship.code,
6100
- 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
6101
5978
  });
6102
5979
  });
6103
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;
6104
5998
  }
6105
5999
  return data;
6106
6000
  };
6107
- const getUsageTypeLW = data => {
6108
- var _data$isResdential;
6109
- if ((data === null || data === void 0 ? void 0 : (_data$isResdential = data.isResdential) === null || _data$isResdential === void 0 ? void 0 : _data$isResdential.code) == "RESIDENTIAL") {
6110
- var _data$isResdential2;
6111
- return data === null || data === void 0 ? void 0 : (_data$isResdential2 = data.isResdential) === null || _data$isResdential2 === void 0 ? void 0 : _data$isResdential2.code;
6112
- } else {
6113
- var _data$usageCategory;
6114
- return data === null || data === void 0 ? void 0 : (_data$usageCategory = data.usageCategory) === null || _data$usageCategory === void 0 ? void 0 : _data$usageCategory.code;
6115
- }
6116
- };
6117
6001
  const setPropertyDetailsLW = data => {
6118
- var _assemblyDet$Building;
6002
+ var _useDetails$propertyT, _useDetails$propertyC, _useDetails$noOfFloor, _useDetails$noOfFloor2, _useDetails$noOfFloor3, _useDetails$noOfFloor4, _useDetails$noOfFloor5, _useDetails$noOfFloor6, _useDetails$noOfFloor7;
6119
6003
  let propertyDetails = {};
6120
6004
  const {
6121
- assemblyDet
6005
+ waterConnection,
6006
+ useDetails: topUseDetails
6122
6007
  } = data;
6008
+ const useDetails = (waterConnection === null || waterConnection === void 0 ? void 0 : waterConnection.useDetails) || topUseDetails;
6123
6009
  propertyDetails = {
6124
- propertyType: assemblyDet === null || assemblyDet === void 0 ? void 0 : (_assemblyDet$Building = assemblyDet.BuildingType) === null || _assemblyDet$Building === void 0 ? void 0 : _assemblyDet$Building.code,
6125
- usageCategory: getUsageTypeLW(assemblyDet),
6126
- landArea: parseInt(assemblyDet === null || assemblyDet === void 0 ? void 0 : assemblyDet.floorarea),
6127
- 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
6128
6015
  };
6129
6016
  data.propertyDetails = propertyDetails;
6130
6017
  return data;
6131
6018
  };
6132
6019
  const convertToPropertyLightWeight = (data = {}) => {
6133
- var _data, _data$owners2, _data$owners2$, _data2, _data2$assemblyDet, _data2$assemblyDet$us;
6134
- let propertyType = data.PropertyType;
6135
- let noOfFloors = 1;
6136
- 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;
6137
6021
  data = setOwnerDetailsLW(data);
6138
6022
  data = setAddressDetailsLW(data);
6139
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;
6140
6027
  const formdata = {
6141
6028
  Property: {
6142
6029
  tenantId: data.tenantId,
6143
6030
  address: data.address,
6144
6031
  propertyType: propertyType,
6145
6032
  ...data.propertyDetails,
6146
- ownershipCategory: typeof ownershipCategory === "string" ? ownershipCategory : ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.code,
6147
- 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,
6148
- owners: [...data.owners.map((owner, index) => {
6149
- 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;
6150
6037
  return {
6151
6038
  ...owner,
6152
6039
  additionalDetails: {
6153
6040
  ownerSequence: index,
6154
6041
  ownerName: owner === null || owner === void 0 ? void 0 : owner.name
6155
6042
  },
6156
- documents: Object.keys(owner.documents).map(key => {
6157
- const {
6158
- documentType,
6159
- fileStoreId
6160
- } = 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];
6161
6046
  return {
6162
- documentType: documentType.code,
6163
- 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) || ""
6164
6049
  };
6165
- }),
6166
- gender: (_owner$gender = owner.gender) === null || _owner$gender === void 0 ? void 0 : _owner$gender.code,
6167
- ownerType: ((_owner$ownerType = owner.ownerType) === null || _owner$ownerType === void 0 ? void 0 : _owner$ownerType.code) || "NONE",
6168
- 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,
6169
6054
  inistitutetype: owner === null || owner === void 0 ? void 0 : (_owner$inistitutetype = owner.inistitutetype) === null || _owner$inistitutetype === void 0 ? void 0 : _owner$inistitutetype.value,
6170
6055
  landlineNumber: owner === null || owner === void 0 ? void 0 : owner.altContactNumber,
6171
6056
  status: "ACTIVE"
@@ -6174,27 +6059,35 @@ const convertToPropertyLightWeight = (data = {}) => {
6174
6059
  noOfFloors: noOfFloors,
6175
6060
  additionalDetails: {
6176
6061
  isRainwaterHarvesting: false,
6177
- owners: [...data.owners.map((owner, index) => {
6178
- 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;
6179
6074
  return {
6180
6075
  ...owner,
6181
6076
  additionalDetails: {
6182
6077
  ownerSequence: index,
6183
6078
  ownerName: owner === null || owner === void 0 ? void 0 : owner.name
6184
6079
  },
6185
- documents: Object.keys(owner.documents).map(key => {
6186
- const {
6187
- documentType,
6188
- fileStoreId
6189
- } = 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];
6190
6083
  return {
6191
- documentType: documentType.code,
6192
- 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) || ""
6193
6086
  };
6194
- }),
6195
- gender: (_owner$gender2 = owner.gender) === null || _owner$gender2 === void 0 ? void 0 : _owner$gender2.code,
6196
- ownerType: ((_owner$ownerType2 = owner.ownerType) === null || _owner$ownerType2 === void 0 ? void 0 : _owner$ownerType2.code) || "NONE",
6197
- 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,
6198
6091
  inistitutetype: owner === null || owner === void 0 ? void 0 : (_owner$inistitutetype2 = owner.inistitutetype) === null || _owner$inistitutetype2 === void 0 ? void 0 : _owner$inistitutetype2.value,
6199
6092
  landlineNumber: owner === null || owner === void 0 ? void 0 : owner.altContactNumber,
6200
6093
  status: "ACTIVE"
@@ -6208,18 +6101,18 @@ const convertToPropertyLightWeight = (data = {}) => {
6208
6101
  };
6209
6102
  const ownershipCategoryCode = typeof ownershipCategory === "string" ? ownershipCategory : ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.code;
6210
6103
  if (ownershipCategoryCode !== null && ownershipCategoryCode !== void 0 && ownershipCategoryCode.includes("INSTITUTIONALPRIVATE") || ownershipCategoryCode !== null && ownershipCategoryCode !== void 0 && ownershipCategoryCode.includes("INSTITUTIONALGOVERNMENT")) {
6211
- var _data3;
6212
- formdata.Property.institution = (_data3 = data) === null || _data3 === void 0 ? void 0 : _data3.institution;
6104
+ var _data2;
6105
+ formdata.Property.institution = (_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.institution;
6213
6106
  }
6214
6107
  return formdata;
6215
6108
  };
6216
6109
  const convertToUpdatePropertyLightWeight = (data = {}) => {
6217
- var _data4, _data5, _data6, _data6$ownershipCateg, _formdata$Property, _data7, _formdata$Property3;
6218
- let propertyType = data.PropertyType;
6219
- 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;
6220
6111
  data = setOwnerDetailsLW(data);
6221
6112
  data = setAddressDetailsLW(data);
6222
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;
6223
6116
  const formdata = {
6224
6117
  Property: {
6225
6118
  id: data.id,
@@ -6230,9 +6123,9 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6230
6123
  tenantId: data.tenantId,
6231
6124
  address: data.address,
6232
6125
  propertyType: propertyType,
6233
- ownershipCategory: typeof ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.ownershipCategory) === "string" ? (_data5 = data) === null || _data5 === void 0 ? void 0 : _data5.ownershipCategory : (_data6 = data) === null || _data6 === void 0 ? void 0 : (_data6$ownershipCateg = _data6.ownershipCategory) === null || _data6$ownershipCateg === void 0 ? void 0 : _data6$ownershipCateg.code,
6126
+ ownershipCategory: "INDIVIDUAL.SINGLEOWNER",
6234
6127
  owners: [...data.owners.map((owner, index) => {
6235
- var _owner$gender3, _owner$ownerType3, _owner$relationship3, _owner$inistitutetype3;
6128
+ var _owner$gender5, _owner$ownerType3, _owner$relationship3, _owner$inistitutetype3;
6236
6129
  return {
6237
6130
  ...owner,
6238
6131
  additionalDetails: {
@@ -6249,7 +6142,7 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6249
6142
  fileStoreId
6250
6143
  };
6251
6144
  }),
6252
- 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,
6253
6146
  ownerType: ((_owner$ownerType3 = owner.ownerType) === null || _owner$ownerType3 === void 0 ? void 0 : _owner$ownerType3.code) || "NONE",
6254
6147
  relationship: (_owner$relationship3 = owner.relationship) === null || _owner$relationship3 === void 0 ? void 0 : _owner$relationship3.code,
6255
6148
  inistitutetype: owner === null || owner === void 0 ? void 0 : (_owner$inistitutetype3 = owner.inistitutetype) === null || _owner$inistitutetype3 === void 0 ? void 0 : _owner$inistitutetype3.value,
@@ -6260,8 +6153,13 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6260
6153
  noOfFloors: noOfFloors,
6261
6154
  additionalDetails: {
6262
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,
6263
6161
  owners: [...data.owners.map((owner, index) => {
6264
- var _owner$gender4, _owner$ownerType4, _owner$relationship4, _owner$inistitutetype4;
6162
+ var _owner$gender6, _owner$ownerType4, _owner$relationship4, _owner$inistitutetype4;
6265
6163
  return {
6266
6164
  ...owner,
6267
6165
  additionalDetails: {
@@ -6278,7 +6176,7 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6278
6176
  fileStoreId
6279
6177
  };
6280
6178
  }),
6281
- 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,
6282
6180
  ownerType: ((_owner$ownerType4 = owner.ownerType) === null || _owner$ownerType4 === void 0 ? void 0 : _owner$ownerType4.code) || "NONE",
6283
6181
  relationship: (_owner$relationship4 = owner.relationship) === null || _owner$relationship4 === void 0 ? void 0 : _owner$relationship4.code,
6284
6182
  inistitutetype: owner === null || owner === void 0 ? void 0 : (_owner$inistitutetype4 = owner.inistitutetype) === null || _owner$inistitutetype4 === void 0 ? void 0 : _owner$inistitutetype4.value,
@@ -6295,7 +6193,7 @@ const convertToUpdatePropertyLightWeight = (data = {}) => {
6295
6193
  }
6296
6194
  };
6297
6195
  let propertyInitialObject = JSON.parse(sessionStorage.getItem("propertyInitialObject"));
6298
- 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) && (_data7 = data) !== null && _data7 !== void 0 && _data7.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) {
6299
6197
  var _formdata$Property2;
6300
6198
  propertyInitialObject.units = propertyInitialObject.units.filter(unit => unit.active);
6301
6199
  let oldUnits = propertyInitialObject.units.map(unit => {
@@ -6324,113 +6222,288 @@ const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => {
6324
6222
  return str;
6325
6223
  };
6326
6224
 
6327
- const GetActionMessage = props => {
6328
- const {
6329
- t
6330
- } = useTranslation();
6331
- if (props.isSuccess) {
6332
- 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");
6333
- } else if (props.isLoading) {
6334
- return !window.location.href.includes("edit-application") ? t("CS_PROPERTY_APPLICATION_PENDING") : t("CS_PROPERTY_UPDATE_APPLICATION_PENDING");
6335
- } else if (!props.isSuccess) {
6336
- return !window.location.href.includes("edit-application") ? t("CS_PROPERTY_APPLICATION_FAILED") : t("CS_PROPERTY_UPDATE_APPLICATION_FAILED");
6337
- }
6338
- };
6339
- const rowContainerStyle = {
6340
- padding: "4px 0px",
6341
- justifyContent: "space-between"
6342
- };
6343
- const BannerPicker = props => {
6344
- var _props$data;
6345
- return /*#__PURE__*/React.createElement(Banner, {
6346
- message: GetActionMessage(props),
6347
- applicationNumber: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.Properties[0].acknowldgementNumber,
6348
- info: props.isSuccess ? props.t("PT_APPLICATION_NO") : "",
6349
- successful: props.isSuccess
6350
- });
6351
- };
6352
- const PTAcknowledgement = ({
6353
- onSuccess,
6225
+ const CreatePropertyForm = ({
6226
+ config,
6354
6227
  onSelect,
6355
- formData,
6356
- redirectUrl,
6357
- userType
6228
+ value,
6229
+ userType,
6230
+ redirectUrl
6358
6231
  }) => {
6359
- 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();
6360
6236
  const {
6361
6237
  t
6362
6238
  } = useTranslation();
6363
6239
  const location = useLocation();
6364
- const stateId = Digit.ULBService.getStateId();
6365
- const tenantId = Digit.ULBService.getCurrentTenantId();
6240
+ const [canSubmit, setCanSubmit] = useState(true);
6241
+ const defaultValues = {
6242
+ ...value
6243
+ };
6366
6244
  const history = useHistory();
6367
- let data = location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.data;
6368
- if (onSelect) {
6369
- var _formData$cptNewPrope;
6370
- 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");
6371
6255
  }
6372
- let createNUpdate = false;
6373
- let {
6374
- data: mdmsConfig,
6375
- isLoading
6376
- } = Digit.Hooks.pt.useMDMS(stateId, "PropertyTax", "PTWorkflow");
6377
- ((mdmsConfig === null || mdmsConfig === void 0 ? void 0 : (_mdmsConfig$PropertyT = mdmsConfig.PropertyTax) === null || _mdmsConfig$PropertyT === void 0 ? void 0 : _mdmsConfig$PropertyT.PTWorkfow) || []).forEach(data => {
6378
- if (data.enable) {
6379
- if (data.businessService.includes("WNS")) {
6380
- 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);
6381
6302
  }
6382
6303
  }
6383
- });
6384
- 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);
6385
- 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", {});
6386
6309
  const {
6387
- data: storeData
6388
- } = 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);
6389
6314
  useEffect(() => {
6390
- try {
6391
- var _data3, _data3$locationDet, _data3$locationDet$ci, _formdata$Property;
6392
- 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;
6393
- data.tenantId = tenant;
6394
- let formdata = convertToPropertyLightWeight(data);
6395
- 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;
6396
- mutation.mutate(formdata, {
6397
- onSuccess
6398
- });
6399
- if (!createNUpdate) {
6400
- if (!(mutation.isLoading && mutation.isIdle)) {
6401
- if (mutation.isSuccess) {
6402
- setTimeout(() => {
6403
- if (redirectUrl) {
6404
- var _mutation$data, _mutation$data$Proper, _location$state2;
6405
- 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}`, {
6406
- ...(location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.prevState)
6407
- });
6408
- const scrollConst = redirectUrl !== null && redirectUrl !== void 0 && redirectUrl.includes("employee/tl") ? 1600 : 300;
6409
- setTimeout(() => window.scrollTo(0, scrollConst), 400);
6410
- return;
6411
- }
6412
- }, 3000);
6413
- }
6414
- }
6415
- }
6416
- } catch (err) {}
6315
+ setMutationHappened(false);
6316
+ clearSuccessData();
6417
6317
  }, []);
6418
- useEffect(() => {
6419
- var _data4, _data4$locationDet, _data4$locationDet$ci;
6420
- 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;
6421
- if (mutation.isSuccess) {
6422
- setTimeout(() => {
6423
- if (redirectUrl) {
6424
- var _mutation$data2, _mutation$data2$Prope, _location$state3;
6425
- 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}`, {
6426
- ...(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")
6427
6367
  });
6428
- const scrollConst = redirectUrl !== null && redirectUrl !== void 0 && redirectUrl.includes("employee/tl") ? 1600 : 300;
6429
- setTimeout(() => window.scrollTo(0, scrollConst), 400);
6430
- return;
6431
6368
  }
6432
- }, 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
+ }
6433
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");
6434
6507
  }, [mutation]);
6435
6508
  useEffect(() => {
6436
6509
  if (mutation.isSuccess && createNUpdate) {
@@ -6443,58 +6516,54 @@ const PTAcknowledgement = ({
6443
6516
  mutationForUpdate.mutate(formdata, {
6444
6517
  onSuccess
6445
6518
  });
6446
- if (mutationForUpdate.isSuccess) {
6447
- setTimeout(() => {
6448
- if (redirectUrl) {
6449
- var _mutationForUpdate$da, _mutationForUpdate$da2, _mutationForUpdate$da3, _mutationForUpdate$da4, _location$state4;
6450
- 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}`, {
6451
- ...(location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.prevState)
6452
- });
6453
- const scrollConst = redirectUrl !== null && redirectUrl !== void 0 && redirectUrl.includes("employee/tl") ? 1600 : 300;
6454
- setTimeout(() => window.scrollTo(0, scrollConst), 400);
6455
- return;
6456
- }
6457
- }, 3000);
6458
- }
6519
+ if (mutationForUpdate.isSuccess) {}
6459
6520
  } catch (er) {}
6460
6521
  }
6461
6522
  }, [mutation.isSuccess]);
6462
6523
  const onNext = () => {
6463
6524
  if (onSelect) {
6464
6525
  if (mutation.isSuccess) {
6465
- var _mutation$data3, _mutation$data4, _mutation$data5;
6466
- 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]));
6467
- 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]));
6468
6529
  onSelect("cpt", {
6469
- 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]
6470
6531
  });
6471
6532
  }
6472
6533
  }
6473
6534
  };
6474
- 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, {
6475
6541
  t: t,
6476
- data: mutation.data,
6477
- isSuccess: mutation.isSuccess,
6478
- isLoading: mutation.isIdle || mutation.isLoading
6479
- }), 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, {
6480
6546
  rowContainerStyle: rowContainerStyle,
6481
6547
  last: true,
6482
6548
  label: t("PT_COMMON_TABLE_COL_PT_ID"),
6483
- 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,
6484
6550
  textStyle: {
6485
6551
  whiteSpace: "pre",
6486
6552
  width: "200%"
6487
6553
  }
6488
- })), 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, {
6489
6555
  label: t("CS_COMMON_PROCEED"),
6490
6556
  onSubmit: onNext
6491
6557
  }) : /*#__PURE__*/React.createElement(SubmitBar, {
6492
6558
  label: t("CS_COMMON_PROCEED"),
6493
6559
  onSubmit: () => {
6494
- if (redirectUrl) {
6495
- var _mutationForUpdate$da5, _mutationForUpdate$da6, _mutationForUpdate$da7, _mutationForUpdate$da8, _location$state5;
6496
- 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}`, {
6497
- ...(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)
6498
6567
  });
6499
6568
  }
6500
6569
  }
@@ -12910,23 +12979,26 @@ const ActionModal$b = ({
12910
12979
  isSuccess
12911
12980
  } = Digit.Hooks.fsm.useVehiclesSearch({
12912
12981
  tenantId,
12982
+ filters: {
12983
+ vendorId: applicationData === null || applicationData === void 0 ? void 0 : applicationData.vendorId
12984
+ },
12913
12985
  config: {
12914
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"
12915
12987
  }
12916
12988
  });
12917
12989
  let vehicleDescription = [];
12918
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 => {
12919
- var _item$driverData, _item$driver;
12920
- 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);
12921
12993
  })) === null || _vehicleData$vehicle$ === void 0 ? void 0 : _vehicleData$vehicle$.map(item => {
12922
- var _item$driverData2, _item$driver2;
12994
+ var _item$driverData2, _item$driver2, _item$owner3;
12923
12995
  vehicleDescription.push({
12924
12996
  code: item === null || item === void 0 ? void 0 : item.registrationNumber,
12925
12997
  name: item === null || item === void 0 ? void 0 : item.registrationNumber,
12926
12998
  i18nKey: item === null || item === void 0 ? void 0 : item.registrationNumber,
12927
12999
  tankerCapacity: item === null || item === void 0 ? void 0 : item.tankCapacity,
12928
13000
  vehicleId: item === null || item === void 0 ? void 0 : item.id,
12929
- 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)
12930
13002
  });
12931
13003
  });
12932
13004
  const [config, setConfig] = useState({});
@@ -12995,7 +13067,11 @@ const ActionModal$b = ({
12995
13067
  applicationData.vehicleId = selectVehicle === null || selectVehicle === void 0 ? void 0 : selectVehicle.vehicleId;
12996
13068
  applicationData.driverId = selectVehicle === null || selectVehicle === void 0 ? void 0 : selectVehicle.driverId;
12997
13069
  }
12998
- 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" ? {
12999
13075
  waterTankerBookingDetail: {
13000
13076
  ...applicationData,
13001
13077
  workflow
@@ -16062,7 +16138,7 @@ function ApplicationDetailsContent({
16062
16138
  fontSize: "24px"
16063
16139
  } : {
16064
16140
  marginBottom: "16px",
16065
- marginTop: "32px",
16141
+ marginTop: "16px",
16066
16142
  fontSize: "24px"
16067
16143
  }
16068
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", {
@@ -16977,7 +17053,7 @@ const NewApplication = ({
16977
17053
  const search = useLocation().search;
16978
17054
  const redirectUrl = new URLSearchParams(search).get('redirectToUrl');
16979
17055
  const createProperty = async () => {
16980
- history.push(`${match.path}/acknowledgement`);
17056
+ history.push(`${match.path}/save-property`);
16981
17057
  };
16982
17058
  const onSuccess = () => {
16983
17059
  clearParams();
@@ -16992,7 +17068,6 @@ const NewApplication = ({
16992
17068
  }, /*#__PURE__*/React.createElement(CreatePropertyForm, {
16993
17069
  onSubmit: createProperty,
16994
17070
  value: params,
16995
- redirectUrl: redirectUrl,
16996
17071
  userType: "employee"
16997
17072
  })), /*#__PURE__*/React.createElement(Route, {
16998
17073
  exact: true,
@@ -17000,7 +17075,6 @@ const NewApplication = ({
17000
17075
  }, /*#__PURE__*/React.createElement(PTAcknowledgement, {
17001
17076
  data: params,
17002
17077
  onSuccess: onSuccess,
17003
- redirectUrl: redirectUrl,
17004
17078
  userType: "employee"
17005
17079
  })));
17006
17080
  };
@@ -17226,7 +17300,7 @@ const EmployeeApp = ({
17226
17300
  show: true
17227
17301
  }];
17228
17302
  const locationCheck = window.location.href.includes("/employee/commonpt/new-application");
17229
- return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
17303
+ return /*#__PURE__*/React.createElement("div", {
17230
17304
  className: "ground-container"
17231
17305
  }, /*#__PURE__*/React.createElement("div", {
17232
17306
  style: locationCheck ? {
@@ -17234,7 +17308,7 @@ const EmployeeApp = ({
17234
17308
  } : {}
17235
17309
  }, /*#__PURE__*/React.createElement(BreadCrumb, {
17236
17310
  crumbs: crumbs
17237
- })), /*#__PURE__*/React.createElement(PrivateRoute, {
17311
+ })), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
17238
17312
  exact: true,
17239
17313
  path: `${path}/`,
17240
17314
  component: () => /*#__PURE__*/React.createElement(CommonPTLinks, {
@@ -17243,16 +17317,18 @@ const EmployeeApp = ({
17243
17317
  })
17244
17318
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
17245
17319
  path: `${path}/new-application`,
17246
- component: () => /*#__PURE__*/React.createElement(NewApplication, {
17247
- parentUrl: url
17248
- })
17320
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
17321
+ layoutClass: "action"
17322
+ }, /*#__PURE__*/React.createElement(NewApplication, {
17323
+ path: path
17324
+ }))
17249
17325
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
17250
17326
  path: `${path}/search`,
17251
- component: () => /*#__PURE__*/React.createElement(Search, null)
17327
+ component: Search
17252
17328
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
17253
17329
  path: `${path}/view-property`,
17254
- component: () => /*#__PURE__*/React.createElement(ViewProperty, null)
17255
- }))));
17330
+ component: ViewProperty
17331
+ })));
17256
17332
  };
17257
17333
 
17258
17334
  const PropertyAssemblyDetails = ({
@@ -17278,7 +17354,7 @@ const PropertyAssemblyDetails = ({
17278
17354
  } : formData === null || formData === void 0 ? void 0 : formData.usageCategoryMajor
17279
17355
  });
17280
17356
  const [focusField, setFocusField] = React.useState("");
17281
- let tenantId = "dl.djb";
17357
+ let tenantId = Digit.ULBService.getCurrentTenantId();
17282
17358
  const [isErrors, setIsErrors] = useState(false);
17283
17359
  const isMobile = window.Digit.Utils.browser.isMobile();
17284
17360
  let proptype = [];
@@ -17287,7 +17363,6 @@ const PropertyAssemblyDetails = ({
17287
17363
  data: Menu = [],
17288
17364
  isLoading
17289
17365
  } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", "PTPropertyType") || {};
17290
- console.log("PropertyType Menu Data (transformed):", Menu);
17291
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 : []);
17292
17367
  const {
17293
17368
  data: Menu1 = [],
@@ -17296,53 +17371,30 @@ const PropertyAssemblyDetails = ({
17296
17371
  console.log("UsageCategory Menu Data (transformed):", Menu1);
17297
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 : []);
17298
17373
  function getPropertyTypeMenu(proptype) {
17299
- if (userType === "employee") {
17300
- var _proptype$filter, _proptype$filter$map;
17301
- 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 => ({
17302
- i18nKey: "COMMON_PROPTYPE_" + stringReplaceAll(item === null || item === void 0 ? void 0 : item.code, ".", "_"),
17303
- code: item === null || item === void 0 ? void 0 : item.code
17304
- }))) === null || _proptype$filter$map === void 0 ? void 0 : _proptype$filter$map.sort((a, b) => a.i18nKey.split("_").pop().localeCompare(b.i18nKey.split("_").pop()));
17305
- } else {
17306
- let menu = [];
17307
- if (Array.isArray(proptype) && proptype.length > 0) {
17308
- for (let i = 0; i < proptype.length; i++) {
17309
- if (i != 1 && i != 4) menu.push({
17310
- i18nKey: "COMMON_PROPTYPE_" + stringReplaceAll(proptype[i].code, ".", "_"),
17311
- code: proptype[i].code
17312
- });
17313
- }
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
+ });
17314
17381
  }
17315
- menu.sort((a, b) => a.i18nKey.split("_").pop().localeCompare(b.i18nKey.split("_").pop()));
17316
- return menu;
17317
17382
  }
17383
+ menu.sort((a, b) => a.i18nKey.split("_").pop().localeCompare(b.i18nKey.split("_").pop()));
17384
+ return menu;
17318
17385
  }
17319
17386
  function usageCategoryMajorMenu(usagecat) {
17320
- if (userType === "employee") {
17321
- var _usagecat$filter;
17322
- 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 => {
17323
- const arr = item === null || item === void 0 ? void 0 : item.code.split(".");
17324
- if (arr.length == 2) return {
17325
- i18nKey: "PROPERTYTAX_BILLING_SLAB_" + arr[1],
17326
- code: item === null || item === void 0 ? void 0 : item.code
17327
- };else return {
17328
- i18nKey: "PROPERTYTAX_BILLING_SLAB_" + (item === null || item === void 0 ? void 0 : item.code),
17329
- code: item === null || item === void 0 ? void 0 : item.code
17330
- };
17331
- });
17332
- return catMenu;
17333
- } else {
17334
- let menu = [];
17335
- for (let i = 0; i < usagecat.length; i++) {
17336
- var _usagecat$i, _usagecat$i$code, _usagecat$i$code$spli, _usagecat$i2, _usagecat$i2$code, _usagecat$i2$code$spl;
17337
- 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) {
17338
- menu.push({
17339
- i18nKey: "PROPERTYTAX_BILLING_SLAB_" + usagecat[i].code.split(".")[1],
17340
- code: usagecat[i].code
17341
- });
17342
- }
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
+ });
17343
17395
  }
17344
- return menu;
17345
17396
  }
17397
+ return menu;
17346
17398
  }
17347
17399
  const {
17348
17400
  control,
@@ -17536,6 +17588,124 @@ const PropertyAssemblyDetails = ({
17536
17588
  };
17537
17589
 
17538
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 = ({
17539
17709
  t,
17540
17710
  config,
17541
17711
  onSelect,
@@ -17544,311 +17714,47 @@ const PropertyLocationDetails = ({
17544
17714
  formState,
17545
17715
  ownerIndex,
17546
17716
  setError,
17547
- clearErrors
17717
+ clearErrors,
17718
+ ...props
17548
17719
  }) => {
17549
- var _Digit$UserService$ge, _errors$cityCode, _errors$cityCode2, _errors$locality, _errors$locality2, _errors$houseDoorNo, _errors$houseDoorNo2, _errors$buildingColon, _errors$buildingColon2, _errors$landmarkName, _errors$landmarkName2;
17550
- let validation = {};
17551
- let allCities = Digit.Hooks.pt.useTenants() ? Digit.Hooks.pt.useTenants() : Digit.Hooks.tl.useTenants();
17552
- if (window.location.href.includes("obps")) {
17553
- allCities = Digit.SessionStorage.get("OBPS_TENANTS");
17554
- }
17555
- if (window.location.href.includes("fsm")) {
17556
- allCities = Digit.SessionStorage.get("FSM_TENANTS");
17557
- console.log("allc", allCities);
17558
- }
17559
- const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
17560
- userType = (userInfo === null || userInfo === void 0 ? void 0 : userInfo.type) == "EMPLOYEE" ? "employee" : "citizen";
17561
- const cityName = 'TENANT_TENANTS_' + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.tenantId.replace('.', '_').toUpperCase());
17562
- const cityObj = (allCities || []).find(city => city.code === ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.tenantId) || "dl.djb")) || {
17563
- code: "dl.djb",
17564
- name: t("TENANT_TENANTS_DL_DJB"),
17565
- i18nKey: "TENANT_TENANTS_DL_DJB"
17566
- };
17567
- const [locationDetails, setLocationDetails] = React.useState({
17568
- ...(formData === null || formData === void 0 ? void 0 : formData.locationDet),
17569
- cityCode: cityObj,
17570
- locality: formData === null || formData === void 0 ? void 0 : formData.locality,
17571
- houseDoorNo: formData === null || formData === void 0 ? void 0 : formData.houseDoorNo,
17572
- buildingColonyName: formData === null || formData === void 0 ? void 0 : formData.buildingColonyName,
17573
- landmarkName: formData === null || formData === void 0 ? void 0 : formData.landmarkName
17574
- });
17575
- const [isErrors, setIsErrors] = React.useState(false);
17576
- const {
17577
- control,
17578
- formState: {
17579
- errors,
17580
- touched
17581
- },
17582
- trigger,
17583
- watch,
17584
- setError: setLocalError,
17585
- clearErrors: clearLocalErrors,
17586
- setValue,
17587
- getValues
17588
- } = useForm();
17589
- const formValue = watch();
17590
- React.useEffect(() => {
17591
- let hasErrors = false;
17592
- const part = {};
17593
- Object.keys(locationDetails).forEach(key => {
17594
- part[key] = formValue === null || formValue === void 0 ? void 0 : formValue[key];
17595
- });
17596
- if (!lodash.isEqual(part, locationDetails)) {
17597
- Object.keys(locationDetails).forEach(key => {
17598
- if (locationDetails[key]) {
17599
- hasErrors = false;
17600
- clearLocalErrors(key);
17601
- } else {
17602
- hasErrors = true;
17603
- }
17604
- });
17605
- }
17606
- if (hasErrors) {
17607
- setError(config === null || config === void 0 ? void 0 : config.key, {
17608
- type: errors
17609
- });
17610
- } else {
17611
- clearErrors(config === null || config === void 0 ? void 0 : config.key);
17612
- }
17613
- trigger();
17614
- setIsErrors(hasErrors);
17615
- onSelect(config === null || config === void 0 ? void 0 : config.key, locationDetails);
17616
- }, [locationDetails]);
17617
- React.useEffect(() => {
17618
- var _formState$errors$con;
17619
- 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)) {
17620
- setError(config.key, {
17621
- type: errors
17622
- });
17623
- } else if (!Object.keys(errors).length && formState.errors[config.key] && isErrors) {
17624
- clearErrors(config.key);
17625
- }
17626
- }, [errors]);
17627
- const errorStyle = {
17628
- width: "70%",
17629
- marginLeft: "30%",
17630
- fontSize: "12px",
17631
- marginTop: "-21px"
17632
- };
17633
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t('PT_PROP_CITY')}*`), /*#__PURE__*/React.createElement("div", {
17634
- className: "form-field"
17635
- }, /*#__PURE__*/React.createElement(Controller, {
17636
- name: "cityCode",
17637
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.cityCode,
17638
- control: control,
17639
- rules: {
17640
- required: t("REQUIRED_FIELD")
17641
- },
17642
- render: ({
17643
- value,
17644
- onBlur,
17645
- onChange
17646
- }) => /*#__PURE__*/React.createElement(Dropdown, {
17647
- selected: value,
17648
- disable: true,
17649
- option: (allCities || []).sort((a, b) => a.name > b.name ? 1 : b.name > a.name ? -1 : 0),
17650
- select: value => {
17651
- onChange(value);
17652
- setLocationDetails({
17653
- ...locationDetails,
17654
- cityCode: value
17655
- });
17656
- },
17657
- optionKey: "code",
17658
- onBlur: onBlur,
17659
- t: t
17660
- })
17661
- }))), (touched === null || touched === void 0 ? 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(CardLabelError, {
17662
- style: errorStyle
17663
- }, errors === null || errors === void 0 ? void 0 : (_errors$cityCode2 = errors.cityCode) === null || _errors$cityCode2 === void 0 ? void 0 : _errors$cityCode2.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_PROP_LOCALITY")}*`), /*#__PURE__*/React.createElement("div", {
17664
- className: "form-field"
17665
- }, /*#__PURE__*/React.createElement(Controller, {
17666
- name: "locality",
17667
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.locality,
17668
- control: control,
17669
- rules: {
17670
- required: t("REQUIRED_FIELD")
17671
- },
17672
- render: ({
17673
- value,
17674
- onBlur,
17675
- onChange
17676
- }) => {
17677
- var _locationDetails$city, _locationDetails$city2;
17678
- return /*#__PURE__*/React.createElement(Localities, {
17679
- selectLocality: value => {
17680
- onChange(value);
17681
- setLocationDetails({
17682
- ...locationDetails,
17683
- locality: value
17684
- });
17685
- },
17686
- tenantId: locationDetails === null || locationDetails === void 0 ? void 0 : (_locationDetails$city = locationDetails.cityCode) === null || _locationDetails$city === void 0 ? void 0 : _locationDetails$city.code,
17687
- boundaryType: "revenue",
17688
- keepNull: false,
17689
- optionCardStyles: {
17690
- height: "600px",
17691
- overflow: "auto",
17692
- zIndex: "10"
17693
- },
17694
- selected: value,
17695
- disable: !(locationDetails !== null && locationDetails !== void 0 && (_locationDetails$city2 = locationDetails.cityCode) !== null && _locationDetails$city2 !== void 0 && _locationDetails$city2.code),
17696
- disableLoader: true,
17697
- onBlur: onBlur
17698
- });
17699
- }
17700
- }))), (touched === null || touched === void 0 ? 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(CardLabelError, {
17701
- style: errorStyle
17702
- }, errors === null || errors === void 0 ? void 0 : (_errors$locality2 = errors.locality) === null || _errors$locality2 === void 0 ? void 0 : _errors$locality2.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_HOUSE_DOOR_NO")}*`), /*#__PURE__*/React.createElement("div", {
17703
- className: "form-field"
17704
- }, /*#__PURE__*/React.createElement(Controller, {
17705
- name: "houseDoorNo",
17706
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.houseDoorNo,
17707
- control: control,
17708
- rules: {
17709
- required: t("REQUIRED_FIELD"),
17710
- validate: value => /^([a-zA-Z0-9 !@#$%^&*()_+\-={};':\\\\|,.<>/?]){1,64}$/i.test(value) ? true : t("PT_HOUSE_DOOR_NO_ERROR_MESSAGE")
17711
- },
17712
- render: ({
17713
- value,
17714
- onBlur,
17715
- onChange
17716
- }) => /*#__PURE__*/React.createElement(TextInput, Object.assign({
17717
- t: t,
17718
- type: "text",
17719
- isMandatory: false,
17720
- optionKey: "i18nKey",
17721
- name: "houseDoorNo",
17722
- value: value,
17723
- onChange: ev => {
17724
- onChange(ev.target.value);
17725
- setLocationDetails({
17726
- ...locationDetails,
17727
- houseDoorNo: ev.target.value
17728
- });
17729
- },
17730
- onBlur: onBlur
17731
- }, validation = {
17732
- pattern: "^([a-zA-Z0-9 !@#$%^&*()_+\-={};':\\\\|,.<>/?]){1,64}$",
17733
- title: t("PT_HOUSE_DOOR_NO_ERROR_MESSAGE")
17734
- }))
17735
- }))), (touched === null || touched === void 0 ? 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(CardLabelError, {
17736
- style: errorStyle
17737
- }, errors === null || errors === void 0 ? void 0 : (_errors$houseDoorNo2 = errors.houseDoorNo) === null || _errors$houseDoorNo2 === void 0 ? void 0 : _errors$houseDoorNo2.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_PROPERTY_ADDRESS_STREET_NAME")}*`), /*#__PURE__*/React.createElement("div", {
17738
- className: "form-field"
17739
- }, /*#__PURE__*/React.createElement(Controller, {
17740
- name: "buildingColonyName",
17741
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.buildingColonyName,
17742
- control: control,
17743
- rules: {
17744
- required: t("REQUIRED_FIELD")
17745
- },
17746
- render: ({
17747
- value,
17748
- onChange,
17749
- onBlur
17750
- }) => /*#__PURE__*/React.createElement(TextInput, {
17751
- t: t,
17752
- type: "text",
17753
- isMandatory: false,
17754
- optionKey: "i18nKey",
17755
- name: "buildingColonyName",
17756
- value: value,
17757
- onChange: ev => {
17758
- onChange(ev.target.value);
17759
- setLocationDetails({
17760
- ...locationDetails,
17761
- buildingColonyName: ev.target.value
17762
- });
17763
- },
17764
- onBlur: onBlur
17765
- })
17766
- }))), (touched === null || touched === void 0 ? 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(CardLabelError, {
17767
- style: errorStyle
17768
- }, errors === null || errors === void 0 ? void 0 : (_errors$buildingColon2 = errors.buildingColonyName) === null || _errors$buildingColon2 === void 0 ? void 0 : _errors$buildingColon2.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_LANDMARK_NAME")}`), /*#__PURE__*/React.createElement("div", {
17769
- className: "form-field"
17770
- }, /*#__PURE__*/React.createElement(Controller, {
17771
- name: "landmarkName",
17772
- defaultValue: locationDetails === null || locationDetails === void 0 ? void 0 : locationDetails.landmarkName,
17773
- control: control,
17774
- rules: {},
17775
- render: ({
17776
- value,
17777
- onChange,
17778
- onBlur
17779
- }) => /*#__PURE__*/React.createElement(TextInput, {
17780
- t: t,
17781
- type: "text",
17782
- isMandatory: false,
17783
- optionKey: "i18nKey",
17784
- name: "landmarkName",
17785
- value: value,
17786
- onChange: ev => {
17787
- onChange(ev.target.value);
17788
- setLocationDetails({
17789
- ...locationDetails,
17790
- landmarkName: ev.target.value
17791
- });
17792
- },
17793
- onBlur: onBlur
17794
- })
17795
- }))), (touched === null || touched === void 0 ? 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) && /*#__PURE__*/React.createElement(CardLabelError, {
17796
- style: errorStyle
17797
- }, errors === null || errors === void 0 ? void 0 : (_errors$landmarkName2 = errors.landmarkName) === null || _errors$landmarkName2 === void 0 ? void 0 : _errors$landmarkName2.message));
17798
- };
17799
-
17800
- const getAddress = (address, t) => {
17801
- 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}` : " "}`;
17802
- };
17803
- const PropertyOwnerDetails = ({
17804
- t,
17805
- config,
17806
- onSelect,
17807
- userType,
17808
- formData,
17809
- formState,
17810
- ownerIndex,
17811
- setError,
17812
- clearErrors
17813
- }) => {
17814
- 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;
17815
- const {
17816
- pathname: url
17817
- } = useLocation();
17818
- const editScreen = url.includes("/modify-application/");
17819
- const mutationScreen = url.includes("/property-mutation/");
17820
- const isMobile = window.Digit.Utils.browser.isMobile();
17821
- let index = 0;
17822
- const [ownershipCategory, setOwnerCategory] = React.useState("");
17823
- const [ownerDetails, setOwnerDetails] = React.useState([{
17824
- ...(formData.owners && formData.owners[index]),
17825
- 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) || "",
17826
- gender: formData.owners && formData.owners[index] && formData.owners[index].gender || (formData === null || formData === void 0 ? void 0 : (_formData$owners2 = formData.owners) === null || _formData$owners2 === void 0 ? void 0 : _formData$owners2.gender),
17827
- mobileNumber: formData.owners && formData.owners[index] && formData.owners[index].mobileNumber || (formData === null || formData === void 0 ? void 0 : (_formData$owners3 = formData.owners) === null || _formData$owners3 === void 0 ? void 0 : _formData$owners3.mobileNumber) || "",
17828
- fatherOrHusbandName: formData.owners && formData.owners[index] && formData.owners[index].fatherOrHusbandName || (formData === null || formData === void 0 ? void 0 : (_formData$owners4 = formData.owners) === null || _formData$owners4 === void 0 ? void 0 : _formData$owners4.fatherOrHusbandName) || "",
17829
- relationship: formData.owners && formData.owners[index] && formData.owners[index].relationship || (formData === null || formData === void 0 ? void 0 : (_formData$owners5 = formData.owners) === null || _formData$owners5 === void 0 ? void 0 : _formData$owners5.relationship),
17830
- ownershipCategory: ownershipCategory,
17831
- ownerType: formData.owners && formData.owners[index] && ((_formData$owners$inde = formData.owners[index]) === null || _formData$owners$inde === void 0 ? void 0 : _formData$owners$inde.ownerType) || ((_formData$owners6 = formData.owners) === null || _formData$owners6 === void 0 ? void 0 : _formData$owners6.ownerType),
17832
- permanentAddress: formData.owners && formData.owners[index] && formData.owners[index].permanentAddress || (formData === null || formData === void 0 ? void 0 : (_formData$owners7 = formData.owners) === null || _formData$owners7 === void 0 ? void 0 : _formData$owners7.permanentAddress) || "",
17833
- email: formData.owners && formData.owners[index] && formData.owners[index].email || (formData === null || formData === void 0 ? void 0 : (_formData$owners8 = formData.owners) === null || _formData$owners8 === void 0 ? void 0 : _formData$owners8.emailId) || "",
17834
- isCoresAddr: false
17835
- }]);
17836
- const [isErrors, setIsErrors] = useState(false);
17837
- const [isMultipleOwnersChecking, setIsMultipleOwnersChecking] = React.useState(false);
17838
- const isUpdateProperty = (formData === null || formData === void 0 ? void 0 : formData.isUpdateProperty) || false;
17839
- let isEditProperty = (formData === null || formData === void 0 ? void 0 : formData.isEditProperty) || false;
17840
- const stateId = Digit.ULBService.getStateId();
17841
- const tenantId = Digit.ULBService.getCurrentTenantId();
17842
- const {
17843
- data: Menu
17844
- } = Digit.Hooks.pt.useGenderMDMS(stateId, "common-masters", "GenderType");
17845
- let menu = [];
17846
- Menu && Menu.map(genderDetails => {
17847
- menu.push({
17848
- i18nKey: `PT_COMMON_GENDER_${genderDetails.code}`,
17849
- code: `${genderDetails.code}`,
17850
- value: `${genderDetails.code}`
17851
- });
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;
17721
+ const {
17722
+ pathname: url
17723
+ } = useLocation();
17724
+ const editScreen = url.includes("/modify-application/");
17725
+ const mutationScreen = url.includes("/property-mutation/");
17726
+ const isMobile = window.Digit.Utils.browser.isMobile();
17727
+ let index = 0;
17728
+ const [ownershipCategory, setOwnerCategory] = React.useState((formData === null || formData === void 0 ? void 0 : formData.ownershipCategory) || "");
17729
+ const [ownerDetails, setOwnerDetails] = React.useState([{
17730
+ ...(formData.owners && formData.owners[index]),
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) || "",
17732
+ gender: formData.owners && formData.owners[index] && formData.owners[index].gender || (formData === null || formData === void 0 ? void 0 : (_formData$owners2 = formData.owners) === null || _formData$owners2 === void 0 ? void 0 : _formData$owners2.gender),
17733
+ mobileNumber: formData.owners && formData.owners[index] && formData.owners[index].mobileNumber || (formData === null || formData === void 0 ? void 0 : (_formData$owners3 = formData.owners) === null || _formData$owners3 === void 0 ? void 0 : _formData$owners3.mobileNumber) || "",
17734
+ fatherOrHusbandName: formData.owners && formData.owners[index] && formData.owners[index].fatherOrHusbandName || (formData === null || formData === void 0 ? void 0 : (_formData$owners4 = formData.owners) === null || _formData$owners4 === void 0 ? void 0 : _formData$owners4.fatherOrHusbandName) || "",
17735
+ relationship: formData.owners && formData.owners[index] && formData.owners[index].relationship || (formData === null || formData === void 0 ? void 0 : (_formData$owners5 = formData.owners) === null || _formData$owners5 === void 0 ? void 0 : _formData$owners5.relationship),
17736
+ ownershipCategory: ownershipCategory,
17737
+ ownerType: formData.owners && formData.owners[index] && ((_formData$owners$inde = formData.owners[index]) === null || _formData$owners$inde === void 0 ? void 0 : _formData$owners$inde.ownerType) || ((_formData$owners6 = formData.owners) === null || _formData$owners6 === void 0 ? void 0 : _formData$owners6.ownerType),
17738
+ permanentAddress: formData.owners && formData.owners[index] && formData.owners[index].permanentAddress || (formData === null || formData === void 0 ? void 0 : (_formData$owners7 = formData.owners) === null || _formData$owners7 === void 0 ? void 0 : _formData$owners7.permanentAddress) || "",
17739
+ email: formData.owners && formData.owners[index] && formData.owners[index].email || (formData === null || formData === void 0 ? void 0 : (_formData$owners8 = formData.owners) === null || _formData$owners8 === void 0 ? void 0 : _formData$owners8.emailId) || "",
17740
+ isCoresAddr: false
17741
+ }]);
17742
+ const [isErrors, setIsErrors] = useState(false);
17743
+ const [isMultipleOwnersChecking, setIsMultipleOwnersChecking] = React.useState(false);
17744
+ const isUpdateProperty = (formData === null || formData === void 0 ? void 0 : formData.isUpdateProperty) || false;
17745
+ let isEditProperty = (formData === null || formData === void 0 ? void 0 : formData.isEditProperty) || false;
17746
+ const stateId = Digit.ULBService.getStateId();
17747
+ const tenantId = Digit.ULBService.getCurrentTenantId();
17748
+ const {
17749
+ data: Menu
17750
+ } = Digit.Hooks.pt.useGenderMDMS(stateId, "common-masters", "GenderType");
17751
+ let menu = [];
17752
+ Menu && Menu.map(genderDetails => {
17753
+ menu.push({
17754
+ i18nKey: `PT_COMMON_GENDER_${genderDetails.code}`,
17755
+ code: `${genderDetails.code}`,
17756
+ value: `${genderDetails.code}`
17757
+ });
17852
17758
  });
17853
17759
  const {
17854
17760
  data: rawMenu1,
@@ -17860,16 +17766,6 @@ const PropertyOwnerDetails = ({
17860
17766
  isLoading: isMdmsDataLoading
17861
17767
  } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["OwnerShipCategory"]);
17862
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);
17863
- function setCorrespondenceAddress(e, ind) {
17864
- let address = "";
17865
- if (e.target.checked === true) {
17866
- var _formData$searchResul, _formData$searchResul2;
17867
- 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;
17868
- address = getAddress(locationDet, t);
17869
- }
17870
- updateState("permanentAddress", ind, address);
17871
- updateState("isCoresAddr", ind, e.target.checked);
17872
- }
17873
17769
  const GuardianOptions = [{
17874
17770
  name: "HUSBAND",
17875
17771
  code: "HUSBAND",
@@ -17947,266 +17843,55 @@ const PropertyOwnerDetails = ({
17947
17843
  };
17948
17844
  const ownershipCategoryMenu = useMemo(() => {
17949
17845
  var _mdmsData$PropertyTax, _mdmsData$PropertyTax2, _mdmsData$PropertyTax3;
17950
- 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 => ({
17951
- ...item,
17952
- i18nKey: `PT_OWNERSHIP_CATEGORY_${item.code.replaceAll(".", "_")}`
17953
- }));
17954
- }, [mdmsData]);
17955
- const institutionTypeMenu = useMemo(() => {
17956
- var _mdmsData$PropertyTax4, _mdmsData$PropertyTax5;
17957
- const code = ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.code;
17958
- 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 => {
17959
- var _e$code;
17960
- 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]);
17961
- });
17962
- const arraData = arr === null || arr === void 0 ? void 0 : arr.filter(data => {
17963
- var _data$code, _data$code$split;
17964
- 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];
17965
- });
17966
- return arraData === null || arraData === void 0 ? void 0 : arraData.map(e => {
17967
- var _e$code2, _e$code2$split, _e$code3;
17968
- 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]) && {
17969
- ...e,
17970
- i18nKey: `PT_OWNERSHIP_CATEGORY_${(_e$code3 = e.code) === null || _e$code3 === void 0 ? void 0 : _e$code3.replaceAll(".", "_")}`
17971
- };
17972
- });
17973
- }, [mdmsData, ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.code]);
17974
- const errorStyle = {
17975
- width: "70%",
17976
- marginLeft: "30%",
17977
- fontSize: "12px",
17978
- marginTop: "-21px"
17979
- };
17980
- const ismultiple = ownershipCategory !== null && ownershipCategory !== void 0 && (_ownershipCategory$co = ownershipCategory.code) !== null && _ownershipCategory$co !== void 0 && _ownershipCategory$co.includes("MULTIPLEOWNERS") ? true : false;
17981
- const isInstitutionalOwnerType = ownershipCategory === null || ownershipCategory === void 0 ? void 0 : (_ownershipCategory$co2 = ownershipCategory.code) === null || _ownershipCategory$co2 === void 0 ? void 0 : _ownershipCategory$co2.includes("INSTITUTIONAL");
17982
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
17983
- className: ""
17984
- }, `${t("TL_NEW_OWNER_DETAILS_OWNERSHIP_TYPE_LABEL")}*`), /*#__PURE__*/React.createElement(Controller, {
17985
- name: "ownershipCategory",
17986
- defaultValue: ownershipCategory,
17987
- control: control,
17988
- rules: {
17989
- required: t("REQUIRED_FIELD")
17990
- },
17991
- render: ({
17992
- value,
17993
- onChange,
17994
- onBlur
17995
- }) => /*#__PURE__*/React.createElement(Dropdown, {
17996
- className: "form-field",
17997
- selected: value,
17998
- option: ownershipCategoryMenu,
17999
- select: value => {
18000
- var _value$code;
18001
- 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) {
18002
- setOwnerDetails([...ownerDetails.filter((own, ind) => ind == 0)]);
18003
- }
18004
- onChange(value);
18005
- setOwnerCategory(value);
18006
- },
18007
- optionKey: "i18nKey",
18008
- onBlur: onBlur,
18009
- t: t
18010
- })
18011
- })), ownerDetails === null || ownerDetails === void 0 ? void 0 : ownerDetails.map((owner, index) => {
18012
- var _errors, _errors2, _errors3, _errors4, _errors5, _errors6, _errors7, _errors8, _errors9, _errors0, _errors1, _errors10, _ownerDetails$index, _ownerDetails$index3, _ownerDetails$index4, _ownerDetails$index5, _errors11, _errors12, _errors13, _errors14, _errors15, _errors16, _errors17, _errors18, _errors19, _errors20, _errors21, _errors22, _ownerDetails$index6, _ownerDetails$index8, _ownerDetails$index9, _ownerDetails$index0;
18013
- return /*#__PURE__*/React.createElement("div", {
18014
- style: {
18015
- border: "1px solid #D6D5D4",
18016
- background: "#FAFAFA",
18017
- borderRadius: "4px",
18018
- boxSizing: "border-box",
18019
- margin: "16px 0px",
18020
- padding: "16px 8px"
18021
- }
18022
- }, isMobile && ismultiple && ownerDetails.length > 1 && /*#__PURE__*/React.createElement("div", {
18023
- style: {
18024
- display: "flex",
18025
- justifyContent: "flex-end"
18026
- }
18027
- }, /*#__PURE__*/React.createElement(LinkButton, {
18028
- label: /*#__PURE__*/React.createElement(DeleteIcon, {
18029
- style: {
18030
- bottom: "5px"
18031
- },
18032
- fill: !(ownerDetails.length == 1) ? "#494848" : "#FAFAFA"
18033
- }),
18034
- style: {
18035
- margin: "0px"
18036
- },
18037
- onClick: e => {
18038
- setOwnerDetails([...ownerDetails.filter((own, ind) => ind != index)]);
18039
- }
18040
- })), 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", {
18041
- className: "form-field"
18042
- }, /*#__PURE__*/React.createElement(Controller, {
18043
- key: "institutionName" + index,
18044
- name: "institutionName" + index,
18045
- defaultValue: owner === null || owner === void 0 ? void 0 : owner.institutionName,
18046
- control: control,
18047
- rules: {
18048
- required: t("REQUIRED_FIELD"),
18049
- validate: value => {
18050
- return /^[a-zA-Z ]*$/i.test(value) ? true : t("PT_NAME_ERROR_MESSAGE");
18051
- }
18052
- },
18053
- render: ({
18054
- value,
18055
- onChange,
18056
- onBlur
18057
- }) => /*#__PURE__*/React.createElement(TextInput, {
18058
- t: t,
18059
- type: "text",
18060
- isMandatory: false,
18061
- optionKey: "i18nKey",
18062
- name: "institutionName" + index,
18063
- value: value,
18064
- onChange: ev => {
18065
- onChange(ev.target.value);
18066
- updateState("institutionName", index, ev.target.value);
18067
- },
18068
- disable: isUpdateProperty || isEditProperty,
18069
- onBlur: onBlur
18070
- })
18071
- }))), (touched === null || touched === void 0 ? 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(CardLabelError, {
18072
- style: errorStyle
18073
- }, errors === null || errors === void 0 ? void 0 : (_errors2 = errors["institutionName" + index]) === null || _errors2 === void 0 ? void 0 : _errors2.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
18074
- className: ""
18075
- }, `${t("PT_INSTITUTION_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
18076
- className: "form-field"
18077
- }, /*#__PURE__*/React.createElement(Controller, {
18078
- key: "institutionType" + index,
18079
- name: "institutionType" + index,
18080
- defaultValue: owner === null || owner === void 0 ? void 0 : owner.institutionType,
18081
- control: control,
18082
- rules: {
18083
- required: t("REQUIRED_FIELD")
18084
- },
18085
- render: ({
18086
- value,
18087
- onChange,
18088
- onBlur
18089
- }) => /*#__PURE__*/React.createElement(Dropdown, {
18090
- selected: (institutionTypeMenu === null || institutionTypeMenu === void 0 ? void 0 : institutionTypeMenu.length) === 1 ? institutionTypeMenu[0] : value,
18091
- disable: (institutionTypeMenu === null || institutionTypeMenu === void 0 ? void 0 : institutionTypeMenu.length) === 1 || editScreen,
18092
- option: institutionTypeMenu ? institutionTypeMenu.sort((a, b) => a.name.localeCompare(b.name)) : [],
18093
- select: value => {
18094
- onChange(value);
18095
- updateState("institutionType", index, value);
18096
- },
18097
- optionKey: "i18nKey",
18098
- t: t,
18099
- onBlur: onBlur
18100
- })
18101
- }))), (touched === null || touched === void 0 ? void 0 : touched["institutionType" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors3 = errors["institutionType" + index]) === null || _errors3 === void 0 ? void 0 : _errors3.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18102
- style: errorStyle
18103
- }, errors === null || errors === void 0 ? void 0 : (_errors4 = errors["institutionType" + index]) === null || _errors4 === void 0 ? void 0 : _errors4.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", {
18104
- className: "form-field"
18105
- }, /*#__PURE__*/React.createElement(Controller, {
18106
- key: "name" + index,
18107
- name: "name" + index,
18108
- defaultValue: owner === null || owner === void 0 ? void 0 : owner.name,
18109
- control: control,
18110
- rules: {
18111
- required: t("REQUIRED_FIELD"),
18112
- validate: value => {
18113
- return /^[a-zA-Z ]+$/i.test(value) ? true : t("PT_NAME_ERROR_MESSAGE");
18114
- }
18115
- },
18116
- render: ({
18117
- value,
18118
- onChange,
18119
- onBlur
18120
- }) => /*#__PURE__*/React.createElement(TextInput, {
18121
- t: t,
18122
- type: "text",
18123
- isMandatory: false,
18124
- optionKey: "i18nKey",
18125
- name: "name" + index,
18126
- value: value,
18127
- onChange: ev => {
18128
- onChange(ev.target.value);
18129
- updateState("name", index, ev.target.value);
18130
- },
18131
- disable: isUpdateProperty || isEditProperty,
18132
- onBlur: onBlur
18133
- })
18134
- }))), (touched === null || touched === void 0 ? void 0 : touched["name" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors5 = errors["name" + index]) === null || _errors5 === void 0 ? void 0 : _errors5.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18135
- style: errorStyle
18136
- }, errors === null || errors === void 0 ? void 0 : (_errors6 = errors["name" + index]) === null || _errors6 === void 0 ? void 0 : _errors6.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_LANDLINE_NUMBER_FLOATING_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
18137
- className: "form-field"
18138
- }, /*#__PURE__*/React.createElement(Controller, {
18139
- key: "altContactNumber" + index,
18140
- name: "altContactNumber" + index,
18141
- defaultValue: owner.altContactNumber,
18142
- control: control,
18143
- rules: {
18144
- required: t("REQUIRED_FIELD"),
18145
- validate: value => /^[0-9]{11}$/i.test(value) ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")
18146
- },
18147
- render: ({
18148
- value,
18149
- onChange,
18150
- onBlur
18151
- }) => /*#__PURE__*/React.createElement(MobileNumber, {
18152
- type: "text",
18153
- t: t,
18154
- maxLength: 11,
18155
- value: value,
18156
- name: "altContactNumber" + index,
18157
- onChange: value => {
18158
- onChange(value);
18159
- updateState("altContactNumber", index, value);
18160
- },
18161
- disable: isUpdateProperty || isEditProperty,
18162
- labelStyle: {
18163
- border: "1px solid #000",
18164
- borderRight: "none"
18165
- },
18166
- onBlur: onBlur
18167
- })
18168
- }))), (touched === null || touched === void 0 ? void 0 : touched["altContactNumber" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors7 = errors["altContactNumber" + index]) === null || _errors7 === void 0 ? void 0 : _errors7.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18169
- style: errorStyle
18170
- }, errors === null || errors === void 0 ? void 0 : (_errors8 = errors["altContactNumber" + index]) === null || _errors8 === void 0 ? void 0 : _errors8.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_MOBILE_NUMBER")}*`), /*#__PURE__*/React.createElement("div", {
18171
- className: "form-field"
18172
- }, /*#__PURE__*/React.createElement(Controller, {
18173
- key: "mobileNumber" + index,
18174
- name: "mobileNumber" + index,
18175
- defaultValue: owner.mobileNumber,
18176
- control: control,
18177
- rules: {
18178
- required: t("REQUIRED_FIELD"),
18179
- validate: value => /[6-9]{1}[0-9]{9}/i.test(value) ? true : t("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")
18180
- },
18181
- render: ({
18182
- value,
18183
- onChange,
18184
- onBlur
18185
- }) => /*#__PURE__*/React.createElement(MobileNumber, {
18186
- value: value,
18187
- name: "mobileNumber" + index,
18188
- onChange: value => {
18189
- onChange(value);
18190
- updateState("mobileNumber", index, value);
18191
- },
18192
- disable: isUpdateProperty || isEditProperty,
18193
- labelStyle: {
18194
- border: "1px solid #000",
18195
- borderRight: "none"
18196
- },
18197
- onBlur: onBlur
18198
- })
18199
- })), !isMobile && /*#__PURE__*/React.createElement("div", {
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]);
17851
+ const institutionTypeMenu = useMemo(() => {
17852
+ var _mdmsData$PropertyTax4, _mdmsData$PropertyTax5;
17853
+ const code = ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.code;
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 => {
17855
+ var _e$code;
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]);
17857
+ });
17858
+ const arraData = arr === null || arr === void 0 ? void 0 : arr.filter(data => {
17859
+ var _data$code, _data$code$split;
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];
17861
+ });
17862
+ return arraData === null || arraData === void 0 ? void 0 : arraData.map(e => {
17863
+ var _e$code2, _e$code2$split, _e$code3;
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]) && {
17865
+ ...e,
17866
+ i18nKey: `PT_OWNERSHIP_CATEGORY_${(_e$code3 = e.code) === null || _e$code3 === void 0 ? void 0 : _e$code3.replaceAll(".", "_")}`
17867
+ };
17868
+ });
17869
+ }, [mdmsData, ownershipCategory === null || ownershipCategory === void 0 ? void 0 : ownershipCategory.code]);
17870
+ const errorStyle = {
17871
+ width: "70%",
17872
+ marginLeft: "30%",
17873
+ fontSize: "12px",
17874
+ marginTop: "-21px"
17875
+ };
17876
+ const ismultiple = ownershipCategory !== null && ownershipCategory !== void 0 && (_ownershipCategory$co = ownershipCategory.code) !== null && _ownershipCategory$co !== void 0 && _ownershipCategory$co.includes("MULTIPLEOWNERS") ? true : false;
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");
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;
17884
+ return /*#__PURE__*/React.createElement("div", {
17885
+ key: index
17886
+ }, isMobile && ismultiple && ownerDetails.length > 1 && /*#__PURE__*/React.createElement("div", {
18200
17887
  style: {
18201
17888
  display: "flex",
18202
- justifyContent: "flex-end",
18203
- width: "20%",
18204
- alignSelf: "flex-start"
17889
+ justifyContent: "flex-end"
18205
17890
  }
18206
- }, ismultiple && /*#__PURE__*/React.createElement(LinkButton, {
17891
+ }, /*#__PURE__*/React.createElement(LinkButton, {
18207
17892
  label: /*#__PURE__*/React.createElement(DeleteIcon, {
18208
17893
  style: {
18209
- bottom: "0px"
17894
+ bottom: "5px"
18210
17895
  },
18211
17896
  fill: !(ownerDetails.length == 1) ? "#494848" : "#FAFAFA"
18212
17897
  }),
@@ -18216,66 +17901,9 @@ const PropertyOwnerDetails = ({
18216
17901
  onClick: e => {
18217
17902
  setOwnerDetails([...ownerDetails.filter((own, ind) => ind != index)]);
18218
17903
  }
18219
- }))), (touched === null || touched === void 0 ? void 0 : touched["mobileNumber" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors9 = errors["mobileNumber" + index]) === null || _errors9 === void 0 ? void 0 : _errors9.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18220
- style: errorStyle
18221
- }, errors === null || errors === void 0 ? void 0 : (_errors0 = errors["mobileNumber" + index]) === null || _errors0 === void 0 ? void 0 : _errors0.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("TL_NEW_DESIG_OWNER_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
18222
- className: "form-field"
18223
- }, /*#__PURE__*/React.createElement(Controller, {
18224
- key: "designation" + index,
18225
- name: "designation" + index,
18226
- defaultValue: owner === null || owner === void 0 ? void 0 : owner.designation,
18227
- control: control,
18228
- rules: {
18229
- required: t("REQUIRED_FIELD"),
18230
- validate: value => {
18231
- return /^[a-zA-Z ]*$/i.test(value) ? true : t("PT_NAME_ERROR_MESSAGE");
18232
- }
18233
- },
18234
- render: ({
18235
- value,
18236
- onChange,
18237
- onBlur
18238
- }) => /*#__PURE__*/React.createElement(TextInput, {
18239
- t: t,
18240
- type: "text",
18241
- isMandatory: false,
18242
- optionKey: "i18nKey",
18243
- name: "designation" + index,
18244
- value: value,
18245
- onChange: ev => {
18246
- onChange(ev.target.value);
18247
- updateState("designation", index, ev.target.value);
18248
- },
18249
- disable: isUpdateProperty || isEditProperty,
18250
- onBlur: onBlur
18251
- })
18252
- }))), (touched === null || touched === void 0 ? void 0 : touched["designation" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors1 = errors["designation" + index]) === null || _errors1 === void 0 ? void 0 : _errors1.message) && /*#__PURE__*/React.createElement(CardLabelError, {
18253
- style: errorStyle
18254
- }, errors === null || errors === void 0 ? void 0 : (_errors10 = errors["designation" + 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", {
18255
- className: "form-field"
18256
- }, /*#__PURE__*/React.createElement(TextArea, {
18257
- isMandatory: false,
18258
- optionKey: "i18nKey",
18259
- t: t,
18260
- disabled: (ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index = ownerDetails[index]) === null || _ownerDetails$index === void 0 ? void 0 : _ownerDetails$index.isCoresAddr) === true,
18261
- name: "address" + index,
18262
- onChange: e => {
18263
- var _ownerDetails$index2;
18264
- if (!((ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index2 = ownerDetails[index]) === null || _ownerDetails$index2 === void 0 ? void 0 : _ownerDetails$index2.isCoresAddr) === true)) {
18265
- updateState("permanentAddress", index, e.target.value);
18266
- }
18267
- },
18268
- value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index3 = ownerDetails[index]) === null || _ownerDetails$index3 === void 0 ? void 0 : _ownerDetails$index3.permanentAddress
18269
- }))), /*#__PURE__*/React.createElement(CheckBox, {
18270
- className: "form-field",
18271
- label: `${t("PT_COMMON_SAME_AS_PROPERTY_ADDRESS")}`,
18272
- onChange: e => setCorrespondenceAddress(e, index),
18273
- value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index4 = ownerDetails[index]) === null || _ownerDetails$index4 === void 0 ? void 0 : _ownerDetails$index4.isCoresAddr,
18274
- checked: (ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index5 = ownerDetails[index]) === null || _ownerDetails$index5 === void 0 ? void 0 : _ownerDetails$index5.isCoresAddr) || false,
18275
- style: window.location.href.includes("/citizen/") ? {
18276
- paddingTop: "10px"
18277
- } : {}
18278
- })) : /*#__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", {
18279
17907
  className: "form-field"
18280
17908
  }, /*#__PURE__*/React.createElement(Controller, {
18281
17909
  key: "mobileNumber" + index,
@@ -18324,9 +17952,9 @@ const PropertyOwnerDetails = ({
18324
17952
  onClick: e => {
18325
17953
  setOwnerDetails([...ownerDetails.filter((own, ind) => ind != index)]);
18326
17954
  }
18327
- }))), (touched === null || touched === void 0 ? void 0 : touched["mobileNumber" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors11 = errors["mobileNumber" + index]) === null || _errors11 === void 0 ? void 0 : _errors11.message) && /*#__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, {
18328
17956
  style: errorStyle
18329
- }, errors === null || errors === void 0 ? void 0 : (_errors12 = errors["mobileNumber" + index]) === null || _errors12 === void 0 ? void 0 : _errors12.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", {
18330
17958
  className: "form-field"
18331
17959
  }, /*#__PURE__*/React.createElement(Controller, {
18332
17960
  key: "name" + index,
@@ -18357,9 +17985,9 @@ const PropertyOwnerDetails = ({
18357
17985
  disable: isUpdateProperty || isEditProperty,
18358
17986
  onBlur: onBlur
18359
17987
  })
18360
- }))), (touched === null || touched === void 0 ? void 0 : touched["name" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors13 = errors["name" + index]) === null || _errors13 === void 0 ? void 0 : _errors13.message) && /*#__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, {
18361
17989
  style: errorStyle
18362
- }, errors === null || errors === void 0 ? void 0 : (_errors14 = errors["name" + index]) === null || _errors14 === void 0 ? void 0 : _errors14.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", {
18363
17991
  className: "form-field"
18364
17992
  }, /*#__PURE__*/React.createElement(Controller, {
18365
17993
  key: "gender" + index,
@@ -18387,9 +18015,9 @@ const PropertyOwnerDetails = ({
18387
18015
  isDropDown: window.location.href.includes("/employee") ? true : false,
18388
18016
  onBlur: onBlur
18389
18017
  })
18390
- }))), (touched === null || touched === void 0 ? void 0 : touched["gender" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors15 = errors["gender" + index]) === null || _errors15 === void 0 ? void 0 : _errors15.message) && /*#__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, {
18391
18019
  style: errorStyle
18392
- }, errors === null || errors === void 0 ? void 0 : (_errors16 = errors["gender" + index]) === null || _errors16 === void 0 ? void 0 : _errors16.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", {
18393
18021
  className: "form-field"
18394
18022
  }, /*#__PURE__*/React.createElement(Controller, {
18395
18023
  key: "fatherOrHusbandName" + index,
@@ -18418,9 +18046,9 @@ const PropertyOwnerDetails = ({
18418
18046
  disable: isUpdateProperty || isEditProperty,
18419
18047
  onBlur: onBlur
18420
18048
  })
18421
- }))), (touched === null || touched === void 0 ? void 0 : touched["fatherOrHusbandName" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors17 = errors["fatherOrHusbandName" + index]) === null || _errors17 === void 0 ? void 0 : _errors17.message) && /*#__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, {
18422
18050
  style: errorStyle
18423
- }, errors === null || errors === void 0 ? void 0 : (_errors18 = errors["fatherOrHusbandName" + index]) === null || _errors18 === void 0 ? void 0 : _errors18.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", {
18424
18052
  className: "form-field"
18425
18053
  }, /*#__PURE__*/React.createElement(Controller, {
18426
18054
  key: "relationship" + index,
@@ -18448,9 +18076,9 @@ const PropertyOwnerDetails = ({
18448
18076
  isDropDown: window.location.href.includes("/employee") ? true : false,
18449
18077
  onBlur: onBlur
18450
18078
  })
18451
- }))), (touched === null || touched === void 0 ? void 0 : touched["relationship" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors19 = errors["relationship" + index]) === null || _errors19 === void 0 ? void 0 : _errors19.message) && /*#__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, {
18452
18080
  style: errorStyle
18453
- }, errors === null || errors === void 0 ? void 0 : (_errors20 = errors["relationship" + index]) === null || _errors20 === void 0 ? void 0 : _errors20.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, {
18454
18082
  className: ""
18455
18083
  }, `${t("PT_SPECIAL_APPLICANT_CATEGORY")}*`), /*#__PURE__*/React.createElement("div", {
18456
18084
  className: "form-field"
@@ -18478,33 +18106,24 @@ const PropertyOwnerDetails = ({
18478
18106
  t: t,
18479
18107
  onBlur: onBlur
18480
18108
  })
18481
- }))), (touched === null || touched === void 0 ? void 0 : touched["ownerType" + index]) && (errors === null || errors === void 0 ? void 0 : (_errors21 = errors["ownerType" + index]) === null || _errors21 === void 0 ? void 0 : _errors21.message) && /*#__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, {
18482
18110
  style: errorStyle
18483
- }, errors === null || errors === void 0 ? void 0 : (_errors22 = errors["ownerType" + index]) === null || _errors22 === void 0 ? void 0 : _errors22.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", {
18484
18112
  className: "form-field"
18485
18113
  }, /*#__PURE__*/React.createElement(TextArea, {
18486
18114
  isMandatory: false,
18487
18115
  optionKey: "i18nKey",
18488
18116
  t: t,
18489
- 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,
18490
18118
  name: "address" + index,
18491
18119
  onChange: e => {
18492
- var _ownerDetails$index7;
18493
- 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)) {
18494
18122
  updateState("permanentAddress", index, e.target.value);
18495
18123
  }
18496
18124
  },
18497
- value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index8 = ownerDetails[index]) === null || _ownerDetails$index8 === void 0 ? void 0 : _ownerDetails$index8.permanentAddress
18498
- }))), /*#__PURE__*/React.createElement(CheckBox, {
18499
- className: "form-field",
18500
- label: `${t("PT_COMMON_SAME_AS_PROPERTY_ADDRESS")}`,
18501
- onChange: e => setCorrespondenceAddress(e, index),
18502
- value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index9 = ownerDetails[index]) === null || _ownerDetails$index9 === void 0 ? void 0 : _ownerDetails$index9.isCoresAddr,
18503
- checked: (ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index0 = ownerDetails[index]) === null || _ownerDetails$index0 === void 0 ? void 0 : _ownerDetails$index0.isCoresAddr) || false,
18504
- style: window.location.href.includes("/citizen/") ? {
18505
- paddingTop: "10px"
18506
- } : {}
18507
- })));
18125
+ value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index3 = ownerDetails[index]) === null || _ownerDetails$index3 === void 0 ? void 0 : _ownerDetails$index3.permanentAddress
18126
+ }))))));
18508
18127
  }), ismultiple ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
18509
18128
  style: {
18510
18129
  display: "flex",
@@ -18538,6 +18157,319 @@ const PropertyOwnerDetails = ({
18538
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);
18539
18158
  };
18540
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
+
18541
18473
  const SwitchComponent = props => {
18542
18474
  return /*#__PURE__*/React.createElement("div", {
18543
18475
  className: "w-fullwidth PropertySearchFormSwitcher"
@@ -18820,7 +18752,7 @@ const getAction = flow => {
18820
18752
  actions = [];
18821
18753
  break;
18822
18754
  case "WS":
18823
- 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'];
18824
18756
  break;
18825
18757
  case "TL":
18826
18758
  actions = ['TL_COMMON_TR_DETAILS', 'TL_LOCATION_AND_OWNER_DETAILS', 'TL_DOCUMENT_DETAIL', 'TL_COMMON_SUMMARY'];
@@ -19064,7 +18996,7 @@ const PropertyDetails = ({
19064
18996
  }))));
19065
18997
  };
19066
18998
 
19067
- const getAddress$1 = (address, t) => {
18999
+ const getAddress = (address, t) => {
19068
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}` : " "}`;
19069
19001
  };
19070
19002
  const PropertySearchNSummary = ({
@@ -19076,7 +19008,7 @@ const PropertySearchNSummary = ({
19076
19008
  formState,
19077
19009
  clearErrors
19078
19010
  }) => {
19079
- 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;
19080
19012
  const {
19081
19013
  t
19082
19014
  } = useTranslation();
@@ -19151,11 +19083,10 @@ const PropertySearchNSummary = ({
19151
19083
  if (isEditScreen) {
19152
19084
  return /*#__PURE__*/React.createElement(React.Fragment, null);
19153
19085
  }
19154
- const redirectBackUrl = window.location.pathname;
19155
19086
  let propertyAddress = "";
19156
19087
  if (propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length) {
19157
19088
  var _propertyDetails$Prop2;
19158
- 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);
19159
19090
  }
19160
19091
  const getInputStyles = () => {
19161
19092
  if (window.location.href.includes("/ws/")) {
@@ -19174,8 +19105,9 @@ const PropertySearchNSummary = ({
19174
19105
  return getOwnersList ? getOwnersList : t("NA");
19175
19106
  };
19176
19107
  if (window.location.href.includes("/ws/")) ;
19177
- return /*#__PURE__*/React.createElement(Card, {
19178
- className: "no-shadow"
19108
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
19109
+ title: t("PT_PROPERTY_DETAILS"),
19110
+ defaultOpen: true
19179
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, {
19180
19112
  style: getInputStyles()
19181
19113
  }, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
@@ -19195,7 +19127,8 @@ const PropertySearchNSummary = ({
19195
19127
  style: {
19196
19128
  width: "80%",
19197
19129
  float: "left"
19198
- }
19130
+ },
19131
+ placeholder: `${t("PT_ENTER_PROPERTY_ID")}`
19199
19132
  }), /*#__PURE__*/React.createElement("button", {
19200
19133
  className: "submit-bar",
19201
19134
  type: "button",
@@ -19203,56 +19136,72 @@ const PropertySearchNSummary = ({
19203
19136
  color: "white"
19204
19137
  },
19205
19138
  onClick: searchProperty
19206
- }, `${t("PT_SEARCH")}`))), /*#__PURE__*/React.createElement("span", {
19207
- onClick: () => history.push(`/digit-ui/employee/commonpt/search?redirectToUrl=${redirectBackUrl}&${serachParams}`, {
19208
- ...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
19209
19143
  })
19210
- }, /*#__PURE__*/React.createElement(LinkButton, {
19211
- label: t("CPT_SEARCH_PROPERTY"),
19144
+ }, /*#__PURE__*/React.createElement("button", {
19145
+ className: "submit-bar",
19146
+ type: "button",
19212
19147
  style: {
19213
- color: "#a82227",
19214
- display: "inline-block"
19148
+ color: "white"
19215
19149
  }
19216
- })), "\xA0 | \xA0", /*#__PURE__*/React.createElement("span", {
19217
- onClick: () => history.push(`/digit-ui/employee/commonpt/new-application?redirectToUrl=${redirectBackUrl}&${serachParams}`, {
19218
- ...state
19219
- })
19220
- }, /*#__PURE__*/React.createElement(LinkButton, {
19221
- 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",
19222
19152
  style: {
19223
- color: "#a82227",
19224
- display: "inline-block"
19153
+ margin: "16px 0px",
19154
+ padding: "20px",
19155
+ boxShadow: "none"
19225
19156
  }
19226
- })), propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("header", {
19227
- className: "card-section-header",
19157
+ }, /*#__PURE__*/React.createElement(StatusTable, {
19228
19158
  style: {
19229
- marginBottom: "5px",
19230
- marginTop: "20px"
19159
+ padding: "0",
19160
+ margin: "0"
19231
19161
  }
19232
- }, t("PT_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement("div", {
19162
+ }, /*#__PURE__*/React.createElement("div", {
19233
19163
  className: "formcomposer-section-grid",
19234
19164
  style: isMobile ? {} : {}
19235
19165
  }, /*#__PURE__*/React.createElement(Row, {
19236
19166
  className: "border-none",
19237
19167
  labelStyle: isMobile ? {
19238
19168
  width: "40%"
19239
- } : {},
19169
+ } : {
19170
+ width: "30%",
19171
+ color: "#505a5f",
19172
+ fontWeight: "600"
19173
+ },
19174
+ textStyle: {
19175
+ color: "#000"
19176
+ },
19240
19177
  label: t(`PROPERTY_ID`),
19241
19178
  text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3.propertyId
19242
19179
  }), /*#__PURE__*/React.createElement(Row, {
19243
19180
  className: "border-none",
19244
19181
  labelStyle: isMobile ? {
19245
19182
  width: "40%"
19246
- } : {},
19183
+ } : {
19184
+ width: "30%",
19185
+ color: "#505a5f",
19186
+ fontWeight: "600"
19187
+ },
19188
+ textStyle: {
19189
+ color: "#000"
19190
+ },
19247
19191
  label: t(`OWNER_NAME`),
19248
19192
  text: getOwnerNames(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0])
19249
19193
  }), /*#__PURE__*/React.createElement(Row, {
19250
19194
  className: "border-none",
19251
19195
  labelStyle: isMobile ? {
19252
19196
  width: "40%"
19253
- } : {},
19197
+ } : {
19198
+ width: "30%",
19199
+ color: "#505a5f",
19200
+ fontWeight: "600"
19201
+ },
19254
19202
  textStyle: {
19255
- wordBreak: "break-word"
19203
+ wordBreak: "break-word",
19204
+ color: "#000"
19256
19205
  },
19257
19206
  label: t(`PROPERTY_ADDRESS`),
19258
19207
  text: propertyAddress,
@@ -19276,15 +19225,7 @@ const PropertySearchNSummary = ({
19276
19225
  isArray: false
19277
19226
  }
19278
19227
  }
19279
- }))), /*#__PURE__*/React.createElement(Link, {
19280
- 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"}`
19281
- }, /*#__PURE__*/React.createElement(LinkButton, {
19282
- label: t("CPT_COMPLETE_PROPERTY_DETAILS"),
19283
- style: {
19284
- color: "#a82227",
19285
- textAlign: "Left"
19286
- }
19287
- }))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
19228
+ }))))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
19288
19229
  isDleteBtn: true,
19289
19230
  labelstyle: {
19290
19231
  width: "100%"
@@ -19331,6 +19272,7 @@ const componentsToRegister = {
19331
19272
  CPTPropertyAssemblyDetails: PropertyAssemblyDetails,
19332
19273
  CPTPropertyLocationDetails: PropertyLocationDetails,
19333
19274
  CPTPropertyOwnerDetails: PropertyOwnerDetails,
19275
+ PropertyWaterConnection,
19334
19276
  CPTKnowYourProperty: KnowYourProperty,
19335
19277
  CPTPropertyDetails: PropertyDetails,
19336
19278
  CPTPropertySearchNSummary: PropertySearchNSummary,