@djb25/digit-ui-module-commonpt 1.0.3 → 1.0.5

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, ViewsIcon, BreakLine, Table, TelePhone, DisplayPhotos, EditIcon, 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
+ zroLocation: (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
@@ -13923,10 +13999,11 @@ function PropertyDocuments({
13923
13999
  const [filesArray, setFilesArray] = useState(() => []);
13924
14000
  const tenantId = Digit.ULBService.getCurrentTenantId();
13925
14001
  const [pdfFiles, setPdfFiles] = useState({});
14002
+ const [modalFile, setModalFile] = useState(null);
13926
14003
  useEffect(() => {
13927
14004
  var _acc;
13928
14005
  let acc = [];
13929
- documents === null || documents === void 0 ? void 0 : documents.forEach((element, index, array) => {
14006
+ documents === null || documents === void 0 ? void 0 : documents.forEach(element => {
13930
14007
  acc = [...acc, ...(element.values ? element.values : [])];
13931
14008
  });
13932
14009
  setFilesArray((_acc = acc) === null || _acc === void 0 ? void 0 : _acc.map(value => value === null || value === void 0 ? void 0 : value.fileStoreId));
@@ -13944,12 +14021,170 @@ function PropertyDocuments({
13944
14021
  }
13945
14022
  }, [filesArray]);
13946
14023
  const checkLocation = window.location.href.includes("employee/tl") || window.location.href.includes("/obps") || window.location.href.includes("employee/ws");
14024
+ const isWSLocation = window.location.href.includes("employee/ws");
13947
14025
  const isStakeholderApplication = window.location.href.includes("stakeholder");
14026
+ const getDocSubType = documentType => {
14027
+ if (!documentType) return "";
14028
+ const parts = documentType.split(".");
14029
+ const last = parts[parts.length - 1] || "";
14030
+ return last.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
14031
+ };
14032
+ const renderModal = () => {
14033
+ if (!modalFile) return null;
14034
+ const isPdf = modalFile.toLowerCase().includes(".pdf") || modalFile.toLowerCase().includes("pdf");
14035
+ return /*#__PURE__*/React.createElement(Modal, {
14036
+ headerBarMain: /*#__PURE__*/React.createElement("h1", {
14037
+ className: "heading-m"
14038
+ }, "Document Preview"),
14039
+ headerBarEnd: /*#__PURE__*/React.createElement("div", {
14040
+ onClick: () => setModalFile(null),
14041
+ style: {
14042
+ cursor: "pointer",
14043
+ padding: "5px",
14044
+ marginTop: "-5px"
14045
+ }
14046
+ }, /*#__PURE__*/React.createElement("svg", {
14047
+ xmlns: "http://www.w3.org/2000/svg",
14048
+ viewBox: "0 0 24 24",
14049
+ fill: "#000000",
14050
+ width: "24px",
14051
+ height: "24px"
14052
+ }, /*#__PURE__*/React.createElement("path", {
14053
+ d: "M0 0h24v24H0V0z",
14054
+ fill: "none"
14055
+ }), /*#__PURE__*/React.createElement("path", {
14056
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
14057
+ }))),
14058
+ hideSubmit: true,
14059
+ popupStyles: {
14060
+ maxWidth: "80vw",
14061
+ width: "100%"
14062
+ },
14063
+ popupModuleMianStyles: {
14064
+ display: "flex",
14065
+ justifyContent: "center",
14066
+ alignItems: "center",
14067
+ padding: "0",
14068
+ overflowY: "hidden"
14069
+ }
14070
+ }, isPdf ? /*#__PURE__*/React.createElement("iframe", {
14071
+ src: modalFile,
14072
+ title: "Document Preview",
14073
+ style: {
14074
+ width: "100%",
14075
+ height: "80vh",
14076
+ border: "none",
14077
+ display: "block"
14078
+ }
14079
+ }) : /*#__PURE__*/React.createElement("img", {
14080
+ src: modalFile,
14081
+ alt: "Document Preview",
14082
+ style: {
14083
+ maxWidth: "100%",
14084
+ maxHeight: "80vh",
14085
+ objectFit: "contain",
14086
+ display: "block"
14087
+ }
14088
+ }));
14089
+ };
14090
+ const renderDocumentRow = (value, index) => {
14091
+ var _pdfFiles$value$fileS;
14092
+ const fileUrl = (_pdfFiles$value$fileS = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS === void 0 ? void 0 : _pdfFiles$value$fileS.split(",")[0];
14093
+ const docSubType = getDocSubType(value === null || value === void 0 ? void 0 : value.documentType);
14094
+ const docUid = (value === null || value === void 0 ? void 0 : value.documentUid) || "";
14095
+ const isPhoto = value === null || value === void 0 ? void 0 : value.isPhoto;
14096
+ let typeLabel = "";
14097
+ let numLabel = "";
14098
+ let uploadLabel = "";
14099
+ if (value.title === "WS_IDENTITY_PROOF") {
14100
+ typeLabel = "Identity Proof*";
14101
+ numLabel = "Identity Proof Document Number";
14102
+ uploadLabel = "Upload Identity Proof Document*";
14103
+ } else if (value.title === "WS_OWNERSHIP_PROOF") {
14104
+ typeLabel = "Ownership Proof*";
14105
+ numLabel = "Ownership Proof Document Number";
14106
+ uploadLabel = "Upload Ownership Proof*";
14107
+ } else if (value.title === "WS_OTHER_DOCUMENTS") {
14108
+ typeLabel = "Other Documents*";
14109
+ numLabel = "Other Document Number";
14110
+ uploadLabel = "Upload Other Documents*";
14111
+ } else if (value.title === "WS_APPLICANT_PHOTO") {
14112
+ uploadLabel = "Upload Applicant Photo*";
14113
+ } else {
14114
+ typeLabel = ((value === null || value === void 0 ? void 0 : value.categoryLabel) || "Document") + "*";
14115
+ numLabel = "Document Number";
14116
+ uploadLabel = "Upload Document*";
14117
+ }
14118
+ return /*#__PURE__*/React.createElement("div", {
14119
+ key: index,
14120
+ style: {
14121
+ marginBottom: "24px"
14122
+ }
14123
+ }, /*#__PURE__*/React.createElement(StatusTable, null, !isPhoto && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
14124
+ label: typeLabel,
14125
+ text: docSubType || t("NA")
14126
+ }), /*#__PURE__*/React.createElement(Row, {
14127
+ label: numLabel,
14128
+ text: docUid || t("NA")
14129
+ })), /*#__PURE__*/React.createElement(Row, {
14130
+ label: uploadLabel,
14131
+ text: /*#__PURE__*/React.createElement("div", {
14132
+ style: {
14133
+ display: "flex",
14134
+ alignItems: "center",
14135
+ gap: "16px"
14136
+ }
14137
+ }, isPhoto ? fileUrl ? /*#__PURE__*/React.createElement("div", {
14138
+ style: {
14139
+ position: "relative"
14140
+ }
14141
+ }, /*#__PURE__*/React.createElement("img", {
14142
+ src: fileUrl,
14143
+ alt: "Applicant Photo",
14144
+ style: {
14145
+ width: "100px",
14146
+ height: "100px",
14147
+ objectFit: "cover",
14148
+ borderRadius: "4px",
14149
+ border: "1px solid #ccc"
14150
+ }
14151
+ })) : /*#__PURE__*/React.createElement("div", {
14152
+ style: {
14153
+ fontSize: "14px",
14154
+ color: "#505A5F"
14155
+ }
14156
+ }, t("NA")) : /*#__PURE__*/React.createElement("div", {
14157
+ onClick: () => {
14158
+ if (fileUrl) setModalFile(fileUrl);
14159
+ },
14160
+ disabled: !fileUrl,
14161
+ style: {
14162
+ cursor: "pointer"
14163
+ }
14164
+ }, /*#__PURE__*/React.createElement(ViewsIcon, null)), !isPhoto && /*#__PURE__*/React.createElement("label", {
14165
+ style: {
14166
+ display: "flex",
14167
+ alignItems: "center",
14168
+ gap: "8px",
14169
+ fontSize: "14px",
14170
+ color: "#0B0C0C",
14171
+ margin: 0
14172
+ }
14173
+ }, /*#__PURE__*/React.createElement("input", {
14174
+ type: "checkbox",
14175
+ style: {
14176
+ width: "18px",
14177
+ height: "18px",
14178
+ accentColor: "#F47738"
14179
+ }
14180
+ }), "Check Verified"))
14181
+ })));
14182
+ };
13948
14183
  return /*#__PURE__*/React.createElement("div", {
13949
14184
  style: {
13950
14185
  marginTop: "19px"
13951
14186
  }
13952
- }, !isStakeholderApplication && (documents === null || documents === void 0 ? void 0 : documents.map((document, index) => {
14187
+ }, renderModal(), !isStakeholderApplication && (documents === null || documents === void 0 ? void 0 : documents.map((document, index) => {
13953
14188
  var _document$values;
13954
14189
  return /*#__PURE__*/React.createElement(React.Fragment, {
13955
14190
  key: index
@@ -13957,7 +14192,7 @@ function PropertyDocuments({
13957
14192
  style: checkLocation ? {
13958
14193
  marginTop: "32px",
13959
14194
  marginBottom: "18px",
13960
- color: "#0B0C0C, 100%",
14195
+ color: "#0B0C0C",
13961
14196
  fontSize: "24px",
13962
14197
  lineHeight: "30px"
13963
14198
  } : {
@@ -13966,17 +14201,21 @@ function PropertyDocuments({
13966
14201
  color: "#505A5F",
13967
14202
  fontSize: "24px"
13968
14203
  }
13969
- }, t(document === null || document === void 0 ? void 0 : document.title)) : null, /*#__PURE__*/React.createElement("div", {
14204
+ }, t(document === null || document === void 0 ? void 0 : document.title)) : null, isWSLocation ? /*#__PURE__*/React.createElement("div", {
14205
+ style: {
14206
+ marginTop: "8px"
14207
+ }
14208
+ }, document !== null && document !== void 0 && document.values && (document === null || document === void 0 ? void 0 : document.values.length) > 0 ? document.values.map((value, idx) => renderDocumentRow(value, idx)) : !window.location.href.includes("citizen") && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, t("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))) : /*#__PURE__*/React.createElement("div", {
13970
14209
  style: {
13971
14210
  display: "flex",
13972
14211
  flexWrap: "wrap",
13973
14212
  justifyContent: "flex-start"
13974
14213
  }
13975
14214
  }, document !== null && document !== void 0 && document.values && (document === null || document === void 0 ? void 0 : document.values.length) > 0 ? document === null || document === void 0 ? void 0 : (_document$values = document.values) === null || _document$values === void 0 ? void 0 : _document$values.map((value, index) => {
13976
- var _pdfFiles$value$fileS, _value$documentType;
14215
+ var _pdfFiles$value$fileS2, _value$documentType;
13977
14216
  return /*#__PURE__*/React.createElement("a", {
13978
14217
  target: "_",
13979
- href: (_pdfFiles$value$fileS = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS === void 0 ? void 0 : _pdfFiles$value$fileS.split(",")[0],
14218
+ href: (_pdfFiles$value$fileS2 = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS2 === void 0 ? void 0 : _pdfFiles$value$fileS2.split(",")[0],
13980
14219
  style: {
13981
14220
  minWidth: "80px",
13982
14221
  marginRight: "10px",
@@ -14023,10 +14262,10 @@ function PropertyDocuments({
14023
14262
  fontSize: "24px"
14024
14263
  }
14025
14264
  }, t(document === null || document === void 0 ? void 0 : document.title)) : null, /*#__PURE__*/React.createElement("div", null, document !== null && document !== void 0 && document.values && (document === null || document === void 0 ? void 0 : document.values.length) > 0 ? document === null || document === void 0 ? void 0 : (_document$values2 = document.values) === null || _document$values2 === void 0 ? void 0 : _document$values2.map((value, index) => {
14026
- var _pdfFiles$value$fileS2;
14265
+ var _pdfFiles$value$fileS3;
14027
14266
  return /*#__PURE__*/React.createElement("a", {
14028
14267
  target: "_",
14029
- href: (_pdfFiles$value$fileS2 = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS2 === void 0 ? void 0 : _pdfFiles$value$fileS2.split(",")[0],
14268
+ href: (_pdfFiles$value$fileS3 = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS3 === void 0 ? void 0 : _pdfFiles$value$fileS3.split(",")[0],
14030
14269
  style: {
14031
14270
  minWidth: svgStyles !== null && svgStyles !== void 0 && svgStyles.minWidth ? svgStyles === null || svgStyles === void 0 ? void 0 : svgStyles.minWidth : "160px",
14032
14271
  marginRight: "20px"
@@ -14789,12 +15028,11 @@ const WSAdditonalDetails = ({
14789
15028
  wsAdditionalDetails,
14790
15029
  oldValue
14791
15030
  }) => {
14792
- var _wsAdditionalDetails$, _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4;
15031
+ var _wsAdditionalDetails$;
14793
15032
  const {
14794
15033
  t
14795
15034
  } = useTranslation();
14796
15035
  let filters = getQueryStringParams(location.search);
14797
- const isModify = filters === null || filters === void 0 ? void 0 : filters.mode;
14798
15036
  var {
14799
15037
  connectionDetails,
14800
15038
  plumberDetails,
@@ -14823,50 +15061,6 @@ const WSAdditonalDetails = ({
14823
15061
  label: `${t(`${value.title}`)}`,
14824
15062
  text: value !== null && value !== void 0 && value.oldValue ? value === null || value === void 0 ? void 0 : value.oldValue : value !== null && value !== void 0 && value.value ? value === null || value === void 0 ? void 0 : value.value : ""
14825
15063
  }));
14826
- })))), (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$2 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$2 === void 0 ? void 0 : _wsAdditionalDetails$2.plumberDetails) && isModify != "MODIFY" && /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(CardSubHeader, {
14827
- style: cardSubHeaderStyles()
14828
- }, t("WS_COMMON_PLUMBER_DETAILS")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
14829
- className: "plumber-details-new-value-wrapper"
14830
- }, plumberDetails === null || plumberDetails === void 0 ? void 0 : plumberDetails.map((value, index) => {
14831
- return /*#__PURE__*/React.createElement(Row, {
14832
- className: "border-none",
14833
- key: `${value.title}`,
14834
- label: `${t(`${value.title}`)}`,
14835
- text: value !== null && value !== void 0 && value.oldValue ? value === null || value === void 0 ? void 0 : value.oldValue : value !== null && value !== void 0 && value.value ? value === null || value === void 0 ? void 0 : value.value : "",
14836
- privacy: value.privacy
14837
- });
14838
- })))), (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$3 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$3 === void 0 ? void 0 : _wsAdditionalDetails$3.roadCuttingDetails) && isModify != "MODIFY" && /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(CardSubHeader, {
14839
- style: cardSubHeaderStyles()
14840
- }, t("WS_ROAD_CUTTING_DETAILS")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
14841
- className: "plumber-details-new-value-wrapper"
14842
- }, roadCuttingDetails === null || roadCuttingDetails === void 0 ? void 0 : roadCuttingDetails.map((value, index) => {
14843
- var _value$values;
14844
- return /*#__PURE__*/React.createElement("div", {
14845
- key: index,
14846
- style: (roadCuttingDetails === null || roadCuttingDetails === void 0 ? void 0 : roadCuttingDetails.length) > 1 ? {
14847
- border: "1px solid #D6D5D4",
14848
- background: "#FAFAFA",
14849
- borderRadius: "4px",
14850
- padding: "10px 10px 0px 10px",
14851
- margin: "5px 0px"
14852
- } : {}
14853
- }, value === null || value === void 0 ? void 0 : (_value$values = value.values) === null || _value$values === void 0 ? void 0 : _value$values.map(roadValue => /*#__PURE__*/React.createElement(Row, {
14854
- className: "border-none",
14855
- key: `${roadValue.title}`,
14856
- label: `${t(`${roadValue.title}`)}`,
14857
- text: roadValue !== null && roadValue !== void 0 && roadValue.oldValue ? roadValue === null || roadValue === void 0 ? void 0 : roadValue.oldValue : roadValue !== null && roadValue !== void 0 && roadValue.value ? roadValue === null || roadValue === void 0 ? void 0 : roadValue.value : ""
14858
- })));
14859
- })))), (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$4 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$4 === void 0 ? void 0 : _wsAdditionalDetails$4.activationDetails) && /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(CardSubHeader, {
14860
- style: cardSubHeaderStyles()
14861
- }, t("WS_ACTIVATION_DETAILS")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
14862
- className: "plumber-details-new-value-wrapper"
14863
- }, activationDetails === null || activationDetails === void 0 ? void 0 : activationDetails.map((value, index) => {
14864
- return /*#__PURE__*/React.createElement(Row, {
14865
- className: "border-none",
14866
- key: `${value.title}`,
14867
- label: `${t(`${value.title}`)}`,
14868
- text: value !== null && value !== void 0 && value.oldValue ? value === null || value === void 0 ? void 0 : value.oldValue : value !== null && value !== void 0 && value.value ? value === null || value === void 0 ? void 0 : value.value : ""
14869
- });
14870
15064
  }))))));
14871
15065
  };
14872
15066
 
@@ -16062,7 +16256,7 @@ function ApplicationDetailsContent({
16062
16256
  fontSize: "24px"
16063
16257
  } : {
16064
16258
  marginBottom: "16px",
16065
- marginTop: "32px",
16259
+ marginTop: "16px",
16066
16260
  fontSize: "24px"
16067
16261
  }
16068
16262
  }, 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 +17171,7 @@ const NewApplication = ({
16977
17171
  const search = useLocation().search;
16978
17172
  const redirectUrl = new URLSearchParams(search).get('redirectToUrl');
16979
17173
  const createProperty = async () => {
16980
- history.push(`${match.path}/acknowledgement`);
17174
+ history.push(`${match.path}/save-property`);
16981
17175
  };
16982
17176
  const onSuccess = () => {
16983
17177
  clearParams();
@@ -16992,7 +17186,6 @@ const NewApplication = ({
16992
17186
  }, /*#__PURE__*/React.createElement(CreatePropertyForm, {
16993
17187
  onSubmit: createProperty,
16994
17188
  value: params,
16995
- redirectUrl: redirectUrl,
16996
17189
  userType: "employee"
16997
17190
  })), /*#__PURE__*/React.createElement(Route, {
16998
17191
  exact: true,
@@ -17000,7 +17193,6 @@ const NewApplication = ({
17000
17193
  }, /*#__PURE__*/React.createElement(PTAcknowledgement, {
17001
17194
  data: params,
17002
17195
  onSuccess: onSuccess,
17003
- redirectUrl: redirectUrl,
17004
17196
  userType: "employee"
17005
17197
  })));
17006
17198
  };
@@ -17226,7 +17418,7 @@ const EmployeeApp = ({
17226
17418
  show: true
17227
17419
  }];
17228
17420
  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", {
17421
+ return /*#__PURE__*/React.createElement("div", {
17230
17422
  className: "ground-container"
17231
17423
  }, /*#__PURE__*/React.createElement("div", {
17232
17424
  style: locationCheck ? {
@@ -17234,7 +17426,7 @@ const EmployeeApp = ({
17234
17426
  } : {}
17235
17427
  }, /*#__PURE__*/React.createElement(BreadCrumb, {
17236
17428
  crumbs: crumbs
17237
- })), /*#__PURE__*/React.createElement(PrivateRoute, {
17429
+ })), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
17238
17430
  exact: true,
17239
17431
  path: `${path}/`,
17240
17432
  component: () => /*#__PURE__*/React.createElement(CommonPTLinks, {
@@ -17243,16 +17435,18 @@ const EmployeeApp = ({
17243
17435
  })
17244
17436
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
17245
17437
  path: `${path}/new-application`,
17246
- component: () => /*#__PURE__*/React.createElement(NewApplication, {
17247
- parentUrl: url
17248
- })
17438
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
17439
+ layoutClass: "action"
17440
+ }, /*#__PURE__*/React.createElement(NewApplication, {
17441
+ path: path
17442
+ }))
17249
17443
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
17250
17444
  path: `${path}/search`,
17251
- component: () => /*#__PURE__*/React.createElement(Search, null)
17445
+ component: Search
17252
17446
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
17253
17447
  path: `${path}/view-property`,
17254
- component: () => /*#__PURE__*/React.createElement(ViewProperty, null)
17255
- }))));
17448
+ component: ViewProperty
17449
+ })));
17256
17450
  };
17257
17451
 
17258
17452
  const PropertyAssemblyDetails = ({
@@ -17278,7 +17472,7 @@ const PropertyAssemblyDetails = ({
17278
17472
  } : formData === null || formData === void 0 ? void 0 : formData.usageCategoryMajor
17279
17473
  });
17280
17474
  const [focusField, setFocusField] = React.useState("");
17281
- let tenantId = "dl.djb";
17475
+ let tenantId = Digit.ULBService.getCurrentTenantId();
17282
17476
  const [isErrors, setIsErrors] = useState(false);
17283
17477
  const isMobile = window.Digit.Utils.browser.isMobile();
17284
17478
  let proptype = [];
@@ -17287,7 +17481,6 @@ const PropertyAssemblyDetails = ({
17287
17481
  data: Menu = [],
17288
17482
  isLoading
17289
17483
  } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", "PTPropertyType") || {};
17290
- console.log("PropertyType Menu Data (transformed):", Menu);
17291
17484
  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
17485
  const {
17293
17486
  data: Menu1 = [],
@@ -17296,53 +17489,30 @@ const PropertyAssemblyDetails = ({
17296
17489
  console.log("UsageCategory Menu Data (transformed):", Menu1);
17297
17490
  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
17491
  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
- }
17492
+ let menu = [];
17493
+ if (Array.isArray(proptype) && proptype.length > 0) {
17494
+ for (let i = 0; i < proptype.length; i++) {
17495
+ if (i != 1 && i != 4) menu.push({
17496
+ i18nKey: "COMMON_PROPTYPE_" + stringReplaceAll(proptype[i].code, ".", "_"),
17497
+ code: proptype[i].code
17498
+ });
17314
17499
  }
17315
- menu.sort((a, b) => a.i18nKey.split("_").pop().localeCompare(b.i18nKey.split("_").pop()));
17316
- return menu;
17317
17500
  }
17501
+ menu.sort((a, b) => a.i18nKey.split("_").pop().localeCompare(b.i18nKey.split("_").pop()));
17502
+ return menu;
17318
17503
  }
17319
17504
  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
- }
17505
+ let menu = [];
17506
+ for (let i = 0; i < usagecat.length; i++) {
17507
+ var _usagecat$i, _usagecat$i$code, _usagecat$i$code$spli, _usagecat$i2, _usagecat$i2$code, _usagecat$i2$code$spl;
17508
+ 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) {
17509
+ menu.push({
17510
+ i18nKey: "PROPERTYTAX_BILLING_SLAB_" + usagecat[i].code.split(".")[1],
17511
+ code: usagecat[i].code
17512
+ });
17343
17513
  }
17344
- return menu;
17345
17514
  }
17515
+ return menu;
17346
17516
  }
17347
17517
  const {
17348
17518
  control,
@@ -17536,270 +17706,121 @@ const PropertyAssemblyDetails = ({
17536
17706
  };
17537
17707
 
17538
17708
  const PropertyLocationDetails = ({
17539
- t,
17540
- config,
17709
+ address,
17710
+ actionCancelOnSubmit,
17711
+ isEdit,
17541
17712
  onSelect,
17542
- userType,
17543
- formData,
17544
- formState,
17545
- ownerIndex,
17546
- setError,
17547
- clearErrors
17713
+ config,
17714
+ formData: formDataProp,
17715
+ ...props
17548
17716
  }) => {
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);
17717
+ var _formDataProp$cpt2;
17576
17718
  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;
17719
+ t
17720
+ } = useTranslation();
17721
+ const [showToast, setShowToast] = useState(null);
17722
+ const [formData, setFormData] = useState({
17723
+ addressType: (address === null || address === void 0 ? void 0 : address.addressType) || "",
17724
+ pincode: (address === null || address === void 0 ? void 0 : address.pinCode) || "",
17725
+ city: (address === null || address === void 0 ? void 0 : address.city) || "",
17726
+ locality: (address === null || address === void 0 ? void 0 : address.locality) || "",
17727
+ streetName: (address === null || address === void 0 ? void 0 : address.streetName) || "",
17728
+ houseNo: (address === null || address === void 0 ? void 0 : address.houseNumber) || "",
17729
+ houseName: (address === null || address === void 0 ? void 0 : address.houseName) || "",
17730
+ landmark: (address === null || address === void 0 ? void 0 : address.landmark) || "",
17731
+ addressLine1: (address === null || address === void 0 ? void 0 : address.address) || "",
17732
+ addressLine2: (address === null || address === void 0 ? void 0 : address.address2) || "",
17733
+ latitude: (address === null || address === void 0 ? void 0 : address.latitude) || "",
17734
+ longitude: (address === null || address === void 0 ? void 0 : address.longitude) || "",
17735
+ assembly: (address === null || address === void 0 ? void 0 : address.assembly) || "",
17736
+ block: (address === null || address === void 0 ? void 0 : address.block) || "",
17737
+ zone: (address === null || address === void 0 ? void 0 : address.zone) || "",
17738
+ zroLocation: (address === null || address === void 0 ? void 0 : address.zroLocation) || ""
17739
+ });
17740
+ const isPropertyFound = window.location.href.includes("ws/old-application");
17741
+ useEffect(() => {
17742
+ var _formDataProp$cpt;
17743
+ if (formDataProp !== null && formDataProp !== void 0 && (_formDataProp$cpt = formDataProp.cpt) !== null && _formDataProp$cpt !== void 0 && _formDataProp$cpt.details) {
17744
+ 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;
17745
+ const details = formDataProp.cpt.details;
17746
+ const addressData = details.address || {};
17747
+ const additionalDetails = details.additionalDetails || {};
17748
+ const localityCode = ((_addressData$locality = addressData.locality) === null || _addressData$locality === void 0 ? void 0 : _addressData$locality.code) || addressData.locality || "";
17749
+ 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 || "";
17750
+ 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 || "";
17751
+ const zroCode = addressData.zroLocation || additionalDetails.zroLocation || ((_addressData$addition = addressData.additionalDetails) === null || _addressData$addition === void 0 ? void 0 : _addressData$addition.zroLocation) || "";
17752
+ const zroValue = zroCode ? {
17753
+ code: zroCode,
17754
+ name: zroCode,
17755
+ i18nKey: zroCode
17756
+ } : "";
17757
+ setFormData({
17758
+ pincode: addressData.pincode || "",
17759
+ city: addressData.city || "",
17760
+ locality: localityCode,
17761
+ streetName: addressData.street || "",
17762
+ houseNo: addressData.houseNo || "",
17763
+ landmark: addressData.landmark || "",
17764
+ latitude: lat,
17765
+ longitude: lng,
17766
+ assembly: additionalDetails.assembly || ((_addressData$addition2 = addressData.additionalDetails) === null || _addressData$addition2 === void 0 ? void 0 : _addressData$addition2.assembly) || "",
17767
+ block: additionalDetails.block || ((_addressData$addition3 = addressData.additionalDetails) === null || _addressData$addition3 === void 0 ? void 0 : _addressData$addition3.block) || "",
17768
+ zone: additionalDetails.zone || ((_addressData$addition4 = addressData.additionalDetails) === null || _addressData$addition4 === void 0 ? void 0 : _addressData$addition4.zone) || "",
17769
+ zroLocation: zroCode,
17770
+ zro: zroValue,
17771
+ address: {
17772
+ ...addressData,
17773
+ city: addressData.city || "",
17774
+ pincode: addressData.pincode || "",
17775
+ locality: localityCode,
17776
+ streetName: addressData.street || "",
17777
+ houseNo: addressData.houseNo || "",
17778
+ addressLine1: addressData.street || "",
17779
+ latitude: lat,
17780
+ longitude: lng,
17781
+ zroLocation: zroCode,
17782
+ zro: zroValue,
17783
+ assembly: additionalDetails.assembly || ((_addressData$addition5 = addressData.additionalDetails) === null || _addressData$addition5 === void 0 ? void 0 : _addressData$addition5.assembly) || "",
17784
+ block: additionalDetails.block || ((_addressData$addition6 = addressData.additionalDetails) === null || _addressData$addition6 === void 0 ? void 0 : _addressData$addition6.block) || "",
17785
+ zone: additionalDetails.zone || ((_addressData$addition7 = addressData.additionalDetails) === null || _addressData$addition7 === void 0 ? void 0 : _addressData$addition7.zone) || ""
17603
17786
  }
17604
17787
  });
17605
17788
  }
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);
17789
+ }, [formDataProp === null || formDataProp === void 0 ? void 0 : (_formDataProp$cpt2 = formDataProp.cpt) === null || _formDataProp$cpt2 === void 0 ? void 0 : _formDataProp$cpt2.details]);
17790
+ useEffect(() => {
17791
+ if (showToast) {
17792
+ const timer = setTimeout(() => {
17793
+ setShowToast(null);
17794
+ }, 1000);
17795
+ return () => clearTimeout(timer);
17625
17796
  }
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
- });
17797
+ }, [showToast]);
17798
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
17799
+ title: t("PT_LOCATION_DETAILS"),
17800
+ defaultOpen: true
17801
+ }, /*#__PURE__*/React.createElement("div", {
17802
+ style: {
17803
+ boxShadow: "none",
17804
+ ...props.style
17699
17805
  }
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")
17806
+ }, /*#__PURE__*/React.createElement(AddressDetails, {
17807
+ t: t,
17808
+ formData: formData,
17809
+ onSelect: (key, data) => {
17810
+ setFormData(data);
17811
+ onSelect(key, data);
17711
17812
  },
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")
17813
+ config: {
17814
+ isCollapsible: false,
17815
+ ...config
17745
17816
  },
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));
17817
+ isEdit: isEdit,
17818
+ showZRO: true,
17819
+ disable: isPropertyFound,
17820
+ hideNextButton: true
17821
+ })));
17798
17822
  };
17799
17823
 
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
17824
  const PropertyOwnerDetails = ({
17804
17825
  t,
17805
17826
  config,
@@ -17809,7 +17830,8 @@ const PropertyOwnerDetails = ({
17809
17830
  formState,
17810
17831
  ownerIndex,
17811
17832
  setError,
17812
- clearErrors
17833
+ clearErrors,
17834
+ ...props
17813
17835
  }) => {
17814
17836
  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
17837
  const {
@@ -17819,7 +17841,7 @@ const PropertyOwnerDetails = ({
17819
17841
  const mutationScreen = url.includes("/property-mutation/");
17820
17842
  const isMobile = window.Digit.Utils.browser.isMobile();
17821
17843
  let index = 0;
17822
- const [ownershipCategory, setOwnerCategory] = React.useState("");
17844
+ const [ownershipCategory, setOwnerCategory] = React.useState((formData === null || formData === void 0 ? void 0 : formData.ownershipCategory) || "");
17823
17845
  const [ownerDetails, setOwnerDetails] = React.useState([{
17824
17846
  ...(formData.owners && formData.owners[index]),
17825
17847
  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) || "",
@@ -17860,16 +17882,6 @@ const PropertyOwnerDetails = ({
17860
17882
  isLoading: isMdmsDataLoading
17861
17883
  } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["OwnerShipCategory"]);
17862
17884
  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
17885
  const GuardianOptions = [{
17874
17886
  name: "HUSBAND",
17875
17887
  code: "HUSBAND",
@@ -17977,305 +17989,37 @@ const PropertyOwnerDetails = ({
17977
17989
  fontSize: "12px",
17978
17990
  marginTop: "-21px"
17979
17991
  };
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", {
18200
- style: {
18201
- display: "flex",
18202
- justifyContent: "flex-end",
18203
- width: "20%",
18204
- alignSelf: "flex-start"
18205
- }
18206
- }, ismultiple && /*#__PURE__*/React.createElement(LinkButton, {
18207
- label: /*#__PURE__*/React.createElement(DeleteIcon, {
18208
- style: {
18209
- bottom: "0px"
18210
- },
18211
- fill: !(ownerDetails.length == 1) ? "#494848" : "#FAFAFA"
18212
- }),
18213
- style: {
18214
- margin: "0px"
18215
- },
18216
- onClick: e => {
18217
- setOwnerDetails([...ownerDetails.filter((own, ind) => ind != index)]);
18218
- }
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);
17992
+ const ismultiple = ownershipCategory !== null && ownershipCategory !== void 0 && (_ownershipCategory$co = ownershipCategory.code) !== null && _ownershipCategory$co !== void 0 && _ownershipCategory$co.includes("MULTIPLEOWNERS") ? true : false;
17993
+ const isInstitutionalOwnerType = ownershipCategory === null || ownershipCategory === void 0 ? void 0 : (_ownershipCategory$co2 = ownershipCategory.code) === null || _ownershipCategory$co2 === void 0 ? void 0 : _ownershipCategory$co2.includes("INSTITUTIONAL");
17994
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
17995
+ title: t("PT_OWNER_DETAILS"),
17996
+ defaultOpen: true,
17997
+ style: props.style
17998
+ }, ownerDetails === null || ownerDetails === void 0 ? void 0 : ownerDetails.map((owner, index) => {
17999
+ var _errors, _errors2, _errors3, _errors4, _errors5, _errors6, _errors7, _errors8, _errors9, _errors0, _errors1, _errors10, _ownerDetails$index, _ownerDetails$index3;
18000
+ return /*#__PURE__*/React.createElement("div", {
18001
+ key: index
18002
+ }, isMobile && ismultiple && ownerDetails.length > 1 && /*#__PURE__*/React.createElement("div", {
18003
+ style: {
18004
+ display: "flex",
18005
+ justifyContent: "flex-end"
18006
+ }
18007
+ }, /*#__PURE__*/React.createElement(LinkButton, {
18008
+ label: /*#__PURE__*/React.createElement(DeleteIcon, {
18009
+ style: {
18010
+ bottom: "5px"
18248
18011
  },
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
- }
18012
+ fill: !(ownerDetails.length == 1) ? "#494848" : "#FAFAFA"
18013
+ }),
18014
+ style: {
18015
+ margin: "0px"
18267
18016
  },
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", {
18017
+ onClick: e => {
18018
+ setOwnerDetails([...ownerDetails.filter((own, ind) => ind != index)]);
18019
+ }
18020
+ })), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
18021
+ className: "formcomposer-section-grid"
18022
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PT_FORM3_MOBILE_NUMBER")}*`), /*#__PURE__*/React.createElement("div", {
18279
18023
  className: "form-field"
18280
18024
  }, /*#__PURE__*/React.createElement(Controller, {
18281
18025
  key: "mobileNumber" + index,
@@ -18324,9 +18068,9 @@ const PropertyOwnerDetails = ({
18324
18068
  onClick: e => {
18325
18069
  setOwnerDetails([...ownerDetails.filter((own, ind) => ind != index)]);
18326
18070
  }
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, {
18071
+ }))), (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
18072
  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", {
18073
+ }, 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
18074
  className: "form-field"
18331
18075
  }, /*#__PURE__*/React.createElement(Controller, {
18332
18076
  key: "name" + index,
@@ -18357,9 +18101,9 @@ const PropertyOwnerDetails = ({
18357
18101
  disable: isUpdateProperty || isEditProperty,
18358
18102
  onBlur: onBlur
18359
18103
  })
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, {
18104
+ }))), (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
18105
  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", {
18106
+ }, 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
18107
  className: "form-field"
18364
18108
  }, /*#__PURE__*/React.createElement(Controller, {
18365
18109
  key: "gender" + index,
@@ -18387,9 +18131,9 @@ const PropertyOwnerDetails = ({
18387
18131
  isDropDown: window.location.href.includes("/employee") ? true : false,
18388
18132
  onBlur: onBlur
18389
18133
  })
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, {
18134
+ }))), (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
18135
  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", {
18136
+ }, 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
18137
  className: "form-field"
18394
18138
  }, /*#__PURE__*/React.createElement(Controller, {
18395
18139
  key: "fatherOrHusbandName" + index,
@@ -18418,9 +18162,9 @@ const PropertyOwnerDetails = ({
18418
18162
  disable: isUpdateProperty || isEditProperty,
18419
18163
  onBlur: onBlur
18420
18164
  })
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, {
18165
+ }))), (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
18166
  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", {
18167
+ }, 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
18168
  className: "form-field"
18425
18169
  }, /*#__PURE__*/React.createElement(Controller, {
18426
18170
  key: "relationship" + index,
@@ -18448,9 +18192,9 @@ const PropertyOwnerDetails = ({
18448
18192
  isDropDown: window.location.href.includes("/employee") ? true : false,
18449
18193
  onBlur: onBlur
18450
18194
  })
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, {
18195
+ }))), (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
18196
  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, {
18197
+ }, 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
18198
  className: ""
18455
18199
  }, `${t("PT_SPECIAL_APPLICANT_CATEGORY")}*`), /*#__PURE__*/React.createElement("div", {
18456
18200
  className: "form-field"
@@ -18478,33 +18222,24 @@ const PropertyOwnerDetails = ({
18478
18222
  t: t,
18479
18223
  onBlur: onBlur
18480
18224
  })
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, {
18225
+ }))), (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
18226
  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", {
18227
+ }, 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
18228
  className: "form-field"
18485
18229
  }, /*#__PURE__*/React.createElement(TextArea, {
18486
18230
  isMandatory: false,
18487
18231
  optionKey: "i18nKey",
18488
18232
  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,
18233
+ disabled: (ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index = ownerDetails[index]) === null || _ownerDetails$index === void 0 ? void 0 : _ownerDetails$index.isCoresAddr) === true,
18490
18234
  name: "address" + index,
18491
18235
  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)) {
18236
+ var _ownerDetails$index2;
18237
+ if (!((ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index2 = ownerDetails[index]) === null || _ownerDetails$index2 === void 0 ? void 0 : _ownerDetails$index2.isCoresAddr) === true)) {
18494
18238
  updateState("permanentAddress", index, e.target.value);
18495
18239
  }
18496
18240
  },
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
- })));
18241
+ value: ownerDetails === null || ownerDetails === void 0 ? void 0 : (_ownerDetails$index3 = ownerDetails[index]) === null || _ownerDetails$index3 === void 0 ? void 0 : _ownerDetails$index3.permanentAddress
18242
+ }))))));
18508
18243
  }), ismultiple ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
18509
18244
  style: {
18510
18245
  display: "flex",
@@ -18538,6 +18273,319 @@ const PropertyOwnerDetails = ({
18538
18273
  }, 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
18274
  };
18540
18275
 
18276
+ const NUMBER_PATTERN = /^\d+$/;
18277
+ const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
18278
+ const PropertyWaterConnection = ({
18279
+ t,
18280
+ config,
18281
+ onSelect,
18282
+ formData,
18283
+ formState,
18284
+ setError,
18285
+ clearErrors,
18286
+ ...props
18287
+ }) => {
18288
+ var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0;
18289
+ const {
18290
+ control,
18291
+ register,
18292
+ formState: {
18293
+ errors,
18294
+ touched
18295
+ },
18296
+ watch,
18297
+ setValue
18298
+ } = useForm({
18299
+ defaultValues: (formData === null || formData === void 0 ? void 0 : formData[config.key]) || {
18300
+ useDetails: {
18301
+ propertyCategory: null,
18302
+ propertyType: null,
18303
+ WaterConnectionUsageType: null,
18304
+ noOfFloors: null,
18305
+ plotArea: "",
18306
+ builtUpArea: "",
18307
+ SelectYearofConstruction: null,
18308
+ NumberofDwellingUnits: "",
18309
+ NumberofRooms: "",
18310
+ hospitalBeds: ""
18311
+ }
18312
+ }
18313
+ });
18314
+ const tenantId = Digit.ULBService.getCurrentTenantId();
18315
+ const {
18316
+ isLoading: isWSServicesMastersLoading,
18317
+ data: ptServicesMastersData
18318
+ } = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["PropertyCategory", "PropertyType", "NoOfFloors", "PropertyNewUsageType"]);
18319
+ const isPropertyFound = window.location.href.includes("ws/old-application");
18320
+ const formValue = watch();
18321
+ const watchPropertyType = watch("useDetails.propertyType");
18322
+ const watchPropertyCategory = watch("useDetails.propertyCategory");
18323
+ const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
18324
+ const yearOptions = useMemo(() => {
18325
+ const currentYear = new Date().getFullYear();
18326
+ const years = [];
18327
+ for (let i = currentYear; i >= currentYear - 100; i--) {
18328
+ years.push({
18329
+ value: i.toString(),
18330
+ name: i.toString()
18331
+ });
18332
+ }
18333
+ return years;
18334
+ }, []);
18335
+ const categoryOptions = useMemo(() => {
18336
+ var _ptServicesMastersDat, _ptServicesMastersDat2;
18337
+ 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 => ({
18338
+ code: item.code,
18339
+ name: item.name
18340
+ }));
18341
+ }, [ptServicesMastersData]);
18342
+ const propertyTypeOptions = useMemo(() => {
18343
+ var _ptServicesMastersDat3, _ptServicesMastersDat4;
18344
+ 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 => ({
18345
+ code: item.code,
18346
+ name: item.name
18347
+ }))) || [];
18348
+ }, [ptServicesMastersData]);
18349
+ const usageTypeOptions = useMemo(() => {
18350
+ var _ptServicesMastersDat5, _ptServicesMastersDat6;
18351
+ 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 => ({
18352
+ code: item.code,
18353
+ name: item.name
18354
+ }));
18355
+ }, [ptServicesMastersData]);
18356
+ const floorOptions = useMemo(() => {
18357
+ var _ptServicesMastersDat7, _ptServicesMastersDat8;
18358
+ 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 => ({
18359
+ code: item.code,
18360
+ name: item.name
18361
+ }));
18362
+ }, [ptServicesMastersData]);
18363
+ const lastSentValue = React.useRef(null);
18364
+ useEffect(() => {
18365
+ if (!lodash.isEqual(lastSentValue.current, formValue)) {
18366
+ lastSentValue.current = lodash.cloneDeep(formValue);
18367
+ onSelect(config.key, formValue);
18368
+ }
18369
+ }, [formValue, config.key, onSelect]);
18370
+ useEffect(() => {
18371
+ var _formData$cpt;
18372
+ if (formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && _formData$cpt.details) {
18373
+ const details = formData.cpt.details;
18374
+ const additionalDetails = (details === null || details === void 0 ? void 0 : details.additionalDetails) || {};
18375
+ setValue("useDetails.propertyCategory", (categoryOptions === null || categoryOptions === void 0 ? void 0 : categoryOptions.find(o => o.code === additionalDetails.propertyCategory)) || null);
18376
+ setValue("useDetails.propertyType", (propertyTypeOptions === null || propertyTypeOptions === void 0 ? void 0 : propertyTypeOptions.find(o => o.code === additionalDetails.propertyType)) || null);
18377
+ setValue("useDetails.WaterConnectionUsageType", (usageTypeOptions === null || usageTypeOptions === void 0 ? void 0 : usageTypeOptions.find(o => o.code === additionalDetails.waterConnectionUsageType)) || null);
18378
+ setValue("useDetails.noOfFloors", (floorOptions === null || floorOptions === void 0 ? void 0 : floorOptions.find(o => {
18379
+ var _details$noOfFloors;
18380
+ return o.code === (((_details$noOfFloors = details.noOfFloors) === null || _details$noOfFloors === void 0 ? void 0 : _details$noOfFloors.toString()) || additionalDetails.noOfFloors);
18381
+ })) || null);
18382
+ setValue("useDetails.plotArea", additionalDetails.plotArea || "");
18383
+ setValue("useDetails.builtUpArea", additionalDetails.builtUpArea || "");
18384
+ setValue("useDetails.SelectYearofConstruction", (yearOptions === null || yearOptions === void 0 ? void 0 : yearOptions.find(o => o.value === additionalDetails.yearOfConstruction)) || null);
18385
+ setValue("useDetails.NumberofDwellingUnits", additionalDetails.numberOfDwellingUnits || "");
18386
+ setValue("useDetails.NumberofRooms", additionalDetails.numberOfRooms || "");
18387
+ }
18388
+ }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.details, categoryOptions, propertyTypeOptions, usageTypeOptions, floorOptions, yearOptions, setValue]);
18389
+ const lastErrorState = React.useRef(null);
18390
+ useEffect(() => {
18391
+ const hasErrors = Object.keys(errors).length > 0;
18392
+ if (lastErrorState.current !== hasErrors) {
18393
+ lastErrorState.current = hasErrors;
18394
+ if (hasErrors) {
18395
+ setError(config.key, {
18396
+ type: "custom",
18397
+ message: "Validation failed"
18398
+ });
18399
+ } else {
18400
+ clearErrors(config.key);
18401
+ }
18402
+ }
18403
+ }, [errors, config.key, setError, clearErrors]);
18404
+ const errorStyle = {
18405
+ width: "70%",
18406
+ marginLeft: "30%",
18407
+ fontSize: "12px",
18408
+ marginTop: "-21px"
18409
+ };
18410
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
18411
+ title: t("WS_PROPERTY_AND_WATER_CONNECTION_USE_DETAILS"),
18412
+ defaultOpen: true,
18413
+ style: props.style
18414
+ }, /*#__PURE__*/React.createElement("div", {
18415
+ className: "formcomposer-section-grid"
18416
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PROPERTY_CATEGORY")}*`), /*#__PURE__*/React.createElement("div", {
18417
+ className: "form-field"
18418
+ }, /*#__PURE__*/React.createElement(Controller, {
18419
+ control: control,
18420
+ name: "useDetails.propertyCategory",
18421
+ rules: {
18422
+ required: t("REQUIRED_FIELD")
18423
+ },
18424
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18425
+ option: categoryOptions,
18426
+ optionKey: "name",
18427
+ selected: props.value,
18428
+ select: props.onChange,
18429
+ t: t,
18430
+ onBlur: props.onBlur,
18431
+ disable: isPropertyFound
18432
+ })
18433
+ }))), (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, {
18434
+ style: errorStyle
18435
+ }, errors.useDetails.propertyCategory.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PROPERTY_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
18436
+ className: "form-field"
18437
+ }, /*#__PURE__*/React.createElement(Controller, {
18438
+ control: control,
18439
+ name: "useDetails.propertyType",
18440
+ rules: {
18441
+ required: t("REQUIRED_FIELD")
18442
+ },
18443
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18444
+ option: propertyTypeOptions,
18445
+ optionKey: "name",
18446
+ selected: props.value,
18447
+ select: props.onChange,
18448
+ t: t,
18449
+ onBlur: props.onBlur,
18450
+ disable: isPropertyFound
18451
+ })
18452
+ }))), (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, {
18453
+ style: errorStyle
18454
+ }, errors.useDetails.propertyType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_WATER_CONNECTION_USAGE_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
18455
+ className: "form-field"
18456
+ }, /*#__PURE__*/React.createElement(Controller, {
18457
+ control: control,
18458
+ name: "useDetails.WaterConnectionUsageType",
18459
+ rules: {
18460
+ required: t("REQUIRED_FIELD")
18461
+ },
18462
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18463
+ option: usageTypeOptions,
18464
+ optionKey: "name",
18465
+ selected: props.value,
18466
+ select: props.onChange,
18467
+ t: t,
18468
+ onBlur: props.onBlur,
18469
+ disable: isPropertyFound
18470
+ })
18471
+ }))), (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, {
18472
+ style: errorStyle
18473
+ }, errors.useDetails.WaterConnectionUsageType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_FLOORS")}*`), /*#__PURE__*/React.createElement("div", {
18474
+ className: "form-field"
18475
+ }, /*#__PURE__*/React.createElement(Controller, {
18476
+ control: control,
18477
+ name: "useDetails.noOfFloors",
18478
+ rules: {
18479
+ required: t("REQUIRED_FIELD")
18480
+ },
18481
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18482
+ option: floorOptions,
18483
+ optionKey: "name",
18484
+ selected: props.value,
18485
+ select: props.onChange,
18486
+ t: t,
18487
+ onBlur: props.onBlur,
18488
+ disable: isPropertyFound
18489
+ })
18490
+ }))), (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, {
18491
+ style: errorStyle
18492
+ }, errors.useDetails.noOfFloors.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PLOT_AREA")}*`), /*#__PURE__*/React.createElement("div", {
18493
+ className: "form-field"
18494
+ }, /*#__PURE__*/React.createElement(TextInput, {
18495
+ t: t,
18496
+ inputRef: register({
18497
+ pattern: {
18498
+ value: DECIMAL_PATTERN,
18499
+ message: t("ERR_INVALID_DECIMAL")
18500
+ },
18501
+ required: t("REQUIRED_FIELD")
18502
+ }),
18503
+ name: "useDetails.plotArea",
18504
+ disabled: isPropertyFound
18505
+ }))), (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, {
18506
+ style: errorStyle
18507
+ }, errors.useDetails.plotArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_BUILT_UP_AREA")}*`), /*#__PURE__*/React.createElement("div", {
18508
+ className: "form-field"
18509
+ }, /*#__PURE__*/React.createElement(TextInput, {
18510
+ t: t,
18511
+ inputRef: register({
18512
+ pattern: {
18513
+ value: DECIMAL_PATTERN,
18514
+ message: t("ERR_INVALID_DECIMAL")
18515
+ },
18516
+ required: t("REQUIRED_FIELD")
18517
+ }),
18518
+ name: "useDetails.builtUpArea",
18519
+ disabled: isPropertyFound
18520
+ }))), (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, {
18521
+ style: errorStyle
18522
+ }, errors.useDetails.builtUpArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_SELECT_YEAR_OF_CONSTRUCTION")}*`), /*#__PURE__*/React.createElement("div", {
18523
+ className: "form-field"
18524
+ }, /*#__PURE__*/React.createElement(Controller, {
18525
+ control: control,
18526
+ name: "useDetails.SelectYearofConstruction",
18527
+ rules: {
18528
+ required: t("REQUIRED_FIELD")
18529
+ },
18530
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
18531
+ option: yearOptions,
18532
+ optionKey: "value",
18533
+ selected: props.value,
18534
+ select: props.onChange,
18535
+ t: t,
18536
+ onBlur: props.onBlur,
18537
+ disable: isPropertyFound
18538
+ })
18539
+ }))), (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, {
18540
+ style: errorStyle
18541
+ }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_DWELLING_UNITS")}*`), /*#__PURE__*/React.createElement("div", {
18542
+ className: "form-field"
18543
+ }, /*#__PURE__*/React.createElement(TextInput, {
18544
+ t: t,
18545
+ inputRef: register({
18546
+ pattern: {
18547
+ value: NUMBER_PATTERN,
18548
+ message: t("ERR_INVALID_NUMBER")
18549
+ },
18550
+ required: t("REQUIRED_FIELD")
18551
+ }),
18552
+ name: "useDetails.NumberofDwellingUnits",
18553
+ disabled: isPropertyFound
18554
+ }))), (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, {
18555
+ style: errorStyle
18556
+ }, errors.useDetails.NumberofDwellingUnits.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_ROOMS")}*`), /*#__PURE__*/React.createElement("div", {
18557
+ className: "form-field"
18558
+ }, /*#__PURE__*/React.createElement(TextInput, {
18559
+ t: t,
18560
+ inputRef: register({
18561
+ pattern: {
18562
+ value: NUMBER_PATTERN,
18563
+ message: t("ERR_INVALID_NUMBER")
18564
+ },
18565
+ required: t("REQUIRED_FIELD")
18566
+ }),
18567
+ name: "useDetails.NumberofRooms",
18568
+ disabled: isPropertyFound
18569
+ }))), (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, {
18570
+ style: errorStyle
18571
+ }, errors.useDetails.NumberofRooms.message), isHospitalProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_BEDS")}*`), /*#__PURE__*/React.createElement("div", {
18572
+ className: "form-field"
18573
+ }, /*#__PURE__*/React.createElement(TextInput, {
18574
+ t: t,
18575
+ inputRef: register({
18576
+ pattern: {
18577
+ value: NUMBER_PATTERN,
18578
+ message: t("ERR_INVALID_NUMBER")
18579
+ },
18580
+ required: isHospitalProperty ? t("REQUIRED_FIELD") : false
18581
+ }),
18582
+ name: "useDetails.hospitalBeds",
18583
+ disabled: isPropertyFound
18584
+ }))) : 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, {
18585
+ style: errorStyle
18586
+ }, errors.useDetails.hospitalBeds.message)));
18587
+ };
18588
+
18541
18589
  const SwitchComponent = props => {
18542
18590
  return /*#__PURE__*/React.createElement("div", {
18543
18591
  className: "w-fullwidth PropertySearchFormSwitcher"
@@ -18820,7 +18868,7 @@ const getAction = flow => {
18820
18868
  actions = [];
18821
18869
  break;
18822
18870
  case "WS":
18823
- actions = ['WS_COMMON_PROPERTY_DETAILS', 'WS_COMMON_CONNECTION_DETAIL', 'WS_COMMON_DOCUMENT_DETAILS', 'WS_COMMON_SUMMARY'];
18871
+ actions = ['WS_COMMON_CONNECTION_DETAIL', 'WS_COMMON_DOCUMENT_DETAILS', 'WS_COMMON_SUMMARY'];
18824
18872
  break;
18825
18873
  case "TL":
18826
18874
  actions = ['TL_COMMON_TR_DETAILS', 'TL_LOCATION_AND_OWNER_DETAILS', 'TL_DOCUMENT_DETAIL', 'TL_COMMON_SUMMARY'];
@@ -19064,7 +19112,7 @@ const PropertyDetails = ({
19064
19112
  }))));
19065
19113
  };
19066
19114
 
19067
- const getAddress$1 = (address, t) => {
19115
+ const getAddress = (address, t) => {
19068
19116
  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
19117
  };
19070
19118
  const PropertySearchNSummary = ({
@@ -19076,7 +19124,7 @@ const PropertySearchNSummary = ({
19076
19124
  formState,
19077
19125
  clearErrors
19078
19126
  }) => {
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;
19127
+ var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3, _propertyDetails$Prop3, _propertyDetails$Prop4, _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop7, _propertyDetails$Prop8;
19080
19128
  const {
19081
19129
  t
19082
19130
  } = useTranslation();
@@ -19151,11 +19199,10 @@ const PropertySearchNSummary = ({
19151
19199
  if (isEditScreen) {
19152
19200
  return /*#__PURE__*/React.createElement(React.Fragment, null);
19153
19201
  }
19154
- const redirectBackUrl = window.location.pathname;
19155
19202
  let propertyAddress = "";
19156
19203
  if (propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length) {
19157
19204
  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);
19205
+ 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
19206
  }
19160
19207
  const getInputStyles = () => {
19161
19208
  if (window.location.href.includes("/ws/")) {
@@ -19174,8 +19221,9 @@ const PropertySearchNSummary = ({
19174
19221
  return getOwnersList ? getOwnersList : t("NA");
19175
19222
  };
19176
19223
  if (window.location.href.includes("/ws/")) ;
19177
- return /*#__PURE__*/React.createElement(Card, {
19178
- className: "no-shadow"
19224
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
19225
+ title: t("PT_PROPERTY_DETAILS"),
19226
+ defaultOpen: true
19179
19227
  }, (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
19228
  style: getInputStyles()
19181
19229
  }, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
@@ -19195,7 +19243,8 @@ const PropertySearchNSummary = ({
19195
19243
  style: {
19196
19244
  width: "80%",
19197
19245
  float: "left"
19198
- }
19246
+ },
19247
+ placeholder: `${t("PT_ENTER_PROPERTY_ID")}`
19199
19248
  }), /*#__PURE__*/React.createElement("button", {
19200
19249
  className: "submit-bar",
19201
19250
  type: "button",
@@ -19203,56 +19252,72 @@ const PropertySearchNSummary = ({
19203
19252
  color: "white"
19204
19253
  },
19205
19254
  onClick: searchProperty
19206
- }, `${t("PT_SEARCH")}`))), /*#__PURE__*/React.createElement("span", {
19207
- onClick: () => history.push(`/digit-ui/employee/commonpt/search?redirectToUrl=${redirectBackUrl}&${serachParams}`, {
19208
- ...state
19255
+ }, `${t("PT_SEARCH")}`), /*#__PURE__*/React.createElement("span", {
19256
+ onClick: () => history.push(`/digit-ui/${userType}/${pathname.split("/")[3]}/create-application/create-property`, {
19257
+ ...state,
19258
+ ...formData
19209
19259
  })
19210
- }, /*#__PURE__*/React.createElement(LinkButton, {
19211
- label: t("CPT_SEARCH_PROPERTY"),
19260
+ }, /*#__PURE__*/React.createElement("button", {
19261
+ className: "submit-bar",
19262
+ type: "button",
19212
19263
  style: {
19213
- color: "#a82227",
19214
- display: "inline-block"
19264
+ color: "white"
19215
19265
  }
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"),
19266
+ }, t("CPT_CREATE_PROPERTY"))))), propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
19267
+ className: "card-with-background",
19222
19268
  style: {
19223
- color: "#a82227",
19224
- display: "inline-block"
19269
+ margin: "16px 0px",
19270
+ padding: "20px",
19271
+ boxShadow: "none"
19225
19272
  }
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",
19273
+ }, /*#__PURE__*/React.createElement(StatusTable, {
19228
19274
  style: {
19229
- marginBottom: "5px",
19230
- marginTop: "20px"
19275
+ padding: "0",
19276
+ margin: "0"
19231
19277
  }
19232
- }, t("PT_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement("div", {
19278
+ }, /*#__PURE__*/React.createElement("div", {
19233
19279
  className: "formcomposer-section-grid",
19234
19280
  style: isMobile ? {} : {}
19235
19281
  }, /*#__PURE__*/React.createElement(Row, {
19236
19282
  className: "border-none",
19237
19283
  labelStyle: isMobile ? {
19238
19284
  width: "40%"
19239
- } : {},
19285
+ } : {
19286
+ width: "30%",
19287
+ color: "#505a5f",
19288
+ fontWeight: "600"
19289
+ },
19290
+ textStyle: {
19291
+ color: "#000"
19292
+ },
19240
19293
  label: t(`PROPERTY_ID`),
19241
19294
  text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3.propertyId
19242
19295
  }), /*#__PURE__*/React.createElement(Row, {
19243
19296
  className: "border-none",
19244
19297
  labelStyle: isMobile ? {
19245
19298
  width: "40%"
19246
- } : {},
19299
+ } : {
19300
+ width: "30%",
19301
+ color: "#505a5f",
19302
+ fontWeight: "600"
19303
+ },
19304
+ textStyle: {
19305
+ color: "#000"
19306
+ },
19247
19307
  label: t(`OWNER_NAME`),
19248
19308
  text: getOwnerNames(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0])
19249
19309
  }), /*#__PURE__*/React.createElement(Row, {
19250
19310
  className: "border-none",
19251
19311
  labelStyle: isMobile ? {
19252
19312
  width: "40%"
19253
- } : {},
19313
+ } : {
19314
+ width: "30%",
19315
+ color: "#505a5f",
19316
+ fontWeight: "600"
19317
+ },
19254
19318
  textStyle: {
19255
- wordBreak: "break-word"
19319
+ wordBreak: "break-word",
19320
+ color: "#000"
19256
19321
  },
19257
19322
  label: t(`PROPERTY_ADDRESS`),
19258
19323
  text: propertyAddress,
@@ -19276,15 +19341,7 @@ const PropertySearchNSummary = ({
19276
19341
  isArray: false
19277
19342
  }
19278
19343
  }
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, {
19344
+ }))))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
19288
19345
  isDleteBtn: true,
19289
19346
  labelstyle: {
19290
19347
  width: "100%"
@@ -19299,52 +19356,25 @@ const PropertySearchNSummary = ({
19299
19356
  };
19300
19357
 
19301
19358
  const CommonPTCard = () => {
19302
- var _propsForModuleCard$l;
19303
19359
  const {
19304
19360
  t
19305
19361
  } = useTranslation();
19306
- if (!Digit.Utils.ptAccess()) {
19307
- return null;
19308
- }
19309
19362
  const propsForModuleCard = {
19310
19363
  Icon: /*#__PURE__*/React.createElement(PropertyHouse, null),
19311
19364
  moduleName: t("ACTION_TEST_COMMON_PROPERTY_TAX"),
19365
+ kpis: [{
19366
+ label: t("PT_TOTAL_APPLICATIONS"),
19367
+ value: 0
19368
+ }],
19312
19369
  links: [{
19313
19370
  label: t("PT_SEARCH_AND_PAY"),
19314
19371
  link: `/digit-ui/employee/commonpt/search`
19315
19372
  }]
19316
19373
  };
19317
- const PT_CEMP = Digit.UserService.hasAccess(["PT_CEMP"]) || false;
19318
- if (PT_CEMP && !((_propsForModuleCard$l = propsForModuleCard.links) !== null && _propsForModuleCard$l !== void 0 && _propsForModuleCard$l[1])) {
19319
- propsForModuleCard.links.push({
19320
- label: t("PT_CREATE_PROPERTY"),
19321
- link: `/digit-ui/employee/commonpt/new-application`
19322
- });
19323
- }
19324
19374
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
19325
19375
  };
19326
19376
 
19327
- const componentsToRegister = {
19328
- CPTPropertySearchForm: SearchPTID,
19329
- CPTPropertySearchResults: SearchPTID$1,
19330
- CPTSearchProperty: SearchProperty$1,
19331
- CPTPropertyAssemblyDetails: PropertyAssemblyDetails,
19332
- CPTPropertyLocationDetails: PropertyLocationDetails,
19333
- CPTPropertyOwnerDetails: PropertyOwnerDetails,
19334
- CPTKnowYourProperty: KnowYourProperty,
19335
- CPTPropertyDetails: PropertyDetails,
19336
- CPTPropertySearchNSummary: PropertySearchNSummary,
19337
- CPTSearchResults: SearchResultsComponent,
19338
- CPTCreateProperty: CreatePropertyForm,
19339
- CPTAcknowledgement: PTAcknowledgement
19340
- };
19341
- const addComponentsToRegistry = () => {
19342
- Object.entries(componentsToRegister).forEach(([key, value]) => {
19343
- Digit.ComponentRegistryService.setComponent(key, value);
19344
- });
19345
- };
19346
19377
  const CommonPTModule = ({
19347
- stateCode,
19348
19378
  userType,
19349
19379
  tenants
19350
19380
  }) => {
@@ -19358,21 +19388,23 @@ const CommonPTModule = ({
19358
19388
  isLoading,
19359
19389
  data: store
19360
19390
  } = Digit.Services.useStore({
19361
- stateCode,
19362
19391
  moduleCode,
19363
19392
  language
19364
19393
  });
19365
- addComponentsToRegistry();
19366
19394
  Digit.SessionStorage.set("PT_TENANTS", tenants);
19395
+ useEffect(() => userType === "employee" && Digit.LocalizationService.getLocale({
19396
+ modules: [`rainmaker-${Digit.ULBService.getCurrentTenantId()}`],
19397
+ locale: Digit.StoreData.getCurrentLanguage(),
19398
+ tenantId: Digit.ULBService.getCurrentTenantId()
19399
+ }), []);
19367
19400
  if (userType === "employee") {
19368
19401
  return /*#__PURE__*/React.createElement(EmployeeApp, {
19369
19402
  path: path,
19370
19403
  url: url,
19371
- userType: userType
19404
+ userType: userType,
19405
+ tenants: tenants
19372
19406
  });
19373
- } else return /*#__PURE__*/React.createElement(App, {
19374
- stateCode: stateCode
19375
- });
19407
+ } else return /*#__PURE__*/React.createElement(App, null);
19376
19408
  };
19377
19409
  const CommonPTLinks = ({
19378
19410
  matchPath,
@@ -19381,10 +19413,6 @@ const CommonPTLinks = ({
19381
19413
  const {
19382
19414
  t
19383
19415
  } = useTranslation();
19384
- const [params, setParams, clearParams] = Digit.Hooks.useSessionStorage("CPT_CREATE_PROPERTY", {});
19385
- useEffect(() => {
19386
- clearParams();
19387
- }, []);
19388
19416
  const links = [{
19389
19417
  link: `${matchPath}/property/citizen-search`,
19390
19418
  i18nKey: t("PT_SEARCH_AND_PAY")
@@ -19401,13 +19429,30 @@ const CommonPTLinks = ({
19401
19429
  });
19402
19430
  };
19403
19431
  const CommonPTComponents = {
19404
- CommonPTCardTemp: CommonPTCard,
19432
+ CommonPTCard,
19405
19433
  CommonPTModule,
19406
- CommonPTLinksTemp: CommonPTLinks,
19407
- ...componentsToRegister
19434
+ CommonPTLinks
19435
+ };
19436
+ const componentsToRegister = {
19437
+ CommonPTModule,
19438
+ CommonPTCard,
19439
+ CommonPTLinks,
19440
+ CPTPropertySearchForm: SearchPTID,
19441
+ CPTPropertySearchResults: SearchPTID$1,
19442
+ CPTSearchProperty: SearchProperty$1,
19443
+ CPTPropertyAssemblyDetails: PropertyAssemblyDetails,
19444
+ CPTPropertyLocationDetails: PropertyLocationDetails,
19445
+ CPTPropertyOwnerDetails: PropertyOwnerDetails,
19446
+ PropertyWaterConnection,
19447
+ CPTKnowYourProperty: KnowYourProperty,
19448
+ CPTPropertyDetails: PropertyDetails,
19449
+ CPTPropertySearchNSummary: PropertySearchNSummary,
19450
+ CPTSearchResults: SearchResultsComponent,
19451
+ CPTCreateProperty: CreatePropertyForm,
19452
+ CPTAcknowledgement: PTAcknowledgement
19408
19453
  };
19409
19454
  const initCommonPTComponents = () => {
19410
- Object.entries(CommonPTComponents).forEach(([key, value]) => {
19455
+ Object.entries(componentsToRegister).forEach(([key, value]) => {
19411
19456
  Digit.ComponentRegistryService.setComponent(key, value);
19412
19457
  });
19413
19458
  };