@djb25/digit-ui-module-ws 1.0.24 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +332 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2238 -743
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, useMemo, Fragment as Fragment$1, useReducer, useCallback } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Link, useLocation, Switch, Route, useHistory, useRouteMatch, Redirect, useParams } from 'react-router-dom';
|
|
4
|
-
import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, Header, BackButton, PrivateRoute, Banner, CardText, ActionBar, HomeIcon, PrintBtnCommon, MultiLink, LinkButton, Toast, ModuleHeader, ArrowLeft, TickMark, FormStep, CardLabel, RadioOrSelect, TextInput, CardHeader, CitizenInfoLabel, CardSubHeader, Dropdown, UploadFile, CheckBox, RadioButtons, MobileNumber, LabelFieldPair, DatePicker,
|
|
4
|
+
import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, Header, BackButton, PrivateRoute, Banner, CardText, ActionBar, LayoutWrapper, HomeIcon, PrintBtnCommon, MultiLink, LinkButton, Toast, ModuleHeader, ArrowLeft, TickMark, FormStep, CardLabel, RadioOrSelect, TextInput, CardHeader, CitizenInfoLabel, CardSubHeader, Dropdown, UploadFile, CheckBox, RadioButtons, MobileNumber, LabelFieldPair, DatePicker, CollapsibleCardPage, ViewsIcon, Modal, DeleteIcon, CardLabelError, WrapUnMaskComponent, StatusTable, Row, CardSectionHeader, InfoIcon, TextArea, SearchField, FilterFormField, RemoveableTag, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, Table, Localities, DownloadBtnCommon, CollectionIcon, ResponseComposer, TelePhone, DisplayPhotos, CheckPoint, ConnectingCheckPoints, ActionLinks, PDFSvg, EditIcon, CardSectionSubText, DownloadIcon, CardLabelDesc, VerticalTimeline, FormComposer, MultiUploadWrapper, Close as Close$e, BreakLine, Menu, ButtonSelector, CitizenHomeCard } from '@djb25/digit-ui-react-components';
|
|
5
5
|
import { useForm, Controller, useWatch, useFormContext } from 'react-hook-form';
|
|
6
6
|
import { read, utils as utils$1 } from 'xlsx';
|
|
7
7
|
import { useQueryClient } from 'react-query';
|
|
@@ -441,15 +441,16 @@ const getFiles = async (filesArray, tenant) => {
|
|
|
441
441
|
response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && (_response$data$fileSt = _response$data.fileStoreIds) !== null && _response$data$fileSt !== void 0 && (_response$data$fileSt2 = _response$data$fileSt[0]) !== null && _response$data$fileSt2 !== void 0 && _response$data$fileSt2.url ? window.open(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$fileS = _response$data2.fileStoreIds) === null || _response$data2$fileS === void 0 ? void 0 : (_response$data2$fileS2 = _response$data2$fileS[0]) === null || _response$data2$fileS2 === void 0 ? void 0 : _response$data2$fileS2.url) : null;
|
|
442
442
|
};
|
|
443
443
|
const createPayloadOfWS = async data => {
|
|
444
|
-
var _data$cpt, _data$cpt$details, _data$cpt$details$own, _data$applicationSele, _data$
|
|
444
|
+
var _data$cpt, _data$cpt$details, _data$cpt$details$own, _data$applicationSele, _data$ConnectionDetai, _data$ConnectionDetai2, _ref, _data$ConnectionHolde, _data$useDetails, _data$useDetails2, _data$useDetails3, _data$useDetails3$pro, _connectionDetailsObj, _connectionDetailsObj2, _data$useDetails4, _data$useDetails4$pro, _connectionDetailsObj3, _connectionDetailsObj4, _data$useDetails5, _data$useDetails6, _data$useDetails7, _data$useDetails8, _connectionHolder$gen, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ow, _data$cpt2$details$ow2, _connectionHolder$own, _connectionHolder$rel, _data$propertyAddress, _data$applicant, _data$useDetails9, _data$useDetails9$gen, _data$contact, _data$applicant2, _data$applicant3, _data$applicant4, _data$contact2, _data$contact3, _data$applicationSele2, _data$applicationSele3, _data$contact4, _data$cpt3, _data$cpt4, _data$cpt4$details, _data$propertyAddress2, _data$propertyAddress3, _data$propertyAddress4, _data$cpt5, _data$cpt5$details, _data$cpt5$details$ad, _data$propertyAddress5, _data$cpt6, _data$cpt6$details, _data$cpt6$details$ad, _data$propertyAddress6, _data$cpt7, _data$cpt7$details, _data$cpt7$details$ad, _data$propertyAddress7, _data$cpt8, _data$cpt8$details, _data$cpt8$details$ad, _data$propertyAddress8, _data$cpt9, _data$cpt9$details, _data$cpt9$details$ad, _data$propertyAddress9, _data$cpt0, _data$cpt0$details, _data$cpt0$details$ad, _data$propertyAddress0, _data$cpt1, _data$cpt1$details, _data$cpt1$details$ad, _data$propertyAddress1, _data$cpt10, _data$cpt10$details, _data$cpt10$details$a, _data$propertyAddress10, _data$cpt11, _data$cpt11$details, _data$cpt11$details$a, _data$cpt12, _data$cpt12$details, _data$cpt12$details$a, _data$propertyAddress11, _data$cpt13, _data$cpt13$details, _data$cpt13$details$a, _data$cpt13$details$a2, _data$propertyAddress12, _data$cpt14, _data$cpt14$details, _data$cpt14$details$a, _data$cpt14$details$a2, _data$propertyAddress13, _data$cpt15, _data$cpt15$details, _data$cpt15$details$a, _data$cpt15$details$a2, _data$cpt16, _data$cpt16$details, _data$roadCuttingDeta, _data$plumberDetails, _data$zro, _data$propertyAddress14, _data$propertyAddress15, _data$cpt17, _data$cpt17$details, _data$cpt17$details$a, _data$cpt17$details$a2, _data$plumberDetails2, _data$plumberDetails3, _data$plumberDetails4, _data$plumberDetails5, _data$plumberDetails6, _data$applicationSele4, _data$applicationSele5, _data$applicationSele6, _data$applicationSele7, _connectionDetailsObj5, _data$applicationSele8, _data$applicationSele9, _connectionHolder$own2, _data$applicationSele0, _data$applicationSele1, _data$applicationSele10, _data$applicationSele11, _data$applicationSele12, _data$applicationSele13, _data$applicationSele14, _data$applicationSele15, _data$applicationSele16, _data$applicationSele17, _data$applicationSele18, _data$applicationSele19, _data$applicationSele20, _data$applicationSele21, _data$applicationSele22, _data$applicationSele23, _data$applicationSele24, _data$contact5, _data$documents, _data$documents2, _data$documents3, _data$documents4, _data$cpt18, _Digit, _Digit$Customizations, _Digit$Customizations2, _Digit2, _Digit2$Customization, _Digit2$Customization2;
|
|
445
445
|
data === null || data === void 0 ? void 0 : (_data$cpt = data.cpt) === null || _data$cpt === void 0 ? void 0 : (_data$cpt$details = _data$cpt.details) === null || _data$cpt$details === void 0 ? void 0 : (_data$cpt$details$own = _data$cpt$details.owners) === null || _data$cpt$details$own === void 0 ? void 0 : _data$cpt$details$own.forEach(owner => {
|
|
446
446
|
if (owner !== null && owner !== void 0 && owner.permanentAddress) owner.correspondenceAddress = owner === null || owner === void 0 ? void 0 : owner.permanentAddress;
|
|
447
447
|
});
|
|
448
|
-
const
|
|
448
|
+
const srvObj = (data === null || data === void 0 ? void 0 : (_data$applicationSele = data.applicationSelection) === null || _data$applicationSele === void 0 ? void 0 : _data$applicationSele.serviceType) || (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai = data.ConnectionDetails) === null || _data$ConnectionDetai === void 0 ? void 0 : (_data$ConnectionDetai2 = _data$ConnectionDetai[0]) === null || _data$ConnectionDetai2 === void 0 ? void 0 : _data$ConnectionDetai2.serviceType);
|
|
449
|
+
const serviceType = ((_ref = typeof srvObj === "object" ? srvObj === null || srvObj === void 0 ? void 0 : srvObj.code : srvObj) === null || _ref === void 0 ? void 0 : _ref.toUpperCase()) || "WATER";
|
|
449
450
|
const connectionDetailsArray = Array.isArray(data === null || data === void 0 ? void 0 : data.ConnectionDetails) ? data.ConnectionDetails : data !== null && data !== void 0 && data.ConnectionDetails ? Object.values(data.ConnectionDetails).filter(i => typeof i === "object") : [];
|
|
450
451
|
const connectionDetail = (connectionDetailsArray === null || connectionDetailsArray === void 0 ? void 0 : connectionDetailsArray[0]) || (data === null || data === void 0 ? void 0 : data.ConnectionDetails) || {};
|
|
451
|
-
const isWater = serviceType === "WATER" || serviceType === "BOTH" || (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.water);
|
|
452
|
-
const isSewerage = serviceType === "SEWERAGE" || serviceType === "BOTH" || (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.sewerage);
|
|
452
|
+
const isWater = (serviceType === null || serviceType === void 0 ? void 0 : serviceType.includes("WATER")) || serviceType === "BOTH" || (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.water);
|
|
453
|
+
const isSewerage = (serviceType === null || serviceType === void 0 ? void 0 : serviceType.includes("SEWERAGE")) || serviceType === "BOTH" || (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.sewerage);
|
|
453
454
|
const connectionDetailsObject = connectionDetail;
|
|
454
455
|
const useDetailsObject = (data === null || data === void 0 ? void 0 : data.useDetails) || connectionDetailsObject || {};
|
|
455
456
|
const connectionHolder = (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde = data.ConnectionHolderDetails) === null || _data$ConnectionHolde === void 0 ? void 0 : _data$ConnectionHolde[0]) || (data === null || data === void 0 ? void 0 : data.ConnectionHolderDetails);
|
|
@@ -466,24 +467,50 @@ const createPayloadOfWS = async data => {
|
|
|
466
467
|
gender: (connectionHolder === null || connectionHolder === void 0 ? void 0 : (_connectionHolder$gen = connectionHolder.gender) === null || _connectionHolder$gen === void 0 ? void 0 : _connectionHolder$gen.code) || (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.gender) || "",
|
|
467
468
|
mobileNumber: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.mobileNumber) || (data === null || data === void 0 ? void 0 : (_data$cpt2 = data.cpt) === null || _data$cpt2 === void 0 ? void 0 : (_data$cpt2$details = _data$cpt2.details) === null || _data$cpt2$details === void 0 ? void 0 : (_data$cpt2$details$ow = _data$cpt2$details.owners) === null || _data$cpt2$details$ow === void 0 ? void 0 : (_data$cpt2$details$ow2 = _data$cpt2$details$ow[0]) === null || _data$cpt2$details$ow2 === void 0 ? void 0 : _data$cpt2$details$ow2.mobileNumber) || "",
|
|
468
469
|
name: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.name) || "",
|
|
470
|
+
middleName: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.middleName) || "",
|
|
471
|
+
lastName: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.lastName) || "",
|
|
472
|
+
emailId: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.emailId) || "",
|
|
473
|
+
watsAppMobileNumber: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.watsAppMobileNumber) || "",
|
|
474
|
+
isWatsappSameAsMobile: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.isWatsappSameAsMobile) || false,
|
|
469
475
|
ownerType: (connectionHolder === null || connectionHolder === void 0 ? void 0 : (_connectionHolder$own = connectionHolder.ownerType) === null || _connectionHolder$own === void 0 ? void 0 : _connectionHolder$own.code) || (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.ownerType) || "",
|
|
470
476
|
relationship: (connectionHolder === null || connectionHolder === void 0 ? void 0 : (_connectionHolder$rel = connectionHolder.relationship) === null || _connectionHolder$rel === void 0 ? void 0 : _connectionHolder$rel.code) || (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.relationship) || "OTHERS",
|
|
471
|
-
sameAsPropertyAddress: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.sameAsOwnerDetails) || (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.sameAsPropertyAddress) || false
|
|
472
|
-
emailId: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.emailId) || ""
|
|
477
|
+
sameAsPropertyAddress: (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.sameAsOwnerDetails) || (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.sameAsPropertyAddress) || false
|
|
473
478
|
}] : [{
|
|
474
479
|
correspondenceAddress: (data === null || data === void 0 ? void 0 : (_data$propertyAddress = data.propertyAddress) === null || _data$propertyAddress === void 0 ? void 0 : _data$propertyAddress.address) || "",
|
|
475
480
|
fatherOrHusbandName: (data === null || data === void 0 ? void 0 : (_data$applicant = data.applicant) === null || _data$applicant === void 0 ? void 0 : _data$applicant.ParentorSpouse) || "",
|
|
476
481
|
gender: (data === null || data === void 0 ? void 0 : (_data$useDetails9 = data.useDetails) === null || _data$useDetails9 === void 0 ? void 0 : (_data$useDetails9$gen = _data$useDetails9.gender) === null || _data$useDetails9$gen === void 0 ? void 0 : _data$useDetails9$gen.code) || "",
|
|
477
482
|
mobileNumber: (data === null || data === void 0 ? void 0 : (_data$contact = data.contact) === null || _data$contact === void 0 ? void 0 : _data$contact.mobileNumber) || "",
|
|
478
483
|
name: `${data === null || data === void 0 ? void 0 : (_data$applicant2 = data.applicant) === null || _data$applicant2 === void 0 ? void 0 : _data$applicant2.firstName} ${(data === null || data === void 0 ? void 0 : (_data$applicant3 = data.applicant) === null || _data$applicant3 === void 0 ? void 0 : _data$applicant3.middleName) || ""} ${data === null || data === void 0 ? void 0 : (_data$applicant4 = data.applicant) === null || _data$applicant4 === void 0 ? void 0 : _data$applicant4.lastName}`.replace(/\s+/g, " ").trim(),
|
|
479
|
-
|
|
484
|
+
watsAppMobileNumber: (data === null || data === void 0 ? void 0 : (_data$contact2 = data.contact) === null || _data$contact2 === void 0 ? void 0 : _data$contact2.watsAppMobileNumber) || "",
|
|
485
|
+
isWatsappSameAsMobile: (data === null || data === void 0 ? void 0 : (_data$contact3 = data.contact) === null || _data$contact3 === void 0 ? void 0 : _data$contact3.isWatsappSameAsMobile) || false,
|
|
486
|
+
ownerType: (data === null || data === void 0 ? void 0 : (_data$applicationSele2 = data.applicationSelection) === null || _data$applicationSele2 === void 0 ? void 0 : (_data$applicationSele3 = _data$applicationSele2.categoryType) === null || _data$applicationSele3 === void 0 ? void 0 : _data$applicationSele3.code) || "",
|
|
480
487
|
relationship: "OTHERS",
|
|
481
488
|
sameAsPropertyAddress: true,
|
|
482
|
-
emailId: (data === null || data === void 0 ? void 0 : (_data$
|
|
489
|
+
emailId: (data === null || data === void 0 ? void 0 : (_data$contact4 = data.contact) === null || _data$contact4 === void 0 ? void 0 : _data$contact4.emailId) || ""
|
|
483
490
|
}],
|
|
484
491
|
service: isWater && !isSewerage ? "Water" : !isWater && isSewerage ? "Sewerage" : "Water And Sewerage",
|
|
485
|
-
property:
|
|
486
|
-
|
|
492
|
+
property: {
|
|
493
|
+
...(data === null || data === void 0 ? void 0 : (_data$cpt3 = data.cpt) === null || _data$cpt3 === void 0 ? void 0 : _data$cpt3.details),
|
|
494
|
+
address: {
|
|
495
|
+
...(data === null || data === void 0 ? void 0 : (_data$cpt4 = data.cpt) === null || _data$cpt4 === void 0 ? void 0 : (_data$cpt4$details = _data$cpt4.details) === null || _data$cpt4$details === void 0 ? void 0 : _data$cpt4$details.address),
|
|
496
|
+
city: (data === null || data === void 0 ? void 0 : (_data$propertyAddress2 = data.propertyAddress) === null || _data$propertyAddress2 === void 0 ? void 0 : (_data$propertyAddress3 = _data$propertyAddress2.city) === null || _data$propertyAddress3 === void 0 ? void 0 : _data$propertyAddress3.code) || (data === null || data === void 0 ? void 0 : (_data$propertyAddress4 = data.propertyAddress) === null || _data$propertyAddress4 === void 0 ? void 0 : _data$propertyAddress4.city) || (data === null || data === void 0 ? void 0 : (_data$cpt5 = data.cpt) === null || _data$cpt5 === void 0 ? void 0 : (_data$cpt5$details = _data$cpt5.details) === null || _data$cpt5$details === void 0 ? void 0 : (_data$cpt5$details$ad = _data$cpt5$details.address) === null || _data$cpt5$details$ad === void 0 ? void 0 : _data$cpt5$details$ad.city),
|
|
497
|
+
locality: (data === null || data === void 0 ? void 0 : (_data$propertyAddress5 = data.propertyAddress) === null || _data$propertyAddress5 === void 0 ? void 0 : _data$propertyAddress5.locality) || (data === null || data === void 0 ? void 0 : (_data$cpt6 = data.cpt) === null || _data$cpt6 === void 0 ? void 0 : (_data$cpt6$details = _data$cpt6.details) === null || _data$cpt6$details === void 0 ? void 0 : (_data$cpt6$details$ad = _data$cpt6$details.address) === null || _data$cpt6$details$ad === void 0 ? void 0 : _data$cpt6$details$ad.locality),
|
|
498
|
+
pincode: (data === null || data === void 0 ? void 0 : (_data$propertyAddress6 = data.propertyAddress) === null || _data$propertyAddress6 === void 0 ? void 0 : _data$propertyAddress6.pinCode) || (data === null || data === void 0 ? void 0 : (_data$cpt7 = data.cpt) === null || _data$cpt7 === void 0 ? void 0 : (_data$cpt7$details = _data$cpt7.details) === null || _data$cpt7$details === void 0 ? void 0 : (_data$cpt7$details$ad = _data$cpt7$details.address) === null || _data$cpt7$details$ad === void 0 ? void 0 : _data$cpt7$details$ad.pincode),
|
|
499
|
+
doorNo: (data === null || data === void 0 ? void 0 : (_data$propertyAddress7 = data.propertyAddress) === null || _data$propertyAddress7 === void 0 ? void 0 : _data$propertyAddress7.houseNo) || (data === null || data === void 0 ? void 0 : (_data$cpt8 = data.cpt) === null || _data$cpt8 === void 0 ? void 0 : (_data$cpt8$details = _data$cpt8.details) === null || _data$cpt8$details === void 0 ? void 0 : (_data$cpt8$details$ad = _data$cpt8$details.address) === null || _data$cpt8$details$ad === void 0 ? void 0 : _data$cpt8$details$ad.doorNo),
|
|
500
|
+
street: (data === null || data === void 0 ? void 0 : (_data$propertyAddress8 = data.propertyAddress) === null || _data$propertyAddress8 === void 0 ? void 0 : _data$propertyAddress8.street) || (data === null || data === void 0 ? void 0 : (_data$cpt9 = data.cpt) === null || _data$cpt9 === void 0 ? void 0 : (_data$cpt9$details = _data$cpt9.details) === null || _data$cpt9$details === void 0 ? void 0 : (_data$cpt9$details$ad = _data$cpt9$details.address) === null || _data$cpt9$details$ad === void 0 ? void 0 : _data$cpt9$details$ad.street),
|
|
501
|
+
landmark: (data === null || data === void 0 ? void 0 : (_data$propertyAddress9 = data.propertyAddress) === null || _data$propertyAddress9 === void 0 ? void 0 : _data$propertyAddress9.landmark) || (data === null || data === void 0 ? void 0 : (_data$cpt0 = data.cpt) === null || _data$cpt0 === void 0 ? void 0 : (_data$cpt0$details = _data$cpt0.details) === null || _data$cpt0$details === void 0 ? void 0 : (_data$cpt0$details$ad = _data$cpt0$details.address) === null || _data$cpt0$details$ad === void 0 ? void 0 : _data$cpt0$details$ad.landmark),
|
|
502
|
+
latitude: (data === null || data === void 0 ? void 0 : (_data$propertyAddress0 = data.propertyAddress) === null || _data$propertyAddress0 === void 0 ? void 0 : _data$propertyAddress0.Latitude) || (data === null || data === void 0 ? void 0 : (_data$cpt1 = data.cpt) === null || _data$cpt1 === void 0 ? void 0 : (_data$cpt1$details = _data$cpt1.details) === null || _data$cpt1$details === void 0 ? void 0 : (_data$cpt1$details$ad = _data$cpt1$details.address) === null || _data$cpt1$details$ad === void 0 ? void 0 : _data$cpt1$details$ad.latitude),
|
|
503
|
+
longitude: (data === null || data === void 0 ? void 0 : (_data$propertyAddress1 = data.propertyAddress) === null || _data$propertyAddress1 === void 0 ? void 0 : _data$propertyAddress1.Longitude) || (data === null || data === void 0 ? void 0 : (_data$cpt10 = data.cpt) === null || _data$cpt10 === void 0 ? void 0 : (_data$cpt10$details = _data$cpt10.details) === null || _data$cpt10$details === void 0 ? void 0 : (_data$cpt10$details$a = _data$cpt10$details.address) === null || _data$cpt10$details$a === void 0 ? void 0 : _data$cpt10$details$a.longitude),
|
|
504
|
+
buildingName: (data === null || data === void 0 ? void 0 : (_data$propertyAddress10 = data.propertyAddress) === null || _data$propertyAddress10 === void 0 ? void 0 : _data$propertyAddress10.address) || (data === null || data === void 0 ? void 0 : (_data$cpt11 = data.cpt) === null || _data$cpt11 === void 0 ? void 0 : (_data$cpt11$details = _data$cpt11.details) === null || _data$cpt11$details === void 0 ? void 0 : (_data$cpt11$details$a = _data$cpt11$details.address) === null || _data$cpt11$details$a === void 0 ? void 0 : _data$cpt11$details$a.buildingName),
|
|
505
|
+
additionalDetails: {
|
|
506
|
+
...(data === null || data === void 0 ? void 0 : (_data$cpt12 = data.cpt) === null || _data$cpt12 === void 0 ? void 0 : (_data$cpt12$details = _data$cpt12.details) === null || _data$cpt12$details === void 0 ? void 0 : (_data$cpt12$details$a = _data$cpt12$details.address) === null || _data$cpt12$details$a === void 0 ? void 0 : _data$cpt12$details$a.additionalDetails),
|
|
507
|
+
assembly: (data === null || data === void 0 ? void 0 : (_data$propertyAddress11 = data.propertyAddress) === null || _data$propertyAddress11 === void 0 ? void 0 : _data$propertyAddress11.Assembly) || (data === null || data === void 0 ? void 0 : (_data$cpt13 = data.cpt) === null || _data$cpt13 === void 0 ? void 0 : (_data$cpt13$details = _data$cpt13.details) === null || _data$cpt13$details === void 0 ? void 0 : (_data$cpt13$details$a = _data$cpt13$details.address) === null || _data$cpt13$details$a === void 0 ? void 0 : (_data$cpt13$details$a2 = _data$cpt13$details$a.additionalDetails) === null || _data$cpt13$details$a2 === void 0 ? void 0 : _data$cpt13$details$a2.assembly),
|
|
508
|
+
block: (data === null || data === void 0 ? void 0 : (_data$propertyAddress12 = data.propertyAddress) === null || _data$propertyAddress12 === void 0 ? void 0 : _data$propertyAddress12.block) || (data === null || data === void 0 ? void 0 : (_data$cpt14 = data.cpt) === null || _data$cpt14 === void 0 ? void 0 : (_data$cpt14$details = _data$cpt14.details) === null || _data$cpt14$details === void 0 ? void 0 : (_data$cpt14$details$a = _data$cpt14$details.address) === null || _data$cpt14$details$a === void 0 ? void 0 : (_data$cpt14$details$a2 = _data$cpt14$details$a.additionalDetails) === null || _data$cpt14$details$a2 === void 0 ? void 0 : _data$cpt14$details$a2.block),
|
|
509
|
+
zone: (data === null || data === void 0 ? void 0 : (_data$propertyAddress13 = data.propertyAddress) === null || _data$propertyAddress13 === void 0 ? void 0 : _data$propertyAddress13.zone) || (data === null || data === void 0 ? void 0 : (_data$cpt15 = data.cpt) === null || _data$cpt15 === void 0 ? void 0 : (_data$cpt15$details = _data$cpt15.details) === null || _data$cpt15$details === void 0 ? void 0 : (_data$cpt15$details$a = _data$cpt15$details.address) === null || _data$cpt15$details$a === void 0 ? void 0 : (_data$cpt15$details$a2 = _data$cpt15$details$a.additionalDetails) === null || _data$cpt15$details$a2 === void 0 ? void 0 : _data$cpt15$details$a2.zone)
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
propertyId: data === null || data === void 0 ? void 0 : (_data$cpt16 = data.cpt) === null || _data$cpt16 === void 0 ? void 0 : (_data$cpt16$details = _data$cpt16.details) === null || _data$cpt16$details === void 0 ? void 0 : _data$cpt16$details.propertyId,
|
|
487
514
|
roadCuttingInfo: data === null || data === void 0 ? void 0 : (_data$roadCuttingDeta = data.roadCuttingDetails) === null || _data$roadCuttingDeta === void 0 ? void 0 : _data$roadCuttingDeta.filter(o => {
|
|
488
515
|
var _o$roadType;
|
|
489
516
|
return (o === null || o === void 0 ? void 0 : (_o$roadType = o.roadType) === null || _o$roadType === void 0 ? void 0 : _o$roadType.code) !== "";
|
|
@@ -515,22 +542,25 @@ const createPayloadOfWS = async data => {
|
|
|
515
542
|
...useDetailsObject,
|
|
516
543
|
...(data === null || data === void 0 ? void 0 : data.djbEmployee),
|
|
517
544
|
...(data === null || data === void 0 ? void 0 : data.bankDetails),
|
|
545
|
+
...(data === null || data === void 0 ? void 0 : data.declarationData),
|
|
546
|
+
...(data === null || data === void 0 ? void 0 : data.declaration),
|
|
518
547
|
zro: (data === null || data === void 0 ? void 0 : (_data$zro = data.zro) === null || _data$zro === void 0 ? void 0 : _data$zro.code) || (data === null || data === void 0 ? void 0 : data.zro),
|
|
519
|
-
locality: (data === null || data === void 0 ? void 0 : (_data$
|
|
548
|
+
locality: (data === null || data === void 0 ? void 0 : (_data$propertyAddress14 = data.propertyAddress) === null || _data$propertyAddress14 === void 0 ? void 0 : (_data$propertyAddress15 = _data$propertyAddress14.locality) === null || _data$propertyAddress15 === void 0 ? void 0 : _data$propertyAddress15.code) || (data === null || data === void 0 ? void 0 : (_data$cpt17 = data.cpt) === null || _data$cpt17 === void 0 ? void 0 : (_data$cpt17$details = _data$cpt17.details) === null || _data$cpt17$details === void 0 ? void 0 : (_data$cpt17$details$a = _data$cpt17$details.address) === null || _data$cpt17$details$a === void 0 ? void 0 : (_data$cpt17$details$a2 = _data$cpt17$details$a.locality) === null || _data$cpt17$details$a2 === void 0 ? void 0 : _data$cpt17$details$a2.code),
|
|
520
549
|
detailsProvidedBy: (data === null || data === void 0 ? void 0 : (_data$plumberDetails2 = data.plumberDetails) === null || _data$plumberDetails2 === void 0 ? void 0 : (_data$plumberDetails3 = _data$plumberDetails2[0]) === null || _data$plumberDetails3 === void 0 ? void 0 : (_data$plumberDetails4 = _data$plumberDetails3.detailsProvidedBy) === null || _data$plumberDetails4 === void 0 ? void 0 : _data$plumberDetails4.code) || (data === null || data === void 0 ? void 0 : (_data$plumberDetails5 = data.plumberDetails) === null || _data$plumberDetails5 === void 0 ? void 0 : (_data$plumberDetails6 = _data$plumberDetails5[0]) === null || _data$plumberDetails6 === void 0 ? void 0 : _data$plumberDetails6.detailsProvidedBy) || "",
|
|
521
|
-
applicantType: data === null || data === void 0 ? void 0 : (_data$
|
|
522
|
-
connectionType: (data === null || data === void 0 ? void 0 : (_data$
|
|
523
|
-
categoryType: (data === null || data === void 0 ? void 0 : (_data$
|
|
524
|
-
subCategory: data === null || data === void 0 ? void 0 : (_data$
|
|
525
|
-
domesticType: data === null || data === void 0 ? void 0 : (_data$
|
|
526
|
-
temporaryConnection: data === null || data === void 0 ? void 0 : (_data$
|
|
527
|
-
ownerAuthorizationDoc: data === null || data === void 0 ? void 0 : (_data$
|
|
528
|
-
ownerContactNumber: data === null || data === void 0 ? void 0 : (_data$
|
|
529
|
-
isOwnerVerified: data === null || data === void 0 ? void 0 : (_data$
|
|
530
|
-
commercialType: data === null || data === void 0 ? void 0 : (_data$
|
|
531
|
-
govtOrganization: data === null || data === void 0 ? void 0 : (_data$
|
|
550
|
+
applicantType: data === null || data === void 0 ? void 0 : (_data$applicationSele4 = data.applicationSelection) === null || _data$applicationSele4 === void 0 ? void 0 : (_data$applicationSele5 = _data$applicationSele4.applicantType) === null || _data$applicationSele5 === void 0 ? void 0 : _data$applicationSele5.code,
|
|
551
|
+
connectionType: (data === null || data === void 0 ? void 0 : (_data$applicationSele6 = data.applicationSelection) === null || _data$applicationSele6 === void 0 ? void 0 : (_data$applicationSele7 = _data$applicationSele6.connectionType) === null || _data$applicationSele7 === void 0 ? void 0 : _data$applicationSele7.code) || (connectionDetailsObject === null || connectionDetailsObject === void 0 ? void 0 : (_connectionDetailsObj5 = connectionDetailsObject.connectionType) === null || _connectionDetailsObj5 === void 0 ? void 0 : _connectionDetailsObj5.code) || (connectionDetailsObject === null || connectionDetailsObject === void 0 ? void 0 : connectionDetailsObject.connectionType) || "Metered",
|
|
552
|
+
categoryType: (data === null || data === void 0 ? void 0 : (_data$applicationSele8 = data.applicationSelection) === null || _data$applicationSele8 === void 0 ? void 0 : (_data$applicationSele9 = _data$applicationSele8.categoryType) === null || _data$applicationSele9 === void 0 ? void 0 : _data$applicationSele9.code) || (connectionHolder === null || connectionHolder === void 0 ? void 0 : (_connectionHolder$own2 = connectionHolder.ownerType) === null || _connectionHolder$own2 === void 0 ? void 0 : _connectionHolder$own2.code) || (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.ownerType),
|
|
553
|
+
subCategory: data === null || data === void 0 ? void 0 : (_data$applicationSele0 = data.applicationSelection) === null || _data$applicationSele0 === void 0 ? void 0 : (_data$applicationSele1 = _data$applicationSele0.subCategory) === null || _data$applicationSele1 === void 0 ? void 0 : _data$applicationSele1.code,
|
|
554
|
+
domesticType: data === null || data === void 0 ? void 0 : (_data$applicationSele10 = data.applicationSelection) === null || _data$applicationSele10 === void 0 ? void 0 : (_data$applicationSele11 = _data$applicationSele10.domesticType) === null || _data$applicationSele11 === void 0 ? void 0 : _data$applicationSele11.code,
|
|
555
|
+
temporaryConnection: data === null || data === void 0 ? void 0 : (_data$applicationSele12 = data.applicationSelection) === null || _data$applicationSele12 === void 0 ? void 0 : (_data$applicationSele13 = _data$applicationSele12.temporaryConnection) === null || _data$applicationSele13 === void 0 ? void 0 : _data$applicationSele13.code,
|
|
556
|
+
ownerAuthorizationDoc: data === null || data === void 0 ? void 0 : (_data$applicationSele14 = data.applicationSelection) === null || _data$applicationSele14 === void 0 ? void 0 : (_data$applicationSele15 = _data$applicationSele14.ownerAuthorizationDoc) === null || _data$applicationSele15 === void 0 ? void 0 : (_data$applicationSele16 = _data$applicationSele15[0]) === null || _data$applicationSele16 === void 0 ? void 0 : (_data$applicationSele17 = _data$applicationSele16[1]) === null || _data$applicationSele17 === void 0 ? void 0 : _data$applicationSele17.fileStoreId,
|
|
557
|
+
ownerContactNumber: data === null || data === void 0 ? void 0 : (_data$applicationSele18 = data.applicationSelection) === null || _data$applicationSele18 === void 0 ? void 0 : _data$applicationSele18.ownerContactNumber,
|
|
558
|
+
isOwnerVerified: data === null || data === void 0 ? void 0 : (_data$applicationSele19 = data.applicationSelection) === null || _data$applicationSele19 === void 0 ? void 0 : _data$applicationSele19.isOwnerVerified,
|
|
559
|
+
commercialType: data === null || data === void 0 ? void 0 : (_data$applicationSele20 = data.applicationSelection) === null || _data$applicationSele20 === void 0 ? void 0 : (_data$applicationSele21 = _data$applicationSele20.commercialType) === null || _data$applicationSele21 === void 0 ? void 0 : _data$applicationSele21.code,
|
|
560
|
+
govtOrganization: data === null || data === void 0 ? void 0 : (_data$applicationSele22 = data.applicationSelection) === null || _data$applicationSele22 === void 0 ? void 0 : _data$applicationSele22.govtOrganization,
|
|
561
|
+
departmentType: data === null || data === void 0 ? void 0 : (_data$applicationSele23 = data.applicationSelection) === null || _data$applicationSele23 === void 0 ? void 0 : (_data$applicationSele24 = _data$applicationSele23.departmentType) === null || _data$applicationSele24 === void 0 ? void 0 : _data$applicationSele24.code,
|
|
532
562
|
governmentEmployee: data === null || data === void 0 ? void 0 : data.governmentEmployee,
|
|
533
|
-
whatsAppNumber: data === null || data === void 0 ? void 0 : (_data$
|
|
563
|
+
whatsAppNumber: data === null || data === void 0 ? void 0 : (_data$contact5 = data.contact) === null || _data$contact5 === void 0 ? void 0 : _data$contact5.whatsAppNumber,
|
|
534
564
|
identityProofNumber: data === null || data === void 0 ? void 0 : (_data$documents = data.documents) === null || _data$documents === void 0 ? void 0 : _data$documents.identityProofNumber,
|
|
535
565
|
ownershipDocumentNumber: data === null || data === void 0 ? void 0 : (_data$documents2 = data.documents) === null || _data$documents2 === void 0 ? void 0 : _data$documents2.ownershipDocumentNumber,
|
|
536
566
|
otherDocumentNumber: data === null || data === void 0 ? void 0 : (_data$documents3 = data.documents) === null || _data$documents3 === void 0 ? void 0 : _data$documents3.otherDocumentNumber,
|
|
@@ -542,8 +572,8 @@ const createPayloadOfWS = async data => {
|
|
|
542
572
|
},
|
|
543
573
|
channel: Digit.UserService.getType() === "CITIZEN" ? "CITIZEN" : "CFC_COUNTER"
|
|
544
574
|
};
|
|
545
|
-
sessionStorage.setItem("WS_DOCUMENTS_INOF", JSON.stringify((data === null || data === void 0 ? void 0 : data.documents) || []));
|
|
546
|
-
sessionStorage.setItem("WS_PROPERTY_INOF", JSON.stringify((data === null || data === void 0 ? void 0 : (_data$
|
|
575
|
+
sessionStorage.setItem("WS_DOCUMENTS_INOF", JSON.stringify((data === null || data === void 0 ? void 0 : (_data$documents4 = data.documents) === null || _data$documents4 === void 0 ? void 0 : _data$documents4.documents) || (data === null || data === void 0 ? void 0 : data.documents) || []));
|
|
576
|
+
sessionStorage.setItem("WS_PROPERTY_INOF", JSON.stringify((data === null || data === void 0 ? void 0 : (_data$cpt18 = data.cpt) === null || _data$cpt18 === void 0 ? void 0 : _data$cpt18.details) || {}));
|
|
547
577
|
payload = (_Digit = Digit) !== null && _Digit !== void 0 && (_Digit$Customizations = _Digit.Customizations) !== null && _Digit$Customizations !== void 0 && (_Digit$Customizations2 = _Digit$Customizations.WS) !== null && _Digit$Customizations2 !== void 0 && _Digit$Customizations2.customiseCreatePayloadOfWS ? (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$Customization = _Digit2.Customizations) === null || _Digit2$Customization === void 0 ? void 0 : (_Digit2$Customization2 = _Digit2$Customization.WS) === null || _Digit2$Customization2 === void 0 ? void 0 : _Digit2$Customization2.customiseCreatePayloadOfWS(data, payload) : payload;
|
|
548
578
|
return payload;
|
|
549
579
|
};
|
|
@@ -563,11 +593,11 @@ const updatePayloadOfWS = async (data, type) => {
|
|
|
563
593
|
return payload;
|
|
564
594
|
};
|
|
565
595
|
const convertToWSUpdate = data => {
|
|
566
|
-
var _data$WaterConnection, _data$WaterConnection2, _data$
|
|
596
|
+
var _data$WaterConnection, _data$WaterConnection2, _data$documents5, _Digit5, _Digit5$Customization, _Digit5$Customization2, _Digit6, _Digit6$Customization, _Digit6$Customization2;
|
|
567
597
|
let formdata = {
|
|
568
598
|
WaterConnection: {
|
|
569
599
|
...(data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnectionResult) === null || _data$WaterConnection === void 0 ? void 0 : (_data$WaterConnection2 = _data$WaterConnection.WaterConnection) === null || _data$WaterConnection2 === void 0 ? void 0 : _data$WaterConnection2[0]),
|
|
570
|
-
documents: [...(data === null || data === void 0 ? void 0 : (_data$
|
|
600
|
+
documents: [...(data === null || data === void 0 ? void 0 : (_data$documents5 = data.documents) === null || _data$documents5 === void 0 ? void 0 : _data$documents5.documents)],
|
|
571
601
|
processInstance: {
|
|
572
602
|
action: "SUBMIT_APPLICATION"
|
|
573
603
|
}
|
|
@@ -577,7 +607,7 @@ const convertToWSUpdate = data => {
|
|
|
577
607
|
return formdata;
|
|
578
608
|
};
|
|
579
609
|
const convertToEditWSUpdate = data => {
|
|
580
|
-
var _data$WaterConnection3, _data$WaterConnection4, _data$
|
|
610
|
+
var _data$WaterConnection3, _data$WaterConnection4, _data$documents6, _data$ConnectionHolde2, _data$ConnectionHolde3, _data$ConnectionHolde4, _data$ConnectionHolde5, _data$ConnectionHolde6, _data$ConnectionHolde7, _data$ConnectionHolde8, _data$ConnectionHolde9, _data$ConnectionHolde0, _data$ConnectionHolde1, _data$ConnectionHolde10, _data$ConnectionHolde11, _data$ConnectionHolde12, _data$ConnectionHolde13, _data$ConnectionHolde14, _data$ConnectionHolde15, _data$waterConectionD, _data$waterConectionD2, _data$waterConectionD3, _data$applicationType, _data$applicationType2, _data$serviceName, _waterResult$serviceN, _data$documents7, _data$sewerageConnect, _data$sewerageConnect2, _Digit7, _Digit7$Customization, _Digit7$Customization2, _Digit8, _Digit8$Customization, _Digit8$Customization2;
|
|
581
611
|
let waterResult = data === null || data === void 0 ? void 0 : (_data$WaterConnection3 = data.WaterConnectionResult) === null || _data$WaterConnection3 === void 0 ? void 0 : (_data$WaterConnection4 = _data$WaterConnection3.WaterConnection) === null || _data$WaterConnection4 === void 0 ? void 0 : _data$WaterConnection4[0];
|
|
582
612
|
let formdata = {
|
|
583
613
|
WaterConnection: {
|
|
@@ -589,7 +619,7 @@ const convertToEditWSUpdate = data => {
|
|
|
589
619
|
status: data !== null && data !== void 0 && data.isEditApplication ? data === null || data === void 0 ? void 0 : data.status : waterResult === null || waterResult === void 0 ? void 0 : waterResult.status,
|
|
590
620
|
connectionNo: (data !== null && data !== void 0 && data.isEditApplication ? data === null || data === void 0 ? void 0 : data.connectionNo : waterResult === null || waterResult === void 0 ? void 0 : waterResult.connectionNo) || null,
|
|
591
621
|
oldConnectionNo: null,
|
|
592
|
-
documents: [...(data === null || data === void 0 ? void 0 : (_data$
|
|
622
|
+
documents: [...(data === null || data === void 0 ? void 0 : (_data$documents6 = data.documents) === null || _data$documents6 === void 0 ? void 0 : _data$documents6.documents)],
|
|
593
623
|
plumberInfo: data !== null && data !== void 0 && data.isEditApplication ? data === null || data === void 0 ? void 0 : data.plumberInfo : (waterResult === null || waterResult === void 0 ? void 0 : waterResult.plumberInfo) || [],
|
|
594
624
|
roadType: null,
|
|
595
625
|
roadCuttingArea: null,
|
|
@@ -618,10 +648,13 @@ const convertToEditWSUpdate = data => {
|
|
|
618
648
|
gender: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde5 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde5 === void 0 ? void 0 : (_data$ConnectionHolde6 = _data$ConnectionHolde5.gender) === null || _data$ConnectionHolde6 === void 0 ? void 0 : _data$ConnectionHolde6.code) || "",
|
|
619
649
|
mobileNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde7 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde7 === void 0 ? void 0 : _data$ConnectionHolde7.mobileNumber) || "",
|
|
620
650
|
name: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde8 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde8 === void 0 ? void 0 : _data$ConnectionHolde8.name) || "",
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
651
|
+
middleName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde9 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde9 === void 0 ? void 0 : _data$ConnectionHolde9.middleName) || "",
|
|
652
|
+
lastName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde0 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde0 === void 0 ? void 0 : _data$ConnectionHolde0.lastName) || "",
|
|
653
|
+
emailId: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde1 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde1 === void 0 ? void 0 : _data$ConnectionHolde1.emailId) || "",
|
|
654
|
+
watsAppMobileNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde10 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde10 === void 0 ? void 0 : _data$ConnectionHolde10.watsAppMobileNumber) || "",
|
|
655
|
+
ownerType: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde11 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde11 === void 0 ? void 0 : (_data$ConnectionHolde12 = _data$ConnectionHolde11.specialCategoryType) === null || _data$ConnectionHolde12 === void 0 ? void 0 : _data$ConnectionHolde12.code) || "",
|
|
656
|
+
relationship: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde13 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde13 === void 0 ? void 0 : (_data$ConnectionHolde14 = _data$ConnectionHolde13.relationship) === null || _data$ConnectionHolde14 === void 0 ? void 0 : _data$ConnectionHolde14.code) || "",
|
|
657
|
+
sameAsPropertyAddress: data === null || data === void 0 ? void 0 : (_data$ConnectionHolde15 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde15 === void 0 ? void 0 : _data$ConnectionHolde15.sameAsOwnerDetails
|
|
625
658
|
}] : null : waterResult === null || waterResult === void 0 ? void 0 : waterResult.connectionHolders,
|
|
626
659
|
oldApplication: false,
|
|
627
660
|
channel: Digit.UserService.getType() === "CITIZEN" ? "CITIZEN" : "CFC_COUNTER",
|
|
@@ -642,7 +675,7 @@ const convertToEditWSUpdate = data => {
|
|
|
642
675
|
water: data !== null && data !== void 0 && (_data$applicationType = data.applicationType) !== null && _data$applicationType !== void 0 && _data$applicationType.includes("WATER") ? true : false,
|
|
643
676
|
sewerage: data !== null && data !== void 0 && (_data$applicationType2 = data.applicationType) !== null && _data$applicationType2 !== void 0 && _data$applicationType2.includes("WATER") ? true : false,
|
|
644
677
|
service: data !== null && data !== void 0 && data.isEditApplication ? data === null || data === void 0 ? void 0 : (_data$serviceName = data.serviceName) === null || _data$serviceName === void 0 ? void 0 : _data$serviceName.code : waterResult === null || waterResult === void 0 ? void 0 : (_waterResult$serviceN = waterResult.serviceName) === null || _waterResult$serviceN === void 0 ? void 0 : _waterResult$serviceN.code,
|
|
645
|
-
reviewDocData: [...(data === null || data === void 0 ? void 0 : (_data$
|
|
678
|
+
reviewDocData: [...(data === null || data === void 0 ? void 0 : (_data$documents7 = data.documents) === null || _data$documents7 === void 0 ? void 0 : _data$documents7.documents)],
|
|
646
679
|
proposedWaterClosets: data === null || data === void 0 ? void 0 : (_data$sewerageConnect = data.sewerageConnectionDetails) === null || _data$sewerageConnect === void 0 ? void 0 : _data$sewerageConnect.proposedWaterClosets,
|
|
647
680
|
proposedToilets: data === null || data === void 0 ? void 0 : (_data$sewerageConnect2 = data.sewerageConnectionDetails) === null || _data$sewerageConnect2 === void 0 ? void 0 : _data$sewerageConnect2.proposedToilets,
|
|
648
681
|
comment: "",
|
|
@@ -656,7 +689,7 @@ const convertToEditWSUpdate = data => {
|
|
|
656
689
|
return formdata;
|
|
657
690
|
};
|
|
658
691
|
const convertToEditSWUpdate = data => {
|
|
659
|
-
var _data$SewerageConnect, _data$SewerageConnect2, _data$
|
|
692
|
+
var _data$SewerageConnect, _data$SewerageConnect2, _data$documents8, _data$ConnectionHolde16, _data$ConnectionHolde17, _data$ConnectionHolde18, _data$ConnectionHolde19, _data$ConnectionHolde20, _data$ConnectionHolde21, _data$ConnectionHolde22, _data$ConnectionHolde23, _data$ConnectionHolde24, _data$ConnectionHolde25, _data$ConnectionHolde26, _data$ConnectionHolde27, _data$ConnectionHolde28, _data$ConnectionHolde29, _data$ConnectionHolde30, _data$ConnectionHolde31, _data$waterConectionD4, _data$waterConectionD5, _data$waterConectionD6, _data$applicationType3, _data$applicationType4, _data$serviceName2, _SewerageResult$servi, _data$documents9, _data$sewerageConnect3, _data$sewerageConnect4, _Digit9, _Digit9$Customization, _Digit9$Customization2, _Digit0, _Digit0$Customization, _Digit0$Customization2;
|
|
660
693
|
let SewerageResult = data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnectionResult) === null || _data$SewerageConnect === void 0 ? void 0 : (_data$SewerageConnect2 = _data$SewerageConnect.SewerageConnections) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2[0];
|
|
661
694
|
let formdata = {
|
|
662
695
|
SewerageConnection: {
|
|
@@ -668,7 +701,7 @@ const convertToEditSWUpdate = data => {
|
|
|
668
701
|
status: data !== null && data !== void 0 && data.isEditApplication ? data === null || data === void 0 ? void 0 : data.status : SewerageResult === null || SewerageResult === void 0 ? void 0 : SewerageResult.status,
|
|
669
702
|
connectionNo: (data !== null && data !== void 0 && data.isEditApplication ? data === null || data === void 0 ? void 0 : data.connectionNo : SewerageResult === null || SewerageResult === void 0 ? void 0 : SewerageResult.connectionNo) || null,
|
|
670
703
|
oldConnectionNo: null,
|
|
671
|
-
documents: [...(data === null || data === void 0 ? void 0 : (_data$
|
|
704
|
+
documents: [...(data === null || data === void 0 ? void 0 : (_data$documents8 = data.documents) === null || _data$documents8 === void 0 ? void 0 : _data$documents8.documents)],
|
|
672
705
|
plumberInfo: data !== null && data !== void 0 && data.isEditApplication ? data === null || data === void 0 ? void 0 : data.plumberInfo : (SewerageResult === null || SewerageResult === void 0 ? void 0 : SewerageResult.plumberInfo) || [],
|
|
673
706
|
roadType: null,
|
|
674
707
|
roadCuttingArea: null,
|
|
@@ -691,16 +724,19 @@ const convertToEditSWUpdate = data => {
|
|
|
691
724
|
},
|
|
692
725
|
applicationType: data !== null && data !== void 0 && data.isEditApplication ? data === null || data === void 0 ? void 0 : data.applicationType : "MODIFY_WATER_CONNECTION",
|
|
693
726
|
dateEffectiveFrom: convertDateToEpoch(Date.now() + 86400000),
|
|
694
|
-
connectionHolders: data !== null && data !== void 0 && data.isEditApplication ? !(data !== null && data !== void 0 && (_data$
|
|
695
|
-
correspondenceAddress: (data === null || data === void 0 ? void 0 : (_data$
|
|
696
|
-
fatherOrHusbandName: (data === null || data === void 0 ? void 0 : (_data$
|
|
697
|
-
gender: (data === null || data === void 0 ? void 0 : (_data$
|
|
698
|
-
mobileNumber: (data === null || data === void 0 ? void 0 : (_data$
|
|
699
|
-
name: (data === null || data === void 0 ? void 0 : (_data$
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
727
|
+
connectionHolders: data !== null && data !== void 0 && data.isEditApplication ? !(data !== null && data !== void 0 && (_data$ConnectionHolde16 = data.ConnectionHolderDetails) !== null && _data$ConnectionHolde16 !== void 0 && _data$ConnectionHolde16.isOwnerSame) ? [{
|
|
728
|
+
correspondenceAddress: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde17 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde17 === void 0 ? void 0 : _data$ConnectionHolde17.address) || "",
|
|
729
|
+
fatherOrHusbandName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde18 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde18 === void 0 ? void 0 : _data$ConnectionHolde18.guardian) || "",
|
|
730
|
+
gender: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde19 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde19 === void 0 ? void 0 : (_data$ConnectionHolde20 = _data$ConnectionHolde19.gender) === null || _data$ConnectionHolde20 === void 0 ? void 0 : _data$ConnectionHolde20.code) || "",
|
|
731
|
+
mobileNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde21 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde21 === void 0 ? void 0 : _data$ConnectionHolde21.mobileNumber) || "",
|
|
732
|
+
name: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde22 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde22 === void 0 ? void 0 : _data$ConnectionHolde22.name) || "",
|
|
733
|
+
middleName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde23 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde23 === void 0 ? void 0 : _data$ConnectionHolde23.middleName) || "",
|
|
734
|
+
lastName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde24 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde24 === void 0 ? void 0 : _data$ConnectionHolde24.lastName) || "",
|
|
735
|
+
emailId: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde25 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde25 === void 0 ? void 0 : _data$ConnectionHolde25.emailId) || "",
|
|
736
|
+
watsAppMobileNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde26 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde26 === void 0 ? void 0 : _data$ConnectionHolde26.watsAppMobileNumber) || "",
|
|
737
|
+
ownerType: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde27 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde27 === void 0 ? void 0 : (_data$ConnectionHolde28 = _data$ConnectionHolde27.specialCategoryType) === null || _data$ConnectionHolde28 === void 0 ? void 0 : _data$ConnectionHolde28.code) || "",
|
|
738
|
+
relationship: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde29 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde29 === void 0 ? void 0 : (_data$ConnectionHolde30 = _data$ConnectionHolde29.relationship) === null || _data$ConnectionHolde30 === void 0 ? void 0 : _data$ConnectionHolde30.code) || "",
|
|
739
|
+
sameAsPropertyAddress: data === null || data === void 0 ? void 0 : (_data$ConnectionHolde31 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde31 === void 0 ? void 0 : _data$ConnectionHolde31.sameAsOwnerDetails
|
|
704
740
|
}] : null : SewerageResult === null || SewerageResult === void 0 ? void 0 : SewerageResult.connectionHolders,
|
|
705
741
|
oldApplication: false,
|
|
706
742
|
channel: Digit.UserService.getType() === "CITIZEN" ? "CITIZEN" : "CFC_COUNTER",
|
|
@@ -721,7 +757,7 @@ const convertToEditSWUpdate = data => {
|
|
|
721
757
|
water: data !== null && data !== void 0 && (_data$applicationType3 = data.applicationType) !== null && _data$applicationType3 !== void 0 && _data$applicationType3.includes("WATER") ? true : false,
|
|
722
758
|
sewerage: data !== null && data !== void 0 && (_data$applicationType4 = data.applicationType) !== null && _data$applicationType4 !== void 0 && _data$applicationType4.includes("WATER") ? true : false,
|
|
723
759
|
service: data !== null && data !== void 0 && data.isEditApplication ? data === null || data === void 0 ? void 0 : (_data$serviceName2 = data.serviceName) === null || _data$serviceName2 === void 0 ? void 0 : _data$serviceName2.code : SewerageResult === null || SewerageResult === void 0 ? void 0 : (_SewerageResult$servi = SewerageResult.serviceName) === null || _SewerageResult$servi === void 0 ? void 0 : _SewerageResult$servi.code,
|
|
724
|
-
reviewDocData: [...(data === null || data === void 0 ? void 0 : (_data$
|
|
760
|
+
reviewDocData: [...(data === null || data === void 0 ? void 0 : (_data$documents9 = data.documents) === null || _data$documents9 === void 0 ? void 0 : _data$documents9.documents)],
|
|
725
761
|
proposedWaterClosets: data === null || data === void 0 ? void 0 : (_data$sewerageConnect3 = data.sewerageConnectionDetails) === null || _data$sewerageConnect3 === void 0 ? void 0 : _data$sewerageConnect3.proposedWaterClosets,
|
|
726
762
|
proposedToilets: data === null || data === void 0 ? void 0 : (_data$sewerageConnect4 = data.sewerageConnectionDetails) === null || _data$sewerageConnect4 === void 0 ? void 0 : _data$sewerageConnect4.proposedToilets,
|
|
727
763
|
comment: "",
|
|
@@ -735,12 +771,12 @@ const convertToEditSWUpdate = data => {
|
|
|
735
771
|
return formdata;
|
|
736
772
|
};
|
|
737
773
|
const convertToSWUpdate = data => {
|
|
738
|
-
var _data$SewerageConnect3, _data$SewerageConnect4, _data$
|
|
774
|
+
var _data$SewerageConnect3, _data$SewerageConnect4, _data$documents0, _Digit1, _Digit1$Customization, _Digit1$Customization2, _Digit10, _Digit10$Customizatio, _Digit10$Customizatio2;
|
|
739
775
|
let formdata = {
|
|
740
776
|
SewerageConnection: {
|
|
741
777
|
...(data === null || data === void 0 ? void 0 : (_data$SewerageConnect3 = data.SewerageConnectionResult) === null || _data$SewerageConnect3 === void 0 ? void 0 : (_data$SewerageConnect4 = _data$SewerageConnect3.SewerageConnections) === null || _data$SewerageConnect4 === void 0 ? void 0 : _data$SewerageConnect4[0]),
|
|
742
778
|
connectionType: "Non Metered",
|
|
743
|
-
documents: [...(data === null || data === void 0 ? void 0 : (_data$
|
|
779
|
+
documents: [...(data === null || data === void 0 ? void 0 : (_data$documents0 = data.documents) === null || _data$documents0 === void 0 ? void 0 : _data$documents0.documents)],
|
|
744
780
|
processInstance: {
|
|
745
781
|
action: "SUBMIT_APPLICATION"
|
|
746
782
|
}
|
|
@@ -1088,7 +1124,7 @@ const getDocumentsForPDF = (app, t) => {
|
|
|
1088
1124
|
});
|
|
1089
1125
|
};
|
|
1090
1126
|
const getPDFData = (application, data, tenantInfo, t) => {
|
|
1091
|
-
var _tenantInfo$city, _data$
|
|
1127
|
+
var _tenantInfo$city, _data$cpt19, _data$cpt19$details, _data$cpt20, _data$cpt20$details, _data$cpt21, _data$cpt21$details, _data$cpt22, _data$cpt22$details, _data$cpt23, _data$cpt23$details, _data$cpt23$details$a, _data$cpt24, _data$cpt24$details, _data$cpt24$details$a, _data$cpt25, _data$cpt25$details, _data$cpt25$details$a, _data$cpt26, _data$cpt26$details, _data$cpt26$details$a, _data$cpt27, _data$cpt27$details, _data$cpt27$details$a, _data$cpt28, _data$cpt28$details, _data$cpt28$details$a, _data$cpt28$details$a2, _data$cpt29, _application$plumberI, _application$plumberI2, _application$plumberI3, _application$plumberI4;
|
|
1092
1128
|
return {
|
|
1093
1129
|
t: t,
|
|
1094
1130
|
tenantId: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.code,
|
|
@@ -1110,44 +1146,44 @@ const getPDFData = (application, data, tenantInfo, t) => {
|
|
|
1110
1146
|
value: (application === null || application === void 0 ? void 0 : application.propertyId) || "N/A"
|
|
1111
1147
|
}, {
|
|
1112
1148
|
title: t("WS_PROPERTY_TYPE_LABEL"),
|
|
1113
|
-
value: (data === null || data === void 0 ? void 0 : (_data$
|
|
1149
|
+
value: (data === null || data === void 0 ? void 0 : (_data$cpt19 = data.cpt) === null || _data$cpt19 === void 0 ? void 0 : (_data$cpt19$details = _data$cpt19.details) === null || _data$cpt19$details === void 0 ? void 0 : _data$cpt19$details.propertyType) || "N/A"
|
|
1114
1150
|
}, {
|
|
1115
1151
|
title: t("WS_PROPERTY_USAGE_TYPE_LABEL"),
|
|
1116
|
-
value: (data === null || data === void 0 ? void 0 : (_data$
|
|
1152
|
+
value: (data === null || data === void 0 ? void 0 : (_data$cpt20 = data.cpt) === null || _data$cpt20 === void 0 ? void 0 : (_data$cpt20$details = _data$cpt20.details) === null || _data$cpt20$details === void 0 ? void 0 : _data$cpt20$details.usageCategory) || "N/A"
|
|
1117
1153
|
}, {
|
|
1118
1154
|
title: t("WS_PROPERTY_SUB_USAGE_TYPE_LABEL"),
|
|
1119
1155
|
value: "N/A"
|
|
1120
1156
|
}, {
|
|
1121
1157
|
title: t("WS_PROP_DETAIL_PLOT_SIZE_LABEL"),
|
|
1122
|
-
value: (data === null || data === void 0 ? void 0 : (_data$
|
|
1158
|
+
value: (data === null || data === void 0 ? void 0 : (_data$cpt21 = data.cpt) === null || _data$cpt21 === void 0 ? void 0 : (_data$cpt21$details = _data$cpt21.details) === null || _data$cpt21$details === void 0 ? void 0 : _data$cpt21$details.superBuiltUpArea) || "N/A"
|
|
1123
1159
|
}, {
|
|
1124
1160
|
title: t("WS_PROPERTY_NO_OF_FLOOR_LABEL"),
|
|
1125
|
-
value: (data === null || data === void 0 ? void 0 : (_data$
|
|
1161
|
+
value: (data === null || data === void 0 ? void 0 : (_data$cpt22 = data.cpt) === null || _data$cpt22 === void 0 ? void 0 : (_data$cpt22$details = _data$cpt22.details) === null || _data$cpt22$details === void 0 ? void 0 : _data$cpt22$details.noOfFloors) || "N/A"
|
|
1126
1162
|
}, {
|
|
1127
1163
|
title: t("WS_SERV_DETAIL_CONN_RAIN_WATER_HARVESTING_FAC"),
|
|
1128
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
1164
|
+
value: data === null || data === void 0 ? void 0 : (_data$cpt23 = data.cpt) === null || _data$cpt23 === void 0 ? void 0 : (_data$cpt23$details = _data$cpt23.details) === null || _data$cpt23$details === void 0 ? void 0 : (_data$cpt23$details$a = _data$cpt23$details.additionalDetails) === null || _data$cpt23$details$a === void 0 ? void 0 : _data$cpt23$details$a.isRainwaterHarvesting
|
|
1129
1165
|
}]
|
|
1130
1166
|
}, {
|
|
1131
1167
|
title: t("WS_COMMON_PROP_LOC_DETAIL_HEADER"),
|
|
1132
1168
|
values: [{
|
|
1133
1169
|
title: t("WS_PROP_DETAIL_CITY"),
|
|
1134
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
1170
|
+
value: data === null || data === void 0 ? void 0 : (_data$cpt24 = data.cpt) === null || _data$cpt24 === void 0 ? void 0 : (_data$cpt24$details = _data$cpt24.details) === null || _data$cpt24$details === void 0 ? void 0 : (_data$cpt24$details$a = _data$cpt24$details.address) === null || _data$cpt24$details$a === void 0 ? void 0 : _data$cpt24$details$a.city
|
|
1135
1171
|
}, {
|
|
1136
1172
|
title: t("WS_PROP_DETAIL_DHNO"),
|
|
1137
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
1173
|
+
value: data === null || data === void 0 ? void 0 : (_data$cpt25 = data.cpt) === null || _data$cpt25 === void 0 ? void 0 : (_data$cpt25$details = _data$cpt25.details) === null || _data$cpt25$details === void 0 ? void 0 : (_data$cpt25$details$a = _data$cpt25$details.address) === null || _data$cpt25$details$a === void 0 ? void 0 : _data$cpt25$details$a.doorNo
|
|
1138
1174
|
}, {
|
|
1139
1175
|
title: t("WS_PROP_DETAIL_BUILD_NAME_LABEL"),
|
|
1140
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
1176
|
+
value: data === null || data === void 0 ? void 0 : (_data$cpt26 = data.cpt) === null || _data$cpt26 === void 0 ? void 0 : (_data$cpt26$details = _data$cpt26.details) === null || _data$cpt26$details === void 0 ? void 0 : (_data$cpt26$details$a = _data$cpt26$details.address) === null || _data$cpt26$details$a === void 0 ? void 0 : _data$cpt26$details$a.buildingName
|
|
1141
1177
|
}, {
|
|
1142
1178
|
title: t("WS_PROP_DETAIL_STREET_NAME"),
|
|
1143
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
1179
|
+
value: data === null || data === void 0 ? void 0 : (_data$cpt27 = data.cpt) === null || _data$cpt27 === void 0 ? void 0 : (_data$cpt27$details = _data$cpt27.details) === null || _data$cpt27$details === void 0 ? void 0 : (_data$cpt27$details$a = _data$cpt27$details.address) === null || _data$cpt27$details$a === void 0 ? void 0 : _data$cpt27$details$a.street
|
|
1144
1180
|
}, {
|
|
1145
1181
|
title: t("WS_PROP_DETAIL_LOCALITY_MOHALLA_LABEL"),
|
|
1146
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
1182
|
+
value: data === null || data === void 0 ? void 0 : (_data$cpt28 = data.cpt) === null || _data$cpt28 === void 0 ? void 0 : (_data$cpt28$details = _data$cpt28.details) === null || _data$cpt28$details === void 0 ? void 0 : (_data$cpt28$details$a = _data$cpt28$details.address) === null || _data$cpt28$details$a === void 0 ? void 0 : (_data$cpt28$details$a2 = _data$cpt28$details$a.locality) === null || _data$cpt28$details$a2 === void 0 ? void 0 : _data$cpt28$details$a2.name
|
|
1147
1183
|
}]
|
|
1148
1184
|
}, {
|
|
1149
1185
|
title: t("WS_TASK_PROP_OWN_HEADER"),
|
|
1150
|
-
values: getOwnersforPDF(data === null || data === void 0 ? void 0 : (_data$
|
|
1186
|
+
values: getOwnersforPDF(data === null || data === void 0 ? void 0 : (_data$cpt29 = data.cpt) === null || _data$cpt29 === void 0 ? void 0 : _data$cpt29.details, t)
|
|
1151
1187
|
}, {
|
|
1152
1188
|
...(application !== null && application !== void 0 && application.applicationType.includes("WATER") ? {
|
|
1153
1189
|
title: t("WS_COMMON_CONNECTION_DETAILS"),
|
|
@@ -1256,7 +1292,7 @@ const getBusinessService = data => {
|
|
|
1256
1292
|
if ((data === null || data === void 0 ? void 0 : data.service) == "WATER") return "WS.ONE_TIME_FEE";else return "SW.ONE_TIME_FEE";
|
|
1257
1293
|
};
|
|
1258
1294
|
const convertApplicationData = (data, serviceType, modify = false, editByConfig = false, t) => {
|
|
1259
|
-
var _data$propertyDetails, _data$propertyDetails2, _data$applicationData, _data$applicationData2, _data$applicationData3, _data$applicationData4, _data$applicationData5, _data$applicationData6, _data$applicationData7, _data$applicationData8, _data$applicationData9, _data$applicationData0, _data$applicationData1, _data$applicationData10, _data$applicationData11, _data$applicationData12, _data$applicationData13, _data$applicationData14, _data$applicationData15, _data$applicationData16, _data$applicationData17, _data$applicationData18, _data$applicationData19, _data$applicationData20, _data$applicationData21, _data$applicationData22, _data$applicationData23, _data$applicationData24, _data$applicationData25, _data$applicationData26, _data$applicationData27, _data$applicationData28, _data$applicationData29, _data$applicationData30, _data$applicationData31, _data$applicationData32, _data$applicationData33, _data$applicationData34, _data$applicationData35, _data$applicationData36, _data$applicationData37, _data$applicationData38, _data$applicationData39, _data$applicationData40, _data$applicationData41, _data$applicationData42, _data$applicationData43, _data$applicationData44, _data$applicationData45, _data$applicationData46, _data$applicationData47, _data$applicationData48, _data$applicationData49, _data$applicationData50, _data$applicationData51, _data$applicationData52, _data$applicationData53, _data$applicationData54, _data$applicationData55, _data$applicationData56, _data$applicationData57, _data$applicationData58, _data$applicationData59, _data$applicationData60, _data$applicationData61, _data$applicationData62, _data$applicationData63, _data$applicationData64, _data$applicationData65, _data$applicationData66, _data$applicationData67, _data$applicationData68, _data$applicationData69, _data$applicationData70, _data$applicationData71, _data$applicationData72, _data$applicationData73, _data$applicationData74, _data$applicationData75;
|
|
1295
|
+
var _data$propertyDetails, _data$propertyDetails2, _data$applicationData, _data$applicationData2, _data$applicationData3, _data$applicationData4, _data$applicationData5, _data$applicationData6, _data$applicationData7, _data$applicationData8, _data$applicationData9, _data$applicationData0, _data$applicationData1, _data$applicationData10, _data$applicationData11, _data$applicationData12, _data$applicationData13, _data$applicationData14, _data$applicationData15, _data$applicationData16, _data$applicationData17, _data$applicationData18, _data$applicationData19, _data$applicationData20, _data$applicationData21, _data$applicationData22, _data$applicationData23, _data$applicationData24, _data$applicationData25, _data$applicationData26, _data$applicationData27, _data$applicationData28, _data$applicationData29, _data$applicationData30, _data$applicationData31, _data$applicationData32, _data$applicationData33, _data$applicationData34, _data$applicationData35, _data$applicationData36, _data$applicationData37, _data$applicationData38, _data$applicationData39, _data$applicationData40, _data$applicationData41, _data$applicationData42, _data$applicationData43, _data$applicationData44, _data$applicationData45, _data$applicationData46, _data$applicationData47, _data$applicationData48, _data$applicationData49, _data$applicationData50, _data$applicationData51, _data$applicationData52, _data$applicationData53, _data$applicationData54, _data$applicationData55, _data$applicationData56, _data$applicationData57, _data$applicationData58, _data$applicationData59, _data$applicationData60, _data$applicationData61, _data$applicationData62, _data$applicationData63, _data$applicationData64, _data$applicationData65, _data$applicationData66, _data$applicationData67, _data$applicationData68, _data$applicationData69, _data$applicationData70, _data$applicationData71, _data$applicationData72, _data$applicationData73, _data$applicationData74, _data$applicationData75, _data$applicationData76, _data$applicationData77, _data$applicationData78, _data$applicationData79, _data$applicationData80, _data$applicationData81, _data$applicationData82, _data$applicationData83, _data$applicationData84, _data$applicationData85, _data$applicationData86, _data$applicationData87, _data$applicationData88, _data$applicationData89, _data$applicationData90, _data$applicationData91, _data$applicationData92, _data$applicationData93;
|
|
1260
1296
|
data === null || data === void 0 ? void 0 : (_data$propertyDetails = data.propertyDetails) === null || _data$propertyDetails === void 0 ? void 0 : (_data$propertyDetails2 = _data$propertyDetails.owners) === null || _data$propertyDetails2 === void 0 ? void 0 : _data$propertyDetails2.forEach(owner => {
|
|
1261
1297
|
if (owner !== null && owner !== void 0 && owner.permanentAddress) owner.correspondenceAddress = owner === null || owner === void 0 ? void 0 : owner.permanentAddress;
|
|
1262
1298
|
});
|
|
@@ -1278,21 +1314,25 @@ const convertApplicationData = (data, serviceType, modify = false, editByConfig
|
|
|
1278
1314
|
sameAsOwnerDetails: false,
|
|
1279
1315
|
uuid: data === null || data === void 0 ? void 0 : (_data$applicationData1 = data.applicationData) === null || _data$applicationData1 === void 0 ? void 0 : (_data$applicationData10 = _data$applicationData1.connectionHolders) === null || _data$applicationData10 === void 0 ? void 0 : (_data$applicationData11 = _data$applicationData10[0]) === null || _data$applicationData11 === void 0 ? void 0 : _data$applicationData11.uuid,
|
|
1280
1316
|
name: (data === null || data === void 0 ? void 0 : (_data$applicationData12 = data.applicationData) === null || _data$applicationData12 === void 0 ? void 0 : (_data$applicationData13 = _data$applicationData12.connectionHolders) === null || _data$applicationData13 === void 0 ? void 0 : (_data$applicationData14 = _data$applicationData13[0]) === null || _data$applicationData14 === void 0 ? void 0 : _data$applicationData14.name) || "",
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1317
|
+
middleName: (data === null || data === void 0 ? void 0 : (_data$applicationData15 = data.applicationData) === null || _data$applicationData15 === void 0 ? void 0 : (_data$applicationData16 = _data$applicationData15.connectionHolders) === null || _data$applicationData16 === void 0 ? void 0 : (_data$applicationData17 = _data$applicationData16[0]) === null || _data$applicationData17 === void 0 ? void 0 : _data$applicationData17.middleName) || "",
|
|
1318
|
+
lastName: (data === null || data === void 0 ? void 0 : (_data$applicationData18 = data.applicationData) === null || _data$applicationData18 === void 0 ? void 0 : (_data$applicationData19 = _data$applicationData18.connectionHolders) === null || _data$applicationData19 === void 0 ? void 0 : (_data$applicationData20 = _data$applicationData19[0]) === null || _data$applicationData20 === void 0 ? void 0 : _data$applicationData20.lastName) || "",
|
|
1319
|
+
mobileNumber: (data === null || data === void 0 ? void 0 : (_data$applicationData21 = data.applicationData) === null || _data$applicationData21 === void 0 ? void 0 : (_data$applicationData22 = _data$applicationData21.connectionHolders) === null || _data$applicationData22 === void 0 ? void 0 : (_data$applicationData23 = _data$applicationData22[0]) === null || _data$applicationData23 === void 0 ? void 0 : _data$applicationData23.mobileNumber) || "",
|
|
1320
|
+
emailId: (data === null || data === void 0 ? void 0 : (_data$applicationData24 = data.applicationData) === null || _data$applicationData24 === void 0 ? void 0 : (_data$applicationData25 = _data$applicationData24.connectionHolders) === null || _data$applicationData25 === void 0 ? void 0 : (_data$applicationData26 = _data$applicationData25[0]) === null || _data$applicationData26 === void 0 ? void 0 : _data$applicationData26.emailId) || "",
|
|
1321
|
+
watsAppMobileNumber: (data === null || data === void 0 ? void 0 : (_data$applicationData27 = data.applicationData) === null || _data$applicationData27 === void 0 ? void 0 : (_data$applicationData28 = _data$applicationData27.connectionHolders) === null || _data$applicationData28 === void 0 ? void 0 : (_data$applicationData29 = _data$applicationData28[0]) === null || _data$applicationData29 === void 0 ? void 0 : _data$applicationData29.watsAppMobileNumber) || "",
|
|
1322
|
+
isWatsappSameAsMobile: data !== null && data !== void 0 && (_data$applicationData30 = data.applicationData) !== null && _data$applicationData30 !== void 0 && (_data$applicationData31 = _data$applicationData30.connectionHolders) !== null && _data$applicationData31 !== void 0 && (_data$applicationData32 = _data$applicationData31[0]) !== null && _data$applicationData32 !== void 0 && _data$applicationData32.mobileNumber && (data === null || data === void 0 ? void 0 : (_data$applicationData33 = data.applicationData) === null || _data$applicationData33 === void 0 ? void 0 : (_data$applicationData34 = _data$applicationData33.connectionHolders) === null || _data$applicationData34 === void 0 ? void 0 : (_data$applicationData35 = _data$applicationData34[0]) === null || _data$applicationData35 === void 0 ? void 0 : _data$applicationData35.mobileNumber) === (data === null || data === void 0 ? void 0 : (_data$applicationData36 = data.applicationData) === null || _data$applicationData36 === void 0 ? void 0 : (_data$applicationData37 = _data$applicationData36.connectionHolders) === null || _data$applicationData37 === void 0 ? void 0 : (_data$applicationData38 = _data$applicationData37[0]) === null || _data$applicationData38 === void 0 ? void 0 : _data$applicationData38.watsAppMobileNumber) ? true : false,
|
|
1323
|
+
guardian: (data === null || data === void 0 ? void 0 : (_data$applicationData39 = data.applicationData) === null || _data$applicationData39 === void 0 ? void 0 : (_data$applicationData40 = _data$applicationData39.connectionHolders) === null || _data$applicationData40 === void 0 ? void 0 : (_data$applicationData41 = _data$applicationData40[0]) === null || _data$applicationData41 === void 0 ? void 0 : _data$applicationData41.fatherOrHusbandName) || "",
|
|
1324
|
+
address: (data === null || data === void 0 ? void 0 : (_data$applicationData42 = data.applicationData) === null || _data$applicationData42 === void 0 ? void 0 : (_data$applicationData43 = _data$applicationData42.connectionHolders) === null || _data$applicationData43 === void 0 ? void 0 : (_data$applicationData44 = _data$applicationData43[0]) === null || _data$applicationData44 === void 0 ? void 0 : _data$applicationData44.correspondenceAddress) || "",
|
|
1325
|
+
gender: data !== null && data !== void 0 && (_data$applicationData45 = data.applicationData) !== null && _data$applicationData45 !== void 0 && (_data$applicationData46 = _data$applicationData45.connectionHolders) !== null && _data$applicationData46 !== void 0 && (_data$applicationData47 = _data$applicationData46[0]) !== null && _data$applicationData47 !== void 0 && _data$applicationData47.gender ? {
|
|
1326
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData48 = data.applicationData) === null || _data$applicationData48 === void 0 ? void 0 : (_data$applicationData49 = _data$applicationData48.connectionHolders) === null || _data$applicationData49 === void 0 ? void 0 : (_data$applicationData50 = _data$applicationData49[0]) === null || _data$applicationData50 === void 0 ? void 0 : _data$applicationData50.gender,
|
|
1327
|
+
i18nKey: data === null || data === void 0 ? void 0 : (_data$applicationData51 = data.applicationData) === null || _data$applicationData51 === void 0 ? void 0 : (_data$applicationData52 = _data$applicationData51.connectionHolders) === null || _data$applicationData52 === void 0 ? void 0 : (_data$applicationData53 = _data$applicationData52[0]) === null || _data$applicationData53 === void 0 ? void 0 : _data$applicationData53.gender
|
|
1288
1328
|
} : "",
|
|
1289
|
-
relationship: data !== null && data !== void 0 && (_data$
|
|
1290
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1291
|
-
i18nKey: data === null || data === void 0 ? void 0 : (_data$
|
|
1329
|
+
relationship: data !== null && data !== void 0 && (_data$applicationData54 = data.applicationData) !== null && _data$applicationData54 !== void 0 && (_data$applicationData55 = _data$applicationData54.connectionHolders) !== null && _data$applicationData55 !== void 0 && (_data$applicationData56 = _data$applicationData55[0]) !== null && _data$applicationData56 !== void 0 && _data$applicationData56.relationship ? {
|
|
1330
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData57 = data.applicationData) === null || _data$applicationData57 === void 0 ? void 0 : (_data$applicationData58 = _data$applicationData57.connectionHolders) === null || _data$applicationData58 === void 0 ? void 0 : (_data$applicationData59 = _data$applicationData58[0]) === null || _data$applicationData59 === void 0 ? void 0 : _data$applicationData59.relationship,
|
|
1331
|
+
i18nKey: data === null || data === void 0 ? void 0 : (_data$applicationData60 = data.applicationData) === null || _data$applicationData60 === void 0 ? void 0 : (_data$applicationData61 = _data$applicationData60.connectionHolders) === null || _data$applicationData61 === void 0 ? void 0 : (_data$applicationData62 = _data$applicationData61[0]) === null || _data$applicationData62 === void 0 ? void 0 : _data$applicationData62.relationship
|
|
1292
1332
|
} : "",
|
|
1293
|
-
ownerType: data !== null && data !== void 0 && (_data$
|
|
1294
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1295
|
-
i18nKey: data === null || data === void 0 ? void 0 : (_data$
|
|
1333
|
+
ownerType: data !== null && data !== void 0 && (_data$applicationData63 = data.applicationData) !== null && _data$applicationData63 !== void 0 && (_data$applicationData64 = _data$applicationData63.connectionHolders) !== null && _data$applicationData64 !== void 0 && (_data$applicationData65 = _data$applicationData64[0]) !== null && _data$applicationData65 !== void 0 && _data$applicationData65.ownerType ? {
|
|
1334
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData66 = data.applicationData) === null || _data$applicationData66 === void 0 ? void 0 : (_data$applicationData67 = _data$applicationData66.connectionHolders) === null || _data$applicationData67 === void 0 ? void 0 : (_data$applicationData68 = _data$applicationData67[0]) === null || _data$applicationData68 === void 0 ? void 0 : _data$applicationData68.ownerType,
|
|
1335
|
+
i18nKey: data === null || data === void 0 ? void 0 : (_data$applicationData69 = data.applicationData) === null || _data$applicationData69 === void 0 ? void 0 : (_data$applicationData70 = _data$applicationData69.connectionHolders) === null || _data$applicationData70 === void 0 ? void 0 : (_data$applicationData71 = _data$applicationData70[0]) === null || _data$applicationData71 === void 0 ? void 0 : _data$applicationData71.ownerType
|
|
1296
1336
|
} : "",
|
|
1297
1337
|
documentId: "",
|
|
1298
1338
|
documentType: "",
|
|
@@ -1300,6 +1340,8 @@ const convertApplicationData = (data, serviceType, modify = false, editByConfig
|
|
|
1300
1340
|
}] : [{
|
|
1301
1341
|
sameAsOwnerDetails: true,
|
|
1302
1342
|
name: "",
|
|
1343
|
+
middleName: "",
|
|
1344
|
+
lastName: "",
|
|
1303
1345
|
gender: "",
|
|
1304
1346
|
mobileNumber: "",
|
|
1305
1347
|
guardian: "",
|
|
@@ -1311,7 +1353,7 @@ const convertApplicationData = (data, serviceType, modify = false, editByConfig
|
|
|
1311
1353
|
file: ""
|
|
1312
1354
|
}];
|
|
1313
1355
|
let documents = [];
|
|
1314
|
-
if (data !== null && data !== void 0 && (_data$
|
|
1356
|
+
if (data !== null && data !== void 0 && (_data$applicationData72 = data.applicationData) !== null && _data$applicationData72 !== void 0 && _data$applicationData72.documents) {
|
|
1315
1357
|
data.applicationData.documents.forEach(data => {
|
|
1316
1358
|
var _data$documentType;
|
|
1317
1359
|
documents.push({
|
|
@@ -1331,63 +1373,63 @@ const convertApplicationData = (data, serviceType, modify = false, editByConfig
|
|
|
1331
1373
|
let cpt = {};
|
|
1332
1374
|
cpt["details"] = (data === null || data === void 0 ? void 0 : data.propertyDetails) || {};
|
|
1333
1375
|
let payload = {};
|
|
1334
|
-
const sourceSubDataValue = data !== null && data !== void 0 && (_data$
|
|
1376
|
+
const sourceSubDataValue = data !== null && data !== void 0 && (_data$applicationData73 = data.applicationData) !== null && _data$applicationData73 !== void 0 && _data$applicationData73.waterSource ? stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$applicationData74 = data.applicationData) === null || _data$applicationData74 === void 0 ? void 0 : (_data$applicationData75 = _data$applicationData74.waterSource) === null || _data$applicationData75 === void 0 ? void 0 : _data$applicationData75.toUpperCase(), " ", "_") : "";
|
|
1335
1377
|
const sourceSubDataFilter = sourceSubDataValue ? stringReplaceAll(sourceSubDataValue === null || sourceSubDataValue === void 0 ? void 0 : sourceSubDataValue.toUpperCase(), ".", "_") : "";
|
|
1336
1378
|
const connectionDetails = serviceType === "WATER" ? {
|
|
1337
|
-
connectionType: data !== null && data !== void 0 && (_data$
|
|
1338
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1339
|
-
i18nKey: t(`WS_CONNECTIONTYPE_${stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$
|
|
1379
|
+
connectionType: data !== null && data !== void 0 && (_data$applicationData76 = data.applicationData) !== null && _data$applicationData76 !== void 0 && _data$applicationData76.connectionType ? {
|
|
1380
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData77 = data.applicationData) === null || _data$applicationData77 === void 0 ? void 0 : _data$applicationData77.connectionType,
|
|
1381
|
+
i18nKey: t(`WS_CONNECTIONTYPE_${stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$applicationData78 = data.applicationData) === null || _data$applicationData78 === void 0 ? void 0 : (_data$applicationData79 = _data$applicationData78.connectionType) === null || _data$applicationData79 === void 0 ? void 0 : _data$applicationData79.toUpperCase(), " ", "_")}`)
|
|
1340
1382
|
} : "",
|
|
1341
|
-
waterSource: data !== null && data !== void 0 && (_data$
|
|
1342
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1343
|
-
i18nKey: t(`WS_SERVICES_MASTERS_WATERSOURCE_${stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$
|
|
1383
|
+
waterSource: data !== null && data !== void 0 && (_data$applicationData80 = data.applicationData) !== null && _data$applicationData80 !== void 0 && _data$applicationData80.waterSource ? {
|
|
1384
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData81 = data.applicationData) === null || _data$applicationData81 === void 0 ? void 0 : _data$applicationData81.waterSource,
|
|
1385
|
+
i18nKey: t(`WS_SERVICES_MASTERS_WATERSOURCE_${stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$applicationData82 = data.applicationData) === null || _data$applicationData82 === void 0 ? void 0 : (_data$applicationData83 = _data$applicationData82.waterSource) === null || _data$applicationData83 === void 0 ? void 0 : (_data$applicationData84 = _data$applicationData83.split(".")[0]) === null || _data$applicationData84 === void 0 ? void 0 : _data$applicationData84.toUpperCase(), " ", "_")}`)
|
|
1344
1386
|
} : "",
|
|
1345
|
-
sourceSubData: data !== null && data !== void 0 && (_data$
|
|
1346
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1387
|
+
sourceSubData: data !== null && data !== void 0 && (_data$applicationData85 = data.applicationData) !== null && _data$applicationData85 !== void 0 && _data$applicationData85.waterSource ? {
|
|
1388
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData86 = data.applicationData) === null || _data$applicationData86 === void 0 ? void 0 : _data$applicationData86.waterSource,
|
|
1347
1389
|
i18nKey: t(`WS_SERVICES_MASTERS_WATERSOURCE_${sourceSubDataFilter}`)
|
|
1348
1390
|
} : "",
|
|
1349
|
-
pipeSize: data !== null && data !== void 0 && (_data$
|
|
1350
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1351
|
-
i18nKey: data === null || data === void 0 ? void 0 : (_data$
|
|
1352
|
-
size: data === null || data === void 0 ? void 0 : (_data$
|
|
1391
|
+
pipeSize: data !== null && data !== void 0 && (_data$applicationData87 = data.applicationData) !== null && _data$applicationData87 !== void 0 && _data$applicationData87.pipeSize ? {
|
|
1392
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData88 = data.applicationData) === null || _data$applicationData88 === void 0 ? void 0 : _data$applicationData88.pipeSize,
|
|
1393
|
+
i18nKey: data === null || data === void 0 ? void 0 : (_data$applicationData89 = data.applicationData) === null || _data$applicationData89 === void 0 ? void 0 : _data$applicationData89.pipeSize,
|
|
1394
|
+
size: data === null || data === void 0 ? void 0 : (_data$applicationData90 = data.applicationData) === null || _data$applicationData90 === void 0 ? void 0 : _data$applicationData90.pipeSize
|
|
1353
1395
|
} : "",
|
|
1354
|
-
noOfTaps: (data === null || data === void 0 ? void 0 : (_data$
|
|
1396
|
+
noOfTaps: (data === null || data === void 0 ? void 0 : (_data$applicationData91 = data.applicationData) === null || _data$applicationData91 === void 0 ? void 0 : _data$applicationData91.noOfTaps) || ""
|
|
1355
1397
|
} : {
|
|
1356
|
-
noOfWaterClosets: (data === null || data === void 0 ? void 0 : (_data$
|
|
1357
|
-
noOfToilets: (data === null || data === void 0 ? void 0 : (_data$
|
|
1398
|
+
noOfWaterClosets: (data === null || data === void 0 ? void 0 : (_data$applicationData92 = data.applicationData) === null || _data$applicationData92 === void 0 ? void 0 : _data$applicationData92.noOfWaterClosets) || "",
|
|
1399
|
+
noOfToilets: (data === null || data === void 0 ? void 0 : (_data$applicationData93 = data.applicationData) === null || _data$applicationData93 === void 0 ? void 0 : _data$applicationData93.noOfToilets) || ""
|
|
1358
1400
|
};
|
|
1359
1401
|
if (modify) {
|
|
1360
|
-
var _data$
|
|
1402
|
+
var _data$applicationData94, _data$applicationData95, _data$applicationData96, _data$applicationData97, _data$applicationData98, _data$applicationData99, _data$applicationData100, _data$applicationData101, _data$applicationData102, _data$applicationData103, _data$applicationData104, _data$applicationData105, _data$applicationData106, _data$applicationData107, _data$applicationData108, _data$applicationData109, _data$applicationData110, _data$applicationData111, _data$applicationData112, _data$applicationData113, _data$applicationData114, _data$applicationData115, _data$applicationData116, _data$applicationData117, _data$applicationData118, _data$applicationData119, _data$applicationData120, _data$applicationData121, _data$applicationData122, _data$applicationData123, _data$applicationData124, _data$applicationData125;
|
|
1361
1403
|
const activationDetails = [{
|
|
1362
|
-
meterId: data !== null && data !== void 0 && (_data$
|
|
1363
|
-
meterInstallationDate: data !== null && data !== void 0 && (_data$
|
|
1364
|
-
meterInitialReading: data !== null && data !== void 0 && (_data$
|
|
1365
|
-
connectionExecutionDate: data !== null && data !== void 0 && (_data$
|
|
1404
|
+
meterId: data !== null && data !== void 0 && (_data$applicationData94 = data.applicationData) !== null && _data$applicationData94 !== void 0 && _data$applicationData94.meterId ? Number(data === null || data === void 0 ? void 0 : (_data$applicationData95 = data.applicationData) === null || _data$applicationData95 === void 0 ? void 0 : _data$applicationData95.meterId) : "",
|
|
1405
|
+
meterInstallationDate: data !== null && data !== void 0 && (_data$applicationData96 = data.applicationData) !== null && _data$applicationData96 !== void 0 && _data$applicationData96.meterInstallationDate ? convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$applicationData97 = data.applicationData) === null || _data$applicationData97 === void 0 ? void 0 : _data$applicationData97.meterInstallationDate, true) : null,
|
|
1406
|
+
meterInitialReading: data !== null && data !== void 0 && (_data$applicationData98 = data.applicationData) !== null && _data$applicationData98 !== void 0 && (_data$applicationData99 = _data$applicationData98.additionalDetails) !== null && _data$applicationData99 !== void 0 && _data$applicationData99.initialMeterReading ? Number(data === null || data === void 0 ? void 0 : (_data$applicationData100 = data.applicationData) === null || _data$applicationData100 === void 0 ? void 0 : (_data$applicationData101 = _data$applicationData100.additionalDetails) === null || _data$applicationData101 === void 0 ? void 0 : _data$applicationData101.initialMeterReading) : "",
|
|
1407
|
+
connectionExecutionDate: data !== null && data !== void 0 && (_data$applicationData102 = data.applicationData) !== null && _data$applicationData102 !== void 0 && _data$applicationData102.connectionExecutionDate ? convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$applicationData103 = data.applicationData) === null || _data$applicationData103 === void 0 ? void 0 : _data$applicationData103.connectionExecutionDate, true) : null
|
|
1366
1408
|
}];
|
|
1367
|
-
if (window.location.href.includes("modify-application-edit")) activationDetails[0].dateEffectiveFrom = data !== null && data !== void 0 && (_data$
|
|
1368
|
-
const _sourceSubDataValue = data !== null && data !== void 0 && (_data$
|
|
1409
|
+
if (window.location.href.includes("modify-application-edit")) activationDetails[0].dateEffectiveFrom = data !== null && data !== void 0 && (_data$applicationData104 = data.applicationData) !== null && _data$applicationData104 !== void 0 && _data$applicationData104.dateEffectiveFrom ? convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$applicationData105 = data.applicationData) === null || _data$applicationData105 === void 0 ? void 0 : _data$applicationData105.dateEffectiveFrom, true) : null;
|
|
1410
|
+
const _sourceSubDataValue = data !== null && data !== void 0 && (_data$applicationData106 = data.applicationData) !== null && _data$applicationData106 !== void 0 && _data$applicationData106.waterSource ? stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$applicationData107 = data.applicationData) === null || _data$applicationData107 === void 0 ? void 0 : (_data$applicationData108 = _data$applicationData107.waterSource) === null || _data$applicationData108 === void 0 ? void 0 : _data$applicationData108.toUpperCase(), " ", "_") : "";
|
|
1369
1411
|
const _sourceSubDataFilter = _sourceSubDataValue ? stringReplaceAll(_sourceSubDataValue === null || _sourceSubDataValue === void 0 ? void 0 : _sourceSubDataValue.toUpperCase(), ".", "_") : "";
|
|
1370
1412
|
const _connectionDetails = serviceType === "WATER" ? {
|
|
1371
|
-
connectionType: data !== null && data !== void 0 && (_data$
|
|
1372
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1373
|
-
i18nKey: t(`WS_CONNECTIONTYPE_${stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$
|
|
1413
|
+
connectionType: data !== null && data !== void 0 && (_data$applicationData109 = data.applicationData) !== null && _data$applicationData109 !== void 0 && _data$applicationData109.connectionType ? {
|
|
1414
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData110 = data.applicationData) === null || _data$applicationData110 === void 0 ? void 0 : _data$applicationData110.connectionType,
|
|
1415
|
+
i18nKey: t(`WS_CONNECTIONTYPE_${stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$applicationData111 = data.applicationData) === null || _data$applicationData111 === void 0 ? void 0 : (_data$applicationData112 = _data$applicationData111.connectionType) === null || _data$applicationData112 === void 0 ? void 0 : _data$applicationData112.toUpperCase(), " ", "_")}`)
|
|
1374
1416
|
} : "",
|
|
1375
|
-
waterSource: data !== null && data !== void 0 && (_data$
|
|
1376
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1377
|
-
i18nKey: t(`WS_SERVICES_MASTERS_WATERSOURCE_${stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$
|
|
1417
|
+
waterSource: data !== null && data !== void 0 && (_data$applicationData113 = data.applicationData) !== null && _data$applicationData113 !== void 0 && _data$applicationData113.waterSource ? {
|
|
1418
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData114 = data.applicationData) === null || _data$applicationData114 === void 0 ? void 0 : _data$applicationData114.waterSource,
|
|
1419
|
+
i18nKey: t(`WS_SERVICES_MASTERS_WATERSOURCE_${stringReplaceAll(data === null || data === void 0 ? void 0 : (_data$applicationData115 = data.applicationData) === null || _data$applicationData115 === void 0 ? void 0 : (_data$applicationData116 = _data$applicationData115.waterSource) === null || _data$applicationData116 === void 0 ? void 0 : (_data$applicationData117 = _data$applicationData116.split(".")[0]) === null || _data$applicationData117 === void 0 ? void 0 : _data$applicationData117.toUpperCase(), " ", "_")}`)
|
|
1378
1420
|
} : "",
|
|
1379
|
-
sourceSubData: data !== null && data !== void 0 && (_data$
|
|
1380
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1421
|
+
sourceSubData: data !== null && data !== void 0 && (_data$applicationData118 = data.applicationData) !== null && _data$applicationData118 !== void 0 && _data$applicationData118.waterSource ? {
|
|
1422
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData119 = data.applicationData) === null || _data$applicationData119 === void 0 ? void 0 : _data$applicationData119.waterSource,
|
|
1381
1423
|
i18nKey: t(`WS_SERVICES_MASTERS_WATERSOURCE_${_sourceSubDataFilter}`)
|
|
1382
1424
|
} : "",
|
|
1383
|
-
pipeSize: data !== null && data !== void 0 && (_data$
|
|
1384
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1385
|
-
i18nKey: data === null || data === void 0 ? void 0 : (_data$
|
|
1425
|
+
pipeSize: data !== null && data !== void 0 && (_data$applicationData120 = data.applicationData) !== null && _data$applicationData120 !== void 0 && _data$applicationData120.pipeSize ? {
|
|
1426
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData121 = data.applicationData) === null || _data$applicationData121 === void 0 ? void 0 : _data$applicationData121.pipeSize,
|
|
1427
|
+
i18nKey: data === null || data === void 0 ? void 0 : (_data$applicationData122 = data.applicationData) === null || _data$applicationData122 === void 0 ? void 0 : _data$applicationData122.pipeSize
|
|
1386
1428
|
} : "",
|
|
1387
|
-
noOfTaps: (data === null || data === void 0 ? void 0 : (_data$
|
|
1429
|
+
noOfTaps: (data === null || data === void 0 ? void 0 : (_data$applicationData123 = data.applicationData) === null || _data$applicationData123 === void 0 ? void 0 : _data$applicationData123.noOfTaps) || ""
|
|
1388
1430
|
} : {
|
|
1389
|
-
noOfWaterClosets: (data === null || data === void 0 ? void 0 : (_data$
|
|
1390
|
-
noOfToilets: (data === null || data === void 0 ? void 0 : (_data$
|
|
1431
|
+
noOfWaterClosets: (data === null || data === void 0 ? void 0 : (_data$applicationData124 = data.applicationData) === null || _data$applicationData124 === void 0 ? void 0 : _data$applicationData124.noOfWaterClosets) || "",
|
|
1432
|
+
noOfToilets: (data === null || data === void 0 ? void 0 : (_data$applicationData125 = data.applicationData) === null || _data$applicationData125 === void 0 ? void 0 : _data$applicationData125.noOfToilets) || ""
|
|
1391
1433
|
};
|
|
1392
1434
|
if (window.location.href.includes("modify-application-edit")) {
|
|
1393
1435
|
DocumentsRequired = {
|
|
@@ -1408,7 +1450,7 @@ const convertApplicationData = (data, serviceType, modify = false, editByConfig
|
|
|
1408
1450
|
InfoLabel: "InfoLabel"
|
|
1409
1451
|
};
|
|
1410
1452
|
} else {
|
|
1411
|
-
var _data$
|
|
1453
|
+
var _data$applicationData126, _data$applicationData127, _data$applicationData128, _data$applicationData129, _data$applicationData130, _data$applicationData131, _data$applicationData132, _data$applicationData133, _data$applicationData134, _data$applicationData135, _data$applicationData136, _data$applicationData137, _data$applicationData138, _data$applicationData139, _data$applicationData140, _data$applicationData141, _data$applicationData142;
|
|
1412
1454
|
payload = {
|
|
1413
1455
|
ConnectionDetails: ConnectionDetails,
|
|
1414
1456
|
ConnectionHolderDetails: ConnectionHolderDetails,
|
|
@@ -1417,16 +1459,16 @@ const convertApplicationData = (data, serviceType, modify = false, editByConfig
|
|
|
1417
1459
|
InfoLabel: "InfoLabel"
|
|
1418
1460
|
};
|
|
1419
1461
|
let plumberDetails = [{
|
|
1420
|
-
detailsProvidedBy: data !== null && data !== void 0 && (_data$
|
|
1421
|
-
i18nKey: data === null || data === void 0 ? void 0 : (_data$
|
|
1422
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1423
|
-
size: data === null || data === void 0 ? void 0 : (_data$
|
|
1462
|
+
detailsProvidedBy: data !== null && data !== void 0 && (_data$applicationData126 = data.applicationData) !== null && _data$applicationData126 !== void 0 && (_data$applicationData127 = _data$applicationData126.additionalDetails) !== null && _data$applicationData127 !== void 0 && _data$applicationData127.detailsProvidedBy ? {
|
|
1463
|
+
i18nKey: data === null || data === void 0 ? void 0 : (_data$applicationData128 = data.applicationData) === null || _data$applicationData128 === void 0 ? void 0 : (_data$applicationData129 = _data$applicationData128.additionalDetails) === null || _data$applicationData129 === void 0 ? void 0 : _data$applicationData129.detailsProvidedBy,
|
|
1464
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData130 = data.applicationData) === null || _data$applicationData130 === void 0 ? void 0 : (_data$applicationData131 = _data$applicationData130.additionalDetails) === null || _data$applicationData131 === void 0 ? void 0 : _data$applicationData131.detailsProvidedBy,
|
|
1465
|
+
size: data === null || data === void 0 ? void 0 : (_data$applicationData132 = data.applicationData) === null || _data$applicationData132 === void 0 ? void 0 : (_data$applicationData133 = _data$applicationData132.additionalDetails) === null || _data$applicationData133 === void 0 ? void 0 : _data$applicationData133.detailsProvidedBy
|
|
1424
1466
|
} : "",
|
|
1425
|
-
plumberName: data === null || data === void 0 ? void 0 : (_data$
|
|
1426
|
-
plumberMobileNo: data === null || data === void 0 ? void 0 : (_data$
|
|
1427
|
-
plumberLicenseNo: data === null || data === void 0 ? void 0 : (_data$
|
|
1467
|
+
plumberName: data === null || data === void 0 ? void 0 : (_data$applicationData134 = data.applicationData) === null || _data$applicationData134 === void 0 ? void 0 : (_data$applicationData135 = _data$applicationData134.plumberInfo) === null || _data$applicationData135 === void 0 ? void 0 : _data$applicationData135[0].name,
|
|
1468
|
+
plumberMobileNo: data === null || data === void 0 ? void 0 : (_data$applicationData136 = data.applicationData) === null || _data$applicationData136 === void 0 ? void 0 : (_data$applicationData137 = _data$applicationData136.plumberInfo) === null || _data$applicationData137 === void 0 ? void 0 : _data$applicationData137[0].mobileNumber,
|
|
1469
|
+
plumberLicenseNo: data === null || data === void 0 ? void 0 : (_data$applicationData138 = data.applicationData) === null || _data$applicationData138 === void 0 ? void 0 : (_data$applicationData139 = _data$applicationData138.plumberInfo) === null || _data$applicationData139 === void 0 ? void 0 : _data$applicationData139[0].licenseNo
|
|
1428
1470
|
}];
|
|
1429
|
-
let roadCuttingDetails = data !== null && data !== void 0 && (_data$
|
|
1471
|
+
let roadCuttingDetails = data !== null && data !== void 0 && (_data$applicationData140 = data.applicationData) !== null && _data$applicationData140 !== void 0 && _data$applicationData140.roadCuttingInfo ? data === null || data === void 0 ? void 0 : (_data$applicationData141 = data.applicationData) === null || _data$applicationData141 === void 0 ? void 0 : (_data$applicationData142 = _data$applicationData141.roadCuttingInfo) === null || _data$applicationData142 === void 0 ? void 0 : _data$applicationData142.map((rc, index) => {
|
|
1430
1472
|
return rc.id ? {
|
|
1431
1473
|
key: index + "_" + Date.now(),
|
|
1432
1474
|
id: rc === null || rc === void 0 ? void 0 : rc.id,
|
|
@@ -1466,30 +1508,33 @@ const convertApplicationData = (data, serviceType, modify = false, editByConfig
|
|
|
1466
1508
|
return payload;
|
|
1467
1509
|
};
|
|
1468
1510
|
const convertEditApplicationDetails = async (data, appData, actionData) => {
|
|
1469
|
-
var _data$
|
|
1470
|
-
data === null || data === void 0 ? void 0 : (_data$
|
|
1511
|
+
var _data$cpt30, _data$cpt30$details, _data$cpt30$details$o, _data$cpt31, _data$cpt31$details, _data$ConnectionDetai3, _data$ConnectionDetai4, _data$ConnectionDetai5, _data$ConnectionDetai6, _data$ConnectionDetai7, _data$ConnectionDetai8, _data$ConnectionDetai9, _data$ConnectionDetai0, _data$ConnectionDetai1, _data$ConnectionDetai10, _data$ConnectionDetai11, _data$ConnectionDetai12, _data$ConnectionDetai13, _data$ConnectionDetai14, _data$ConnectionDetai15, _data$ConnectionDetai16, _data$ConnectionDetai17, _data$ConnectionDetai18, _data$ConnectionHolde32, _data$ConnectionHolde33, _appData$applicationD, _appData$applicationD2, _data$ConnectionHolde34, _data$ConnectionHolde35, _data$ConnectionHolde36, _data$ConnectionHolde37, _data$ConnectionHolde38, _data$ConnectionHolde39, _data$ConnectionHolde40, _data$ConnectionHolde41, _data$ConnectionHolde42, _data$ConnectionHolde43, _data$ConnectionHolde44, _data$ConnectionHolde45, _data$ConnectionHolde46, _data$ConnectionHolde47, _data$ConnectionHolde48, _data$ConnectionHolde49, _data$ConnectionHolde50, _data$ConnectionHolde51, _data$ConnectionHolde52, _data$ConnectionHolde53, _data$ConnectionHolde54, _data$ConnectionHolde55, _data$ConnectionHolde56, _data$ConnectionHolde57, _data$ConnectionHolde58, _data$ConnectionHolde59, _data$ConnectionHolde60, _data$cpt32, _data$DocumentsRequir;
|
|
1512
|
+
data === null || data === void 0 ? void 0 : (_data$cpt30 = data.cpt) === null || _data$cpt30 === void 0 ? void 0 : (_data$cpt30$details = _data$cpt30.details) === null || _data$cpt30$details === void 0 ? void 0 : (_data$cpt30$details$o = _data$cpt30$details.owners) === null || _data$cpt30$details$o === void 0 ? void 0 : _data$cpt30$details$o.forEach(owner => {
|
|
1471
1513
|
if (owner !== null && owner !== void 0 && owner.permanentAddress) owner.correspondenceAddress = owner === null || owner === void 0 ? void 0 : owner.permanentAddress;
|
|
1472
1514
|
});
|
|
1473
1515
|
let payload = {
|
|
1474
1516
|
...appData.applicationData,
|
|
1475
|
-
propertyId: data === null || data === void 0 ? void 0 : (_data$
|
|
1476
|
-
proposedTaps: (data === null || data === void 0 ? void 0 : (_data$
|
|
1477
|
-
proposedPipeSize: (data === null || data === void 0 ? void 0 : (_data$
|
|
1478
|
-
proposedWaterClosets: (data === null || data === void 0 ? void 0 : (_data$
|
|
1479
|
-
proposedToilets: (data === null || data === void 0 ? void 0 : (_data$
|
|
1480
|
-
connectionHolders: !(data !== null && data !== void 0 && (_data$
|
|
1517
|
+
propertyId: data === null || data === void 0 ? void 0 : (_data$cpt31 = data.cpt) === null || _data$cpt31 === void 0 ? void 0 : (_data$cpt31$details = _data$cpt31.details) === null || _data$cpt31$details === void 0 ? void 0 : _data$cpt31$details.propertyId,
|
|
1518
|
+
proposedTaps: (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai3 = data.ConnectionDetails) === null || _data$ConnectionDetai3 === void 0 ? void 0 : (_data$ConnectionDetai4 = _data$ConnectionDetai3[0]) === null || _data$ConnectionDetai4 === void 0 ? void 0 : _data$ConnectionDetai4.proposedTaps) && Number(data === null || data === void 0 ? void 0 : (_data$ConnectionDetai5 = data.ConnectionDetails) === null || _data$ConnectionDetai5 === void 0 ? void 0 : (_data$ConnectionDetai6 = _data$ConnectionDetai5[0]) === null || _data$ConnectionDetai6 === void 0 ? void 0 : _data$ConnectionDetai6.proposedTaps),
|
|
1519
|
+
proposedPipeSize: (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai7 = data.ConnectionDetails) === null || _data$ConnectionDetai7 === void 0 ? void 0 : (_data$ConnectionDetai8 = _data$ConnectionDetai7[0]) === null || _data$ConnectionDetai8 === void 0 ? void 0 : (_data$ConnectionDetai9 = _data$ConnectionDetai8.proposedPipeSize) === null || _data$ConnectionDetai9 === void 0 ? void 0 : _data$ConnectionDetai9.size) && Number(data === null || data === void 0 ? void 0 : (_data$ConnectionDetai0 = data.ConnectionDetails) === null || _data$ConnectionDetai0 === void 0 ? void 0 : (_data$ConnectionDetai1 = _data$ConnectionDetai0[0]) === null || _data$ConnectionDetai1 === void 0 ? void 0 : (_data$ConnectionDetai10 = _data$ConnectionDetai1.proposedPipeSize) === null || _data$ConnectionDetai10 === void 0 ? void 0 : _data$ConnectionDetai10.size),
|
|
1520
|
+
proposedWaterClosets: (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai11 = data.ConnectionDetails) === null || _data$ConnectionDetai11 === void 0 ? void 0 : (_data$ConnectionDetai12 = _data$ConnectionDetai11[0]) === null || _data$ConnectionDetai12 === void 0 ? void 0 : _data$ConnectionDetai12.proposedWaterClosets) && Number(data === null || data === void 0 ? void 0 : (_data$ConnectionDetai13 = data.ConnectionDetails) === null || _data$ConnectionDetai13 === void 0 ? void 0 : (_data$ConnectionDetai14 = _data$ConnectionDetai13[0]) === null || _data$ConnectionDetai14 === void 0 ? void 0 : _data$ConnectionDetai14.proposedWaterClosets),
|
|
1521
|
+
proposedToilets: (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai15 = data.ConnectionDetails) === null || _data$ConnectionDetai15 === void 0 ? void 0 : (_data$ConnectionDetai16 = _data$ConnectionDetai15[0]) === null || _data$ConnectionDetai16 === void 0 ? void 0 : _data$ConnectionDetai16.proposedToilets) && Number(data === null || data === void 0 ? void 0 : (_data$ConnectionDetai17 = data.ConnectionDetails) === null || _data$ConnectionDetai17 === void 0 ? void 0 : (_data$ConnectionDetai18 = _data$ConnectionDetai17[0]) === null || _data$ConnectionDetai18 === void 0 ? void 0 : _data$ConnectionDetai18.proposedToilets),
|
|
1522
|
+
connectionHolders: !(data !== null && data !== void 0 && (_data$ConnectionHolde32 = data.ConnectionHolderDetails) !== null && _data$ConnectionHolde32 !== void 0 && (_data$ConnectionHolde33 = _data$ConnectionHolde32[0]) !== null && _data$ConnectionHolde33 !== void 0 && _data$ConnectionHolde33.sameAsOwnerDetails) ? [{
|
|
1481
1523
|
...(appData === null || appData === void 0 ? void 0 : (_appData$applicationD = appData.applicationData) === null || _appData$applicationD === void 0 ? void 0 : (_appData$applicationD2 = _appData$applicationD.connectionHolders) === null || _appData$applicationD2 === void 0 ? void 0 : _appData$applicationD2[0]),
|
|
1482
|
-
correspondenceAddress: (data === null || data === void 0 ? void 0 : (_data$
|
|
1483
|
-
fatherOrHusbandName: (data === null || data === void 0 ? void 0 : (_data$
|
|
1484
|
-
gender: (data === null || data === void 0 ? void 0 : (_data$
|
|
1485
|
-
mobileNumber: (data === null || data === void 0 ? void 0 : (_data$
|
|
1486
|
-
name: (data === null || data === void 0 ? void 0 : (_data$
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1524
|
+
correspondenceAddress: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde34 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde34 === void 0 ? void 0 : (_data$ConnectionHolde35 = _data$ConnectionHolde34[0]) === null || _data$ConnectionHolde35 === void 0 ? void 0 : _data$ConnectionHolde35.address) || "",
|
|
1525
|
+
fatherOrHusbandName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde36 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde36 === void 0 ? void 0 : (_data$ConnectionHolde37 = _data$ConnectionHolde36[0]) === null || _data$ConnectionHolde37 === void 0 ? void 0 : _data$ConnectionHolde37.guardian) || "",
|
|
1526
|
+
gender: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde38 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde38 === void 0 ? void 0 : (_data$ConnectionHolde39 = _data$ConnectionHolde38[0]) === null || _data$ConnectionHolde39 === void 0 ? void 0 : (_data$ConnectionHolde40 = _data$ConnectionHolde39.gender) === null || _data$ConnectionHolde40 === void 0 ? void 0 : _data$ConnectionHolde40.code) || "",
|
|
1527
|
+
mobileNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde41 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde41 === void 0 ? void 0 : (_data$ConnectionHolde42 = _data$ConnectionHolde41[0]) === null || _data$ConnectionHolde42 === void 0 ? void 0 : _data$ConnectionHolde42.mobileNumber) || "",
|
|
1528
|
+
name: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde43 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde43 === void 0 ? void 0 : (_data$ConnectionHolde44 = _data$ConnectionHolde43[0]) === null || _data$ConnectionHolde44 === void 0 ? void 0 : _data$ConnectionHolde44.name) || "",
|
|
1529
|
+
middleName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde45 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde45 === void 0 ? void 0 : (_data$ConnectionHolde46 = _data$ConnectionHolde45[0]) === null || _data$ConnectionHolde46 === void 0 ? void 0 : _data$ConnectionHolde46.middleName) || "",
|
|
1530
|
+
lastName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde47 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde47 === void 0 ? void 0 : (_data$ConnectionHolde48 = _data$ConnectionHolde47[0]) === null || _data$ConnectionHolde48 === void 0 ? void 0 : _data$ConnectionHolde48.lastName) || "",
|
|
1531
|
+
emailId: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde49 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde49 === void 0 ? void 0 : (_data$ConnectionHolde50 = _data$ConnectionHolde49[0]) === null || _data$ConnectionHolde50 === void 0 ? void 0 : _data$ConnectionHolde50.emailId) || "",
|
|
1532
|
+
watsAppMobileNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde51 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde51 === void 0 ? void 0 : (_data$ConnectionHolde52 = _data$ConnectionHolde51[0]) === null || _data$ConnectionHolde52 === void 0 ? void 0 : _data$ConnectionHolde52.watsAppMobileNumber) || "",
|
|
1533
|
+
ownerType: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde53 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde53 === void 0 ? void 0 : (_data$ConnectionHolde54 = _data$ConnectionHolde53[0]) === null || _data$ConnectionHolde54 === void 0 ? void 0 : (_data$ConnectionHolde55 = _data$ConnectionHolde54.ownerType) === null || _data$ConnectionHolde55 === void 0 ? void 0 : _data$ConnectionHolde55.code) || "",
|
|
1534
|
+
relationship: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde56 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde56 === void 0 ? void 0 : (_data$ConnectionHolde57 = _data$ConnectionHolde56[0]) === null || _data$ConnectionHolde57 === void 0 ? void 0 : (_data$ConnectionHolde58 = _data$ConnectionHolde57.relationship) === null || _data$ConnectionHolde58 === void 0 ? void 0 : _data$ConnectionHolde58.code) || "",
|
|
1535
|
+
sameAsPropertyAddress: data === null || data === void 0 ? void 0 : (_data$ConnectionHolde59 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde59 === void 0 ? void 0 : (_data$ConnectionHolde60 = _data$ConnectionHolde59[0]) === null || _data$ConnectionHolde60 === void 0 ? void 0 : _data$ConnectionHolde60.sameAsOwnerDetails
|
|
1491
1536
|
}] : null,
|
|
1492
|
-
property: data === null || data === void 0 ? void 0 : (_data$
|
|
1537
|
+
property: data === null || data === void 0 ? void 0 : (_data$cpt32 = data.cpt) === null || _data$cpt32 === void 0 ? void 0 : _data$cpt32.details,
|
|
1493
1538
|
processInstance: {
|
|
1494
1539
|
action: actionData ? actionData : "RESUBMIT_APPLICATION"
|
|
1495
1540
|
},
|
|
@@ -1499,17 +1544,17 @@ const convertEditApplicationDetails = async (data, appData, actionData) => {
|
|
|
1499
1544
|
return payload;
|
|
1500
1545
|
};
|
|
1501
1546
|
const convertDisonnectApplicationData = (data, serviceType, editByConfig = false, t) => {
|
|
1502
|
-
var _data$
|
|
1547
|
+
var _data$applicationData143, _data$applicationData144, _data$applicationData145, _data$applicationData146, _data$applicationData147, _data$applicationData148;
|
|
1503
1548
|
const temp = "TEMPORARY",
|
|
1504
1549
|
perm = "PERMANENT";
|
|
1505
1550
|
let disConnectionDetails = [{
|
|
1506
|
-
consumerNumber: data === null || data === void 0 ? void 0 : (_data$
|
|
1507
|
-
disConnectionType: data !== null && data !== void 0 && (_data$
|
|
1508
|
-
disConnectionReason: (data === null || data === void 0 ? void 0 : (_data$
|
|
1509
|
-
disConnectionProposeDate: data !== null && data !== void 0 && (_data$
|
|
1551
|
+
consumerNumber: data === null || data === void 0 ? void 0 : (_data$applicationData143 = data.applicationData) === null || _data$applicationData143 === void 0 ? void 0 : _data$applicationData143.applicationNo,
|
|
1552
|
+
disConnectionType: data !== null && data !== void 0 && (_data$applicationData144 = data.applicationData) !== null && _data$applicationData144 !== void 0 && _data$applicationData144.isDisconnectionTemporary ? temp : perm,
|
|
1553
|
+
disConnectionReason: (data === null || data === void 0 ? void 0 : (_data$applicationData145 = data.applicationData) === null || _data$applicationData145 === void 0 ? void 0 : _data$applicationData145.disconnectionReason) || "",
|
|
1554
|
+
disConnectionProposeDate: data !== null && data !== void 0 && (_data$applicationData146 = data.applicationData) !== null && _data$applicationData146 !== void 0 && _data$applicationData146.dateEffectiveFrom ? convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$applicationData147 = data.applicationData) === null || _data$applicationData147 === void 0 ? void 0 : _data$applicationData147.dateEffectiveFrom, true) : null
|
|
1510
1555
|
}];
|
|
1511
1556
|
let documents = [];
|
|
1512
|
-
if (data !== null && data !== void 0 && (_data$
|
|
1557
|
+
if (data !== null && data !== void 0 && (_data$applicationData148 = data.applicationData) !== null && _data$applicationData148 !== void 0 && _data$applicationData148.documents) {
|
|
1513
1558
|
data.applicationData.documents.forEach(data => {
|
|
1514
1559
|
var _data$documentType2;
|
|
1515
1560
|
documents.push({
|
|
@@ -1530,17 +1575,17 @@ const convertDisonnectApplicationData = (data, serviceType, editByConfig = false
|
|
|
1530
1575
|
payload.disConnectionDetails = disConnectionDetails;
|
|
1531
1576
|
payload.DocumentsRequired = DocumentsRequired;
|
|
1532
1577
|
if (editByConfig) {
|
|
1533
|
-
var _data$
|
|
1578
|
+
var _data$applicationData149, _data$applicationData150, _data$applicationData151, _data$applicationData152, _data$applicationData153, _data$applicationData154, _data$applicationData155, _data$applicationData156, _data$applicationData157, _data$applicationData158, _data$applicationData159, _data$applicationData160, _data$applicationData161, _data$applicationData162, _data$applicationData163;
|
|
1534
1579
|
let plumberDetails = [{
|
|
1535
|
-
detailsProvidedBy: data !== null && data !== void 0 && (_data$
|
|
1536
|
-
i18nKey: data === null || data === void 0 ? void 0 : (_data$
|
|
1537
|
-
code: data === null || data === void 0 ? void 0 : (_data$
|
|
1538
|
-
size: data === null || data === void 0 ? void 0 : (_data$
|
|
1580
|
+
detailsProvidedBy: data !== null && data !== void 0 && (_data$applicationData149 = data.applicationData) !== null && _data$applicationData149 !== void 0 && (_data$applicationData150 = _data$applicationData149.additionalDetails) !== null && _data$applicationData150 !== void 0 && _data$applicationData150.detailsProvidedBy ? {
|
|
1581
|
+
i18nKey: data === null || data === void 0 ? void 0 : (_data$applicationData151 = data.applicationData) === null || _data$applicationData151 === void 0 ? void 0 : (_data$applicationData152 = _data$applicationData151.additionalDetails) === null || _data$applicationData152 === void 0 ? void 0 : _data$applicationData152.detailsProvidedBy,
|
|
1582
|
+
code: data === null || data === void 0 ? void 0 : (_data$applicationData153 = data.applicationData) === null || _data$applicationData153 === void 0 ? void 0 : (_data$applicationData154 = _data$applicationData153.additionalDetails) === null || _data$applicationData154 === void 0 ? void 0 : _data$applicationData154.detailsProvidedBy,
|
|
1583
|
+
size: data === null || data === void 0 ? void 0 : (_data$applicationData155 = data.applicationData) === null || _data$applicationData155 === void 0 ? void 0 : (_data$applicationData156 = _data$applicationData155.additionalDetails) === null || _data$applicationData156 === void 0 ? void 0 : _data$applicationData156.detailsProvidedBy
|
|
1539
1584
|
} : "",
|
|
1540
|
-
plumberName: data === null || data === void 0 ? void 0 : (_data$
|
|
1541
|
-
plumberMobileNo: data === null || data === void 0 ? void 0 : (_data$
|
|
1542
|
-
plumberLicenseNo: data === null || data === void 0 ? void 0 : (_data$
|
|
1543
|
-
applicationNo: data === null || data === void 0 ? void 0 : (_data$
|
|
1585
|
+
plumberName: data === null || data === void 0 ? void 0 : (_data$applicationData157 = data.applicationData) === null || _data$applicationData157 === void 0 ? void 0 : (_data$applicationData158 = _data$applicationData157.plumberInfo) === null || _data$applicationData158 === void 0 ? void 0 : _data$applicationData158[0].name,
|
|
1586
|
+
plumberMobileNo: data === null || data === void 0 ? void 0 : (_data$applicationData159 = data.applicationData) === null || _data$applicationData159 === void 0 ? void 0 : (_data$applicationData160 = _data$applicationData159.plumberInfo) === null || _data$applicationData160 === void 0 ? void 0 : _data$applicationData160[0].mobileNumber,
|
|
1587
|
+
plumberLicenseNo: data === null || data === void 0 ? void 0 : (_data$applicationData161 = data.applicationData) === null || _data$applicationData161 === void 0 ? void 0 : (_data$applicationData162 = _data$applicationData161.plumberInfo) === null || _data$applicationData162 === void 0 ? void 0 : _data$applicationData162[0].licenseNo,
|
|
1588
|
+
applicationNo: data === null || data === void 0 ? void 0 : (_data$applicationData163 = data.applicationData) === null || _data$applicationData163 === void 0 ? void 0 : _data$applicationData163.applicationNo
|
|
1544
1589
|
}];
|
|
1545
1590
|
payload.plumberDetails = plumberDetails;
|
|
1546
1591
|
}
|
|
@@ -1610,14 +1655,14 @@ const getConvertedDate = async dateOfTime => {
|
|
|
1610
1655
|
return convertedDate;
|
|
1611
1656
|
};
|
|
1612
1657
|
const convertModifyApplicationDetails = async (data, appData, actionData = "INITIATE") => {
|
|
1613
|
-
var _data$
|
|
1614
|
-
data === null || data === void 0 ? void 0 : (_data$
|
|
1658
|
+
var _data$cpt33, _data$cpt33$details, _data$cpt33$details$o, _data$cpt34, _data$cpt34$details, _data$cpt35, _data$cpt35$details, _data$connectionDetai, _data$connectionDetai2, _data$connectionDetai3, _data$connectionDetai4, _data$connectionDetai5, _data$connectionDetai6, _data$connectionDetai7, _data$connectionDetai8, _data$connectionDetai9, _data$connectionDetai0, _data$connectionDetai1, _data$connectionDetai10, _data$connectionDetai11, _data$connectionDetai12, _data$connectionDetai13, _data$connectionDetai14, _data$connectionDetai15, _data$connectionDetai16, _data$connectionDetai17, _data$connectionDetai18, _data$connectionDetai19, _data$connectionDetai20, _data$connectionDetai21, _data$connectionDetai22, _data$connectionDetai23, _data$connectionDetai24, _data$connectionDetai25, _data$connectionDetai26, _data$connectionDetai27, _data$connectionDetai28, _data$activationDetai, _data$activationDetai2, _data$activationDetai3, _data$activationDetai4, _data$activationDetai5, _data$activationDetai6, _data$activationDetai7, _data$activationDetai8, _data$activationDetai9, _data$activationDetai0, _data$activationDetai1, _data$activationDetai10, _data$activationDetai11, _data$activationDetai12, _data$activationDetai13, _data$activationDetai14, _data$activationDetai15, _data$activationDetai16, _data$activationDetai17, _data$activationDetai18, _data$DocumentsRequir3, _data$DocumentsRequir4, _data$DocumentsRequir5, _data$ConnectionHolde61, _data$ConnectionHolde62, _data$DocumentsRequir6, _data$cpt36;
|
|
1659
|
+
data === null || data === void 0 ? void 0 : (_data$cpt33 = data.cpt) === null || _data$cpt33 === void 0 ? void 0 : (_data$cpt33$details = _data$cpt33.details) === null || _data$cpt33$details === void 0 ? void 0 : (_data$cpt33$details$o = _data$cpt33$details.owners) === null || _data$cpt33$details$o === void 0 ? void 0 : _data$cpt33$details$o.forEach(owner => {
|
|
1615
1660
|
if (owner !== null && owner !== void 0 && owner.permanentAddress) owner.correspondenceAddress = owner === null || owner === void 0 ? void 0 : owner.permanentAddress;
|
|
1616
1661
|
});
|
|
1617
1662
|
let formData = {
|
|
1618
1663
|
...appData.applicationData
|
|
1619
1664
|
};
|
|
1620
|
-
if (data !== null && data !== void 0 && (_data$
|
|
1665
|
+
if (data !== null && data !== void 0 && (_data$cpt34 = data.cpt) !== null && _data$cpt34 !== void 0 && (_data$cpt34$details = _data$cpt34.details) !== null && _data$cpt34$details !== void 0 && _data$cpt34$details.propertyId) formData.propertyId = data === null || data === void 0 ? void 0 : (_data$cpt35 = data.cpt) === null || _data$cpt35 === void 0 ? void 0 : (_data$cpt35$details = _data$cpt35.details) === null || _data$cpt35$details === void 0 ? void 0 : _data$cpt35$details.propertyId;
|
|
1621
1666
|
if (data !== null && data !== void 0 && (_data$connectionDetai = data.connectionDetails) !== null && _data$connectionDetai !== void 0 && (_data$connectionDetai2 = _data$connectionDetai[0]) !== null && _data$connectionDetai2 !== void 0 && (_data$connectionDetai3 = _data$connectionDetai2.connectionType) !== null && _data$connectionDetai3 !== void 0 && _data$connectionDetai3.code) formData.connectionType = data === null || data === void 0 ? void 0 : (_data$connectionDetai4 = data.connectionDetails) === null || _data$connectionDetai4 === void 0 ? void 0 : (_data$connectionDetai5 = _data$connectionDetai4[0]) === null || _data$connectionDetai5 === void 0 ? void 0 : (_data$connectionDetai6 = _data$connectionDetai5.connectionType) === null || _data$connectionDetai6 === void 0 ? void 0 : _data$connectionDetai6.code;
|
|
1622
1667
|
if (data !== null && data !== void 0 && (_data$connectionDetai7 = data.connectionDetails) !== null && _data$connectionDetai7 !== void 0 && (_data$connectionDetai8 = _data$connectionDetai7[0]) !== null && _data$connectionDetai8 !== void 0 && (_data$connectionDetai9 = _data$connectionDetai8.waterSource) !== null && _data$connectionDetai9 !== void 0 && _data$connectionDetai9.code) formData.waterSource = data === null || data === void 0 ? void 0 : (_data$connectionDetai0 = data.connectionDetails) === null || _data$connectionDetai0 === void 0 ? void 0 : (_data$connectionDetai1 = _data$connectionDetai0[0]) === null || _data$connectionDetai1 === void 0 ? void 0 : (_data$connectionDetai10 = _data$connectionDetai1.waterSource) === null || _data$connectionDetai10 === void 0 ? void 0 : _data$connectionDetai10.code;
|
|
1623
1668
|
if (data !== null && data !== void 0 && (_data$connectionDetai11 = data.connectionDetails) !== null && _data$connectionDetai11 !== void 0 && (_data$connectionDetai12 = _data$connectionDetai11[0]) !== null && _data$connectionDetai12 !== void 0 && (_data$connectionDetai13 = _data$connectionDetai12.pipeSize) !== null && _data$connectionDetai13 !== void 0 && _data$connectionDetai13.size) formData.pipeSize = data === null || data === void 0 ? void 0 : (_data$connectionDetai14 = data.connectionDetails) === null || _data$connectionDetai14 === void 0 ? void 0 : (_data$connectionDetai15 = _data$connectionDetai14[0]) === null || _data$connectionDetai15 === void 0 ? void 0 : (_data$connectionDetai16 = _data$connectionDetai15.pipeSize) === null || _data$connectionDetai16 === void 0 ? void 0 : _data$connectionDetai16.size;
|
|
@@ -1630,19 +1675,22 @@ const convertModifyApplicationDetails = async (data, appData, actionData = "INIT
|
|
|
1630
1675
|
if (data !== null && data !== void 0 && (_data$activationDetai11 = data.activationDetails) !== null && _data$activationDetai11 !== void 0 && (_data$activationDetai12 = _data$activationDetai11[0]) !== null && _data$activationDetai12 !== void 0 && _data$activationDetai12.connectionExecutionDate) formData.connectionExecutionDate = await getConvertedDate(data === null || data === void 0 ? void 0 : (_data$activationDetai13 = data.activationDetails) === null || _data$activationDetai13 === void 0 ? void 0 : (_data$activationDetai14 = _data$activationDetai13[0]) === null || _data$activationDetai14 === void 0 ? void 0 : _data$activationDetai14.connectionExecutionDate);
|
|
1631
1676
|
if (data !== null && data !== void 0 && (_data$activationDetai15 = data.activationDetails) !== null && _data$activationDetai15 !== void 0 && (_data$activationDetai16 = _data$activationDetai15[0]) !== null && _data$activationDetai16 !== void 0 && _data$activationDetai16.dateEffectiveFrom) formData.dateEffectiveFrom = await getConvertedDate(data === null || data === void 0 ? void 0 : (_data$activationDetai17 = data.activationDetails) === null || _data$activationDetai17 === void 0 ? void 0 : (_data$activationDetai18 = _data$activationDetai17[0]) === null || _data$activationDetai18 === void 0 ? void 0 : _data$activationDetai18.dateEffectiveFrom);
|
|
1632
1677
|
if (data !== null && data !== void 0 && (_data$DocumentsRequir3 = data.DocumentsRequired) !== null && _data$DocumentsRequir3 !== void 0 && (_data$DocumentsRequir4 = _data$DocumentsRequir3.documents) !== null && _data$DocumentsRequir4 !== void 0 && _data$DocumentsRequir4.length) formData.documents = data === null || data === void 0 ? void 0 : (_data$DocumentsRequir5 = data.DocumentsRequired) === null || _data$DocumentsRequir5 === void 0 ? void 0 : _data$DocumentsRequir5.documents;else formData.documents = null;
|
|
1633
|
-
if (!(data !== null && data !== void 0 && (_data$
|
|
1634
|
-
var _appData$applicationD8, _appData$applicationD9, _data$
|
|
1678
|
+
if (!(data !== null && data !== void 0 && (_data$ConnectionHolde61 = data.ConnectionHolderDetails) !== null && _data$ConnectionHolde61 !== void 0 && (_data$ConnectionHolde62 = _data$ConnectionHolde61[0]) !== null && _data$ConnectionHolde62 !== void 0 && _data$ConnectionHolde62.sameAsOwnerDetails)) {
|
|
1679
|
+
var _appData$applicationD8, _appData$applicationD9, _data$ConnectionHolde63, _data$ConnectionHolde64, _data$ConnectionHolde65, _data$ConnectionHolde66, _data$ConnectionHolde67, _data$ConnectionHolde68, _data$ConnectionHolde69, _data$ConnectionHolde70, _data$ConnectionHolde71, _data$ConnectionHolde72, _data$ConnectionHolde73, _data$ConnectionHolde74, _data$ConnectionHolde75, _data$ConnectionHolde76, _data$ConnectionHolde77, _data$ConnectionHolde78, _data$ConnectionHolde79, _data$ConnectionHolde80, _data$ConnectionHolde81, _data$ConnectionHolde82, _data$ConnectionHolde83, _data$ConnectionHolde84, _data$ConnectionHolde85, _data$ConnectionHolde86, _data$ConnectionHolde87, _data$ConnectionHolde88, _data$ConnectionHolde89;
|
|
1635
1680
|
formData.connectionHolders = [{
|
|
1636
1681
|
...(appData === null || appData === void 0 ? void 0 : (_appData$applicationD8 = appData.applicationData) === null || _appData$applicationD8 === void 0 ? void 0 : (_appData$applicationD9 = _appData$applicationD8.connectionHolders) === null || _appData$applicationD9 === void 0 ? void 0 : _appData$applicationD9[0]),
|
|
1637
|
-
correspondenceAddress: (data === null || data === void 0 ? void 0 : (_data$
|
|
1638
|
-
fatherOrHusbandName: (data === null || data === void 0 ? void 0 : (_data$
|
|
1639
|
-
gender: (data === null || data === void 0 ? void 0 : (_data$
|
|
1640
|
-
mobileNumber: (data === null || data === void 0 ? void 0 : (_data$
|
|
1641
|
-
name: (data === null || data === void 0 ? void 0 : (_data$
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1682
|
+
correspondenceAddress: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde63 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde63 === void 0 ? void 0 : (_data$ConnectionHolde64 = _data$ConnectionHolde63[0]) === null || _data$ConnectionHolde64 === void 0 ? void 0 : _data$ConnectionHolde64.address) || "",
|
|
1683
|
+
fatherOrHusbandName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde65 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde65 === void 0 ? void 0 : (_data$ConnectionHolde66 = _data$ConnectionHolde65[0]) === null || _data$ConnectionHolde66 === void 0 ? void 0 : _data$ConnectionHolde66.guardian) || "",
|
|
1684
|
+
gender: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde67 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde67 === void 0 ? void 0 : (_data$ConnectionHolde68 = _data$ConnectionHolde67[0]) === null || _data$ConnectionHolde68 === void 0 ? void 0 : (_data$ConnectionHolde69 = _data$ConnectionHolde68.gender) === null || _data$ConnectionHolde69 === void 0 ? void 0 : _data$ConnectionHolde69.code) || "",
|
|
1685
|
+
mobileNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde70 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde70 === void 0 ? void 0 : (_data$ConnectionHolde71 = _data$ConnectionHolde70[0]) === null || _data$ConnectionHolde71 === void 0 ? void 0 : _data$ConnectionHolde71.mobileNumber) || "",
|
|
1686
|
+
name: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde72 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde72 === void 0 ? void 0 : (_data$ConnectionHolde73 = _data$ConnectionHolde72[0]) === null || _data$ConnectionHolde73 === void 0 ? void 0 : _data$ConnectionHolde73.name) || "",
|
|
1687
|
+
middleName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde74 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde74 === void 0 ? void 0 : (_data$ConnectionHolde75 = _data$ConnectionHolde74[0]) === null || _data$ConnectionHolde75 === void 0 ? void 0 : _data$ConnectionHolde75.middleName) || "",
|
|
1688
|
+
lastName: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde76 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde76 === void 0 ? void 0 : (_data$ConnectionHolde77 = _data$ConnectionHolde76[0]) === null || _data$ConnectionHolde77 === void 0 ? void 0 : _data$ConnectionHolde77.lastName) || "",
|
|
1689
|
+
emailId: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde78 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde78 === void 0 ? void 0 : (_data$ConnectionHolde79 = _data$ConnectionHolde78[0]) === null || _data$ConnectionHolde79 === void 0 ? void 0 : _data$ConnectionHolde79.emailId) || "",
|
|
1690
|
+
watsAppMobileNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde80 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde80 === void 0 ? void 0 : (_data$ConnectionHolde81 = _data$ConnectionHolde80[0]) === null || _data$ConnectionHolde81 === void 0 ? void 0 : _data$ConnectionHolde81.watsAppMobileNumber) || "",
|
|
1691
|
+
ownerType: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde82 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde82 === void 0 ? void 0 : (_data$ConnectionHolde83 = _data$ConnectionHolde82[0]) === null || _data$ConnectionHolde83 === void 0 ? void 0 : (_data$ConnectionHolde84 = _data$ConnectionHolde83.ownerType) === null || _data$ConnectionHolde84 === void 0 ? void 0 : _data$ConnectionHolde84.code) || "",
|
|
1692
|
+
relationship: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde85 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde85 === void 0 ? void 0 : (_data$ConnectionHolde86 = _data$ConnectionHolde85[0]) === null || _data$ConnectionHolde86 === void 0 ? void 0 : (_data$ConnectionHolde87 = _data$ConnectionHolde86.relationship) === null || _data$ConnectionHolde87 === void 0 ? void 0 : _data$ConnectionHolde87.code) || "",
|
|
1693
|
+
sameAsPropertyAddress: data === null || data === void 0 ? void 0 : (_data$ConnectionHolde88 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde88 === void 0 ? void 0 : (_data$ConnectionHolde89 = _data$ConnectionHolde88[0]) === null || _data$ConnectionHolde89 === void 0 ? void 0 : _data$ConnectionHolde89.sameAsOwnerDetails
|
|
1646
1694
|
}];
|
|
1647
1695
|
}
|
|
1648
1696
|
formData.processInstance = {
|
|
@@ -1651,7 +1699,7 @@ const convertModifyApplicationDetails = async (data, appData, actionData = "INIT
|
|
|
1651
1699
|
formData.action = actionData;
|
|
1652
1700
|
formData.channel = "CFC_COUNTER";
|
|
1653
1701
|
sessionStorage.setItem("WS_DOCUMENTS_INOF", JSON.stringify((data === null || data === void 0 ? void 0 : (_data$DocumentsRequir6 = data.DocumentsRequired) === null || _data$DocumentsRequir6 === void 0 ? void 0 : _data$DocumentsRequir6.documents) || []));
|
|
1654
|
-
sessionStorage.setItem("WS_PROPERTY_INOF", JSON.stringify(data === null || data === void 0 ? void 0 : (_data$
|
|
1702
|
+
sessionStorage.setItem("WS_PROPERTY_INOF", JSON.stringify(data === null || data === void 0 ? void 0 : (_data$cpt36 = data.cpt) === null || _data$cpt36 === void 0 ? void 0 : _data$cpt36.details));
|
|
1655
1703
|
return formData;
|
|
1656
1704
|
};
|
|
1657
1705
|
const downloadPdf = (blob, fileName) => {
|
|
@@ -9224,11 +9272,11 @@ const BILLSBreadCrumbs = ({
|
|
|
9224
9272
|
}, {
|
|
9225
9273
|
path: "/digit-ui/employee/module/details",
|
|
9226
9274
|
label: t("ES_TITLE_WATER_AND_SEWERAGE"),
|
|
9227
|
-
show: location.pathname.includes("/create-application") || location.pathname.includes("/new-application")
|
|
9275
|
+
show: location.pathname.includes("/create-application") || location.pathname.includes("/new-application") || location.pathname.includes("/old-application")
|
|
9228
9276
|
}, {
|
|
9229
9277
|
path: "/digit-ui/employee/ws/create-application",
|
|
9230
9278
|
label: t("ES_COMMON_WS_DOCUMENTS_REQUIRED"),
|
|
9231
|
-
show: location.pathname.includes("/create-application") || location.pathname.includes("/new-application"),
|
|
9279
|
+
show: location.pathname.includes("/create-application") || location.pathname.includes("/new-application") || location.pathname.includes("/old-application"),
|
|
9232
9280
|
rightContent: location.pathname.includes("/create-application") && /*#__PURE__*/React.createElement("div", {
|
|
9233
9281
|
className: "flex-center flex-gap-1 .cursorPointer",
|
|
9234
9282
|
onClick: printDiv
|
|
@@ -9284,6 +9332,10 @@ const BILLSBreadCrumbs = ({
|
|
|
9284
9332
|
path: "/digit-ui/employee/ws/new-application",
|
|
9285
9333
|
label: fromScreen ? `${t(fromScreen)} / ${t("ES_COMMON_WS_NEW_CONNECTION")}` : t("ES_COMMON_WS_NEW_CONNECTION"),
|
|
9286
9334
|
show: location.pathname.includes("/new-application") ? true : false
|
|
9335
|
+
}, {
|
|
9336
|
+
path: "/digit-ui/employee/ws/old-application",
|
|
9337
|
+
label: fromScreen ? `${t(fromScreen)} / ${t("ES_COMMON_WS_OLD_CONNECTION")}` : t("ES_COMMON_WS_OLD_CONNECTION"),
|
|
9338
|
+
show: location.pathname.includes("/old-application") ? true : false
|
|
9287
9339
|
}, {
|
|
9288
9340
|
path: `${location === null || location === void 0 ? void 0 : location.pathname}${location.search}`,
|
|
9289
9341
|
label: t("ACTION_TEST_RESPONSE"),
|
|
@@ -9444,7 +9496,7 @@ const BILLSBreadCrumbs = ({
|
|
|
9444
9496
|
const App$1 = ({
|
|
9445
9497
|
path
|
|
9446
9498
|
}) => {
|
|
9447
|
-
var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi, _Digit7, _Digit7$ComponentRegi, _Digit8, _Digit8$ComponentRegi, _Digit9, _Digit9$ComponentRegi, _Digit0, _Digit0$ComponentRegi, _Digit1, _Digit1$ComponentRegi, _Digit10, _Digit10$ComponentReg, _Digit11, _Digit11$ComponentReg, _Digit12, _Digit12$ComponentReg, _Digit13, _Digit13$ComponentReg, _Digit14, _Digit14$ComponentReg, _Digit15, _Digit15$ComponentReg, _Digit16, _Digit16$ComponentReg, _Digit17, _Digit17$ComponentReg, _Digit18, _Digit18$ComponentReg, _Digit19, _Digit19$ComponentReg, _Digit20, _Digit20$ComponentReg, _Digit21, _Digit21$ComponentReg, _Digit22, _Digit22$ComponentReg, _Digit23, _Digit23$ComponentReg, _Digit24, _Digit24$ComponentReg, _Digit25, _Digit25$ComponentReg, _Digit26, _Digit26$ComponentReg;
|
|
9499
|
+
var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi, _Digit7, _Digit7$ComponentRegi, _Digit8, _Digit8$ComponentRegi, _Digit9, _Digit9$ComponentRegi, _Digit0, _Digit0$ComponentRegi, _Digit1, _Digit1$ComponentRegi, _Digit10, _Digit10$ComponentReg, _Digit11, _Digit11$ComponentReg, _Digit12, _Digit12$ComponentReg, _Digit13, _Digit13$ComponentReg, _Digit14, _Digit14$ComponentReg, _Digit15, _Digit15$ComponentReg, _Digit16, _Digit16$ComponentReg, _Digit17, _Digit17$ComponentReg, _Digit18, _Digit18$ComponentReg, _Digit19, _Digit19$ComponentReg, _Digit20, _Digit20$ComponentReg, _Digit21, _Digit21$ComponentReg, _Digit22, _Digit22$ComponentReg, _Digit23, _Digit23$ComponentReg, _Digit24, _Digit24$ComponentReg, _Digit25, _Digit25$ComponentReg, _Digit26, _Digit26$ComponentReg, _Digit27, _Digit27$ComponentReg, _Digit28, _Digit28$ComponentReg;
|
|
9448
9500
|
const location = useLocation();
|
|
9449
9501
|
const WSDocsRequired = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("WSDocsRequired");
|
|
9450
9502
|
const WSInbox = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent("WSInbox");
|
|
@@ -9474,6 +9526,8 @@ const App$1 = ({
|
|
|
9474
9526
|
const WSResubmitDisconnection = (_Digit24 = Digit) === null || _Digit24 === void 0 ? void 0 : (_Digit24$ComponentReg = _Digit24.ComponentRegistryService) === null || _Digit24$ComponentReg === void 0 ? void 0 : _Digit24$ComponentReg.getComponent("WSResubmitDisconnection");
|
|
9475
9527
|
const WSSearchIntegrated = (_Digit25 = Digit) === null || _Digit25 === void 0 ? void 0 : (_Digit25$ComponentReg = _Digit25.ComponentRegistryService) === null || _Digit25$ComponentReg === void 0 ? void 0 : _Digit25$ComponentReg.getComponent("WSSearchIntegrated");
|
|
9476
9528
|
const WSBulkBillGeneration = (_Digit26 = Digit) === null || _Digit26 === void 0 ? void 0 : (_Digit26$ComponentReg = _Digit26.ComponentRegistryService) === null || _Digit26$ComponentReg === void 0 ? void 0 : _Digit26$ComponentReg.getComponent("WSBulkBillGeneration");
|
|
9529
|
+
const CPTCreateProperty = (_Digit27 = Digit) === null || _Digit27 === void 0 ? void 0 : (_Digit27$ComponentReg = _Digit27.ComponentRegistryService) === null || _Digit27$ComponentReg === void 0 ? void 0 : _Digit27$ComponentReg.getComponent("CPTCreateProperty");
|
|
9530
|
+
const CPTAcknowledgement = (_Digit28 = Digit) === null || _Digit28 === void 0 ? void 0 : (_Digit28$ComponentReg = _Digit28.ComponentRegistryService) === null || _Digit28$ComponentReg === void 0 ? void 0 : _Digit28$ComponentReg.getComponent("CPTAcknowledgement");
|
|
9477
9531
|
const locationCheck = window.location.href.includes("/employee/ws/new-application") || window.location.href.includes("/employee/ws/modify-application") || window.location.href.includes("/employee/ws/edit-application") || window.location.href.includes("/employee/ws/activate-connection") || window.location.href.includes("/employee/ws/application-details") || window.location.href.includes("/employee/ws/modify-details") || window.location.href.includes("/employee/ws/ws-response") || window.location.href.includes("/employee/ws/new-disconnection/application-form") || window.location.href.includes("/employee/ws/ws-disconnection-response") || window.location.href.includes("/employee/ws/consumption-details") || window.location.href.includes("/employee/ws/edit-disconnection-application") || window.location.href.includes("/employee/ws/config-by-disconnection-application") || window.location.href.includes("/employee/ws/resubmit-disconnection-application") || window.location.href.includes("/employee/ws/water/bulk-bill");
|
|
9478
9532
|
const locationCheckReqDocs = window.location.href.includes("/employee/ws/create-application") || window.location.href.includes("/employee/ws/new-disconnection/docsrequired");
|
|
9479
9533
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -9487,6 +9541,24 @@ const App$1 = ({
|
|
|
9487
9541
|
}, /*#__PURE__*/React.createElement("div", {
|
|
9488
9542
|
className: "employee-form-content"
|
|
9489
9543
|
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
9544
|
+
path: `${path}/create-application/create-property/save-property`,
|
|
9545
|
+
component: props => {
|
|
9546
|
+
const redirectUrl = new URLSearchParams(props.location.search).get("redirectToUrl");
|
|
9547
|
+
return /*#__PURE__*/React.createElement(CPTAcknowledgement, Object.assign({}, props, {
|
|
9548
|
+
redirectUrl: redirectUrl
|
|
9549
|
+
}));
|
|
9550
|
+
}
|
|
9551
|
+
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
9552
|
+
path: `${path}/create-application/create-property`,
|
|
9553
|
+
component: props => {
|
|
9554
|
+
const redirectUrl = new URLSearchParams(props.location.search).get("redirectToUrl");
|
|
9555
|
+
return /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
9556
|
+
layoutClass: "action"
|
|
9557
|
+
}, /*#__PURE__*/React.createElement(CPTCreateProperty, Object.assign({}, props, {
|
|
9558
|
+
redirectUrl: redirectUrl
|
|
9559
|
+
})));
|
|
9560
|
+
}
|
|
9561
|
+
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
9490
9562
|
path: `${path}/create-application`,
|
|
9491
9563
|
component: WSDocsRequired
|
|
9492
9564
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
@@ -9494,7 +9566,11 @@ const App$1 = ({
|
|
|
9494
9566
|
component: WSNewApplication
|
|
9495
9567
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
9496
9568
|
path: `${path}/old-application`,
|
|
9497
|
-
component:
|
|
9569
|
+
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
9570
|
+
layoutClass: "action"
|
|
9571
|
+
}, /*#__PURE__*/React.createElement(WSOLDApplication, {
|
|
9572
|
+
path
|
|
9573
|
+
}))
|
|
9498
9574
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
9499
9575
|
path: `${path}/edit-application`,
|
|
9500
9576
|
component: WSEditApplication
|
|
@@ -10967,7 +11043,42 @@ const createConnectionDetails = () => ({
|
|
|
10967
11043
|
proposedPipeSize: "",
|
|
10968
11044
|
proposedTaps: "",
|
|
10969
11045
|
proposedToilets: "",
|
|
10970
|
-
proposedWaterClosets: ""
|
|
11046
|
+
proposedWaterClosets: "",
|
|
11047
|
+
serviceType: {
|
|
11048
|
+
code: "WATER",
|
|
11049
|
+
i18nKey: "WS_APPLICATION_TYPE_WATER"
|
|
11050
|
+
},
|
|
11051
|
+
categoryType: {
|
|
11052
|
+
code: "DOMESTIC",
|
|
11053
|
+
i18nKey: "WS_CATEGORY_DOMESTIC"
|
|
11054
|
+
},
|
|
11055
|
+
connectionType: {
|
|
11056
|
+
code: "Permanent",
|
|
11057
|
+
i18nKey: "WS_CONNECTION_Permanent"
|
|
11058
|
+
},
|
|
11059
|
+
temporaryType: {
|
|
11060
|
+
code: "Exhibition",
|
|
11061
|
+
i18nKey: "Exhibition"
|
|
11062
|
+
},
|
|
11063
|
+
waterDemandType: {
|
|
11064
|
+
code: "BULK",
|
|
11065
|
+
i18nKey: "WS_WATER_DEMAND_BULK"
|
|
11066
|
+
},
|
|
11067
|
+
applicantType: {
|
|
11068
|
+
code: "OWNER",
|
|
11069
|
+
i18nKey: "WS_APPLICANT_OWNER"
|
|
11070
|
+
},
|
|
11071
|
+
domesticType: {
|
|
11072
|
+
i18nKey: "WS_DOMESTIC_TYPE_DOMESTIC",
|
|
11073
|
+
code: "INDIVIDUAL"
|
|
11074
|
+
},
|
|
11075
|
+
departmentType: {
|
|
11076
|
+
i18nKey: "WS_DEPARTMENT_TYPE_GOVERNMENT",
|
|
11077
|
+
code: "GOVERNMENT"
|
|
11078
|
+
},
|
|
11079
|
+
institutionName: "",
|
|
11080
|
+
natureOfWork: "",
|
|
11081
|
+
orgDeptDocument: ""
|
|
10971
11082
|
});
|
|
10972
11083
|
const WSConnectionDetails = ({
|
|
10973
11084
|
config,
|
|
@@ -10997,11 +11108,20 @@ const WSConnectionDetails = ({
|
|
|
10997
11108
|
water: true,
|
|
10998
11109
|
sewerage: false
|
|
10999
11110
|
});
|
|
11000
|
-
const [
|
|
11111
|
+
const [applicationTypeList, setApplicationTypeList] = useState([]);
|
|
11112
|
+
const [categoryTypeList, setCategoryTypeList] = useState([]);
|
|
11113
|
+
const [connectionTypeList, setConnectionTypeList] = useState([]);
|
|
11114
|
+
const [waterDemandTypeList, setWaterDemandTypeList] = useState([]);
|
|
11115
|
+
const [applicantTypeList, setApplicantTypeList] = useState([]);
|
|
11116
|
+
const [temporaryTypeList, setTemporaryTypeList] = useState([]);
|
|
11117
|
+
const [institutionTypeList, setInstitutionTypeList] = useState([]);
|
|
11001
11118
|
const {
|
|
11002
|
-
|
|
11003
|
-
data:
|
|
11004
|
-
} = Digit.Hooks.ws.useMDMS(tenantId, "ws-services-
|
|
11119
|
+
isWSServicesMastersLoading,
|
|
11120
|
+
data: wsServicesMastersData
|
|
11121
|
+
} = Digit.Hooks.ws.useMDMS(tenantId, "ws-services-masters", ["ApplicationType", "WsCategoryType", "connectionCategory", "WSWaterDemandType", "ApplicantType", "TemporaryConnectionType"]);
|
|
11122
|
+
const {
|
|
11123
|
+
data: commonMastersData
|
|
11124
|
+
} = Digit.Hooks.ws.useMDMS(tenantId, "common-masters", ["InstitutionType"]);
|
|
11005
11125
|
useEffect(() => {
|
|
11006
11126
|
const data = connectionDetails.map(e => {
|
|
11007
11127
|
return e;
|
|
@@ -11009,11 +11129,33 @@ const WSConnectionDetails = ({
|
|
|
11009
11129
|
onSelect(config === null || config === void 0 ? void 0 : config.key, data);
|
|
11010
11130
|
}, [connectionDetails]);
|
|
11011
11131
|
useEffect(() => {
|
|
11012
|
-
var
|
|
11013
|
-
|
|
11014
|
-
list === null ||
|
|
11015
|
-
|
|
11016
|
-
|
|
11132
|
+
var _wsServicesMastersDat, _list, _wsServicesMastersDat2, _wsServicesMastersDat3, _wsServicesMastersDat4, _wsServicesMastersDat5, _wsServicesMastersDat6;
|
|
11133
|
+
let list = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat === void 0 ? void 0 : _wsServicesMastersDat.ApplicationType) || [];
|
|
11134
|
+
list = list.filter(data => (data === null || data === void 0 ? void 0 : data.active) !== false && (data === null || data === void 0 ? void 0 : data.active) !== "false");
|
|
11135
|
+
(_list = list) === null || _list === void 0 ? void 0 : _list.forEach(data => data.i18nKey = `WS_APPLICATION_TYPE_${data.code}`);
|
|
11136
|
+
setApplicationTypeList(list);
|
|
11137
|
+
const categories = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat2 = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat2 === void 0 ? void 0 : _wsServicesMastersDat2.WsCategoryType) || [];
|
|
11138
|
+
categories.forEach(data => data.i18nKey = data.i18nKey || `WS_CATEGORY_${data.code}`);
|
|
11139
|
+
setCategoryTypeList(categories);
|
|
11140
|
+
const connections = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat3 = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat3 === void 0 ? void 0 : _wsServicesMastersDat3.connectionCategory) || [];
|
|
11141
|
+
connections.forEach(data => data.i18nKey = data.i18nKey || `WS_CONNECTION_${data.code}`);
|
|
11142
|
+
setConnectionTypeList(connections);
|
|
11143
|
+
const demands = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat4 = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat4 === void 0 ? void 0 : _wsServicesMastersDat4.WSWaterDemandType) || [];
|
|
11144
|
+
demands.forEach(data => data.i18nKey = data.i18nKey || `WS_WATER_DEMAND_${data.code}`);
|
|
11145
|
+
setWaterDemandTypeList(demands);
|
|
11146
|
+
const applicants = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat5 = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat5 === void 0 ? void 0 : _wsServicesMastersDat5.ApplicantType) || [];
|
|
11147
|
+
applicants.forEach(data => data.i18nKey = data.i18nKey || `WS_APPLICANT_${data.code}`);
|
|
11148
|
+
setApplicantTypeList(applicants);
|
|
11149
|
+
const tempTypes = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat6 = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat6 === void 0 ? void 0 : _wsServicesMastersDat6.TemporaryConnectionType) || [];
|
|
11150
|
+
tempTypes.forEach(data => data.i18nKey = data.name || data.code);
|
|
11151
|
+
setTemporaryTypeList(tempTypes);
|
|
11152
|
+
}, [wsServicesMastersData]);
|
|
11153
|
+
useEffect(() => {
|
|
11154
|
+
var _commonMastersData$co;
|
|
11155
|
+
const instTypes = (commonMastersData === null || commonMastersData === void 0 ? void 0 : (_commonMastersData$co = commonMastersData["common-masters"]) === null || _commonMastersData$co === void 0 ? void 0 : _commonMastersData$co.InstitutionType) || [];
|
|
11156
|
+
instTypes.forEach(data => data.i18nKey = `COMMON_MASTERS_INSTITUTION_${data.code}`);
|
|
11157
|
+
setInstitutionTypeList(instTypes);
|
|
11158
|
+
}, [commonMastersData]);
|
|
11017
11159
|
useEffect(() => {
|
|
11018
11160
|
var _connectionDetails$, _connectionDetails$2;
|
|
11019
11161
|
if (userType === "employee") {
|
|
@@ -11033,7 +11175,6 @@ const WSConnectionDetails = ({
|
|
|
11033
11175
|
setConnectionDetails([createConnectionDetails()]);
|
|
11034
11176
|
}
|
|
11035
11177
|
}, [formData === null || formData === void 0 ? void 0 : formData.ConnectionDetails]);
|
|
11036
|
-
if (isWSServicesCalculationLoading) return /*#__PURE__*/React.createElement(Loader, null);
|
|
11037
11178
|
const commonProps = {
|
|
11038
11179
|
focusIndex,
|
|
11039
11180
|
connectionDetails,
|
|
@@ -11047,9 +11188,14 @@ const WSConnectionDetails = ({
|
|
|
11047
11188
|
setConnectionDetails,
|
|
11048
11189
|
setIsErrors,
|
|
11049
11190
|
isErrors,
|
|
11050
|
-
pipeSizeList,
|
|
11051
|
-
wsServicesCalculationData,
|
|
11052
11191
|
waterSewarageSelection,
|
|
11192
|
+
applicationTypeList,
|
|
11193
|
+
categoryTypeList,
|
|
11194
|
+
connectionTypeList,
|
|
11195
|
+
waterDemandTypeList,
|
|
11196
|
+
applicantTypeList,
|
|
11197
|
+
temporaryTypeList,
|
|
11198
|
+
institutionTypeList,
|
|
11053
11199
|
formData
|
|
11054
11200
|
};
|
|
11055
11201
|
return /*#__PURE__*/React.createElement(React.Fragment, null, connectionDetails.map((connectionDetail, index) => connectionDetail && /*#__PURE__*/React.createElement(ConnectionDetails, Object.assign({
|
|
@@ -11059,7 +11205,7 @@ const WSConnectionDetails = ({
|
|
|
11059
11205
|
}, commonProps))));
|
|
11060
11206
|
};
|
|
11061
11207
|
const ConnectionDetails = _props => {
|
|
11062
|
-
var _formData$DocumentsRe,
|
|
11208
|
+
var _formData$DocumentsRe, _formValue$connection, _formValue$categoryTy, _formValue$categoryTy2, _formValue$domesticTy;
|
|
11063
11209
|
const {
|
|
11064
11210
|
connectionDetail,
|
|
11065
11211
|
focusIndex,
|
|
@@ -11073,10 +11219,14 @@ const ConnectionDetails = _props => {
|
|
|
11073
11219
|
isErrors,
|
|
11074
11220
|
connectionTypeList,
|
|
11075
11221
|
setConnectionDetails,
|
|
11076
|
-
wsServicesCalculationData,
|
|
11077
|
-
pipeSizeList,
|
|
11078
11222
|
connectionDetails,
|
|
11079
11223
|
waterSewarageSelection,
|
|
11224
|
+
applicationTypeList,
|
|
11225
|
+
categoryTypeList,
|
|
11226
|
+
waterDemandTypeList,
|
|
11227
|
+
applicantTypeList,
|
|
11228
|
+
temporaryTypeList,
|
|
11229
|
+
institutionTypeList,
|
|
11080
11230
|
formData
|
|
11081
11231
|
} = _props;
|
|
11082
11232
|
const {
|
|
@@ -11088,11 +11238,110 @@ const ConnectionDetails = _props => {
|
|
|
11088
11238
|
setValue,
|
|
11089
11239
|
trigger,
|
|
11090
11240
|
getValues
|
|
11091
|
-
} = useForm(
|
|
11241
|
+
} = useForm({
|
|
11242
|
+
defaultValues: {
|
|
11243
|
+
serviceType: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.serviceType) || {
|
|
11244
|
+
code: "WATER",
|
|
11245
|
+
i18nKey: "WS_APPLICATION_TYPE_WATER"
|
|
11246
|
+
},
|
|
11247
|
+
categoryType: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.categoryType) || {
|
|
11248
|
+
code: "DOMESTIC",
|
|
11249
|
+
i18nKey: "WS_CATEGORY_DOMESTIC"
|
|
11250
|
+
},
|
|
11251
|
+
connectionType: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.connectionType) || {
|
|
11252
|
+
code: "Permanent",
|
|
11253
|
+
i18nKey: "WS_CONNECTION_Permanent"
|
|
11254
|
+
},
|
|
11255
|
+
temporaryType: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.temporaryType) || {
|
|
11256
|
+
code: "Exhibition",
|
|
11257
|
+
i18nKey: "Exhibition"
|
|
11258
|
+
},
|
|
11259
|
+
waterDemandType: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.waterDemandType) || {
|
|
11260
|
+
code: "BULK",
|
|
11261
|
+
i18nKey: "WS_WATER_DEMAND_BULK"
|
|
11262
|
+
},
|
|
11263
|
+
applicantType: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.applicantType) || {
|
|
11264
|
+
code: "OWNER",
|
|
11265
|
+
i18nKey: "WS_APPLICANT_OWNER"
|
|
11266
|
+
},
|
|
11267
|
+
domesticType: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.domesticType) || {
|
|
11268
|
+
i18nKey: "WS_DOMESTIC_TYPE_DOMESTIC",
|
|
11269
|
+
code: "INDIVIDUAL"
|
|
11270
|
+
},
|
|
11271
|
+
departmentType: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.departmentType) || {
|
|
11272
|
+
i18nKey: "WS_DEPARTMENT_TYPE_GOVERNMENT",
|
|
11273
|
+
code: "GOVERNMENT"
|
|
11274
|
+
},
|
|
11275
|
+
institutionName: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.institutionName) || "",
|
|
11276
|
+
natureOfWork: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.natureOfWork) || "",
|
|
11277
|
+
orgDeptDocument: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.orgDeptDocument) || ""
|
|
11278
|
+
}
|
|
11279
|
+
});
|
|
11092
11280
|
const formValue = watch();
|
|
11093
11281
|
const {
|
|
11094
11282
|
errors
|
|
11095
11283
|
} = localFormState;
|
|
11284
|
+
const [uploadedFile, setUploadedFile] = useState((connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.orgDeptDocument) || null);
|
|
11285
|
+
const [file, setFile] = useState(null);
|
|
11286
|
+
const [fileUploadError, setFileUploadError] = useState(null);
|
|
11287
|
+
const [showDocModal, setShowDocModal] = useState(false);
|
|
11288
|
+
const [docFileUrl, setDocFileUrl] = useState("");
|
|
11289
|
+
const [docFileType, setDocFileType] = useState("");
|
|
11290
|
+
const handleSelectFile = e => {
|
|
11291
|
+
var _e$target$files;
|
|
11292
|
+
const selectedFile = (_e$target$files = e.target.files) === null || _e$target$files === void 0 ? void 0 : _e$target$files[0];
|
|
11293
|
+
if (selectedFile) {
|
|
11294
|
+
if (selectedFile.size >= 5242880) {
|
|
11295
|
+
setFileUploadError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED") || "Maximum file size exceeded (5MB)");
|
|
11296
|
+
} else {
|
|
11297
|
+
setFile(selectedFile);
|
|
11298
|
+
setFileUploadError(null);
|
|
11299
|
+
}
|
|
11300
|
+
}
|
|
11301
|
+
};
|
|
11302
|
+
useEffect(() => {
|
|
11303
|
+
(async () => {
|
|
11304
|
+
if (file) {
|
|
11305
|
+
try {
|
|
11306
|
+
var _response$data, _response$data$files;
|
|
11307
|
+
const response = await Digit.UploadServices.Filestorage("WS", file, Digit.ULBService.getStateId());
|
|
11308
|
+
if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
|
|
11309
|
+
var _response$data2, _response$data2$files;
|
|
11310
|
+
const fsId = response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId;
|
|
11311
|
+
setUploadedFile(fsId);
|
|
11312
|
+
setValue("orgDeptDocument", fsId);
|
|
11313
|
+
} else {
|
|
11314
|
+
setFileUploadError(t("CS_FILE_UPLOAD_ERROR") || "File Upload Error");
|
|
11315
|
+
}
|
|
11316
|
+
} catch (err) {
|
|
11317
|
+
setFileUploadError(t("CS_FILE_UPLOAD_ERROR") || "File Upload Error");
|
|
11318
|
+
}
|
|
11319
|
+
}
|
|
11320
|
+
})();
|
|
11321
|
+
}, [file]);
|
|
11322
|
+
const viewDocument = async () => {
|
|
11323
|
+
if (uploadedFile) {
|
|
11324
|
+
try {
|
|
11325
|
+
const res = await Digit.UploadServices.FileFetchbyid(uploadedFile, Digit.ULBService.getStateId());
|
|
11326
|
+
if (res !== null && res !== void 0 && res.data) {
|
|
11327
|
+
const blob = res.data instanceof Blob ? res.data : new Blob([res.data], {
|
|
11328
|
+
type: res.headers["content-type"] || res.headers["Content-Type"] || "image/jpeg"
|
|
11329
|
+
});
|
|
11330
|
+
const fileURL = URL.createObjectURL(blob);
|
|
11331
|
+
setDocFileUrl(fileURL);
|
|
11332
|
+
const contentType = res.headers["content-type"] || res.headers["Content-Type"] || "";
|
|
11333
|
+
if (contentType.toLowerCase().includes("pdf")) {
|
|
11334
|
+
setDocFileType("pdf");
|
|
11335
|
+
} else {
|
|
11336
|
+
setDocFileType("image");
|
|
11337
|
+
}
|
|
11338
|
+
setShowDocModal(true);
|
|
11339
|
+
}
|
|
11340
|
+
} catch (err) {
|
|
11341
|
+
console.error("Failed to fetch file URL via FileFetchbyid", err);
|
|
11342
|
+
}
|
|
11343
|
+
}
|
|
11344
|
+
};
|
|
11096
11345
|
useEffect(() => {
|
|
11097
11346
|
trigger();
|
|
11098
11347
|
}, []);
|
|
@@ -11111,6 +11360,7 @@ const ConnectionDetails = _props => {
|
|
|
11111
11360
|
});
|
|
11112
11361
|
if (isErrorsFound) setIsErrors(true);
|
|
11113
11362
|
let ob = [{
|
|
11363
|
+
...connectionDetail,
|
|
11114
11364
|
...formValue
|
|
11115
11365
|
}];
|
|
11116
11366
|
setConnectionDetails(ob);
|
|
@@ -11155,154 +11405,149 @@ const ConnectionDetails = _props => {
|
|
|
11155
11405
|
clearErrors(config.key);
|
|
11156
11406
|
}
|
|
11157
11407
|
}, [errors]);
|
|
11158
|
-
const errorStyle = {
|
|
11159
|
-
width: "70%",
|
|
11160
|
-
marginLeft: "30%",
|
|
11161
|
-
fontSize: "12px",
|
|
11162
|
-
marginTop: "-21px"
|
|
11163
|
-
};
|
|
11164
11408
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
11165
11409
|
const isEmployee = window.location.href.includes("/employee");
|
|
11166
|
-
return /*#__PURE__*/React.createElement(
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11410
|
+
return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
|
|
11411
|
+
title: t("WS_CONNECTION_DETAILS"),
|
|
11412
|
+
defaultOpen: true
|
|
11413
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11170
11414
|
className: "formcomposer-section-grid"
|
|
11171
|
-
}, /*#__PURE__*/React.createElement(
|
|
11172
|
-
style: {
|
|
11173
|
-
fontWeight: "700"
|
|
11174
|
-
}
|
|
11175
|
-
}, `${t("WS_APPLY_FOR")}*`), /*#__PURE__*/React.createElement("div", {
|
|
11176
|
-
style: {
|
|
11177
|
-
display: "flex",
|
|
11178
|
-
gap: "0 3rem"
|
|
11179
|
-
}
|
|
11180
|
-
}, /*#__PURE__*/React.createElement(Controller, {
|
|
11415
|
+
}, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_SERVICE_TYPE")}*`), /*#__PURE__*/React.createElement(Controller, {
|
|
11181
11416
|
control: control,
|
|
11182
|
-
name: "
|
|
11183
|
-
defaultValue: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.
|
|
11417
|
+
name: "serviceType",
|
|
11418
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.serviceType) || "",
|
|
11419
|
+
rules: {
|
|
11420
|
+
required: t("REQUIRED_FIELD")
|
|
11421
|
+
},
|
|
11184
11422
|
isMandatory: true,
|
|
11185
11423
|
render: props => {
|
|
11186
|
-
var _errors$
|
|
11187
|
-
return /*#__PURE__*/React.createElement(
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
setFocusIndex({
|
|
11196
|
-
index: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.key,
|
|
11197
|
-
type: "water"
|
|
11198
|
-
});
|
|
11199
|
-
}
|
|
11200
|
-
},
|
|
11201
|
-
checked: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.water,
|
|
11202
|
-
style: {
|
|
11203
|
-
paddingBottom: "10px",
|
|
11204
|
-
paddingTop: "3px"
|
|
11424
|
+
var _errors$serviceType;
|
|
11425
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
11426
|
+
className: "form-field",
|
|
11427
|
+
selected: getValues("serviceType"),
|
|
11428
|
+
disable: false,
|
|
11429
|
+
option: applicationTypeList,
|
|
11430
|
+
errorStyle: localFormState.touched.serviceType && errors !== null && errors !== void 0 && (_errors$serviceType = errors.serviceType) !== null && _errors$serviceType !== void 0 && _errors$serviceType.message ? true : false,
|
|
11431
|
+
select: e => {
|
|
11432
|
+
props.onChange(e);
|
|
11205
11433
|
},
|
|
11206
|
-
|
|
11434
|
+
optionKey: "i18nKey",
|
|
11435
|
+
onBlur: props.onBlur,
|
|
11436
|
+
t: t
|
|
11207
11437
|
});
|
|
11208
11438
|
}
|
|
11209
|
-
}), /*#__PURE__*/React.createElement(Controller, {
|
|
11439
|
+
})), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_CATEGORY_TYPE")}*`), /*#__PURE__*/React.createElement(Controller, {
|
|
11210
11440
|
control: control,
|
|
11211
|
-
name: "
|
|
11212
|
-
defaultValue: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.
|
|
11213
|
-
|
|
11441
|
+
name: "categoryType",
|
|
11442
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.categoryType) || "",
|
|
11443
|
+
rules: {
|
|
11444
|
+
required: t("REQUIRED_FIELD")
|
|
11445
|
+
},
|
|
11214
11446
|
isMandatory: true,
|
|
11215
11447
|
render: props => {
|
|
11216
|
-
var _errors$
|
|
11217
|
-
return /*#__PURE__*/React.createElement(
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
setFocusIndex({
|
|
11226
|
-
index: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.key,
|
|
11227
|
-
type: "sewerage"
|
|
11228
|
-
});
|
|
11229
|
-
}
|
|
11230
|
-
},
|
|
11231
|
-
checked: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.sewerage,
|
|
11232
|
-
style: {
|
|
11233
|
-
paddingBottom: "10px",
|
|
11234
|
-
paddingTop: "3px"
|
|
11448
|
+
var _errors$categoryType;
|
|
11449
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
11450
|
+
className: "form-field",
|
|
11451
|
+
selected: getValues("categoryType"),
|
|
11452
|
+
disable: false,
|
|
11453
|
+
option: categoryTypeList,
|
|
11454
|
+
errorStyle: localFormState.touched.categoryType && errors !== null && errors !== void 0 && (_errors$categoryType = errors.categoryType) !== null && _errors$categoryType !== void 0 && _errors$categoryType.message ? true : false,
|
|
11455
|
+
select: e => {
|
|
11456
|
+
props.onChange(e);
|
|
11235
11457
|
},
|
|
11236
|
-
|
|
11458
|
+
optionKey: "i18nKey",
|
|
11459
|
+
onBlur: props.onBlur,
|
|
11460
|
+
t: t
|
|
11237
11461
|
});
|
|
11238
11462
|
}
|
|
11239
|
-
}))
|
|
11240
|
-
style: isMobile && isEmployee ? {
|
|
11241
|
-
fontWeight: "700",
|
|
11242
|
-
width: "100%"
|
|
11243
|
-
} : {
|
|
11244
|
-
fontWeight: "700"
|
|
11245
|
-
},
|
|
11246
|
-
className: "card-label-smaller"
|
|
11247
|
-
}, `${t("WS_NO_OF_PROPOSED_TAPS_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
|
|
11248
|
-
className: "field"
|
|
11249
|
-
}, /*#__PURE__*/React.createElement(Controller, {
|
|
11463
|
+
})), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_CONNECTION_TYPE")}*`), /*#__PURE__*/React.createElement(Controller, {
|
|
11250
11464
|
control: control,
|
|
11251
|
-
name: "
|
|
11252
|
-
defaultValue: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.
|
|
11465
|
+
name: "connectionType",
|
|
11466
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.connectionType) || "",
|
|
11253
11467
|
rules: {
|
|
11254
|
-
validate: e => parseInt(e) > 0 && e && getPattern("WSOnlyNumbers").test(e) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG"),
|
|
11255
11468
|
required: t("REQUIRED_FIELD")
|
|
11256
11469
|
},
|
|
11257
|
-
type: "number",
|
|
11258
11470
|
isMandatory: true,
|
|
11259
11471
|
render: props => {
|
|
11260
|
-
var _errors$
|
|
11261
|
-
return /*#__PURE__*/React.createElement(
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
index: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.key,
|
|
11270
|
-
type: "proposedTaps"
|
|
11271
|
-
});
|
|
11472
|
+
var _errors$connectionTyp;
|
|
11473
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
11474
|
+
className: "form-field",
|
|
11475
|
+
selected: getValues("connectionType"),
|
|
11476
|
+
disable: false,
|
|
11477
|
+
option: connectionTypeList,
|
|
11478
|
+
errorStyle: localFormState.touched.connectionType && errors !== null && errors !== void 0 && (_errors$connectionTyp = errors.connectionType) !== null && _errors$connectionTyp !== void 0 && _errors$connectionTyp.message ? true : false,
|
|
11479
|
+
select: e => {
|
|
11480
|
+
props.onChange(e);
|
|
11272
11481
|
},
|
|
11273
|
-
|
|
11274
|
-
|
|
11482
|
+
optionKey: "i18nKey",
|
|
11483
|
+
onBlur: props.onBlur,
|
|
11484
|
+
t: t
|
|
11485
|
+
});
|
|
11486
|
+
}
|
|
11487
|
+
})), (formValue === null || formValue === void 0 ? void 0 : (_formValue$connection = formValue.connectionType) === null || _formValue$connection === void 0 ? void 0 : _formValue$connection.code) === "Temporary" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_TEMPORARY_TYPE")}*`), /*#__PURE__*/React.createElement(Controller, {
|
|
11488
|
+
control: control,
|
|
11489
|
+
name: "temporaryType",
|
|
11490
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.temporaryType) || "",
|
|
11491
|
+
rules: {
|
|
11492
|
+
required: t("REQUIRED_FIELD")
|
|
11493
|
+
},
|
|
11494
|
+
isMandatory: true,
|
|
11495
|
+
render: props => {
|
|
11496
|
+
var _errors$temporaryType;
|
|
11497
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
11498
|
+
className: "form-field",
|
|
11499
|
+
selected: getValues("temporaryType"),
|
|
11500
|
+
disable: false,
|
|
11501
|
+
option: temporaryTypeList,
|
|
11502
|
+
errorStyle: localFormState.touched.temporaryType && errors !== null && errors !== void 0 && (_errors$temporaryType = errors.temporaryType) !== null && _errors$temporaryType !== void 0 && _errors$temporaryType.message ? true : false,
|
|
11503
|
+
select: e => {
|
|
11504
|
+
props.onChange(e);
|
|
11275
11505
|
},
|
|
11276
|
-
|
|
11506
|
+
optionKey: "i18nKey",
|
|
11507
|
+
onBlur: props.onBlur,
|
|
11508
|
+
t: t
|
|
11277
11509
|
});
|
|
11278
11510
|
}
|
|
11279
|
-
}))
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
paddingTop: "10px"
|
|
11286
|
-
} : {
|
|
11287
|
-
fontWeight: "700"
|
|
11511
|
+
})), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_WATER_DEMAND_TYPE")}*`), /*#__PURE__*/React.createElement(Controller, {
|
|
11512
|
+
control: control,
|
|
11513
|
+
name: "waterDemandType",
|
|
11514
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.waterDemandType) || "",
|
|
11515
|
+
rules: {
|
|
11516
|
+
required: t("REQUIRED_FIELD")
|
|
11288
11517
|
},
|
|
11289
|
-
|
|
11290
|
-
|
|
11518
|
+
isMandatory: true,
|
|
11519
|
+
render: props => {
|
|
11520
|
+
var _errors$waterDemandTy;
|
|
11521
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
11522
|
+
className: "form-field",
|
|
11523
|
+
selected: getValues("waterDemandType"),
|
|
11524
|
+
disable: false,
|
|
11525
|
+
option: waterDemandTypeList,
|
|
11526
|
+
errorStyle: localFormState.touched.waterDemandType && errors !== null && errors !== void 0 && (_errors$waterDemandTy = errors.waterDemandType) !== null && _errors$waterDemandTy !== void 0 && _errors$waterDemandTy.message ? true : false,
|
|
11527
|
+
select: e => {
|
|
11528
|
+
props.onChange(e);
|
|
11529
|
+
},
|
|
11530
|
+
optionKey: "i18nKey",
|
|
11531
|
+
onBlur: props.onBlur,
|
|
11532
|
+
t: t
|
|
11533
|
+
});
|
|
11534
|
+
}
|
|
11535
|
+
})), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_APPLICANT_TYPE")}*`), /*#__PURE__*/React.createElement(Controller, {
|
|
11291
11536
|
control: control,
|
|
11292
|
-
name: "
|
|
11293
|
-
defaultValue: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.
|
|
11537
|
+
name: "applicantType",
|
|
11538
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.applicantType) || "",
|
|
11294
11539
|
rules: {
|
|
11295
11540
|
required: t("REQUIRED_FIELD")
|
|
11296
11541
|
},
|
|
11297
11542
|
isMandatory: true,
|
|
11298
11543
|
render: props => {
|
|
11299
|
-
var _errors$
|
|
11544
|
+
var _errors$applicantType;
|
|
11300
11545
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
11301
11546
|
className: "form-field",
|
|
11302
|
-
selected: getValues("
|
|
11547
|
+
selected: getValues("applicantType"),
|
|
11303
11548
|
disable: false,
|
|
11304
|
-
option:
|
|
11305
|
-
errorStyle: localFormState.touched.
|
|
11549
|
+
option: applicantTypeList,
|
|
11550
|
+
errorStyle: localFormState.touched.applicantType && errors !== null && errors !== void 0 && (_errors$applicantType = errors.applicantType) !== null && _errors$applicantType !== void 0 && _errors$applicantType.message ? true : false,
|
|
11306
11551
|
select: e => {
|
|
11307
11552
|
props.onChange(e);
|
|
11308
11553
|
},
|
|
@@ -11311,93 +11556,230 @@ const ConnectionDetails = _props => {
|
|
|
11311
11556
|
t: t
|
|
11312
11557
|
});
|
|
11313
11558
|
}
|
|
11314
|
-
})),
|
|
11315
|
-
|
|
11316
|
-
},
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11559
|
+
})), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${(formValue === null || formValue === void 0 ? void 0 : (_formValue$categoryTy = formValue.categoryType) === null || _formValue$categoryTy === void 0 ? void 0 : _formValue$categoryTy.code) === "NON_DOMESTIC" || (formValue === null || formValue === void 0 ? void 0 : (_formValue$categoryTy2 = formValue.categoryType) === null || _formValue$categoryTy2 === void 0 ? void 0 : _formValue$categoryTy2.name) === "Non-Domestic" ? t("WS_NON_DOMESTIC_TYPE") : t("WS_DOMESTIC_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
|
|
11560
|
+
className: "field"
|
|
11561
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
11562
|
+
control: control,
|
|
11563
|
+
name: "domesticType",
|
|
11564
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.domesticType) || "",
|
|
11565
|
+
rules: {
|
|
11566
|
+
required: t("REQUIRED_FIELD")
|
|
11322
11567
|
},
|
|
11323
|
-
|
|
11324
|
-
|
|
11568
|
+
isMandatory: true,
|
|
11569
|
+
render: props => /*#__PURE__*/React.createElement(RadioButtons, {
|
|
11570
|
+
className: "form-field",
|
|
11571
|
+
style: {
|
|
11572
|
+
display: "flex",
|
|
11573
|
+
gap: "2rem",
|
|
11574
|
+
alignItems: "center"
|
|
11575
|
+
},
|
|
11576
|
+
options: [{
|
|
11577
|
+
i18nKey: "WS_DOMESTIC_TYPE_DOMESTIC",
|
|
11578
|
+
code: "INDIVIDUAL"
|
|
11579
|
+
}, {
|
|
11580
|
+
i18nKey: "WS_DOMESTIC_TYPE_NON_DOMESTIC",
|
|
11581
|
+
code: "ORGANIZATION"
|
|
11582
|
+
}],
|
|
11583
|
+
optionsKey: "i18nKey",
|
|
11584
|
+
selectedOption: getValues("domesticType"),
|
|
11585
|
+
onSelect: e => {
|
|
11586
|
+
props.onChange(e);
|
|
11587
|
+
},
|
|
11588
|
+
t: t,
|
|
11589
|
+
isDependent: true
|
|
11590
|
+
})
|
|
11591
|
+
}))), (formValue === null || formValue === void 0 ? void 0 : (_formValue$domesticTy = formValue.domesticType) === null || _formValue$domesticTy === void 0 ? void 0 : _formValue$domesticTy.code) === "ORGANIZATION" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_DEPARTMENT_TYPE")}*`), /*#__PURE__*/React.createElement("div", {
|
|
11325
11592
|
className: "field"
|
|
11326
11593
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
11327
11594
|
control: control,
|
|
11328
|
-
name: "
|
|
11329
|
-
defaultValue: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.
|
|
11595
|
+
name: "departmentType",
|
|
11596
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.departmentType) || {
|
|
11597
|
+
i18nKey: "WS_DEPARTMENT_TYPE_GOVERNMENT",
|
|
11598
|
+
code: "GOVERNMENT"
|
|
11599
|
+
},
|
|
11600
|
+
rules: {
|
|
11601
|
+
required: t("REQUIRED_FIELD")
|
|
11602
|
+
},
|
|
11603
|
+
isMandatory: true,
|
|
11604
|
+
render: props => /*#__PURE__*/React.createElement(RadioButtons, {
|
|
11605
|
+
className: "form-field",
|
|
11606
|
+
style: {
|
|
11607
|
+
display: "flex",
|
|
11608
|
+
gap: "2rem",
|
|
11609
|
+
alignItems: "center"
|
|
11610
|
+
},
|
|
11611
|
+
options: [{
|
|
11612
|
+
i18nKey: "WS_DEPARTMENT_TYPE_GOVERNMENT",
|
|
11613
|
+
code: "GOVERNMENT"
|
|
11614
|
+
}, {
|
|
11615
|
+
i18nKey: "WS_DEPARTMENT_TYPE_NON_GOVERNMENT",
|
|
11616
|
+
code: "NON_GOVERNMENT"
|
|
11617
|
+
}],
|
|
11618
|
+
optionsKey: "i18nKey",
|
|
11619
|
+
selectedOption: getValues("departmentType"),
|
|
11620
|
+
onSelect: e => {
|
|
11621
|
+
props.onChange(e);
|
|
11622
|
+
},
|
|
11623
|
+
t: t,
|
|
11624
|
+
isDependent: true
|
|
11625
|
+
})
|
|
11626
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
11627
|
+
style: {
|
|
11628
|
+
color: "#3257F2",
|
|
11629
|
+
fontWeight: "700",
|
|
11630
|
+
fontSize: "1.5rem",
|
|
11631
|
+
gridColumn: "span 2"
|
|
11632
|
+
}
|
|
11633
|
+
}, t("WS_DEPARTMENT_ORGANIZATION_DETAILS")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_ORGANIZATION_DEPARTMENT_NAME")}*`), /*#__PURE__*/React.createElement("div", {
|
|
11634
|
+
className: "field"
|
|
11635
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
11636
|
+
control: control,
|
|
11637
|
+
name: "institutionName",
|
|
11638
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.institutionName) || "",
|
|
11330
11639
|
rules: {
|
|
11331
|
-
validate: e => parseInt(e) > 0 && e && getPattern("WSOnlyNumbers").test(e) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG"),
|
|
11332
11640
|
required: t("REQUIRED_FIELD")
|
|
11333
11641
|
},
|
|
11334
|
-
type: "number",
|
|
11335
11642
|
isMandatory: true,
|
|
11336
11643
|
render: props => {
|
|
11337
|
-
var _errors$
|
|
11644
|
+
var _errors$institutionNa;
|
|
11338
11645
|
return /*#__PURE__*/React.createElement(TextInput, {
|
|
11339
|
-
type: "number",
|
|
11340
11646
|
value: props.value,
|
|
11341
|
-
|
|
11342
|
-
|
|
11647
|
+
placeholder: t("WS_ORGANIZATION_DEPARTMENT_NAME_PLACEHOLDER"),
|
|
11648
|
+
autoFocus: focusIndex.index === (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.key) && focusIndex.type === "institutionName",
|
|
11649
|
+
errorStyle: localFormState.touched.institutionName && errors !== null && errors !== void 0 && (_errors$institutionNa = errors.institutionName) !== null && _errors$institutionNa !== void 0 && _errors$institutionNa.message ? true : false,
|
|
11343
11650
|
onChange: e => {
|
|
11344
11651
|
props.onChange(e.target.value);
|
|
11345
11652
|
setFocusIndex({
|
|
11346
11653
|
index: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.key,
|
|
11347
|
-
type: "
|
|
11654
|
+
type: "institutionName"
|
|
11348
11655
|
});
|
|
11349
11656
|
},
|
|
11350
|
-
labelStyle: {
|
|
11351
|
-
marginTop: "unset"
|
|
11352
|
-
},
|
|
11353
11657
|
onBlur: props.onBlur
|
|
11354
11658
|
});
|
|
11355
11659
|
}
|
|
11356
|
-
}))), /*#__PURE__*/React.createElement(
|
|
11357
|
-
style: errorStyle
|
|
11358
|
-
}, localFormState.touched.proposedWaterClosets ? errors === null || errors === void 0 ? void 0 : (_errors$proposedWater2 = errors.proposedWaterClosets) === null || _errors$proposedWater2 === void 0 ? void 0 : _errors$proposedWater2.message : ""), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
11359
|
-
style: isMobile && isEmployee ? {
|
|
11360
|
-
fontWeight: "700",
|
|
11361
|
-
width: "100%"
|
|
11362
|
-
} : {
|
|
11363
|
-
fontWeight: "700"
|
|
11364
|
-
},
|
|
11365
|
-
className: "card-label-smaller"
|
|
11366
|
-
}, `${t("WS_PROPOSED_WATER_TOILETS_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
|
|
11660
|
+
}))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NATURE_OF_WORK")}*`), /*#__PURE__*/React.createElement("div", {
|
|
11367
11661
|
className: "field"
|
|
11368
11662
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
11369
11663
|
control: control,
|
|
11370
|
-
name: "
|
|
11371
|
-
defaultValue: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.
|
|
11664
|
+
name: "natureOfWork",
|
|
11665
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.natureOfWork) || "",
|
|
11372
11666
|
rules: {
|
|
11373
|
-
validate: e => parseInt(e) > 0 && e && getPattern("WSOnlyNumbers").test(e) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG"),
|
|
11374
11667
|
required: t("REQUIRED_FIELD")
|
|
11375
11668
|
},
|
|
11376
|
-
type: "number",
|
|
11377
11669
|
isMandatory: true,
|
|
11378
11670
|
render: props => {
|
|
11379
|
-
var _errors$
|
|
11671
|
+
var _errors$natureOfWork;
|
|
11380
11672
|
return /*#__PURE__*/React.createElement(TextInput, {
|
|
11381
|
-
type: "number",
|
|
11382
11673
|
value: props.value,
|
|
11383
|
-
|
|
11384
|
-
|
|
11674
|
+
placeholder: t("WS_NATURE_OF_WORK_PLACEHOLDER"),
|
|
11675
|
+
autoFocus: focusIndex.index === (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.key) && focusIndex.type === "natureOfWork",
|
|
11676
|
+
errorStyle: localFormState.touched.natureOfWork && errors !== null && errors !== void 0 && (_errors$natureOfWork = errors.natureOfWork) !== null && _errors$natureOfWork !== void 0 && _errors$natureOfWork.message ? true : false,
|
|
11385
11677
|
onChange: e => {
|
|
11386
11678
|
props.onChange(e.target.value);
|
|
11387
11679
|
setFocusIndex({
|
|
11388
11680
|
index: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.key,
|
|
11389
|
-
type: "
|
|
11681
|
+
type: "natureOfWork"
|
|
11390
11682
|
});
|
|
11391
11683
|
},
|
|
11392
|
-
labelStyle: {
|
|
11393
|
-
marginTop: "unset"
|
|
11394
|
-
},
|
|
11395
11684
|
onBlur: props.onBlur
|
|
11396
11685
|
});
|
|
11397
11686
|
}
|
|
11398
|
-
}))), /*#__PURE__*/React.createElement(
|
|
11399
|
-
|
|
11400
|
-
|
|
11687
|
+
}))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_ORG_DEPT_DOCUMENT")}*`), /*#__PURE__*/React.createElement("div", {
|
|
11688
|
+
className: "field",
|
|
11689
|
+
style: {
|
|
11690
|
+
display: "flex",
|
|
11691
|
+
gap: "10px",
|
|
11692
|
+
alignItems: "center"
|
|
11693
|
+
}
|
|
11694
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11695
|
+
style: {
|
|
11696
|
+
flex: 1
|
|
11697
|
+
}
|
|
11698
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
11699
|
+
control: control,
|
|
11700
|
+
name: "orgDeptDocument",
|
|
11701
|
+
defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.orgDeptDocument) || "",
|
|
11702
|
+
rules: {
|
|
11703
|
+
required: t("REQUIRED_FIELD")
|
|
11704
|
+
},
|
|
11705
|
+
isMandatory: true,
|
|
11706
|
+
render: props => /*#__PURE__*/React.createElement(UploadFile, {
|
|
11707
|
+
id: "orgDeptDocument",
|
|
11708
|
+
onUpload: handleSelectFile,
|
|
11709
|
+
onDelete: () => {
|
|
11710
|
+
setUploadedFile(null);
|
|
11711
|
+
setFile(null);
|
|
11712
|
+
props.onChange(null);
|
|
11713
|
+
},
|
|
11714
|
+
message: uploadedFile ? `1 ${t("WS_ACTION_FILEUPLOADED")}` : t("WS_ACTION_NO_FILEUPLOADED"),
|
|
11715
|
+
accept: "image/*, .pdf"
|
|
11716
|
+
})
|
|
11717
|
+
})), uploadedFile && /*#__PURE__*/React.createElement("div", {
|
|
11718
|
+
onClick: viewDocument,
|
|
11719
|
+
style: {
|
|
11720
|
+
cursor: "pointer"
|
|
11721
|
+
}
|
|
11722
|
+
}, /*#__PURE__*/React.createElement(ViewsIcon, null)))), fileUploadError && /*#__PURE__*/React.createElement("div", {
|
|
11723
|
+
style: {
|
|
11724
|
+
color: "red",
|
|
11725
|
+
fontSize: "12px",
|
|
11726
|
+
marginTop: "4px"
|
|
11727
|
+
}
|
|
11728
|
+
}, fileUploadError))), showDocModal && /*#__PURE__*/React.createElement(Modal, {
|
|
11729
|
+
open: showDocModal,
|
|
11730
|
+
headerBarMain: t("WS_VIEW_DOCUMENT") || "View Document",
|
|
11731
|
+
headerBarEnd: /*#__PURE__*/React.createElement("div", {
|
|
11732
|
+
className: "icon-bg-secondary",
|
|
11733
|
+
onClick: () => setShowDocModal(false),
|
|
11734
|
+
style: {
|
|
11735
|
+
cursor: "pointer",
|
|
11736
|
+
padding: "5px"
|
|
11737
|
+
}
|
|
11738
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
11739
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11740
|
+
viewBox: "0 0 24 24",
|
|
11741
|
+
fill: "#FFFFFF",
|
|
11742
|
+
width: "24",
|
|
11743
|
+
height: "24"
|
|
11744
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
11745
|
+
d: "M0 0h24v24H0V0z",
|
|
11746
|
+
fill: "none"
|
|
11747
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
11748
|
+
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"
|
|
11749
|
+
}))),
|
|
11750
|
+
center: true,
|
|
11751
|
+
actionCancelOnSubmit: () => setShowDocModal(false),
|
|
11752
|
+
actionCancelLabel: t("CS_COMMON_CLOSE") || "Close",
|
|
11753
|
+
popupStyles: {
|
|
11754
|
+
width: "80%",
|
|
11755
|
+
maxWidth: "800px"
|
|
11756
|
+
}
|
|
11757
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11758
|
+
style: {
|
|
11759
|
+
display: "flex",
|
|
11760
|
+
justifyContent: "center",
|
|
11761
|
+
alignItems: "center",
|
|
11762
|
+
padding: "20px",
|
|
11763
|
+
minHeight: "300px"
|
|
11764
|
+
}
|
|
11765
|
+
}, docFileType === "pdf" ? /*#__PURE__*/React.createElement("iframe", {
|
|
11766
|
+
src: docFileUrl,
|
|
11767
|
+
title: "Document Preview",
|
|
11768
|
+
width: "100%",
|
|
11769
|
+
height: "500px",
|
|
11770
|
+
style: {
|
|
11771
|
+
border: "none"
|
|
11772
|
+
}
|
|
11773
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
11774
|
+
src: docFileUrl,
|
|
11775
|
+
alt: "Document Preview",
|
|
11776
|
+
style: {
|
|
11777
|
+
maxWidth: "100%",
|
|
11778
|
+
maxHeight: "500px",
|
|
11779
|
+
objectFit: "contain",
|
|
11780
|
+
borderRadius: "4px"
|
|
11781
|
+
}
|
|
11782
|
+
}))));
|
|
11401
11783
|
};
|
|
11402
11784
|
|
|
11403
11785
|
const WSDocumentsRequired = () => {
|
|
@@ -11749,7 +12131,6 @@ const WSPropertyDetails = ({
|
|
|
11749
12131
|
clearErrors
|
|
11750
12132
|
}) => {
|
|
11751
12133
|
var _Digit$SessionStorage, _formData$cptId, _formData$cptId2, _propertyDetails$Prop2, _propertyDetails$Prop3, _propertyDetails$Prop4;
|
|
11752
|
-
const redirectBackUrl = `/digit-ui/${userType}/ws/new-application`;
|
|
11753
12134
|
const [propertyId, setPropertyId] = React.useState("");
|
|
11754
12135
|
const tenantId = (_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code;
|
|
11755
12136
|
const {
|
|
@@ -11811,7 +12192,7 @@ const WSPropertyDetails = ({
|
|
|
11811
12192
|
type: "button",
|
|
11812
12193
|
onClick: () => setPropertyId(propertyId)
|
|
11813
12194
|
}, `${t("PT_SEARCH")}`))), /*#__PURE__*/React.createElement(Link, {
|
|
11814
|
-
to: `/digit-ui/${userType}/commonpt/search
|
|
12195
|
+
to: `/digit-ui/${userType}/commonpt/search`
|
|
11815
12196
|
}, /*#__PURE__*/React.createElement(LinkButton, {
|
|
11816
12197
|
label: t("CPT_SEARCH_PROPERTY"),
|
|
11817
12198
|
style: {
|
|
@@ -11819,20 +12200,14 @@ const WSPropertyDetails = ({
|
|
|
11819
12200
|
display: "inline-block"
|
|
11820
12201
|
}
|
|
11821
12202
|
})), "\xA0 | \xA0", /*#__PURE__*/React.createElement(Link, {
|
|
11822
|
-
to: `/digit-ui/${userType}/commonpt/new-application
|
|
12203
|
+
to: `/digit-ui/${userType}/commonpt/new-application`
|
|
11823
12204
|
}, /*#__PURE__*/React.createElement(LinkButton, {
|
|
11824
12205
|
label: t("CPT_CREATE_PROPERTY"),
|
|
11825
12206
|
style: {
|
|
11826
12207
|
color: "#a82227",
|
|
11827
12208
|
display: "inline-block"
|
|
11828
12209
|
}
|
|
11829
|
-
})), propertyDetails && (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties.length) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
11830
|
-
className: "card-section-header",
|
|
11831
|
-
style: {
|
|
11832
|
-
marginBottom: 0,
|
|
11833
|
-
marginTop: "20px"
|
|
11834
|
-
}
|
|
11835
|
-
}, t("PT_DETAILS")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12210
|
+
})), propertyDetails && (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties.length) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
11836
12211
|
className: "card-label-smaller"
|
|
11837
12212
|
}, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
|
|
11838
12213
|
className: "field"
|
|
@@ -11857,6 +12232,8 @@ const WSPropertyDetails = ({
|
|
|
11857
12232
|
const createConnectionHolderDetails = () => ({
|
|
11858
12233
|
sameAsOwnerDetails: true,
|
|
11859
12234
|
name: "",
|
|
12235
|
+
middleName: "",
|
|
12236
|
+
lastName: "",
|
|
11860
12237
|
gender: "",
|
|
11861
12238
|
mobileNumber: "",
|
|
11862
12239
|
guardian: "",
|
|
@@ -11866,7 +12243,9 @@ const createConnectionHolderDetails = () => ({
|
|
|
11866
12243
|
documentId: "",
|
|
11867
12244
|
documentType: "",
|
|
11868
12245
|
file: "",
|
|
11869
|
-
emailId: ""
|
|
12246
|
+
emailId: "",
|
|
12247
|
+
watsAppMobileNumber: "",
|
|
12248
|
+
isWatsappSameAsMobile: false
|
|
11870
12249
|
});
|
|
11871
12250
|
const WSConnectionHolderDetails = ({
|
|
11872
12251
|
config,
|
|
@@ -12007,7 +12386,7 @@ const WSConnectionHolderDetails = ({
|
|
|
12007
12386
|
}, commonProps))));
|
|
12008
12387
|
};
|
|
12009
12388
|
const ConnectionDetails$1 = _props => {
|
|
12010
|
-
var _errors$name2, _errors$name3, _errors$
|
|
12389
|
+
var _errors$name2, _errors$name3, _errors$middleName2, _errors$middleName3, _errors$lastName2, _errors$lastName3, _errors$gender2, _errors$gender3, _errors$guardian2, _errors$guardian3, _errors$relationship2, _errors$relationship3, _errors$mobileNumber2, _errors$mobileNumber3, _errors$watsAppMobile2, _errors$watsAppMobile3, _errors$emailId2, _errors$emailId3;
|
|
12011
12390
|
const {
|
|
12012
12391
|
connectionHolderDetail,
|
|
12013
12392
|
focusIndex,
|
|
@@ -12037,6 +12416,8 @@ const ConnectionDetails$1 = _props => {
|
|
|
12037
12416
|
getValues
|
|
12038
12417
|
} = useForm();
|
|
12039
12418
|
const [name, setName] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.name);
|
|
12419
|
+
const [middleName, setMiddleName] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.middleName);
|
|
12420
|
+
const [lastName, setLastName] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.lastName);
|
|
12040
12421
|
const [gender, setGender] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.gender);
|
|
12041
12422
|
const [mobileNumber, setMobileNumber] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.mobileNumber);
|
|
12042
12423
|
const [guardian, setGuardian] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.guardian);
|
|
@@ -12046,8 +12427,12 @@ const ConnectionDetails$1 = _props => {
|
|
|
12046
12427
|
const [sameAsOwnerDetails, setSameAsOwnerDetails] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.sameAsOwnerDetails);
|
|
12047
12428
|
const [uuid, setuuid] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.uuid);
|
|
12048
12429
|
const [emailId, setEmailId] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.emailId);
|
|
12430
|
+
const [watsAppMobileNumber, setWatsAppMobileNumber] = useState(connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.watsAppMobileNumber);
|
|
12431
|
+
const [isWatsappSameAsMobile, setIsWatsappSameAsMobile] = useState((connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.isWatsappSameAsMobile) || false);
|
|
12049
12432
|
const formValue = {
|
|
12050
12433
|
name,
|
|
12434
|
+
middleName,
|
|
12435
|
+
lastName,
|
|
12051
12436
|
gender,
|
|
12052
12437
|
mobileNumber,
|
|
12053
12438
|
guardian,
|
|
@@ -12056,7 +12441,9 @@ const ConnectionDetails$1 = _props => {
|
|
|
12056
12441
|
sameAsOwnerDetails,
|
|
12057
12442
|
address,
|
|
12058
12443
|
uuid,
|
|
12059
|
-
emailId
|
|
12444
|
+
emailId,
|
|
12445
|
+
watsAppMobileNumber,
|
|
12446
|
+
isWatsappSameAsMobile
|
|
12060
12447
|
};
|
|
12061
12448
|
const {
|
|
12062
12449
|
errors
|
|
@@ -12175,37 +12562,12 @@ const ConnectionDetails$1 = _props => {
|
|
|
12175
12562
|
fontSize: "12px",
|
|
12176
12563
|
marginTop: "-21px"
|
|
12177
12564
|
};
|
|
12178
|
-
return /*#__PURE__*/React.createElement(
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
name: "sameAsOwnerDetails",
|
|
12183
|
-
defaultValue: sameAsOwnerDetails,
|
|
12184
|
-
isMandatory: true,
|
|
12185
|
-
render: props => {
|
|
12186
|
-
var _errors$sameAsOwnerDe;
|
|
12187
|
-
return /*#__PURE__*/React.createElement(CheckBox, {
|
|
12188
|
-
label: t("WS_SAME_AS_PROPERTY_OWNERS"),
|
|
12189
|
-
name: "sameAsOwnerDetails",
|
|
12190
|
-
autoFocus: focusIndex.index === (connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key) && focusIndex.type === "sameAsOwnerDetails",
|
|
12191
|
-
errorStyle: localFormState.touched.sameAsOwnerDetails && errors !== null && errors !== void 0 && (_errors$sameAsOwnerDe = errors.sameAsOwnerDetails) !== null && _errors$sameAsOwnerDe !== void 0 && _errors$sameAsOwnerDe.message ? true : false,
|
|
12192
|
-
onChange: e => {
|
|
12193
|
-
setSameAsOwnerDetails(e.target.checked);
|
|
12194
|
-
props.onChange(e.target.checked);
|
|
12195
|
-
setFocusIndex({
|
|
12196
|
-
index: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key,
|
|
12197
|
-
type: "sameAsOwnerDetails"
|
|
12198
|
-
});
|
|
12199
|
-
},
|
|
12200
|
-
checked: sameAsOwnerDetails,
|
|
12201
|
-
onBlur: props.onBlur
|
|
12202
|
-
});
|
|
12203
|
-
}
|
|
12204
|
-
})), !sameAsOwnerDetails ? /*#__PURE__*/React.createElement("div", {
|
|
12565
|
+
return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
|
|
12566
|
+
title: t("WS_CONNECTION_HOLDER_DETAILS"),
|
|
12567
|
+
defaultOpen: true
|
|
12568
|
+
}, !sameAsOwnerDetails ? /*#__PURE__*/React.createElement("div", {
|
|
12205
12569
|
className: "formcomposer-section-grid"
|
|
12206
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12207
|
-
className: "card-label-smaller"
|
|
12208
|
-
}, `${t("WS_OWN_DETAIL_NAME")}*`), /*#__PURE__*/React.createElement(Controller, {
|
|
12570
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_OWN_DETAIL_NAME")}*`), /*#__PURE__*/React.createElement(Controller, {
|
|
12209
12571
|
control: control,
|
|
12210
12572
|
name: "name",
|
|
12211
12573
|
defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.name,
|
|
@@ -12257,9 +12619,59 @@ const ConnectionDetails$1 = _props => {
|
|
|
12257
12619
|
}
|
|
12258
12620
|
})), localFormState.touched.name && (errors === null || errors === void 0 ? void 0 : (_errors$name2 = errors.name) === null || _errors$name2 === void 0 ? void 0 : _errors$name2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
12259
12621
|
style: errorStyle
|
|
12260
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$name3 = errors.name) === null || _errors$name3 === void 0 ? void 0 : _errors$name3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12261
|
-
|
|
12262
|
-
|
|
12622
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$name3 = errors.name) === null || _errors$name3 === void 0 ? void 0 : _errors$name3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_OWN_DETAIL_MIDDLE_NAME")}`), /*#__PURE__*/React.createElement(Controller, {
|
|
12623
|
+
control: control,
|
|
12624
|
+
name: "middleName",
|
|
12625
|
+
defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.middleName,
|
|
12626
|
+
render: props => {
|
|
12627
|
+
var _errors$middleName;
|
|
12628
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextInput, {
|
|
12629
|
+
value: getValues("middleName"),
|
|
12630
|
+
autoFocus: focusIndex.index === (connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key) && focusIndex.type === "middleName",
|
|
12631
|
+
errorStyle: localFormState.touched.middleName && errors !== null && errors !== void 0 && (_errors$middleName = errors.middleName) !== null && _errors$middleName !== void 0 && _errors$middleName.message ? true : false,
|
|
12632
|
+
onChange: e => {
|
|
12633
|
+
setMiddleName(e.target.value);
|
|
12634
|
+
props.onChange(e.target.value);
|
|
12635
|
+
setFocusIndex({
|
|
12636
|
+
index: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key,
|
|
12637
|
+
type: "middleName"
|
|
12638
|
+
});
|
|
12639
|
+
},
|
|
12640
|
+
labelStyle: {
|
|
12641
|
+
marginTop: "unset"
|
|
12642
|
+
},
|
|
12643
|
+
onBlur: props.onBlur
|
|
12644
|
+
}));
|
|
12645
|
+
}
|
|
12646
|
+
})), localFormState.touched.middleName && (errors === null || errors === void 0 ? void 0 : (_errors$middleName2 = errors.middleName) === null || _errors$middleName2 === void 0 ? void 0 : _errors$middleName2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
12647
|
+
style: errorStyle
|
|
12648
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$middleName3 = errors.middleName) === null || _errors$middleName3 === void 0 ? void 0 : _errors$middleName3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_OWN_DETAIL_LAST_NAME")}`), /*#__PURE__*/React.createElement(Controller, {
|
|
12649
|
+
control: control,
|
|
12650
|
+
name: "lastName",
|
|
12651
|
+
defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.lastName,
|
|
12652
|
+
render: props => {
|
|
12653
|
+
var _errors$lastName;
|
|
12654
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextInput, {
|
|
12655
|
+
value: getValues("lastName"),
|
|
12656
|
+
autoFocus: focusIndex.index === (connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key) && focusIndex.type === "lastName",
|
|
12657
|
+
errorStyle: localFormState.touched.lastName && errors !== null && errors !== void 0 && (_errors$lastName = errors.lastName) !== null && _errors$lastName !== void 0 && _errors$lastName.message ? true : false,
|
|
12658
|
+
onChange: e => {
|
|
12659
|
+
setLastName(e.target.value);
|
|
12660
|
+
props.onChange(e.target.value);
|
|
12661
|
+
setFocusIndex({
|
|
12662
|
+
index: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key,
|
|
12663
|
+
type: "lastName"
|
|
12664
|
+
});
|
|
12665
|
+
},
|
|
12666
|
+
labelStyle: {
|
|
12667
|
+
marginTop: "unset"
|
|
12668
|
+
},
|
|
12669
|
+
onBlur: props.onBlur
|
|
12670
|
+
}));
|
|
12671
|
+
}
|
|
12672
|
+
})), localFormState.touched.lastName && (errors === null || errors === void 0 ? void 0 : (_errors$lastName2 = errors.lastName) === null || _errors$lastName2 === void 0 ? void 0 : _errors$lastName2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
12673
|
+
style: errorStyle
|
|
12674
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$lastName3 = errors.lastName) === null || _errors$lastName3 === void 0 ? void 0 : _errors$lastName3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_CONN_HOLDER_OWN_DETAIL_GENDER_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
|
|
12263
12675
|
className: "field"
|
|
12264
12676
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
12265
12677
|
control: control,
|
|
@@ -12314,65 +12726,7 @@ const ConnectionDetails$1 = _props => {
|
|
|
12314
12726
|
}
|
|
12315
12727
|
}))), localFormState.touched.gender && (errors === null || errors === void 0 ? void 0 : (_errors$gender2 = errors.gender) === null || _errors$gender2 === void 0 ? void 0 : _errors$gender2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
12316
12728
|
style: errorStyle
|
|
12317
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$gender3 = errors.gender) === null || _errors$gender3 === void 0 ? void 0 : _errors$gender3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12318
|
-
className: "card-label-smaller"
|
|
12319
|
-
}, `${t("CORE_COMMON_MOBILE_NUMBER")}*`), /*#__PURE__*/React.createElement("div", {
|
|
12320
|
-
className: "field"
|
|
12321
|
-
}, /*#__PURE__*/React.createElement(Controller, {
|
|
12322
|
-
control: control,
|
|
12323
|
-
name: "mobileNumber",
|
|
12324
|
-
defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.mobileNumber,
|
|
12325
|
-
rules: {
|
|
12326
|
-
validate: e => e && getPattern("MobileNoWithPrivacy").test(e) || !e || e.includes("*") ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG"),
|
|
12327
|
-
required: t("REQUIRED_FIELD")
|
|
12328
|
-
},
|
|
12329
|
-
isMandatory: true,
|
|
12330
|
-
render: props => {
|
|
12331
|
-
var _errors$mobileNumber, _formData$ConnectionD11, _formData$ConnectionD12, _formData$cpt3, _formData$cpt3$detail, _formData$ConnectionD13, _formData$ConnectionD14, _formData$ConnectionD15, _formData$ConnectionD16;
|
|
12332
|
-
const mobileValue = getValues("mobileNumber");
|
|
12333
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MobileNumber, {
|
|
12334
|
-
name: "mobileNumber",
|
|
12335
|
-
value: mobileValue,
|
|
12336
|
-
autoFocus: focusIndex.index === (connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key) && focusIndex.type === "mobileNumber",
|
|
12337
|
-
errorStyle: localFormState.touched.mobileNumber && (errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber = errors.mobileNumber) === null || _errors$mobileNumber === void 0 ? void 0 : _errors$mobileNumber.message),
|
|
12338
|
-
onChange: val => {
|
|
12339
|
-
setMobileNumber(val);
|
|
12340
|
-
props.onChange(val);
|
|
12341
|
-
setFocusIndex({
|
|
12342
|
-
index: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key,
|
|
12343
|
-
type: "mobileNumber"
|
|
12344
|
-
});
|
|
12345
|
-
},
|
|
12346
|
-
onBlur: props.onBlur,
|
|
12347
|
-
hideSpan: false
|
|
12348
|
-
}), checkifPrivacyValid() && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(WrapUnMaskComponent, {
|
|
12349
|
-
value: mobileValue,
|
|
12350
|
-
unmaskField: e => {
|
|
12351
|
-
props.onChange(e);
|
|
12352
|
-
},
|
|
12353
|
-
iseyevisible: mobileValue === null || mobileValue === void 0 ? void 0 : mobileValue.includes("*"),
|
|
12354
|
-
privacy: {
|
|
12355
|
-
uuid: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.uuid,
|
|
12356
|
-
fieldName: "connectionHoldersMobileNumber",
|
|
12357
|
-
model: "WnSConnectionOwner",
|
|
12358
|
-
loadData: {
|
|
12359
|
-
serviceName: formData !== null && formData !== void 0 && (_formData$ConnectionD11 = formData.ConnectionDetails) !== null && _formData$ConnectionD11 !== void 0 && (_formData$ConnectionD12 = _formData$ConnectionD11[0]) !== null && _formData$ConnectionD12 !== void 0 && _formData$ConnectionD12.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search",
|
|
12360
|
-
requestBody: {},
|
|
12361
|
-
requestParam: {
|
|
12362
|
-
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : (_formData$cpt3$detail = _formData$cpt3.details) === null || _formData$cpt3$detail === void 0 ? void 0 : _formData$cpt3$detail.tenantId,
|
|
12363
|
-
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD13 = formData.ConnectionDetails) === null || _formData$ConnectionD13 === void 0 ? void 0 : (_formData$ConnectionD14 = _formData$ConnectionD13[0]) === null || _formData$ConnectionD14 === void 0 ? void 0 : _formData$ConnectionD14.applicationNo
|
|
12364
|
-
},
|
|
12365
|
-
jsonPath: formData !== null && formData !== void 0 && (_formData$ConnectionD15 = formData.ConnectionDetails) !== null && _formData$ConnectionD15 !== void 0 && (_formData$ConnectionD16 = _formData$ConnectionD15[0]) !== null && _formData$ConnectionD16 !== void 0 && _formData$ConnectionD16.water ? "WaterConnection[0].connectionHolders[0].mobileNumber" : "SewerageConnections[0].connectionHolders[0].mobileNumber",
|
|
12366
|
-
isArray: false
|
|
12367
|
-
}
|
|
12368
|
-
}
|
|
12369
|
-
})));
|
|
12370
|
-
}
|
|
12371
|
-
}))), localFormState.touched.mobileNumber && (errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber2 = errors.mobileNumber) === null || _errors$mobileNumber2 === void 0 ? void 0 : _errors$mobileNumber2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
12372
|
-
style: errorStyle
|
|
12373
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber3 = errors.mobileNumber) === null || _errors$mobileNumber3 === void 0 ? void 0 : _errors$mobileNumber3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12374
|
-
className: "card-label-smaller"
|
|
12375
|
-
}, `${t("WS_OWN_DETAIL_GUARDIAN_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
|
|
12729
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$gender3 = errors.gender) === null || _errors$gender3 === void 0 ? void 0 : _errors$gender3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_OWN_DETAIL_GUARDIAN_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
|
|
12376
12730
|
className: "field"
|
|
12377
12731
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
12378
12732
|
control: control,
|
|
@@ -12384,7 +12738,7 @@ const ConnectionDetails$1 = _props => {
|
|
|
12384
12738
|
},
|
|
12385
12739
|
isMandatory: true,
|
|
12386
12740
|
render: props => {
|
|
12387
|
-
var _errors$guardian, _getValues2, _formData$
|
|
12741
|
+
var _errors$guardian, _getValues2, _formData$ConnectionD11, _formData$ConnectionD12, _formData$cpt3, _formData$cpt3$detail, _formData$ConnectionD13, _formData$ConnectionD14, _formData$ConnectionD15, _formData$ConnectionD16;
|
|
12388
12742
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextInput, {
|
|
12389
12743
|
value: getValues("guardian"),
|
|
12390
12744
|
autoFocus: focusIndex.index === (connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key) && focusIndex.type === "guardian",
|
|
@@ -12412,13 +12766,13 @@ const ConnectionDetails$1 = _props => {
|
|
|
12412
12766
|
fieldName: "fatherOrHusbandName",
|
|
12413
12767
|
model: "WnSConnectionOwner",
|
|
12414
12768
|
loadData: {
|
|
12415
|
-
serviceName: formData !== null && formData !== void 0 && (_formData$
|
|
12769
|
+
serviceName: formData !== null && formData !== void 0 && (_formData$ConnectionD11 = formData.ConnectionDetails) !== null && _formData$ConnectionD11 !== void 0 && (_formData$ConnectionD12 = _formData$ConnectionD11[0]) !== null && _formData$ConnectionD12 !== void 0 && _formData$ConnectionD12.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search",
|
|
12416
12770
|
requestBody: {},
|
|
12417
12771
|
requestParam: {
|
|
12418
|
-
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12419
|
-
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12772
|
+
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : (_formData$cpt3$detail = _formData$cpt3.details) === null || _formData$cpt3$detail === void 0 ? void 0 : _formData$cpt3$detail.tenantId,
|
|
12773
|
+
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD13 = formData.ConnectionDetails) === null || _formData$ConnectionD13 === void 0 ? void 0 : (_formData$ConnectionD14 = _formData$ConnectionD13[0]) === null || _formData$ConnectionD14 === void 0 ? void 0 : _formData$ConnectionD14.applicationNo
|
|
12420
12774
|
},
|
|
12421
|
-
jsonPath: formData !== null && formData !== void 0 && (_formData$
|
|
12775
|
+
jsonPath: formData !== null && formData !== void 0 && (_formData$ConnectionD15 = formData.ConnectionDetails) !== null && _formData$ConnectionD15 !== void 0 && (_formData$ConnectionD16 = _formData$ConnectionD15[0]) !== null && _formData$ConnectionD16 !== void 0 && _formData$ConnectionD16.water ? "WaterConnection[0].connectionHolders[0].fatherOrHusbandName" : "SewerageConnections[0].connectionHolders[0].fatherOrHusbandName",
|
|
12422
12776
|
isArray: false
|
|
12423
12777
|
}
|
|
12424
12778
|
}
|
|
@@ -12426,9 +12780,7 @@ const ConnectionDetails$1 = _props => {
|
|
|
12426
12780
|
}
|
|
12427
12781
|
}))), localFormState.touched.guardian && (errors === null || errors === void 0 ? void 0 : (_errors$guardian2 = errors.guardian) === null || _errors$guardian2 === void 0 ? void 0 : _errors$guardian2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
12428
12782
|
style: errorStyle
|
|
12429
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$guardian3 = errors.guardian) === null || _errors$guardian3 === void 0 ? void 0 : _errors$guardian3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12430
|
-
className: "card-label-smaller"
|
|
12431
|
-
}, `${t("WS_CONN_HOLDER_OWN_DETAIL_RELATION_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
|
|
12783
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$guardian3 = errors.guardian) === null || _errors$guardian3 === void 0 ? void 0 : _errors$guardian3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_CONN_HOLDER_OWN_DETAIL_RELATION_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
|
|
12432
12784
|
className: "field"
|
|
12433
12785
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
12434
12786
|
control: control,
|
|
@@ -12439,7 +12791,7 @@ const ConnectionDetails$1 = _props => {
|
|
|
12439
12791
|
},
|
|
12440
12792
|
isMandatory: true,
|
|
12441
12793
|
render: props => {
|
|
12442
|
-
var _errors$relationship, _relationship$i18nKey, _formData$
|
|
12794
|
+
var _errors$relationship, _relationship$i18nKey, _formData$ConnectionD17, _formData$ConnectionD18, _formData$cpt4, _formData$cpt4$detail, _formData$ConnectionD19, _formData$ConnectionD20, _formData$ConnectionD21, _formData$ConnectionD22;
|
|
12443
12795
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
12444
12796
|
className: "form-field",
|
|
12445
12797
|
selected: getValues("relationship"),
|
|
@@ -12469,13 +12821,13 @@ const ConnectionDetails$1 = _props => {
|
|
|
12469
12821
|
fieldName: "relationship",
|
|
12470
12822
|
model: "WnSConnection",
|
|
12471
12823
|
loadData: {
|
|
12472
|
-
serviceName: formData !== null && formData !== void 0 && (_formData$
|
|
12824
|
+
serviceName: formData !== null && formData !== void 0 && (_formData$ConnectionD17 = formData.ConnectionDetails) !== null && _formData$ConnectionD17 !== void 0 && (_formData$ConnectionD18 = _formData$ConnectionD17[0]) !== null && _formData$ConnectionD18 !== void 0 && _formData$ConnectionD18.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search",
|
|
12473
12825
|
requestBody: {},
|
|
12474
12826
|
requestParam: {
|
|
12475
|
-
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12476
|
-
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12827
|
+
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$cpt4 = formData.cpt) === null || _formData$cpt4 === void 0 ? void 0 : (_formData$cpt4$detail = _formData$cpt4.details) === null || _formData$cpt4$detail === void 0 ? void 0 : _formData$cpt4$detail.tenantId,
|
|
12828
|
+
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD19 = formData.ConnectionDetails) === null || _formData$ConnectionD19 === void 0 ? void 0 : (_formData$ConnectionD20 = _formData$ConnectionD19[0]) === null || _formData$ConnectionD20 === void 0 ? void 0 : _formData$ConnectionD20.applicationNo
|
|
12477
12829
|
},
|
|
12478
|
-
jsonPath: formData !== null && formData !== void 0 && (_formData$
|
|
12830
|
+
jsonPath: formData !== null && formData !== void 0 && (_formData$ConnectionD21 = formData.ConnectionDetails) !== null && _formData$ConnectionD21 !== void 0 && (_formData$ConnectionD22 = _formData$ConnectionD21[0]) !== null && _formData$ConnectionD22 !== void 0 && _formData$ConnectionD22.water ? "WaterConnection[0].connectionHolders[0].relationship" : "SewerageConnections[0].connectionHolders[0].relationship",
|
|
12479
12831
|
isArray: false
|
|
12480
12832
|
}
|
|
12481
12833
|
}
|
|
@@ -12483,121 +12835,153 @@ const ConnectionDetails$1 = _props => {
|
|
|
12483
12835
|
}
|
|
12484
12836
|
}))), localFormState.touched.relationship && (errors === null || errors === void 0 ? void 0 : (_errors$relationship2 = errors.relationship) === null || _errors$relationship2 === void 0 ? void 0 : _errors$relationship2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
12485
12837
|
style: errorStyle
|
|
12486
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$relationship3 = errors.relationship) === null || _errors$relationship3 === void 0 ? void 0 : _errors$relationship3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12487
|
-
className: "card-label-smaller"
|
|
12488
|
-
}, `${t("WS_CORRESPONDANCE_ADDRESS_LABEL")}*`), /*#__PURE__*/React.createElement("div", {
|
|
12838
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$relationship3 = errors.relationship) === null || _errors$relationship3 === void 0 ? void 0 : _errors$relationship3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CORE_COMMON_MOBILE_NUMBER")}*`), /*#__PURE__*/React.createElement("div", {
|
|
12489
12839
|
className: "field"
|
|
12490
12840
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
12491
12841
|
control: control,
|
|
12492
|
-
name: "
|
|
12493
|
-
defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.
|
|
12842
|
+
name: "mobileNumber",
|
|
12843
|
+
defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.mobileNumber,
|
|
12494
12844
|
rules: {
|
|
12495
|
-
validate: e => e && getPattern("
|
|
12845
|
+
validate: e => e && getPattern("MobileNoWithPrivacy").test(e) || !e || e.includes("*") ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG"),
|
|
12496
12846
|
required: t("REQUIRED_FIELD")
|
|
12497
12847
|
},
|
|
12498
12848
|
isMandatory: true,
|
|
12499
12849
|
render: props => {
|
|
12500
|
-
var _errors$
|
|
12501
|
-
|
|
12502
|
-
|
|
12503
|
-
|
|
12504
|
-
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
|
|
12850
|
+
var _errors$mobileNumber, _formData$ConnectionD23, _formData$ConnectionD24, _formData$cpt5, _formData$cpt5$detail, _formData$ConnectionD25, _formData$ConnectionD26, _formData$ConnectionD27, _formData$ConnectionD28;
|
|
12851
|
+
const mobileValue = getValues("mobileNumber");
|
|
12852
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MobileNumber, {
|
|
12853
|
+
name: "mobileNumber",
|
|
12854
|
+
value: mobileValue,
|
|
12855
|
+
autoFocus: focusIndex.index === (connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key) && focusIndex.type === "mobileNumber",
|
|
12856
|
+
errorStyle: localFormState.touched.mobileNumber && (errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber = errors.mobileNumber) === null || _errors$mobileNumber === void 0 ? void 0 : _errors$mobileNumber.message),
|
|
12857
|
+
onChange: val => {
|
|
12858
|
+
setMobileNumber(val);
|
|
12859
|
+
props.onChange(val);
|
|
12508
12860
|
setFocusIndex({
|
|
12509
12861
|
index: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key,
|
|
12510
|
-
type: "
|
|
12862
|
+
type: "mobileNumber"
|
|
12511
12863
|
});
|
|
12864
|
+
if (isWatsappSameAsMobile) {
|
|
12865
|
+
setWatsAppMobileNumber(val);
|
|
12866
|
+
setValue("watsAppMobileNumber", val);
|
|
12867
|
+
}
|
|
12512
12868
|
},
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
},
|
|
12516
|
-
onBlur: props.onBlur
|
|
12869
|
+
onBlur: props.onBlur,
|
|
12870
|
+
hideSpan: false
|
|
12517
12871
|
}), checkifPrivacyValid() && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(WrapUnMaskComponent, {
|
|
12872
|
+
value: mobileValue,
|
|
12518
12873
|
unmaskField: e => {
|
|
12519
|
-
setAddress(e);
|
|
12520
12874
|
props.onChange(e);
|
|
12521
12875
|
},
|
|
12522
|
-
iseyevisible:
|
|
12876
|
+
iseyevisible: mobileValue === null || mobileValue === void 0 ? void 0 : mobileValue.includes("*"),
|
|
12523
12877
|
privacy: {
|
|
12524
12878
|
uuid: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.uuid,
|
|
12525
|
-
fieldName: "
|
|
12879
|
+
fieldName: "connectionHoldersMobileNumber",
|
|
12526
12880
|
model: "WnSConnectionOwner",
|
|
12527
12881
|
loadData: {
|
|
12528
|
-
serviceName: formData !== null && formData !== void 0 && (_formData$
|
|
12882
|
+
serviceName: formData !== null && formData !== void 0 && (_formData$ConnectionD23 = formData.ConnectionDetails) !== null && _formData$ConnectionD23 !== void 0 && (_formData$ConnectionD24 = _formData$ConnectionD23[0]) !== null && _formData$ConnectionD24 !== void 0 && _formData$ConnectionD24.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search",
|
|
12529
12883
|
requestBody: {},
|
|
12530
12884
|
requestParam: {
|
|
12531
|
-
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12532
|
-
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12885
|
+
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$cpt5 = formData.cpt) === null || _formData$cpt5 === void 0 ? void 0 : (_formData$cpt5$detail = _formData$cpt5.details) === null || _formData$cpt5$detail === void 0 ? void 0 : _formData$cpt5$detail.tenantId,
|
|
12886
|
+
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD25 = formData.ConnectionDetails) === null || _formData$ConnectionD25 === void 0 ? void 0 : (_formData$ConnectionD26 = _formData$ConnectionD25[0]) === null || _formData$ConnectionD26 === void 0 ? void 0 : _formData$ConnectionD26.applicationNo
|
|
12533
12887
|
},
|
|
12534
|
-
jsonPath: formData !== null && formData !== void 0 && (_formData$
|
|
12888
|
+
jsonPath: formData !== null && formData !== void 0 && (_formData$ConnectionD27 = formData.ConnectionDetails) !== null && _formData$ConnectionD27 !== void 0 && (_formData$ConnectionD28 = _formData$ConnectionD27[0]) !== null && _formData$ConnectionD28 !== void 0 && _formData$ConnectionD28.water ? "WaterConnection[0].connectionHolders[0].mobileNumber" : "SewerageConnections[0].connectionHolders[0].mobileNumber",
|
|
12535
12889
|
isArray: false
|
|
12536
12890
|
}
|
|
12537
12891
|
}
|
|
12538
12892
|
})));
|
|
12539
12893
|
}
|
|
12540
|
-
}))), localFormState.touched.
|
|
12894
|
+
}))), localFormState.touched.mobileNumber && (errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber2 = errors.mobileNumber) === null || _errors$mobileNumber2 === void 0 ? void 0 : _errors$mobileNumber2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
12541
12895
|
style: errorStyle
|
|
12542
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$
|
|
12543
|
-
className: "card-label-smaller"
|
|
12544
|
-
}, `${t("WS_OWNER_SPECIAL_CATEGORY")}*`), /*#__PURE__*/React.createElement("div", {
|
|
12896
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber3 = errors.mobileNumber) === null || _errors$mobileNumber3 === void 0 ? void 0 : _errors$mobileNumber3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CORE_COMMON_WHATSAPP_MOBILE_NUMBER")}`), /*#__PURE__*/React.createElement("div", {
|
|
12545
12897
|
className: "field"
|
|
12546
12898
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
12547
12899
|
control: control,
|
|
12548
|
-
name: "
|
|
12549
|
-
defaultValue:
|
|
12900
|
+
name: "isWatsappSameAsMobile",
|
|
12901
|
+
defaultValue: isWatsappSameAsMobile,
|
|
12902
|
+
render: props => {
|
|
12903
|
+
var _errors$isWatsappSame;
|
|
12904
|
+
return /*#__PURE__*/React.createElement(CheckBox, {
|
|
12905
|
+
label: t("WS_SAME_AS_MOBILE_NUMBER"),
|
|
12906
|
+
name: "isWatsappSameAsMobile",
|
|
12907
|
+
autoFocus: focusIndex.index === (connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key) && focusIndex.type === "isWatsappSameAsMobile",
|
|
12908
|
+
errorStyle: localFormState.touched.isWatsappSameAsMobile && errors !== null && errors !== void 0 && (_errors$isWatsappSame = errors.isWatsappSameAsMobile) !== null && _errors$isWatsappSame !== void 0 && _errors$isWatsappSame.message ? true : false,
|
|
12909
|
+
onChange: e => {
|
|
12910
|
+
setIsWatsappSameAsMobile(e.target.checked);
|
|
12911
|
+
props.onChange(e.target.checked);
|
|
12912
|
+
setFocusIndex({
|
|
12913
|
+
index: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key,
|
|
12914
|
+
type: "isWatsappSameAsMobile"
|
|
12915
|
+
});
|
|
12916
|
+
if (e.target.checked) {
|
|
12917
|
+
setWatsAppMobileNumber(mobileNumber);
|
|
12918
|
+
setValue("watsAppMobileNumber", mobileNumber);
|
|
12919
|
+
} else {
|
|
12920
|
+
setWatsAppMobileNumber("");
|
|
12921
|
+
setValue("watsAppMobileNumber", "");
|
|
12922
|
+
}
|
|
12923
|
+
},
|
|
12924
|
+
checked: isWatsappSameAsMobile,
|
|
12925
|
+
onBlur: props.onBlur,
|
|
12926
|
+
style: {
|
|
12927
|
+
paddingBottom: "10px"
|
|
12928
|
+
}
|
|
12929
|
+
});
|
|
12930
|
+
}
|
|
12931
|
+
}), /*#__PURE__*/React.createElement(Controller, {
|
|
12932
|
+
control: control,
|
|
12933
|
+
name: "watsAppMobileNumber",
|
|
12934
|
+
defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.watsAppMobileNumber,
|
|
12550
12935
|
rules: {
|
|
12936
|
+
validate: e => e && getPattern("MobileNoWithPrivacy").test(e) || !e || e.includes("*") ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG"),
|
|
12551
12937
|
required: t("REQUIRED_FIELD")
|
|
12552
12938
|
},
|
|
12939
|
+
isMandatory: true,
|
|
12553
12940
|
render: props => {
|
|
12554
|
-
var _errors$
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
errorStyle: localFormState.touched.
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
props.onChange(
|
|
12941
|
+
var _errors$watsAppMobile, _formData$ConnectionD29, _formData$ConnectionD30, _formData$cpt6, _formData$cpt6$detail, _formData$ConnectionD31, _formData$ConnectionD32, _formData$ConnectionD33, _formData$ConnectionD34;
|
|
12942
|
+
const watsAppmobileValue = getValues("watsAppMobileNumber");
|
|
12943
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MobileNumber, {
|
|
12944
|
+
name: "watsAppMobileNumber",
|
|
12945
|
+
value: watsAppmobileValue,
|
|
12946
|
+
autoFocus: focusIndex.index === (connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key) && focusIndex.type === "watsAppMobileNumber",
|
|
12947
|
+
errorStyle: localFormState.touched.watsAppMobileNumber && (errors === null || errors === void 0 ? void 0 : (_errors$watsAppMobile = errors.watsAppMobileNumber) === null || _errors$watsAppMobile === void 0 ? void 0 : _errors$watsAppMobile.message),
|
|
12948
|
+
onChange: val => {
|
|
12949
|
+
setWatsAppMobileNumber(val);
|
|
12950
|
+
props.onChange(val);
|
|
12951
|
+
setFocusIndex({
|
|
12952
|
+
index: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key,
|
|
12953
|
+
type: "watsAppMobileNumber"
|
|
12954
|
+
});
|
|
12564
12955
|
},
|
|
12565
|
-
optionKey: "i18nKey",
|
|
12566
12956
|
onBlur: props.onBlur,
|
|
12567
|
-
|
|
12957
|
+
hideSpan: false,
|
|
12958
|
+
disable: isWatsappSameAsMobile
|
|
12568
12959
|
}), checkifPrivacyValid() && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(WrapUnMaskComponent, {
|
|
12960
|
+
value: watsAppmobileValue,
|
|
12569
12961
|
unmaskField: e => {
|
|
12570
|
-
|
|
12571
|
-
code: e,
|
|
12572
|
-
i18nKey: `COMMON_MASTERS_OWNERTYPE_${e}`,
|
|
12573
|
-
name: e
|
|
12574
|
-
};
|
|
12575
|
-
setOwnerType(r);
|
|
12576
|
-
props.onChange(r);
|
|
12962
|
+
props.onChange(e);
|
|
12577
12963
|
},
|
|
12578
|
-
iseyevisible:
|
|
12964
|
+
iseyevisible: watsAppmobileValue === null || watsAppmobileValue === void 0 ? void 0 : watsAppmobileValue.includes("*"),
|
|
12579
12965
|
privacy: {
|
|
12580
12966
|
uuid: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.uuid,
|
|
12581
|
-
fieldName: "
|
|
12582
|
-
model: "
|
|
12967
|
+
fieldName: "connectionHoldersMobileNumber",
|
|
12968
|
+
model: "WnSConnectionOwner",
|
|
12583
12969
|
loadData: {
|
|
12584
|
-
serviceName: formData !== null && formData !== void 0 && (_formData$
|
|
12970
|
+
serviceName: formData !== null && formData !== void 0 && (_formData$ConnectionD29 = formData.ConnectionDetails) !== null && _formData$ConnectionD29 !== void 0 && (_formData$ConnectionD30 = _formData$ConnectionD29[0]) !== null && _formData$ConnectionD30 !== void 0 && _formData$ConnectionD30.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search",
|
|
12585
12971
|
requestBody: {},
|
|
12586
12972
|
requestParam: {
|
|
12587
|
-
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12588
|
-
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12973
|
+
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$cpt6 = formData.cpt) === null || _formData$cpt6 === void 0 ? void 0 : (_formData$cpt6$detail = _formData$cpt6.details) === null || _formData$cpt6$detail === void 0 ? void 0 : _formData$cpt6$detail.tenantId,
|
|
12974
|
+
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD31 = formData.ConnectionDetails) === null || _formData$ConnectionD31 === void 0 ? void 0 : (_formData$ConnectionD32 = _formData$ConnectionD31[0]) === null || _formData$ConnectionD32 === void 0 ? void 0 : _formData$ConnectionD32.applicationNo
|
|
12589
12975
|
},
|
|
12590
|
-
jsonPath: formData !== null && formData !== void 0 && (_formData$
|
|
12976
|
+
jsonPath: formData !== null && formData !== void 0 && (_formData$ConnectionD33 = formData.ConnectionDetails) !== null && _formData$ConnectionD33 !== void 0 && (_formData$ConnectionD34 = _formData$ConnectionD33[0]) !== null && _formData$ConnectionD34 !== void 0 && _formData$ConnectionD34.water ? "WaterConnection[0].connectionHolders[0].mobileNumber" : "SewerageConnections[0].connectionHolders[0].mobileNumber",
|
|
12591
12977
|
isArray: false
|
|
12592
12978
|
}
|
|
12593
12979
|
}
|
|
12594
12980
|
})));
|
|
12595
12981
|
}
|
|
12596
|
-
}))), localFormState.touched.
|
|
12982
|
+
}))), localFormState.touched.watsAppMobileNumber && (errors === null || errors === void 0 ? void 0 : (_errors$watsAppMobile2 = errors.watsAppMobileNumber) === null || _errors$watsAppMobile2 === void 0 ? void 0 : _errors$watsAppMobile2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
12597
12983
|
style: errorStyle
|
|
12598
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$
|
|
12599
|
-
className: "card-label-smaller"
|
|
12600
|
-
}, `${t("WS_EMAIL_ID")}`), /*#__PURE__*/React.createElement("div", {
|
|
12984
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$watsAppMobile3 = errors.watsAppMobileNumber) === null || _errors$watsAppMobile3 === void 0 ? void 0 : _errors$watsAppMobile3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_EMAIL_ID")}`), /*#__PURE__*/React.createElement("div", {
|
|
12601
12985
|
className: "field"
|
|
12602
12986
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
12603
12987
|
control: control,
|
|
@@ -12608,7 +12992,7 @@ const ConnectionDetails$1 = _props => {
|
|
|
12608
12992
|
},
|
|
12609
12993
|
isMandatory: false,
|
|
12610
12994
|
render: props => {
|
|
12611
|
-
var _errors$emailId,
|
|
12995
|
+
var _errors$emailId, _getValues3, _formData$ConnectionD35, _formData$ConnectionD36, _formData$cpt7, _formData$cpt7$detail, _formData$ConnectionD37, _formData$ConnectionD38, _formData$ConnectionD39, _formData$ConnectionD40;
|
|
12612
12996
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextInput, {
|
|
12613
12997
|
value: getValues("emailId"),
|
|
12614
12998
|
autoFocus: focusIndex.index === (connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.key) && focusIndex.type === "emailId",
|
|
@@ -12631,19 +13015,19 @@ const ConnectionDetails$1 = _props => {
|
|
|
12631
13015
|
setEmailId(e);
|
|
12632
13016
|
props.onChange(e);
|
|
12633
13017
|
},
|
|
12634
|
-
iseyevisible: (
|
|
13018
|
+
iseyevisible: (_getValues3 = getValues("emailId")) !== null && _getValues3 !== void 0 && _getValues3.includes("*") ? true : false,
|
|
12635
13019
|
privacy: {
|
|
12636
13020
|
uuid: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.uuid,
|
|
12637
13021
|
fieldName: "emailId",
|
|
12638
13022
|
model: "WnSConnectionOwner",
|
|
12639
13023
|
loadData: {
|
|
12640
|
-
serviceName: formData !== null && formData !== void 0 && (_formData$
|
|
13024
|
+
serviceName: formData !== null && formData !== void 0 && (_formData$ConnectionD35 = formData.ConnectionDetails) !== null && _formData$ConnectionD35 !== void 0 && (_formData$ConnectionD36 = _formData$ConnectionD35[0]) !== null && _formData$ConnectionD36 !== void 0 && _formData$ConnectionD36.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search",
|
|
12641
13025
|
requestBody: {},
|
|
12642
13026
|
requestParam: {
|
|
12643
|
-
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12644
|
-
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$
|
|
13027
|
+
tenantId: formData === null || formData === void 0 ? void 0 : (_formData$cpt7 = formData.cpt) === null || _formData$cpt7 === void 0 ? void 0 : (_formData$cpt7$detail = _formData$cpt7.details) === null || _formData$cpt7$detail === void 0 ? void 0 : _formData$cpt7$detail.tenantId,
|
|
13028
|
+
applicationNumber: formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD37 = formData.ConnectionDetails) === null || _formData$ConnectionD37 === void 0 ? void 0 : (_formData$ConnectionD38 = _formData$ConnectionD37[0]) === null || _formData$ConnectionD38 === void 0 ? void 0 : _formData$ConnectionD38.applicationNo
|
|
12645
13029
|
},
|
|
12646
|
-
jsonPath: formData !== null && formData !== void 0 && (_formData$
|
|
13030
|
+
jsonPath: formData !== null && formData !== void 0 && (_formData$ConnectionD39 = formData.ConnectionDetails) !== null && _formData$ConnectionD39 !== void 0 && (_formData$ConnectionD40 = _formData$ConnectionD39[0]) !== null && _formData$ConnectionD40 !== void 0 && _formData$ConnectionD40.water ? "WaterConnection[0].connectionHolders[0].emailId" : "SewerageConnections[0].connectionHolders[0].emailId",
|
|
12647
13031
|
isArray: false
|
|
12648
13032
|
}
|
|
12649
13033
|
}
|
|
@@ -15103,10 +15487,10 @@ const WSDocumentsEmployee = ({
|
|
|
15103
15487
|
formState
|
|
15104
15488
|
}) => {
|
|
15105
15489
|
var _formData$DocumentsRe, _applicationDetailsDa, _applicationDetailsDa2, _wsDocs$wsDocsData2;
|
|
15106
|
-
const
|
|
15490
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
15107
15491
|
const [documents, setDocuments] = useState((formData === null || formData === void 0 ? void 0 : (_formData$DocumentsRe = formData.DocumentsRequired) === null || _formData$DocumentsRe === void 0 ? void 0 : _formData$DocumentsRe.documents) || []);
|
|
15108
15492
|
const [error, setError] = useState(null);
|
|
15109
|
-
const wsDocsData = window.location.href.includes("modify") ? "ModifyConnectionDocuments" : window.location.href.includes("disconnection") ? "DisconnectionDocuments" : "
|
|
15493
|
+
const wsDocsData = window.location.href.includes("modify") ? "ModifyConnectionDocuments" : window.location.href.includes("disconnection") ? "DisconnectionDocuments" : "NewWSDocuments";
|
|
15110
15494
|
let action = "create";
|
|
15111
15495
|
const {
|
|
15112
15496
|
pathname
|
|
@@ -15117,7 +15501,7 @@ const WSDocumentsEmployee = ({
|
|
|
15117
15501
|
const {
|
|
15118
15502
|
isLoading,
|
|
15119
15503
|
data: wsDocs
|
|
15120
|
-
} = Digit.Hooks.ws.WSSearchMdmsTypes.
|
|
15504
|
+
} = Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesNewMasters(tenantId, wsDocsData);
|
|
15121
15505
|
const goNext = () => {
|
|
15122
15506
|
onSelect(config.key, {
|
|
15123
15507
|
documents
|
|
@@ -15150,7 +15534,10 @@ const WSDocumentsEmployee = ({
|
|
|
15150
15534
|
});
|
|
15151
15535
|
});
|
|
15152
15536
|
}
|
|
15153
|
-
return /*#__PURE__*/React.createElement(
|
|
15537
|
+
return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
|
|
15538
|
+
title: t("WS_DOCUMENTS"),
|
|
15539
|
+
defaultOpen: true
|
|
15540
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
15154
15541
|
className: "formcomposer-section-grid ws-doc-upload"
|
|
15155
15542
|
}, wsDocs === null || wsDocs === void 0 ? void 0 : (_wsDocs$wsDocsData2 = wsDocs[wsDocsData]) === null || _wsDocs$wsDocsData2 === void 0 ? void 0 : _wsDocs$wsDocsData2.map((document, index) => {
|
|
15156
15543
|
return /*#__PURE__*/React.createElement(SelectDocument$1, {
|
|
@@ -15191,7 +15578,7 @@ function SelectDocument$1({
|
|
|
15191
15578
|
fromRawData,
|
|
15192
15579
|
id
|
|
15193
15580
|
}) {
|
|
15194
|
-
var _doc$dropdownData, _formData$ConnectionD;
|
|
15581
|
+
var _doc$dropdownData, _formData$ConnectionD, _doc$i18nKey, _doc$i18nKey2, _doc$i18nKey3;
|
|
15195
15582
|
const fileRef = useRef();
|
|
15196
15583
|
const filteredDocument = documents === null || documents === void 0 ? void 0 : documents.filter(item => {
|
|
15197
15584
|
var _item$documentType;
|
|
@@ -15200,21 +15587,57 @@ function SelectDocument$1({
|
|
|
15200
15587
|
const [selectedDocument, setSelectedDocument] = useState(filteredDocument ? {
|
|
15201
15588
|
...filteredDocument,
|
|
15202
15589
|
code: filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.documentType
|
|
15203
|
-
} : (doc === null || doc === void 0 ? void 0 : (_doc$dropdownData = doc.dropdownData) === null || _doc$dropdownData === void 0 ? void 0 : _doc$dropdownData.length) === 1 ? doc === null || doc === void 0 ? void 0 : doc.dropdownData[0] : {});
|
|
15590
|
+
} : doc !== null && doc !== void 0 && doc.hasDropdown ? (doc === null || doc === void 0 ? void 0 : (_doc$dropdownData = doc.dropdownData) === null || _doc$dropdownData === void 0 ? void 0 : _doc$dropdownData.length) === 1 ? doc === null || doc === void 0 ? void 0 : doc.dropdownData[0] : {} : doc);
|
|
15204
15591
|
const [file, setFile] = useState(null);
|
|
15205
15592
|
const [uploadedFile, setUploadedFile] = useState(() => (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileStoreId) || null);
|
|
15593
|
+
const [documentUid, setDocumentUid] = useState(() => (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.documentUid) || "");
|
|
15594
|
+
const [showCamera, setShowCamera] = useState(false);
|
|
15595
|
+
const [isUploading, setIsUploading] = useState(false);
|
|
15596
|
+
const [isCameraFile, setIsCameraFile] = useState(false);
|
|
15597
|
+
const [showDocModal, setShowDocModal] = useState(false);
|
|
15598
|
+
const [docFileUrl, setDocFileUrl] = useState("");
|
|
15599
|
+
const [docFileType, setDocFileType] = useState("");
|
|
15600
|
+
const handleCapture = capturedFile => {
|
|
15601
|
+
setFile(capturedFile);
|
|
15602
|
+
setIsCameraFile(true);
|
|
15603
|
+
setShowCamera(false);
|
|
15604
|
+
};
|
|
15206
15605
|
const handleSelectDocument = value => setSelectedDocument(value);
|
|
15606
|
+
const viewDocument = async () => {
|
|
15607
|
+
if (uploadedFile) {
|
|
15608
|
+
try {
|
|
15609
|
+
const res = await Digit.UploadServices.FileFetchbyid(uploadedFile, Digit.ULBService.getStateId());
|
|
15610
|
+
if (res !== null && res !== void 0 && res.data) {
|
|
15611
|
+
const blob = res.data instanceof Blob ? res.data : new Blob([res.data], {
|
|
15612
|
+
type: res.headers["content-type"] || res.headers["Content-Type"] || "image/jpeg"
|
|
15613
|
+
});
|
|
15614
|
+
const fileURL = URL.createObjectURL(blob);
|
|
15615
|
+
setDocFileUrl(fileURL);
|
|
15616
|
+
const contentType = res.headers["content-type"] || res.headers["Content-Type"] || "";
|
|
15617
|
+
if (contentType.toLowerCase().includes("pdf")) {
|
|
15618
|
+
setDocFileType("pdf");
|
|
15619
|
+
} else {
|
|
15620
|
+
setDocFileType("image");
|
|
15621
|
+
}
|
|
15622
|
+
setShowDocModal(true);
|
|
15623
|
+
}
|
|
15624
|
+
} catch (err) {
|
|
15625
|
+
console.error("Failed to fetch file URL via FileFetchbyid", err);
|
|
15626
|
+
}
|
|
15627
|
+
}
|
|
15628
|
+
};
|
|
15207
15629
|
useEffect(() => {
|
|
15208
15630
|
if (filteredDocument) {
|
|
15209
15631
|
var _doc$dropdownData2;
|
|
15210
15632
|
setSelectedDocument(filteredDocument ? {
|
|
15211
15633
|
...filteredDocument,
|
|
15212
15634
|
code: filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.documentType
|
|
15213
|
-
} : (doc === null || doc === void 0 ? void 0 : (_doc$dropdownData2 = doc.dropdownData) === null || _doc$dropdownData2 === void 0 ? void 0 : _doc$dropdownData2.length) === 1 ? doc === null || doc === void 0 ? void 0 : doc.dropdownData[0] : {});
|
|
15635
|
+
} : doc !== null && doc !== void 0 && doc.hasDropdown ? (doc === null || doc === void 0 ? void 0 : (_doc$dropdownData2 = doc.dropdownData) === null || _doc$dropdownData2 === void 0 ? void 0 : _doc$dropdownData2.length) === 1 ? doc === null || doc === void 0 ? void 0 : doc.dropdownData[0] : {} : doc);
|
|
15214
15636
|
}
|
|
15215
15637
|
}, []);
|
|
15216
15638
|
function selectfile(e) {
|
|
15217
15639
|
setFile(e.target.files[0]);
|
|
15640
|
+
setIsCameraFile(false);
|
|
15218
15641
|
}
|
|
15219
15642
|
const {
|
|
15220
15643
|
dropdownData
|
|
@@ -15258,6 +15681,7 @@ function SelectDocument$1({
|
|
|
15258
15681
|
const data = [...filteredDocumentsByFileStoreId, {
|
|
15259
15682
|
documentType: selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.code,
|
|
15260
15683
|
fileStoreId: uploadedFile,
|
|
15684
|
+
documentUid: documentUid,
|
|
15261
15685
|
i18nKey: selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.code,
|
|
15262
15686
|
id: selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.id,
|
|
15263
15687
|
status: "ACTIVE"
|
|
@@ -15275,7 +15699,7 @@ function SelectDocument$1({
|
|
|
15275
15699
|
} else if (isHidden) {
|
|
15276
15700
|
removeError();
|
|
15277
15701
|
}
|
|
15278
|
-
}, [uploadedFile, selectedDocument, isHidden, formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD = formData.ConnectionDetails) === null || _formData$ConnectionD === void 0 ? void 0 : _formData$ConnectionD[0]]);
|
|
15702
|
+
}, [uploadedFile, selectedDocument, documentUid, isHidden, formData === null || formData === void 0 ? void 0 : (_formData$ConnectionD = formData.ConnectionDetails) === null || _formData$ConnectionD === void 0 ? void 0 : _formData$ConnectionD[0]]);
|
|
15279
15703
|
useEffect(() => {
|
|
15280
15704
|
(async () => {
|
|
15281
15705
|
setError(null);
|
|
@@ -15286,6 +15710,7 @@ function SelectDocument$1({
|
|
|
15286
15710
|
try {
|
|
15287
15711
|
var _response$data, _response$data$files;
|
|
15288
15712
|
setUploadedFile(null);
|
|
15713
|
+
setIsUploading(true);
|
|
15289
15714
|
const response = await Digit.UploadServices.Filestorage("WS", file, Digit.ULBService.getStateId());
|
|
15290
15715
|
if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
|
|
15291
15716
|
var _response$data2, _response$data2$files;
|
|
@@ -15295,6 +15720,8 @@ function SelectDocument$1({
|
|
|
15295
15720
|
}
|
|
15296
15721
|
} catch (err) {
|
|
15297
15722
|
setError(t("CS_FILE_UPLOAD_ERROR"));
|
|
15723
|
+
} finally {
|
|
15724
|
+
setIsUploading(false);
|
|
15298
15725
|
}
|
|
15299
15726
|
}
|
|
15300
15727
|
}
|
|
@@ -15303,11 +15730,16 @@ function SelectDocument$1({
|
|
|
15303
15730
|
useEffect(() => {
|
|
15304
15731
|
if (isHidden) setUploadedFile(null);
|
|
15305
15732
|
}, [isHidden]);
|
|
15306
|
-
return /*#__PURE__*/React.createElement(
|
|
15733
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15307
15734
|
style: {
|
|
15308
|
-
|
|
15735
|
+
gridColumn: "span 2",
|
|
15736
|
+
display: "grid",
|
|
15737
|
+
gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
|
|
15738
|
+
gap: "20px",
|
|
15739
|
+
width: "100%",
|
|
15740
|
+
marginBottom: "20px"
|
|
15309
15741
|
}
|
|
15310
|
-
}, doc !== null && doc !== void 0 && doc.required ? `${t(doc === null || doc === void 0 ? void 0 : doc.i18nKey)}*` : `${t(doc === null || doc === void 0 ? void 0 : doc.i18nKey)}`), /*#__PURE__*/React.createElement(Dropdown, {
|
|
15742
|
+
}, doc !== null && doc !== void 0 && doc.hasDropdown ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, doc !== null && doc !== void 0 && doc.required ? `${t(doc === null || doc === void 0 ? void 0 : doc.i18nKey)}*` : `${t(doc === null || doc === void 0 ? void 0 : doc.i18nKey)}`), /*#__PURE__*/React.createElement(Dropdown, {
|
|
15311
15743
|
id: `doc-${doc === null || doc === void 0 ? void 0 : doc.code}`,
|
|
15312
15744
|
key: `doc-${doc === null || doc === void 0 ? void 0 : doc.code}`,
|
|
15313
15745
|
className: "form-field",
|
|
@@ -15322,12 +15754,31 @@ function SelectDocument$1({
|
|
|
15322
15754
|
select: handleSelectDocument,
|
|
15323
15755
|
optionKey: "i18nKey",
|
|
15324
15756
|
t: t
|
|
15325
|
-
})) : null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement("div", {
|
|
15757
|
+
})) : null, (doc === null || doc === void 0 ? void 0 : doc.code) !== "OWNER.APPLICANTPHOTO" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey = doc.i18nKey) === null || _doc$i18nKey === void 0 ? void 0 : _doc$i18nKey.replaceAll(".", "_")}_DOCUMENT_NO`)), /*#__PURE__*/React.createElement("div", {
|
|
15326
15758
|
className: "field"
|
|
15759
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
15760
|
+
type: "text",
|
|
15761
|
+
value: documentUid,
|
|
15762
|
+
onChange: e => setDocumentUid(e.target.value),
|
|
15763
|
+
placeholder: t("WS_IDENTITY_NO_PLACEHOLDER")
|
|
15764
|
+
}))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, doc !== null && doc !== void 0 && doc.required ? `${t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey2 = doc.i18nKey) === null || _doc$i18nKey2 === void 0 ? void 0 : _doc$i18nKey2.replaceAll(".", "_")}_UPLOAD_DOCUMENT`)}*` : `${t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey3 = doc.i18nKey) === null || _doc$i18nKey3 === void 0 ? void 0 : _doc$i18nKey3.replaceAll(".", "_")}_UPLOAD_DOCUMENT`)}`), /*#__PURE__*/React.createElement("div", {
|
|
15765
|
+
className: "field",
|
|
15766
|
+
style: {
|
|
15767
|
+
display: "flex",
|
|
15768
|
+
gap: "20px",
|
|
15769
|
+
alignItems: "center",
|
|
15770
|
+
width: "100%"
|
|
15771
|
+
}
|
|
15772
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
15773
|
+
style: {
|
|
15774
|
+
flex: 1
|
|
15775
|
+
}
|
|
15327
15776
|
}, /*#__PURE__*/React.createElement(UploadFile, {
|
|
15328
15777
|
onUpload: selectfile,
|
|
15329
15778
|
onDelete: () => {
|
|
15330
15779
|
setUploadedFile(null);
|
|
15780
|
+
setFile(null);
|
|
15781
|
+
setIsCameraFile(false);
|
|
15331
15782
|
},
|
|
15332
15783
|
id: id,
|
|
15333
15784
|
message: uploadedFile ? `1 ${t(`CS_ACTION_FILEUPLOADED`)}` : t(`CS_ACTION_NO_FILEUPLOADED`),
|
|
@@ -15336,9 +15787,235 @@ function SelectDocument$1({
|
|
|
15336
15787
|
},
|
|
15337
15788
|
buttonType: "button",
|
|
15338
15789
|
error: !uploadedFile,
|
|
15339
|
-
accept: "image/*, .pdf, .png, .jpeg, .jpg"
|
|
15790
|
+
accept: "image/*, .pdf, .png, .jpeg, .jpg",
|
|
15791
|
+
uploadedFiles: uploadedFile && file && isCameraFile ? [[(file === null || file === void 0 ? void 0 : file.name) || "applicant_photo.jpg", {
|
|
15792
|
+
fileStoreId: uploadedFile
|
|
15793
|
+
}]] : undefined,
|
|
15794
|
+
removeTargetedFile: () => {
|
|
15795
|
+
setUploadedFile(null);
|
|
15796
|
+
setFile(null);
|
|
15797
|
+
setIsCameraFile(false);
|
|
15798
|
+
}
|
|
15799
|
+
})), uploadedFile && /*#__PURE__*/React.createElement("div", {
|
|
15800
|
+
onClick: viewDocument,
|
|
15801
|
+
style: {
|
|
15802
|
+
cursor: "pointer"
|
|
15803
|
+
}
|
|
15804
|
+
}, /*#__PURE__*/React.createElement(ViewsIcon, null)), (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.APPLICANTPHOTO" && /*#__PURE__*/React.createElement("div", {
|
|
15805
|
+
style: {
|
|
15806
|
+
flex: 1,
|
|
15807
|
+
display: "flex",
|
|
15808
|
+
flexDirection: "column",
|
|
15809
|
+
marginTop: "-20px"
|
|
15810
|
+
}
|
|
15811
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_CLICK_APPLICANT_PHOTO") || "Click Applicant Photo"), /*#__PURE__*/React.createElement("div", {
|
|
15812
|
+
style: {
|
|
15813
|
+
display: "flex",
|
|
15814
|
+
alignItems: "center",
|
|
15815
|
+
gap: "10px"
|
|
15816
|
+
}
|
|
15817
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
15818
|
+
type: "button",
|
|
15819
|
+
style: {
|
|
15820
|
+
display: "flex",
|
|
15821
|
+
alignItems: "center",
|
|
15822
|
+
justifyContent: "center",
|
|
15823
|
+
gap: "8px",
|
|
15824
|
+
padding: "6px 16px",
|
|
15825
|
+
background: "#f0f0f0",
|
|
15826
|
+
border: "1px solid #ccc",
|
|
15827
|
+
borderRadius: "2px",
|
|
15828
|
+
cursor: isUploading ? "not-allowed" : "pointer",
|
|
15829
|
+
width: "fit-content",
|
|
15830
|
+
opacity: isUploading ? 0.5 : 1
|
|
15831
|
+
},
|
|
15832
|
+
onClick: () => !isUploading && setShowCamera(true),
|
|
15833
|
+
disabled: isUploading
|
|
15834
|
+
}, /*#__PURE__*/React.createElement("span", null, "\uD83D\uDCF8"), " ", t("WS_CLICK_PHOTO") || "Click Photo"), isUploading && /*#__PURE__*/React.createElement("span", {
|
|
15835
|
+
style: {
|
|
15836
|
+
color: "#00497e",
|
|
15837
|
+
fontWeight: "bold",
|
|
15838
|
+
fontSize: "14px"
|
|
15839
|
+
}
|
|
15840
|
+
}, t("CS_COMMON_UPLOADING") || "Uploading..."), uploadedFile && !isUploading && /*#__PURE__*/React.createElement("span", {
|
|
15841
|
+
style: {
|
|
15842
|
+
color: "green",
|
|
15843
|
+
fontWeight: "bold",
|
|
15844
|
+
fontSize: "14px"
|
|
15845
|
+
}
|
|
15846
|
+
}, "\u2714 Uploaded"))))), showCamera && /*#__PURE__*/React.createElement(CameraCaptureModal, {
|
|
15847
|
+
onCapture: handleCapture,
|
|
15848
|
+
onClose: () => setShowCamera(false),
|
|
15849
|
+
t: t
|
|
15850
|
+
}), showDocModal && /*#__PURE__*/React.createElement(Modal, {
|
|
15851
|
+
open: showDocModal,
|
|
15852
|
+
headerBarMain: t("WS_VIEW_DOCUMENT") || "View Document",
|
|
15853
|
+
headerBarEnd: /*#__PURE__*/React.createElement("div", {
|
|
15854
|
+
className: "icon-bg-secondary",
|
|
15855
|
+
onClick: () => setShowDocModal(false),
|
|
15856
|
+
style: {
|
|
15857
|
+
cursor: "pointer",
|
|
15858
|
+
padding: "5px"
|
|
15859
|
+
}
|
|
15860
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
15861
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15862
|
+
viewBox: "0 0 24 24",
|
|
15863
|
+
fill: "#FFFFFF",
|
|
15864
|
+
width: "24",
|
|
15865
|
+
height: "24"
|
|
15866
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
15867
|
+
d: "M0 0h24v24H0V0z",
|
|
15868
|
+
fill: "none"
|
|
15869
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
15870
|
+
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"
|
|
15871
|
+
}))),
|
|
15872
|
+
center: true,
|
|
15873
|
+
actionCancelOnSubmit: () => setShowDocModal(false),
|
|
15874
|
+
actionCancelLabel: t("CS_COMMON_CLOSE") || "Close",
|
|
15875
|
+
popupStyles: {
|
|
15876
|
+
width: "80%",
|
|
15877
|
+
maxWidth: "800px"
|
|
15878
|
+
}
|
|
15879
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
15880
|
+
style: {
|
|
15881
|
+
display: "flex",
|
|
15882
|
+
justifyContent: "center",
|
|
15883
|
+
alignItems: "center",
|
|
15884
|
+
padding: "20px",
|
|
15885
|
+
minHeight: "300px"
|
|
15886
|
+
}
|
|
15887
|
+
}, docFileType === "pdf" ? /*#__PURE__*/React.createElement("iframe", {
|
|
15888
|
+
src: docFileUrl,
|
|
15889
|
+
title: "Document Preview",
|
|
15890
|
+
width: "100%",
|
|
15891
|
+
height: "500px",
|
|
15892
|
+
style: {
|
|
15893
|
+
border: "none"
|
|
15894
|
+
}
|
|
15895
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
15896
|
+
src: docFileUrl,
|
|
15897
|
+
alt: "Document Preview",
|
|
15898
|
+
style: {
|
|
15899
|
+
maxWidth: "100%",
|
|
15900
|
+
maxHeight: "500px",
|
|
15901
|
+
objectFit: "contain",
|
|
15902
|
+
borderRadius: "4px"
|
|
15903
|
+
}
|
|
15340
15904
|
}))));
|
|
15341
15905
|
}
|
|
15906
|
+
const CameraCaptureModal = ({
|
|
15907
|
+
onCapture,
|
|
15908
|
+
onClose,
|
|
15909
|
+
t
|
|
15910
|
+
}) => {
|
|
15911
|
+
const videoRef = useRef(null);
|
|
15912
|
+
const canvasRef = useRef(null);
|
|
15913
|
+
const [stream, setStream] = useState(null);
|
|
15914
|
+
const [error, setError] = useState(null);
|
|
15915
|
+
useEffect(() => {
|
|
15916
|
+
const startCamera = async () => {
|
|
15917
|
+
try {
|
|
15918
|
+
const mediaStream = await navigator.mediaDevices.getUserMedia({
|
|
15919
|
+
video: true
|
|
15920
|
+
});
|
|
15921
|
+
if (videoRef.current) {
|
|
15922
|
+
videoRef.current.srcObject = mediaStream;
|
|
15923
|
+
}
|
|
15924
|
+
setStream(mediaStream);
|
|
15925
|
+
} catch (err) {
|
|
15926
|
+
setError(t("WS_CAMERA_ACCESS_ERROR") || "Camera Access Error");
|
|
15927
|
+
console.error("Error accessing camera: ", err);
|
|
15928
|
+
}
|
|
15929
|
+
};
|
|
15930
|
+
startCamera();
|
|
15931
|
+
return () => {
|
|
15932
|
+
if (stream) {
|
|
15933
|
+
stream.getTracks().forEach(track => track.stop());
|
|
15934
|
+
}
|
|
15935
|
+
};
|
|
15936
|
+
}, []);
|
|
15937
|
+
const capturePhoto = () => {
|
|
15938
|
+
if (videoRef.current && canvasRef.current) {
|
|
15939
|
+
const context = canvasRef.current.getContext("2d");
|
|
15940
|
+
canvasRef.current.width = videoRef.current.videoWidth;
|
|
15941
|
+
canvasRef.current.height = videoRef.current.videoHeight;
|
|
15942
|
+
context.translate(canvasRef.current.width, 0);
|
|
15943
|
+
context.scale(-1, 1);
|
|
15944
|
+
context.drawImage(videoRef.current, 0, 0, canvasRef.current.width, canvasRef.current.height);
|
|
15945
|
+
canvasRef.current.toBlob(blob => {
|
|
15946
|
+
const file = new File([blob], "applicant_photo.jpg", {
|
|
15947
|
+
type: "image/jpeg"
|
|
15948
|
+
});
|
|
15949
|
+
onCapture(file);
|
|
15950
|
+
}, "image/jpeg");
|
|
15951
|
+
}
|
|
15952
|
+
};
|
|
15953
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15954
|
+
style: {
|
|
15955
|
+
position: "fixed",
|
|
15956
|
+
top: 0,
|
|
15957
|
+
left: 0,
|
|
15958
|
+
width: "100%",
|
|
15959
|
+
height: "100%",
|
|
15960
|
+
backgroundColor: "rgba(0,0,0,0.8)",
|
|
15961
|
+
zIndex: 9999,
|
|
15962
|
+
display: "flex",
|
|
15963
|
+
flexDirection: "column",
|
|
15964
|
+
alignItems: "center",
|
|
15965
|
+
justifyContent: "center"
|
|
15966
|
+
}
|
|
15967
|
+
}, error ? /*#__PURE__*/React.createElement("div", {
|
|
15968
|
+
style: {
|
|
15969
|
+
color: "white",
|
|
15970
|
+
marginBottom: "20px"
|
|
15971
|
+
}
|
|
15972
|
+
}, error) : /*#__PURE__*/React.createElement("video", {
|
|
15973
|
+
ref: videoRef,
|
|
15974
|
+
autoPlay: true,
|
|
15975
|
+
playsInline: true,
|
|
15976
|
+
style: {
|
|
15977
|
+
maxWidth: "100%",
|
|
15978
|
+
maxHeight: "80%",
|
|
15979
|
+
backgroundColor: "black",
|
|
15980
|
+
transform: "scaleX(-1)"
|
|
15981
|
+
}
|
|
15982
|
+
}), /*#__PURE__*/React.createElement("canvas", {
|
|
15983
|
+
ref: canvasRef,
|
|
15984
|
+
style: {
|
|
15985
|
+
display: "none"
|
|
15986
|
+
}
|
|
15987
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
15988
|
+
style: {
|
|
15989
|
+
marginTop: "20px",
|
|
15990
|
+
display: "flex",
|
|
15991
|
+
gap: "20px"
|
|
15992
|
+
}
|
|
15993
|
+
}, !error && /*#__PURE__*/React.createElement("button", {
|
|
15994
|
+
type: "button",
|
|
15995
|
+
onClick: capturePhoto,
|
|
15996
|
+
style: {
|
|
15997
|
+
padding: "10px 20px",
|
|
15998
|
+
background: "#00497e",
|
|
15999
|
+
color: "white",
|
|
16000
|
+
border: "none",
|
|
16001
|
+
borderRadius: "4px",
|
|
16002
|
+
cursor: "pointer",
|
|
16003
|
+
fontWeight: "bold"
|
|
16004
|
+
}
|
|
16005
|
+
}, t("WS_CAPTURE_PHOTO") || "Capture"), /*#__PURE__*/React.createElement("button", {
|
|
16006
|
+
type: "button",
|
|
16007
|
+
onClick: onClose,
|
|
16008
|
+
style: {
|
|
16009
|
+
padding: "10px 20px",
|
|
16010
|
+
background: "white",
|
|
16011
|
+
color: "#00497e",
|
|
16012
|
+
border: "1px solid #00497e",
|
|
16013
|
+
borderRadius: "4px",
|
|
16014
|
+
cursor: "pointer",
|
|
16015
|
+
fontWeight: "bold"
|
|
16016
|
+
}
|
|
16017
|
+
}, t("CS_COMMON_CANCEL") || "Cancel")));
|
|
16018
|
+
};
|
|
15342
16019
|
|
|
15343
16020
|
const createConnectionDetails$2 = () => ({
|
|
15344
16021
|
water: true,
|
|
@@ -19157,6 +19834,551 @@ const PlumberDetails$1 = _props => {
|
|
|
19157
19834
|
}, localFormState.touched.disConnectionReason ? errors === null || errors === void 0 ? void 0 : (_errors$disConnection4 = errors.disConnectionReason) === null || _errors$disConnection4 === void 0 ? void 0 : _errors$disConnection4.message : "")));
|
|
19158
19835
|
};
|
|
19159
19836
|
|
|
19837
|
+
const WSBankDetails = ({
|
|
19838
|
+
config,
|
|
19839
|
+
onSelect,
|
|
19840
|
+
userType,
|
|
19841
|
+
formData,
|
|
19842
|
+
setError,
|
|
19843
|
+
formState,
|
|
19844
|
+
clearErrors
|
|
19845
|
+
}) => {
|
|
19846
|
+
var _localFormState$touch, _errors$bankName, _localFormState$touch2, _errors$bankBranchNam, _localFormState$touch3, _errors$ifscCode, _localFormState$touch4, _errors$accountNumber;
|
|
19847
|
+
const {
|
|
19848
|
+
t
|
|
19849
|
+
} = useTranslation();
|
|
19850
|
+
const {
|
|
19851
|
+
control,
|
|
19852
|
+
formState: localFormState,
|
|
19853
|
+
watch,
|
|
19854
|
+
trigger,
|
|
19855
|
+
getValues,
|
|
19856
|
+
setValue
|
|
19857
|
+
} = useForm({
|
|
19858
|
+
defaultValues: (formData === null || formData === void 0 ? void 0 : formData.bankDetails) || {
|
|
19859
|
+
bankName: "",
|
|
19860
|
+
bankBranchName: "",
|
|
19861
|
+
ifscCode: "",
|
|
19862
|
+
accountNumber: "",
|
|
19863
|
+
confirmAccountNumber: "",
|
|
19864
|
+
accountHolderName: ""
|
|
19865
|
+
}
|
|
19866
|
+
});
|
|
19867
|
+
const formValue = watch();
|
|
19868
|
+
const {
|
|
19869
|
+
errors
|
|
19870
|
+
} = localFormState;
|
|
19871
|
+
useEffect(() => {
|
|
19872
|
+
const isDifferent = !lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData.bankDetails, formValue);
|
|
19873
|
+
if (isDifferent) {
|
|
19874
|
+
const timer = setTimeout(() => {
|
|
19875
|
+
onSelect(config === null || config === void 0 ? void 0 : config.key, {
|
|
19876
|
+
...formValue
|
|
19877
|
+
});
|
|
19878
|
+
}, 200);
|
|
19879
|
+
return () => clearTimeout(timer);
|
|
19880
|
+
}
|
|
19881
|
+
}, [formValue]);
|
|
19882
|
+
useEffect(() => {
|
|
19883
|
+
var _formState$errors$con;
|
|
19884
|
+
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)) {
|
|
19885
|
+
setError(config.key, {
|
|
19886
|
+
type: errors
|
|
19887
|
+
});
|
|
19888
|
+
} else if (!Object.keys(errors).length && formState.errors[config.key]) {
|
|
19889
|
+
clearErrors(config.key);
|
|
19890
|
+
}
|
|
19891
|
+
}, [errors]);
|
|
19892
|
+
useEffect(() => {
|
|
19893
|
+
const ifsc = formValue === null || formValue === void 0 ? void 0 : formValue.ifscCode;
|
|
19894
|
+
if (ifsc && ifsc.length === 11) {
|
|
19895
|
+
fetch(`https://ifsc.razorpay.com/${ifsc}`).then(response => {
|
|
19896
|
+
if (response.ok) return response.json();
|
|
19897
|
+
throw new Error("Invalid IFSC");
|
|
19898
|
+
}).then(data => {
|
|
19899
|
+
if (data) {
|
|
19900
|
+
setValue("bankName", data.BANK);
|
|
19901
|
+
setValue("bankBranchName", data.BRANCH);
|
|
19902
|
+
}
|
|
19903
|
+
}).catch(err => {
|
|
19904
|
+
console.error("IFSC lookup failed", err);
|
|
19905
|
+
});
|
|
19906
|
+
}
|
|
19907
|
+
}, [formValue === null || formValue === void 0 ? void 0 : formValue.ifscCode]);
|
|
19908
|
+
const errorStyle = {
|
|
19909
|
+
width: "70%",
|
|
19910
|
+
marginLeft: "30%",
|
|
19911
|
+
fontSize: "12px",
|
|
19912
|
+
marginTop: "-21px"
|
|
19913
|
+
};
|
|
19914
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
|
|
19915
|
+
title: t("WS_BANK_DETAILS"),
|
|
19916
|
+
defaultOpen: true
|
|
19917
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
19918
|
+
className: "formcomposer-section-grid"
|
|
19919
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
19920
|
+
className: "card-label-smaller"
|
|
19921
|
+
}, t("WS_NAME_OF_BANK") + " *"), /*#__PURE__*/React.createElement("div", {
|
|
19922
|
+
className: "field"
|
|
19923
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
19924
|
+
control: control,
|
|
19925
|
+
name: "bankName",
|
|
19926
|
+
rules: {
|
|
19927
|
+
required: t("CORE_COMMON_REQUIRED_ERRMSG")
|
|
19928
|
+
},
|
|
19929
|
+
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
19930
|
+
value: props.value,
|
|
19931
|
+
placeholder: t("WS_NAME_OF_BANK_PLACEHOLDER"),
|
|
19932
|
+
onChange: e => props.onChange(e.target.value),
|
|
19933
|
+
onBlur: props.onBlur
|
|
19934
|
+
})
|
|
19935
|
+
}))), (_localFormState$touch = localFormState.touched) !== null && _localFormState$touch !== void 0 && _localFormState$touch.bankName ? /*#__PURE__*/React.createElement(CardLabelError, {
|
|
19936
|
+
style: errorStyle
|
|
19937
|
+
}, " ", errors === null || errors === void 0 ? void 0 : (_errors$bankName = errors.bankName) === null || _errors$bankName === void 0 ? void 0 : _errors$bankName.message) : null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
19938
|
+
className: "card-label-smaller"
|
|
19939
|
+
}, t("WS_NAME_OF_BRANCH") + " *"), /*#__PURE__*/React.createElement("div", {
|
|
19940
|
+
className: "field"
|
|
19941
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
19942
|
+
control: control,
|
|
19943
|
+
name: "bankBranchName",
|
|
19944
|
+
rules: {
|
|
19945
|
+
required: t("CORE_COMMON_REQUIRED_ERRMSG")
|
|
19946
|
+
},
|
|
19947
|
+
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
19948
|
+
value: props.value,
|
|
19949
|
+
placeholder: t("WS_NAME_OF_BRANCH_PLACEHOLDER"),
|
|
19950
|
+
onChange: e => props.onChange(e.target.value),
|
|
19951
|
+
onBlur: props.onBlur
|
|
19952
|
+
})
|
|
19953
|
+
}))), (_localFormState$touch2 = localFormState.touched) !== null && _localFormState$touch2 !== void 0 && _localFormState$touch2.bankBranchName ? /*#__PURE__*/React.createElement(CardLabelError, {
|
|
19954
|
+
style: errorStyle
|
|
19955
|
+
}, " ", errors === null || errors === void 0 ? void 0 : (_errors$bankBranchNam = errors.bankBranchName) === null || _errors$bankBranchNam === void 0 ? void 0 : _errors$bankBranchNam.message) : null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
19956
|
+
className: "card-label-smaller"
|
|
19957
|
+
}, t("WS_IFSC_CODE") + " *"), /*#__PURE__*/React.createElement("div", {
|
|
19958
|
+
className: "field"
|
|
19959
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
19960
|
+
control: control,
|
|
19961
|
+
name: "ifscCode",
|
|
19962
|
+
rules: {
|
|
19963
|
+
required: t("CORE_COMMON_REQUIRED_ERRMSG"),
|
|
19964
|
+
pattern: {
|
|
19965
|
+
value: /^[A-Z]{4}0[A-Z0-9]{6}$/,
|
|
19966
|
+
message: t("ERR_INVALID_IFSC_CODE")
|
|
19967
|
+
}
|
|
19968
|
+
},
|
|
19969
|
+
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
19970
|
+
value: props.value,
|
|
19971
|
+
placeholder: t("WS_IFSC_CODE_PLACEHOLDER"),
|
|
19972
|
+
onChange: e => props.onChange(e.target.value.toUpperCase()),
|
|
19973
|
+
onBlur: props.onBlur
|
|
19974
|
+
})
|
|
19975
|
+
}))), (_localFormState$touch3 = localFormState.touched) !== null && _localFormState$touch3 !== void 0 && _localFormState$touch3.ifscCode ? /*#__PURE__*/React.createElement(CardLabelError, {
|
|
19976
|
+
style: errorStyle
|
|
19977
|
+
}, " ", errors === null || errors === void 0 ? void 0 : (_errors$ifscCode = errors.ifscCode) === null || _errors$ifscCode === void 0 ? void 0 : _errors$ifscCode.message) : null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
19978
|
+
className: "card-label-smaller"
|
|
19979
|
+
}, t("WS_BANK_ACCOUNT_NO") + " *"), /*#__PURE__*/React.createElement("div", {
|
|
19980
|
+
className: "field"
|
|
19981
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
19982
|
+
control: control,
|
|
19983
|
+
name: "accountNumber",
|
|
19984
|
+
rules: {
|
|
19985
|
+
required: t("CORE_COMMON_REQUIRED_ERRMSG"),
|
|
19986
|
+
pattern: {
|
|
19987
|
+
value: /^[0-9]{9,18}$/,
|
|
19988
|
+
message: t("ERR_INVALID_BA_ACCOUNT_NUMBER")
|
|
19989
|
+
}
|
|
19990
|
+
},
|
|
19991
|
+
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
19992
|
+
value: props.value,
|
|
19993
|
+
placeholder: t("WS_BANK_ACCOUNT_NO_PLACEHOLDER"),
|
|
19994
|
+
onChange: e => props.onChange(e.target.value),
|
|
19995
|
+
onBlur: props.onBlur
|
|
19996
|
+
})
|
|
19997
|
+
}))), (_localFormState$touch4 = localFormState.touched) !== null && _localFormState$touch4 !== void 0 && _localFormState$touch4.accountNumber ? /*#__PURE__*/React.createElement(CardLabelError, {
|
|
19998
|
+
style: errorStyle
|
|
19999
|
+
}, " ", errors === null || errors === void 0 ? void 0 : (_errors$accountNumber = errors.accountNumber) === null || _errors$accountNumber === void 0 ? void 0 : _errors$accountNumber.message) : null), /*#__PURE__*/React.createElement("div", {
|
|
20000
|
+
style: {
|
|
20001
|
+
display: "none"
|
|
20002
|
+
}
|
|
20003
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
20004
|
+
control: control,
|
|
20005
|
+
name: "confirmAccountNumber",
|
|
20006
|
+
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
20007
|
+
value: props.value
|
|
20008
|
+
})
|
|
20009
|
+
}), /*#__PURE__*/React.createElement(Controller, {
|
|
20010
|
+
control: control,
|
|
20011
|
+
name: "accountHolderName",
|
|
20012
|
+
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
20013
|
+
value: props.value
|
|
20014
|
+
})
|
|
20015
|
+
})))));
|
|
20016
|
+
};
|
|
20017
|
+
|
|
20018
|
+
const WSDeclaration = ({
|
|
20019
|
+
config,
|
|
20020
|
+
onSelect,
|
|
20021
|
+
userType,
|
|
20022
|
+
formData,
|
|
20023
|
+
setError,
|
|
20024
|
+
formState,
|
|
20025
|
+
clearErrors,
|
|
20026
|
+
tenantId
|
|
20027
|
+
}) => {
|
|
20028
|
+
var _formData$declaration, _formData$declaration2, _formData$declaration3, _formData$declaration4, _formData$declaration5, _formData$declaration6, _formData$declaration7, _formData$declaration8;
|
|
20029
|
+
const {
|
|
20030
|
+
t
|
|
20031
|
+
} = useTranslation();
|
|
20032
|
+
const [signatureFileStoreId, setSignatureFileStoreId] = useState((formData === null || formData === void 0 ? void 0 : (_formData$declaration = formData.declarationData) === null || _formData$declaration === void 0 ? void 0 : _formData$declaration.signatureFileStoreId) || null);
|
|
20033
|
+
const [signatureFile, setSignatureFile] = useState((formData === null || formData === void 0 ? void 0 : (_formData$declaration2 = formData.declarationData) === null || _formData$declaration2 === void 0 ? void 0 : _formData$declaration2.signatureFile) || null);
|
|
20034
|
+
const {
|
|
20035
|
+
control,
|
|
20036
|
+
formState: localFormState,
|
|
20037
|
+
watch,
|
|
20038
|
+
trigger,
|
|
20039
|
+
getValues,
|
|
20040
|
+
setValue
|
|
20041
|
+
} = useForm({
|
|
20042
|
+
defaultValues: {
|
|
20043
|
+
agree: (formData === null || formData === void 0 ? void 0 : (_formData$declaration3 = formData.declarationData) === null || _formData$declaration3 === void 0 ? void 0 : _formData$declaration3.agree) || false,
|
|
20044
|
+
submittedBy: (formData === null || formData === void 0 ? void 0 : (_formData$declaration4 = formData.declarationData) === null || _formData$declaration4 === void 0 ? void 0 : _formData$declaration4.submittedBy) || {
|
|
20045
|
+
code: "SELF",
|
|
20046
|
+
i18nKey: "WS_SUBMITTED_BY_SELF"
|
|
20047
|
+
},
|
|
20048
|
+
signatureFile: (formData === null || formData === void 0 ? void 0 : (_formData$declaration5 = formData.declarationData) === null || _formData$declaration5 === void 0 ? void 0 : _formData$declaration5.signatureFile) || null,
|
|
20049
|
+
signatureFileStoreId: (formData === null || formData === void 0 ? void 0 : (_formData$declaration6 = formData.declarationData) === null || _formData$declaration6 === void 0 ? void 0 : _formData$declaration6.signatureFileStoreId) || null,
|
|
20050
|
+
declarations: (formData === null || formData === void 0 ? void 0 : (_formData$declaration7 = formData.declarationData) === null || _formData$declaration7 === void 0 ? void 0 : _formData$declaration7.declarations) || Array(9).fill((formData === null || formData === void 0 ? void 0 : (_formData$declaration8 = formData.declarationData) === null || _formData$declaration8 === void 0 ? void 0 : _formData$declaration8.agree) || false)
|
|
20051
|
+
}
|
|
20052
|
+
});
|
|
20053
|
+
const formValue = watch();
|
|
20054
|
+
const {
|
|
20055
|
+
isWSServicesMastersLoading,
|
|
20056
|
+
data: wsServicesMastersData
|
|
20057
|
+
} = Digit.Hooks.ws.useMDMS("dl.djb", "ws-services-masters", ["Declaration"]);
|
|
20058
|
+
const [declarationPoints, setDeclarationPoints] = useState([]);
|
|
20059
|
+
useEffect(() => {
|
|
20060
|
+
var _wsServicesMastersDat;
|
|
20061
|
+
if (wsServicesMastersData !== null && wsServicesMastersData !== void 0 && (_wsServicesMastersDat = wsServicesMastersData["ws-services-masters"]) !== null && _wsServicesMastersDat !== void 0 && _wsServicesMastersDat.Declaration) {
|
|
20062
|
+
setDeclarationPoints(wsServicesMastersData["ws-services-masters"].Declaration);
|
|
20063
|
+
}
|
|
20064
|
+
}, [wsServicesMastersData]);
|
|
20065
|
+
const submittedByOptions = [{
|
|
20066
|
+
code: "SELF",
|
|
20067
|
+
i18nKey: "WS_SUBMITTED_BY_SELF"
|
|
20068
|
+
}];
|
|
20069
|
+
useEffect(() => {
|
|
20070
|
+
var _formData$declaration9, _formData$declaration1;
|
|
20071
|
+
if ((formData === null || formData === void 0 ? void 0 : (_formData$declaration9 = formData.declarationData) === null || _formData$declaration9 === void 0 ? void 0 : _formData$declaration9.signatureFileStoreId) !== signatureFileStoreId) {
|
|
20072
|
+
var _formData$declaration0;
|
|
20073
|
+
const fsId = (formData === null || formData === void 0 ? void 0 : (_formData$declaration0 = formData.declarationData) === null || _formData$declaration0 === void 0 ? void 0 : _formData$declaration0.signatureFileStoreId) || null;
|
|
20074
|
+
setSignatureFileStoreId(fsId);
|
|
20075
|
+
setValue("signatureFileStoreId", fsId);
|
|
20076
|
+
}
|
|
20077
|
+
if ((formData === null || formData === void 0 ? void 0 : (_formData$declaration1 = formData.declarationData) === null || _formData$declaration1 === void 0 ? void 0 : _formData$declaration1.signatureFile) !== signatureFile) {
|
|
20078
|
+
var _formData$declaration10;
|
|
20079
|
+
const file = (formData === null || formData === void 0 ? void 0 : (_formData$declaration10 = formData.declarationData) === null || _formData$declaration10 === void 0 ? void 0 : _formData$declaration10.signatureFile) || null;
|
|
20080
|
+
setSignatureFile(file);
|
|
20081
|
+
setValue("signatureFile", file);
|
|
20082
|
+
}
|
|
20083
|
+
}, [formData === null || formData === void 0 ? void 0 : formData.declarationData]);
|
|
20084
|
+
useEffect(() => {
|
|
20085
|
+
const currentValues = {
|
|
20086
|
+
...formValue,
|
|
20087
|
+
signatureFileStoreId,
|
|
20088
|
+
signatureFile
|
|
20089
|
+
};
|
|
20090
|
+
const isDifferent = !lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData.declarationData, currentValues);
|
|
20091
|
+
if (isDifferent) {
|
|
20092
|
+
const timer = setTimeout(() => {
|
|
20093
|
+
onSelect(config === null || config === void 0 ? void 0 : config.key, currentValues);
|
|
20094
|
+
}, 200);
|
|
20095
|
+
return () => clearTimeout(timer);
|
|
20096
|
+
}
|
|
20097
|
+
}, [formValue, signatureFileStoreId, signatureFile]);
|
|
20098
|
+
const onUploadSignature = async e => {
|
|
20099
|
+
var _e$target$files;
|
|
20100
|
+
const file = (_e$target$files = e.target.files) === null || _e$target$files === void 0 ? void 0 : _e$target$files[0];
|
|
20101
|
+
if (file) {
|
|
20102
|
+
if (file.size >= 5242880) ; else {
|
|
20103
|
+
try {
|
|
20104
|
+
var _response$data, _response$data$files;
|
|
20105
|
+
const response = await Digit.UploadServices.Filestorage("WS", file, Digit.ULBService.getStateId());
|
|
20106
|
+
if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
|
|
20107
|
+
var _response$data2, _response$data2$files;
|
|
20108
|
+
const fsId = response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId;
|
|
20109
|
+
setSignatureFileStoreId(fsId);
|
|
20110
|
+
setSignatureFile(file);
|
|
20111
|
+
setValue("signatureFileStoreId", fsId);
|
|
20112
|
+
setValue("signatureFile", file);
|
|
20113
|
+
}
|
|
20114
|
+
} catch (err) {
|
|
20115
|
+
console.error("Signature upload failed", err);
|
|
20116
|
+
}
|
|
20117
|
+
}
|
|
20118
|
+
}
|
|
20119
|
+
};
|
|
20120
|
+
const [showDocModal, setShowDocModal] = useState(false);
|
|
20121
|
+
const [docFileUrl, setDocFileUrl] = useState("");
|
|
20122
|
+
const [docFileType, setDocFileType] = useState("");
|
|
20123
|
+
const viewDocument = async () => {
|
|
20124
|
+
if (signatureFileStoreId) {
|
|
20125
|
+
try {
|
|
20126
|
+
const res = await Digit.UploadServices.FileFetchbyid(signatureFileStoreId, Digit.ULBService.getStateId());
|
|
20127
|
+
if (res !== null && res !== void 0 && res.data) {
|
|
20128
|
+
const blob = res.data instanceof Blob ? res.data : new Blob([res.data], {
|
|
20129
|
+
type: res.headers["content-type"] || res.headers["Content-Type"] || "image/jpeg"
|
|
20130
|
+
});
|
|
20131
|
+
const fileURL = URL.createObjectURL(blob);
|
|
20132
|
+
setDocFileUrl(fileURL);
|
|
20133
|
+
const contentType = res.headers["content-type"] || res.headers["Content-Type"] || "";
|
|
20134
|
+
if (contentType.toLowerCase().includes("pdf")) {
|
|
20135
|
+
setDocFileType("pdf");
|
|
20136
|
+
} else {
|
|
20137
|
+
setDocFileType("image");
|
|
20138
|
+
}
|
|
20139
|
+
setShowDocModal(true);
|
|
20140
|
+
}
|
|
20141
|
+
} catch (err) {
|
|
20142
|
+
console.error("Failed to fetch file URL via FileFetchbyid", err);
|
|
20143
|
+
}
|
|
20144
|
+
}
|
|
20145
|
+
};
|
|
20146
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
|
|
20147
|
+
title: t("WS_DECLARATION"),
|
|
20148
|
+
defaultOpen: true
|
|
20149
|
+
}, /*#__PURE__*/React.createElement("div", null, declarationPoints.map((point, index) => /*#__PURE__*/React.createElement("div", {
|
|
20150
|
+
key: index,
|
|
20151
|
+
style: {
|
|
20152
|
+
display: "flex",
|
|
20153
|
+
alignItems: "flex-start",
|
|
20154
|
+
padding: "10px 0",
|
|
20155
|
+
borderBottom: "1px solid #eee"
|
|
20156
|
+
}
|
|
20157
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
20158
|
+
style: {
|
|
20159
|
+
fontSize: "14px",
|
|
20160
|
+
lineHeight: "1.5",
|
|
20161
|
+
marginRight: "8px",
|
|
20162
|
+
fontWeight: "bold"
|
|
20163
|
+
}
|
|
20164
|
+
}, index + 1, "."), /*#__PURE__*/React.createElement("span", {
|
|
20165
|
+
style: {
|
|
20166
|
+
fontSize: "14px",
|
|
20167
|
+
lineHeight: "1.5",
|
|
20168
|
+
flex: 1
|
|
20169
|
+
}
|
|
20170
|
+
}, t(point.code) !== point.code ? t(point.code) : point.description)))), /*#__PURE__*/React.createElement("div", {
|
|
20171
|
+
style: {
|
|
20172
|
+
marginTop: "10px"
|
|
20173
|
+
}
|
|
20174
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
20175
|
+
control: control,
|
|
20176
|
+
name: "agree",
|
|
20177
|
+
render: props => /*#__PURE__*/React.createElement(CheckBox, {
|
|
20178
|
+
label: t("WS_I_AGREE_TO_ALL_DECLARATIONS") || "I agree to all the above declarations",
|
|
20179
|
+
checked: props.value,
|
|
20180
|
+
onChange: e => {
|
|
20181
|
+
const val = e.target.checked;
|
|
20182
|
+
setValue("declarations", Array(9).fill(val));
|
|
20183
|
+
props.onChange(val);
|
|
20184
|
+
}
|
|
20185
|
+
})
|
|
20186
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
20187
|
+
className: "formcomposer-section-grid"
|
|
20188
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_SUBMITTED_BY")), /*#__PURE__*/React.createElement("div", {
|
|
20189
|
+
className: "field"
|
|
20190
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
20191
|
+
control: control,
|
|
20192
|
+
name: "submittedBy",
|
|
20193
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
20194
|
+
option: submittedByOptions,
|
|
20195
|
+
optionKey: "i18nKey",
|
|
20196
|
+
selected: props.value,
|
|
20197
|
+
select: props.onChange,
|
|
20198
|
+
t: t
|
|
20199
|
+
})
|
|
20200
|
+
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_UPLOAD_SIGNATURE_FILE")), /*#__PURE__*/React.createElement("div", {
|
|
20201
|
+
className: "field",
|
|
20202
|
+
style: {
|
|
20203
|
+
display: "flex",
|
|
20204
|
+
gap: "10px",
|
|
20205
|
+
alignItems: "center"
|
|
20206
|
+
}
|
|
20207
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
20208
|
+
style: {
|
|
20209
|
+
flex: 1
|
|
20210
|
+
}
|
|
20211
|
+
}, /*#__PURE__*/React.createElement(UploadFile, {
|
|
20212
|
+
onUpload: onUploadSignature,
|
|
20213
|
+
onDelete: () => {
|
|
20214
|
+
setSignatureFile(null);
|
|
20215
|
+
setSignatureFileStoreId(null);
|
|
20216
|
+
setValue("signatureFile", null);
|
|
20217
|
+
setValue("signatureFileStoreId", null);
|
|
20218
|
+
},
|
|
20219
|
+
id: "ws-declaration-signature",
|
|
20220
|
+
message: signatureFileStoreId ? `1 ${t(`CS_ACTION_FILEUPLOADED`)}` : t(`CS_ACTION_NO_FILEUPLOADED`),
|
|
20221
|
+
textStyles: {
|
|
20222
|
+
width: "100%"
|
|
20223
|
+
},
|
|
20224
|
+
buttonType: "button",
|
|
20225
|
+
accept: "image/*, .pdf, .png, .jpeg, .jpg"
|
|
20226
|
+
})), signatureFileStoreId && /*#__PURE__*/React.createElement("div", {
|
|
20227
|
+
onClick: viewDocument,
|
|
20228
|
+
style: {
|
|
20229
|
+
cursor: "pointer"
|
|
20230
|
+
}
|
|
20231
|
+
}, /*#__PURE__*/React.createElement(ViewsIcon, null))))))), showDocModal && /*#__PURE__*/React.createElement(Modal, {
|
|
20232
|
+
open: showDocModal,
|
|
20233
|
+
headerBarMain: t("WS_VIEW_DOCUMENT") || "View Document",
|
|
20234
|
+
headerBarEnd: /*#__PURE__*/React.createElement("div", {
|
|
20235
|
+
className: "icon-bg-secondary",
|
|
20236
|
+
onClick: () => setShowDocModal(false),
|
|
20237
|
+
style: {
|
|
20238
|
+
cursor: "pointer",
|
|
20239
|
+
padding: "5px"
|
|
20240
|
+
}
|
|
20241
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
20242
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20243
|
+
viewBox: "0 0 24 24",
|
|
20244
|
+
fill: "#FFFFFF",
|
|
20245
|
+
width: "24",
|
|
20246
|
+
height: "24"
|
|
20247
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
20248
|
+
d: "M0 0h24v24H0V0z",
|
|
20249
|
+
fill: "none"
|
|
20250
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
20251
|
+
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"
|
|
20252
|
+
}))),
|
|
20253
|
+
center: true,
|
|
20254
|
+
actionCancelOnSubmit: () => setShowDocModal(false),
|
|
20255
|
+
actionCancelLabel: t("CS_COMMON_CLOSE") || "Close",
|
|
20256
|
+
popupStyles: {
|
|
20257
|
+
width: "80%",
|
|
20258
|
+
maxWidth: "800px"
|
|
20259
|
+
}
|
|
20260
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
20261
|
+
style: {
|
|
20262
|
+
display: "flex",
|
|
20263
|
+
justifyContent: "center",
|
|
20264
|
+
alignItems: "center",
|
|
20265
|
+
padding: "20px",
|
|
20266
|
+
minHeight: "300px"
|
|
20267
|
+
}
|
|
20268
|
+
}, docFileType === "pdf" ? /*#__PURE__*/React.createElement("iframe", {
|
|
20269
|
+
src: docFileUrl,
|
|
20270
|
+
title: "Document Preview",
|
|
20271
|
+
width: "100%",
|
|
20272
|
+
height: "500px",
|
|
20273
|
+
style: {
|
|
20274
|
+
border: "none"
|
|
20275
|
+
}
|
|
20276
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
20277
|
+
src: docFileUrl,
|
|
20278
|
+
alt: "Document Preview",
|
|
20279
|
+
style: {
|
|
20280
|
+
maxWidth: "100%",
|
|
20281
|
+
maxHeight: "500px",
|
|
20282
|
+
objectFit: "contain",
|
|
20283
|
+
borderRadius: "4px"
|
|
20284
|
+
}
|
|
20285
|
+
}))));
|
|
20286
|
+
};
|
|
20287
|
+
|
|
20288
|
+
const WSDjbEmployee = ({
|
|
20289
|
+
config,
|
|
20290
|
+
onSelect,
|
|
20291
|
+
userType,
|
|
20292
|
+
formData,
|
|
20293
|
+
setError,
|
|
20294
|
+
formState,
|
|
20295
|
+
clearErrors
|
|
20296
|
+
}) => {
|
|
20297
|
+
const {
|
|
20298
|
+
t
|
|
20299
|
+
} = useTranslation();
|
|
20300
|
+
const {
|
|
20301
|
+
control,
|
|
20302
|
+
watch,
|
|
20303
|
+
setValue,
|
|
20304
|
+
formState: localFormState
|
|
20305
|
+
} = useForm({
|
|
20306
|
+
defaultValues: (formData === null || formData === void 0 ? void 0 : formData.djbEmployee) || {
|
|
20307
|
+
isDjbEmployee: false,
|
|
20308
|
+
employeeId: "",
|
|
20309
|
+
dor: "",
|
|
20310
|
+
designation: ""
|
|
20311
|
+
}
|
|
20312
|
+
});
|
|
20313
|
+
const formValue = watch();
|
|
20314
|
+
const isDjbEmployee = watch("isDjbEmployee");
|
|
20315
|
+
useEffect(() => {
|
|
20316
|
+
const isDifferent = !lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData.djbEmployee, formValue);
|
|
20317
|
+
if (isDifferent) {
|
|
20318
|
+
const timer = setTimeout(() => {
|
|
20319
|
+
onSelect(config === null || config === void 0 ? void 0 : config.key, {
|
|
20320
|
+
...formValue
|
|
20321
|
+
});
|
|
20322
|
+
}, 200);
|
|
20323
|
+
return () => clearTimeout(timer);
|
|
20324
|
+
}
|
|
20325
|
+
}, [formValue]);
|
|
20326
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
|
|
20327
|
+
title: t("WS_DJB_EMPLOYEE"),
|
|
20328
|
+
defaultOpen: true
|
|
20329
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
20330
|
+
style: {
|
|
20331
|
+
marginBottom: "24px"
|
|
20332
|
+
}
|
|
20333
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
20334
|
+
control: control,
|
|
20335
|
+
name: "isDjbEmployee",
|
|
20336
|
+
render: props => /*#__PURE__*/React.createElement(CheckBox, {
|
|
20337
|
+
label: t("WS_DJB_EMPLOYEE"),
|
|
20338
|
+
checked: props.value,
|
|
20339
|
+
onChange: e => props.onChange(e.target.checked)
|
|
20340
|
+
})
|
|
20341
|
+
})), isDjbEmployee && /*#__PURE__*/React.createElement("div", {
|
|
20342
|
+
className: "formcomposer-section-grid"
|
|
20343
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_EMPLOYEE_ID") + " *"), /*#__PURE__*/React.createElement(Controller, {
|
|
20344
|
+
control: control,
|
|
20345
|
+
name: "employeeId",
|
|
20346
|
+
rules: {
|
|
20347
|
+
required: isDjbEmployee ? t("CORE_COMMON_REQUIRED_ERRMSG") : false
|
|
20348
|
+
},
|
|
20349
|
+
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
20350
|
+
value: props.value,
|
|
20351
|
+
onChange: e => props.onChange(e.target.value),
|
|
20352
|
+
onBlur: props.onBlur
|
|
20353
|
+
})
|
|
20354
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_DATE_OF_RETIREMENT") + " *"), /*#__PURE__*/React.createElement("div", {
|
|
20355
|
+
className: "field"
|
|
20356
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
20357
|
+
control: control,
|
|
20358
|
+
name: "dor",
|
|
20359
|
+
rules: {
|
|
20360
|
+
required: isDjbEmployee ? t("CORE_COMMON_REQUIRED_ERRMSG") : false
|
|
20361
|
+
},
|
|
20362
|
+
render: props => /*#__PURE__*/React.createElement(DatePicker, {
|
|
20363
|
+
value: props.value,
|
|
20364
|
+
onChange: date => props.onChange(date)
|
|
20365
|
+
})
|
|
20366
|
+
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_EMPLOYEE_DESIGNATION") + " *"), /*#__PURE__*/React.createElement("div", {
|
|
20367
|
+
className: "field"
|
|
20368
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
20369
|
+
control: control,
|
|
20370
|
+
name: "designation",
|
|
20371
|
+
rules: {
|
|
20372
|
+
required: isDjbEmployee ? t("CORE_COMMON_REQUIRED_ERRMSG") : false
|
|
20373
|
+
},
|
|
20374
|
+
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
20375
|
+
value: props.value,
|
|
20376
|
+
onChange: e => props.onChange(e.target.value),
|
|
20377
|
+
onBlur: props.onBlur
|
|
20378
|
+
})
|
|
20379
|
+
})))))));
|
|
20380
|
+
};
|
|
20381
|
+
|
|
19160
20382
|
function _extends() {
|
|
19161
20383
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
19162
20384
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -21867,10 +23089,6 @@ const WSCard = () => {
|
|
|
21867
23089
|
}, [wsData]);
|
|
21868
23090
|
let links = [{
|
|
21869
23091
|
label: t("WS_APPLY_NEW_CONNECTION_HOME_CARD_LABEL"),
|
|
21870
|
-
link: `/digit-ui/employee/ws/create-application`,
|
|
21871
|
-
roles: ["WS_CEMP", "SW_CEMP"]
|
|
21872
|
-
}, {
|
|
21873
|
-
label: t("WS_APPLY_OLD_CONNECTION_HOME_CARD_LABEL"),
|
|
21874
23092
|
link: `/digit-ui/employee/ws/old-application`,
|
|
21875
23093
|
roles: ["WS_CEMP", "SW_CEMP"]
|
|
21876
23094
|
}];
|
|
@@ -22816,7 +24034,6 @@ const newConfig = [{
|
|
|
22816
24034
|
hideInCitizen: true
|
|
22817
24035
|
}]
|
|
22818
24036
|
}, {
|
|
22819
|
-
head: "WS_COMMON_PROPERTY_DETAILS",
|
|
22820
24037
|
isEditConnection: true,
|
|
22821
24038
|
isCreateConnection: true,
|
|
22822
24039
|
isModifyConnection: true,
|
|
@@ -22863,8 +24080,6 @@ const newConfig = [{
|
|
|
22863
24080
|
withoutLabel: true
|
|
22864
24081
|
}]
|
|
22865
24082
|
}, {
|
|
22866
|
-
head: "WS_COMMON_CONNECTION_DETAIL",
|
|
22867
|
-
subHead: "WS_CONNECTION_DETAILS_HEADER_SUB_TEXT_LABEL",
|
|
22868
24083
|
isEditConnection: false,
|
|
22869
24084
|
isCreateConnection: true,
|
|
22870
24085
|
body: [{
|
|
@@ -22945,135 +24160,6 @@ const newConfig = [{
|
|
|
22945
24160
|
hideInCitizen: true
|
|
22946
24161
|
}]
|
|
22947
24162
|
}, {
|
|
22948
|
-
head: "WS_COMMON_PROPERTY_DETAILS",
|
|
22949
|
-
isEditConnection: true,
|
|
22950
|
-
isCreateConnection: true,
|
|
22951
|
-
isModifyConnection: true,
|
|
22952
|
-
isEditByConfigConnection: true,
|
|
22953
|
-
body: [{
|
|
22954
|
-
component: "WSPropertySearchNSummary",
|
|
22955
|
-
withoutLabel: true,
|
|
22956
|
-
key: "cpt",
|
|
22957
|
-
type: "component",
|
|
22958
|
-
hideInCitizen: true
|
|
22959
|
-
}]
|
|
22960
|
-
}, {
|
|
22961
|
-
head: "WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER",
|
|
22962
|
-
isEditConnection: true,
|
|
22963
|
-
isCreateConnection: true,
|
|
22964
|
-
isModifyConnection: true,
|
|
22965
|
-
isEditByConfigConnection: true,
|
|
22966
|
-
body: [{
|
|
22967
|
-
type: "component",
|
|
22968
|
-
key: "ConnectionHolderDetails",
|
|
22969
|
-
component: "WSConnectionHolderDetails",
|
|
22970
|
-
withoutLabel: true
|
|
22971
|
-
}]
|
|
22972
|
-
}, {
|
|
22973
|
-
head: "WS_COMMON_CONNECTION_DETAIL",
|
|
22974
|
-
isEditConnection: false,
|
|
22975
|
-
isCreateConnection: false,
|
|
22976
|
-
isModifyConnection: true,
|
|
22977
|
-
body: [{
|
|
22978
|
-
type: "component",
|
|
22979
|
-
key: "connectionDetails",
|
|
22980
|
-
component: "WSActivationConnectionDetails",
|
|
22981
|
-
withoutLabel: true
|
|
22982
|
-
}]
|
|
22983
|
-
}, {
|
|
22984
|
-
head: "WS_ACTIVATION_DETAILS",
|
|
22985
|
-
isEditConnection: false,
|
|
22986
|
-
isCreateConnection: false,
|
|
22987
|
-
isModifyConnection: true,
|
|
22988
|
-
body: [{
|
|
22989
|
-
type: "component",
|
|
22990
|
-
key: "activationDetails",
|
|
22991
|
-
component: "WSActivationPageDetails",
|
|
22992
|
-
withoutLabel: true
|
|
22993
|
-
}]
|
|
22994
|
-
}, {
|
|
22995
|
-
head: "WS_COMMON_CONNECTION_DETAIL",
|
|
22996
|
-
isEditConnection: false,
|
|
22997
|
-
isCreateConnection: true,
|
|
22998
|
-
body: [{
|
|
22999
|
-
type: "component",
|
|
23000
|
-
key: "ConnectionDetails",
|
|
23001
|
-
component: "WSConnectionDetails",
|
|
23002
|
-
withoutLabel: true
|
|
23003
|
-
}]
|
|
23004
|
-
}, {
|
|
23005
|
-
head: "WS_COMMON_CONNECTION_DETAIL",
|
|
23006
|
-
isEditByConfigConnection: true,
|
|
23007
|
-
body: [{
|
|
23008
|
-
type: "component",
|
|
23009
|
-
key: "connectionDetails",
|
|
23010
|
-
component: "WSActivationConnectionDetails",
|
|
23011
|
-
withoutLabel: true
|
|
23012
|
-
}]
|
|
23013
|
-
}, {
|
|
23014
|
-
head: "WS_COMMON_PLUMBER_DETAILS",
|
|
23015
|
-
isEditByConfigConnection: true,
|
|
23016
|
-
isCreateConnection: true,
|
|
23017
|
-
body: [{
|
|
23018
|
-
type: "component",
|
|
23019
|
-
key: "plumberDetails",
|
|
23020
|
-
component: "WSActivationPlumberDetails",
|
|
23021
|
-
withoutLabel: true
|
|
23022
|
-
}]
|
|
23023
|
-
}, {
|
|
23024
|
-
head: "WS_COMMON_ROAD_CUTTING_DETAILS",
|
|
23025
|
-
isEditByConfigConnection: true,
|
|
23026
|
-
isCreateConnection: true,
|
|
23027
|
-
body: [{
|
|
23028
|
-
type: "component",
|
|
23029
|
-
key: "roadCuttingDetails",
|
|
23030
|
-
component: "WSRoadCuttingDetails",
|
|
23031
|
-
withoutLabel: true
|
|
23032
|
-
}]
|
|
23033
|
-
}, {
|
|
23034
|
-
head: "WS_COMMON_DOCS",
|
|
23035
|
-
isEditConnection: true,
|
|
23036
|
-
isCreateConnection: true,
|
|
23037
|
-
isModifyConnection: true,
|
|
23038
|
-
isEditByConfigConnection: true,
|
|
23039
|
-
body: [{
|
|
23040
|
-
type: "component",
|
|
23041
|
-
key: "DocumentsRequired",
|
|
23042
|
-
component: "WSDocumentsEmployee",
|
|
23043
|
-
withoutLabel: true
|
|
23044
|
-
}]
|
|
23045
|
-
}]
|
|
23046
|
-
}, {
|
|
23047
|
-
head: "WS_APP_FOR_WATER_AND_SEWERAGE_LABEL",
|
|
23048
|
-
isEdit: true,
|
|
23049
|
-
hideInCitizen: true,
|
|
23050
|
-
body: [{
|
|
23051
|
-
head: "",
|
|
23052
|
-
isEditConnection: true,
|
|
23053
|
-
isCreateConnection: true,
|
|
23054
|
-
isModifyConnection: true,
|
|
23055
|
-
isEditByConfigConnection: true,
|
|
23056
|
-
body: [{
|
|
23057
|
-
type: "component",
|
|
23058
|
-
key: "InfoLabel",
|
|
23059
|
-
component: "WSInfoLabel",
|
|
23060
|
-
withoutLabel: true
|
|
23061
|
-
}]
|
|
23062
|
-
}, {
|
|
23063
|
-
head: "",
|
|
23064
|
-
isEditConnection: true,
|
|
23065
|
-
isCreateConnection: false,
|
|
23066
|
-
isModifyConnection: true,
|
|
23067
|
-
isEditByConfigConnection: true,
|
|
23068
|
-
body: [{
|
|
23069
|
-
component: "WSEditConnectionDetails",
|
|
23070
|
-
withoutLabel: true,
|
|
23071
|
-
key: "ConnectionDetails",
|
|
23072
|
-
type: "component",
|
|
23073
|
-
hideInCitizen: true
|
|
23074
|
-
}]
|
|
23075
|
-
}, {
|
|
23076
|
-
head: "WS_COMMON_PROPERTY_DETAILS",
|
|
23077
24163
|
isEditConnection: true,
|
|
23078
24164
|
isCreateConnection: true,
|
|
23079
24165
|
isModifyConnection: true,
|
|
@@ -23119,8 +24205,133 @@ const newConfig = [{
|
|
|
23119
24205
|
component: "WSActivationPageDetails",
|
|
23120
24206
|
withoutLabel: true
|
|
23121
24207
|
}]
|
|
24208
|
+
}, {
|
|
24209
|
+
isEditConnection: false,
|
|
24210
|
+
isCreateConnection: true,
|
|
24211
|
+
body: [{
|
|
24212
|
+
type: "component",
|
|
24213
|
+
key: "ConnectionDetails",
|
|
24214
|
+
component: "WSConnectionDetails",
|
|
24215
|
+
withoutLabel: true
|
|
24216
|
+
}]
|
|
24217
|
+
}, {
|
|
24218
|
+
head: "WS_COMMON_CONNECTION_DETAIL",
|
|
24219
|
+
isEditByConfigConnection: true,
|
|
24220
|
+
body: [{
|
|
24221
|
+
type: "component",
|
|
24222
|
+
key: "connectionDetails",
|
|
24223
|
+
component: "WSActivationConnectionDetails",
|
|
24224
|
+
withoutLabel: true
|
|
24225
|
+
}]
|
|
24226
|
+
}, {
|
|
24227
|
+
head: "WS_COMMON_PLUMBER_DETAILS",
|
|
24228
|
+
isEditByConfigConnection: true,
|
|
24229
|
+
isCreateConnection: true,
|
|
24230
|
+
body: [{
|
|
24231
|
+
type: "component",
|
|
24232
|
+
key: "plumberDetails",
|
|
24233
|
+
component: "WSActivationPlumberDetails",
|
|
24234
|
+
withoutLabel: true
|
|
24235
|
+
}]
|
|
24236
|
+
}, {
|
|
24237
|
+
head: "WS_COMMON_ROAD_CUTTING_DETAILS",
|
|
24238
|
+
isEditByConfigConnection: true,
|
|
24239
|
+
isCreateConnection: true,
|
|
24240
|
+
body: [{
|
|
24241
|
+
type: "component",
|
|
24242
|
+
key: "roadCuttingDetails",
|
|
24243
|
+
component: "WSRoadCuttingDetails",
|
|
24244
|
+
withoutLabel: true
|
|
24245
|
+
}]
|
|
24246
|
+
}, {
|
|
24247
|
+
head: "WS_COMMON_DOCS",
|
|
24248
|
+
isEditConnection: true,
|
|
24249
|
+
isCreateConnection: true,
|
|
24250
|
+
isModifyConnection: true,
|
|
24251
|
+
isEditByConfigConnection: true,
|
|
24252
|
+
body: [{
|
|
24253
|
+
type: "component",
|
|
24254
|
+
key: "DocumentsRequired",
|
|
24255
|
+
component: "WSDocumentsEmployee",
|
|
24256
|
+
withoutLabel: true
|
|
24257
|
+
}]
|
|
24258
|
+
}]
|
|
24259
|
+
}, {
|
|
24260
|
+
head: "WS_APP_FOR_WATER_AND_SEWERAGE_LABEL",
|
|
24261
|
+
isEdit: true,
|
|
24262
|
+
hideInCitizen: true,
|
|
24263
|
+
body: [{
|
|
24264
|
+
head: "",
|
|
24265
|
+
isEditConnection: true,
|
|
24266
|
+
isCreateConnection: true,
|
|
24267
|
+
isModifyConnection: true,
|
|
24268
|
+
isEditByConfigConnection: true,
|
|
24269
|
+
body: [{
|
|
24270
|
+
type: "component",
|
|
24271
|
+
key: "InfoLabel",
|
|
24272
|
+
component: "WSInfoLabel",
|
|
24273
|
+
withoutLabel: true
|
|
24274
|
+
}]
|
|
24275
|
+
}, {
|
|
24276
|
+
head: "",
|
|
24277
|
+
isEditConnection: true,
|
|
24278
|
+
isCreateConnection: false,
|
|
24279
|
+
isModifyConnection: true,
|
|
24280
|
+
isEditByConfigConnection: true,
|
|
24281
|
+
body: [{
|
|
24282
|
+
component: "WSEditConnectionDetails",
|
|
24283
|
+
withoutLabel: true,
|
|
24284
|
+
key: "ConnectionDetails",
|
|
24285
|
+
type: "component",
|
|
24286
|
+
hideInCitizen: true
|
|
24287
|
+
}]
|
|
24288
|
+
}, {
|
|
24289
|
+
isEditConnection: true,
|
|
24290
|
+
isCreateConnection: true,
|
|
24291
|
+
isModifyConnection: true,
|
|
24292
|
+
isEditByConfigConnection: true,
|
|
24293
|
+
body: [{
|
|
24294
|
+
component: "WSPropertySearchNSummary",
|
|
24295
|
+
withoutLabel: true,
|
|
24296
|
+
key: "cpt",
|
|
24297
|
+
type: "component",
|
|
24298
|
+
hideInCitizen: true
|
|
24299
|
+
}]
|
|
24300
|
+
}, {
|
|
24301
|
+
head: "WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER",
|
|
24302
|
+
isEditConnection: true,
|
|
24303
|
+
isCreateConnection: true,
|
|
24304
|
+
isModifyConnection: true,
|
|
24305
|
+
isEditByConfigConnection: true,
|
|
24306
|
+
body: [{
|
|
24307
|
+
type: "component",
|
|
24308
|
+
key: "ConnectionHolderDetails",
|
|
24309
|
+
component: "WSConnectionHolderDetails",
|
|
24310
|
+
withoutLabel: true
|
|
24311
|
+
}]
|
|
23122
24312
|
}, {
|
|
23123
24313
|
head: "WS_COMMON_CONNECTION_DETAIL",
|
|
24314
|
+
isEditConnection: false,
|
|
24315
|
+
isCreateConnection: false,
|
|
24316
|
+
isModifyConnection: true,
|
|
24317
|
+
body: [{
|
|
24318
|
+
type: "component",
|
|
24319
|
+
key: "connectionDetails",
|
|
24320
|
+
component: "WSActivationConnectionDetails",
|
|
24321
|
+
withoutLabel: true
|
|
24322
|
+
}]
|
|
24323
|
+
}, {
|
|
24324
|
+
head: "WS_ACTIVATION_DETAILS",
|
|
24325
|
+
isEditConnection: false,
|
|
24326
|
+
isCreateConnection: false,
|
|
24327
|
+
isModifyConnection: true,
|
|
24328
|
+
body: [{
|
|
24329
|
+
type: "component",
|
|
24330
|
+
key: "activationDetails",
|
|
24331
|
+
component: "WSActivationPageDetails",
|
|
24332
|
+
withoutLabel: true
|
|
24333
|
+
}]
|
|
24334
|
+
}, {
|
|
23124
24335
|
isEditConnection: false,
|
|
23125
24336
|
isCreateConnection: true,
|
|
23126
24337
|
body: [{
|
|
@@ -23201,7 +24412,6 @@ const newConfig = [{
|
|
|
23201
24412
|
hideInCitizen: true
|
|
23202
24413
|
}]
|
|
23203
24414
|
}, {
|
|
23204
|
-
head: "WS_COMMON_PROPERTY_DETAILS",
|
|
23205
24415
|
isEditConnection: true,
|
|
23206
24416
|
isCreateConnection: true,
|
|
23207
24417
|
isModifyConnection: true,
|
|
@@ -31151,7 +32361,7 @@ const ViewIcon = () => /*#__PURE__*/React.createElement("svg", {
|
|
|
31151
32361
|
cy: "12",
|
|
31152
32362
|
r: "3"
|
|
31153
32363
|
}));
|
|
31154
|
-
const CameraCaptureModal = ({
|
|
32364
|
+
const CameraCaptureModal$1 = ({
|
|
31155
32365
|
onCapture,
|
|
31156
32366
|
onClose,
|
|
31157
32367
|
t
|
|
@@ -34127,7 +35337,7 @@ const NewApplication = () => {
|
|
|
34127
35337
|
label: showToast === null || showToast === void 0 ? void 0 : showToast.message,
|
|
34128
35338
|
onClose: closeToast,
|
|
34129
35339
|
warning: showToast === null || showToast === void 0 ? void 0 : showToast.warning
|
|
34130
|
-
}) : null, showCamera && /*#__PURE__*/React.createElement(CameraCaptureModal, {
|
|
35340
|
+
}) : null, showCamera && /*#__PURE__*/React.createElement(CameraCaptureModal$1, {
|
|
34131
35341
|
onCapture: handleCapture,
|
|
34132
35342
|
onClose: () => setShowCamera(false),
|
|
34133
35343
|
t: t
|
|
@@ -37053,23 +38263,26 @@ const ActionModal$b = ({
|
|
|
37053
38263
|
isSuccess
|
|
37054
38264
|
} = Digit.Hooks.fsm.useVehiclesSearch({
|
|
37055
38265
|
tenantId,
|
|
38266
|
+
filters: {
|
|
38267
|
+
vendorId: applicationData === null || applicationData === void 0 ? void 0 : applicationData.vendorId
|
|
38268
|
+
},
|
|
37056
38269
|
config: {
|
|
37057
38270
|
enabled: (action === null || action === void 0 ? void 0 : action.state) === "DELIVERY_PENDING" || (action === null || action === void 0 ? void 0 : action.action) === "ASSIGN_VEHICLE_DRIVER"
|
|
37058
38271
|
}
|
|
37059
38272
|
});
|
|
37060
38273
|
let vehicleDescription = [];
|
|
37061
38274
|
vehicleData === null || vehicleData === void 0 ? void 0 : (_vehicleData$vehicle = vehicleData.vehicle) === null || _vehicleData$vehicle === void 0 ? void 0 : (_vehicleData$vehicle$ = _vehicleData$vehicle.filter(item => {
|
|
37062
|
-
var _item$driverData, _item$driver;
|
|
37063
|
-
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);
|
|
38275
|
+
var _item$driverData, _item$driver, _item$owner2;
|
|
38276
|
+
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);
|
|
37064
38277
|
})) === null || _vehicleData$vehicle$ === void 0 ? void 0 : _vehicleData$vehicle$.map(item => {
|
|
37065
|
-
var _item$driverData2, _item$driver2;
|
|
38278
|
+
var _item$driverData2, _item$driver2, _item$owner3;
|
|
37066
38279
|
vehicleDescription.push({
|
|
37067
38280
|
code: item === null || item === void 0 ? void 0 : item.registrationNumber,
|
|
37068
38281
|
name: item === null || item === void 0 ? void 0 : item.registrationNumber,
|
|
37069
38282
|
i18nKey: item === null || item === void 0 ? void 0 : item.registrationNumber,
|
|
37070
38283
|
tankerCapacity: item === null || item === void 0 ? void 0 : item.tankCapacity,
|
|
37071
38284
|
vehicleId: item === null || item === void 0 ? void 0 : item.id,
|
|
37072
|
-
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)
|
|
38285
|
+
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)
|
|
37073
38286
|
});
|
|
37074
38287
|
});
|
|
37075
38288
|
const [config, setConfig] = useState({});
|
|
@@ -45187,9 +46400,7 @@ const OLDApplication = () => {
|
|
|
45187
46400
|
const {
|
|
45188
46401
|
t
|
|
45189
46402
|
} = useTranslation();
|
|
45190
|
-
const
|
|
45191
|
-
state
|
|
45192
|
-
} = useLocation();
|
|
46403
|
+
const location = useLocation();
|
|
45193
46404
|
const history = useHistory();
|
|
45194
46405
|
let filters = getQueryStringParams(location.search);
|
|
45195
46406
|
const [canSubmit, setSubmitValve] = useState(false);
|
|
@@ -45198,9 +46409,26 @@ const OLDApplication = () => {
|
|
|
45198
46409
|
const [appDetails, setAppDetails] = useState({});
|
|
45199
46410
|
const [waterAndSewerageBoth, setWaterAndSewerageBoth] = useState(null);
|
|
45200
46411
|
const [config, setConfig] = useState({
|
|
45201
|
-
head: "",
|
|
45202
46412
|
body: []
|
|
45203
46413
|
});
|
|
46414
|
+
const [currentStep, setCurrentStep] = useState(1);
|
|
46415
|
+
const timelineConfig = [{
|
|
46416
|
+
label: "WS_COMMON_PROPERTY_DETAILS"
|
|
46417
|
+
}, {
|
|
46418
|
+
label: "WS_COMMON_CONNECTION_DETAIL"
|
|
46419
|
+
}, {
|
|
46420
|
+
label: "WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"
|
|
46421
|
+
}, {
|
|
46422
|
+
label: "WS_COMMON_DOCS"
|
|
46423
|
+
}, {
|
|
46424
|
+
label: "WS_COMMON_SUMMARY"
|
|
46425
|
+
}].map((step, index) => ({
|
|
46426
|
+
route: `step-${index + 1}`,
|
|
46427
|
+
timeLine: [{
|
|
46428
|
+
actions: step.label,
|
|
46429
|
+
currentStep: index + 1
|
|
46430
|
+
}]
|
|
46431
|
+
}));
|
|
45204
46432
|
let tenantId = Digit.ULBService.getCurrentTenantId();
|
|
45205
46433
|
if (!tenantId) {
|
|
45206
46434
|
var _Digit$SessionStorage;
|
|
@@ -45231,19 +46459,12 @@ const OLDApplication = () => {
|
|
|
45231
46459
|
sessionStorage.removeItem("FORMSTATE_ERRORS");
|
|
45232
46460
|
}, []);
|
|
45233
46461
|
useEffect(() => {
|
|
45234
|
-
console.log("[WS] useEffect newConfig triggered", {
|
|
45235
|
-
isLoading,
|
|
45236
|
-
newConfig
|
|
45237
|
-
});
|
|
45238
46462
|
if (!isLoading && newConfig) {
|
|
45239
46463
|
const config = newConfig.find(conf => conf.hideInCitizen && conf.isCreate);
|
|
45240
|
-
console.log("[WS] found config", config);
|
|
45241
46464
|
if (config) {
|
|
45242
46465
|
var _config$body;
|
|
45243
|
-
config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_LABEL";
|
|
45244
46466
|
const allCreateSections = (config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.filter(section => section === null || section === void 0 ? void 0 : section.isCreateConnection)) || [];
|
|
45245
|
-
|
|
45246
|
-
const desiredComponentOrder = ["CPTPropertySearchNSummary", "WSConnectionHolderDetails", "WSConnectionDetails", "WSActivationPlumberDetails", "WSRoadCuttingDetails", "WSDocumentsEmployee"];
|
|
46467
|
+
const desiredComponentOrder = ["CPTPropertySearchNSummary", "WSConnectionDetails", "WSConnectionHolderDetails", "CPTPropertyLocationDetails", "PropertyWaterConnection", "WSDjbEmployee", "WSActivationPlumberDetails", "WSRoadCuttingDetails", "WSDocumentsEmployee", "WSBankDetails", "WSDeclaration"];
|
|
45247
46468
|
const reorderedBody = [];
|
|
45248
46469
|
desiredComponentOrder.forEach(compName => {
|
|
45249
46470
|
const section = allCreateSections.find(s => {
|
|
@@ -45252,11 +46473,57 @@ const OLDApplication = () => {
|
|
|
45252
46473
|
return bodyComp === compName || compName === "WSConnectionDetails" && bodyComp === "WSConnectionDetails";
|
|
45253
46474
|
});
|
|
45254
46475
|
if (section) {
|
|
45255
|
-
if (compName === "CPTPropertySearchNSummary") section.head = "WS_COMMON_PROPERTY_DETAILS";
|
|
45256
|
-
if (compName === "WSConnectionHolderDetails") section.head = "WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER";
|
|
45257
|
-
if (compName === "WSConnectionDetails") section.head = "WS_COMMON_CONNECTION_DETAIL";
|
|
45258
|
-
if (compName === "WSDocumentsEmployee") section.head = "WS_COMMON_DOCS";
|
|
45259
46476
|
reorderedBody.push(section);
|
|
46477
|
+
} else if (compName === "CPTPropertyLocationDetails") {
|
|
46478
|
+
reorderedBody.push({
|
|
46479
|
+
isCreateConnection: true,
|
|
46480
|
+
body: [{
|
|
46481
|
+
type: "component",
|
|
46482
|
+
key: "propertyAddress",
|
|
46483
|
+
component: "CPTPropertyLocationDetails",
|
|
46484
|
+
withoutLabel: true
|
|
46485
|
+
}]
|
|
46486
|
+
});
|
|
46487
|
+
} else if (compName === "PropertyWaterConnection") {
|
|
46488
|
+
reorderedBody.push({
|
|
46489
|
+
isCreateConnection: true,
|
|
46490
|
+
body: [{
|
|
46491
|
+
type: "component",
|
|
46492
|
+
key: "useDetails",
|
|
46493
|
+
component: "PropertyWaterConnection",
|
|
46494
|
+
withoutLabel: true
|
|
46495
|
+
}]
|
|
46496
|
+
});
|
|
46497
|
+
} else if (compName === "WSBankDetails") {
|
|
46498
|
+
reorderedBody.push({
|
|
46499
|
+
isCreateConnection: true,
|
|
46500
|
+
body: [{
|
|
46501
|
+
type: "component",
|
|
46502
|
+
key: "bankDetails",
|
|
46503
|
+
component: "WSBankDetails",
|
|
46504
|
+
withoutLabel: true
|
|
46505
|
+
}]
|
|
46506
|
+
});
|
|
46507
|
+
} else if (compName === "WSDeclaration") {
|
|
46508
|
+
reorderedBody.push({
|
|
46509
|
+
isCreateConnection: true,
|
|
46510
|
+
body: [{
|
|
46511
|
+
type: "component",
|
|
46512
|
+
key: "declarationData",
|
|
46513
|
+
component: "WSDeclaration",
|
|
46514
|
+
withoutLabel: true
|
|
46515
|
+
}]
|
|
46516
|
+
});
|
|
46517
|
+
} else if (compName === "WSDjbEmployee") {
|
|
46518
|
+
reorderedBody.push({
|
|
46519
|
+
isCreateConnection: true,
|
|
46520
|
+
body: [{
|
|
46521
|
+
type: "component",
|
|
46522
|
+
key: "djbEmployee",
|
|
46523
|
+
component: "WSDjbEmployee",
|
|
46524
|
+
withoutLabel: true
|
|
46525
|
+
}]
|
|
46526
|
+
});
|
|
45260
46527
|
} else {
|
|
45261
46528
|
console.warn(`[WS] section for component ${compName} not found in allCreateSections`);
|
|
45262
46529
|
}
|
|
@@ -45271,7 +46538,6 @@ const OLDApplication = () => {
|
|
|
45271
46538
|
reorderedBody.push(section);
|
|
45272
46539
|
}
|
|
45273
46540
|
});
|
|
45274
|
-
console.log("[WS] reorderedBody", reorderedBody);
|
|
45275
46541
|
config.body = reorderedBody;
|
|
45276
46542
|
setConfig(config);
|
|
45277
46543
|
}
|
|
@@ -45336,12 +46602,7 @@ const OLDApplication = () => {
|
|
|
45336
46602
|
setShowToast(null);
|
|
45337
46603
|
};
|
|
45338
46604
|
const onSubmit = async data => {
|
|
45339
|
-
var _data$cpt, _propertyDetails$Prop2, _formStateErros$Conne, _Object$keys2, _formStateErros$Conne2, _data$
|
|
45340
|
-
console.log("[WS] onSubmit triggered", {
|
|
45341
|
-
data,
|
|
45342
|
-
propertyId,
|
|
45343
|
-
propertyDetails
|
|
45344
|
-
});
|
|
46605
|
+
var _data$cpt, _propertyDetails$Prop2, _formStateErros$Conne, _Object$keys2, _formStateErros$Conne2, _data$useDetails, _data$ConnectionDetai, _data$ConnectionDetai2, _data$DocumentsRequir, _data$cpt3, _data$ConnectionHolde, _data$ConnectionHolde2, _data$ConnectionHolde3, _data$ConnectionHolde4, _data$ConnectionHolde5, _propertyDetails$Prop4, _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop7, _data$ConnectionHolde6, _data$ConnectionHolde7, _data$cpt4, _data$cpt4$details, _data$cpt4$details$ow, _data$cpt4$details$ow2;
|
|
45345
46606
|
if (!(data !== null && data !== void 0 && (_data$cpt = data.cpt) !== null && _data$cpt !== void 0 && _data$cpt.id) && !(propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop2 = propertyDetails.Properties) !== null && _propertyDetails$Prop2 !== void 0 && _propertyDetails$Prop2[0])) {
|
|
45346
46607
|
var _data$cpt2;
|
|
45347
46608
|
if (!(data !== null && data !== void 0 && (_data$cpt2 = data.cpt) !== null && _data$cpt2 !== void 0 && _data$cpt2.details) || !propertyDetails) {
|
|
@@ -45357,7 +46618,6 @@ const OLDApplication = () => {
|
|
|
45357
46618
|
}
|
|
45358
46619
|
}
|
|
45359
46620
|
const errors = sessionStorage.getItem("FORMSTATE_ERRORS");
|
|
45360
|
-
console.log("[WS] FORMSTATE_ERRORS from sessionStorage:", errors);
|
|
45361
46621
|
const formStateErros = typeof errors === "string" && errors !== "null" ? JSON.parse(errors) : {};
|
|
45362
46622
|
if (Object.keys(formStateErros).length > 0 && !(Object.keys(formStateErros).length == 1 && formStateErros !== null && formStateErros !== void 0 && (_formStateErros$Conne = formStateErros["ConnectionHolderDetails"]) !== null && _formStateErros$Conne !== void 0 && _formStateErros$Conne.type && ((_Object$keys2 = Object.keys(formStateErros === null || formStateErros === void 0 ? void 0 : (_formStateErros$Conne2 = formStateErros["ConnectionHolderDetails"]) === null || _formStateErros$Conne2 === void 0 ? void 0 : _formStateErros$Conne2.type)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length) == 1 && formStateErros["ConnectionHolderDetails"] && Object.values(formStateErros["ConnectionHolderDetails"].type).filter(ob => {
|
|
45363
46623
|
var _ob$ref2;
|
|
@@ -45370,6 +46630,99 @@ const OLDApplication = () => {
|
|
|
45370
46630
|
});
|
|
45371
46631
|
return;
|
|
45372
46632
|
}
|
|
46633
|
+
if (data !== null && data !== void 0 && (_data$useDetails = data.useDetails) !== null && _data$useDetails !== void 0 && _data$useDetails.useDetails) {
|
|
46634
|
+
data.useDetails = {
|
|
46635
|
+
...data.useDetails,
|
|
46636
|
+
...data.useDetails.useDetails
|
|
46637
|
+
};
|
|
46638
|
+
delete data.useDetails.useDetails;
|
|
46639
|
+
}
|
|
46640
|
+
if (data !== null && data !== void 0 && (_data$ConnectionDetai = data.ConnectionDetails) !== null && _data$ConnectionDetai !== void 0 && _data$ConnectionDetai[0]) {
|
|
46641
|
+
const srv = data.ConnectionDetails[0].serviceType;
|
|
46642
|
+
const srvCode = (typeof srv === "object" ? srv === null || srv === void 0 ? void 0 : srv.code : srv) || "WATER";
|
|
46643
|
+
const srvUpper = (srvCode === null || srvCode === void 0 ? void 0 : srvCode.toUpperCase()) || "";
|
|
46644
|
+
data.ConnectionDetails[0].water = srvUpper.includes("WATER") || srvUpper === "BOTH";
|
|
46645
|
+
data.ConnectionDetails[0].sewerage = srvUpper.includes("SEWERAGE") || srvUpper === "BOTH";
|
|
46646
|
+
data.ConnectionDetails[0].service = srvUpper.includes("WATER") && srvUpper.includes("SEWERAGE") ? "Water And Sewerage" : srvUpper.includes("SEWERAGE") ? "Sewerage" : "Water";
|
|
46647
|
+
if (typeof srv !== "object") {
|
|
46648
|
+
data.ConnectionDetails[0].serviceType = {
|
|
46649
|
+
code: srvCode
|
|
46650
|
+
};
|
|
46651
|
+
}
|
|
46652
|
+
} else {
|
|
46653
|
+
data.ConnectionDetails = [{
|
|
46654
|
+
serviceType: {
|
|
46655
|
+
code: "WATER"
|
|
46656
|
+
},
|
|
46657
|
+
water: true,
|
|
46658
|
+
sewerage: false,
|
|
46659
|
+
service: "Water"
|
|
46660
|
+
}];
|
|
46661
|
+
}
|
|
46662
|
+
const connDetail = (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai2 = data.ConnectionDetails) === null || _data$ConnectionDetai2 === void 0 ? void 0 : _data$ConnectionDetai2[0]) || {};
|
|
46663
|
+
if (data !== null && data !== void 0 && data.useDetails) {
|
|
46664
|
+
data.useDetails = {
|
|
46665
|
+
...connDetail,
|
|
46666
|
+
...data.useDetails
|
|
46667
|
+
};
|
|
46668
|
+
}
|
|
46669
|
+
if (data !== null && data !== void 0 && (_data$DocumentsRequir = data.DocumentsRequired) !== null && _data$DocumentsRequir !== void 0 && _data$DocumentsRequir.documents) {
|
|
46670
|
+
const docs = data.DocumentsRequired.documents;
|
|
46671
|
+
const identityDoc = docs.find(d => {
|
|
46672
|
+
var _d$documentType;
|
|
46673
|
+
return d === null || d === void 0 ? void 0 : (_d$documentType = d.documentType) === null || _d$documentType === void 0 ? void 0 : _d$documentType.includes("IDENTITYPROOF");
|
|
46674
|
+
});
|
|
46675
|
+
const ownershipDoc = docs.find(d => {
|
|
46676
|
+
var _d$documentType2, _d$documentType3;
|
|
46677
|
+
return (d === null || d === void 0 ? void 0 : (_d$documentType2 = d.documentType) === null || _d$documentType2 === void 0 ? void 0 : _d$documentType2.includes("ADDRESSPROOF")) || (d === null || d === void 0 ? void 0 : (_d$documentType3 = d.documentType) === null || _d$documentType3 === void 0 ? void 0 : _d$documentType3.includes("OWNERSHIPPROOF"));
|
|
46678
|
+
});
|
|
46679
|
+
const otherDoc = docs.find(d => {
|
|
46680
|
+
var _d$documentType4, _d$documentType5;
|
|
46681
|
+
return !(d !== null && d !== void 0 && (_d$documentType4 = d.documentType) !== null && _d$documentType4 !== void 0 && _d$documentType4.includes("IDENTITYPROOF")) && !(d !== null && d !== void 0 && (_d$documentType5 = d.documentType) !== null && _d$documentType5 !== void 0 && _d$documentType5.includes("ADDRESSPROOF"));
|
|
46682
|
+
});
|
|
46683
|
+
data.documents = {
|
|
46684
|
+
documents: docs,
|
|
46685
|
+
identityProofNumber: (identityDoc === null || identityDoc === void 0 ? void 0 : identityDoc.documentUid) || "",
|
|
46686
|
+
ownershipDocumentNumber: (ownershipDoc === null || ownershipDoc === void 0 ? void 0 : ownershipDoc.documentUid) || "",
|
|
46687
|
+
otherDocumentNumber: (otherDoc === null || otherDoc === void 0 ? void 0 : otherDoc.documentUid) || ""
|
|
46688
|
+
};
|
|
46689
|
+
}
|
|
46690
|
+
if (data !== null && data !== void 0 && data.propertyAddress) {
|
|
46691
|
+
data.propertyAddress = {
|
|
46692
|
+
...data.propertyAddress,
|
|
46693
|
+
pinCode: data.propertyAddress.pincode || data.propertyAddress.pinCode,
|
|
46694
|
+
street: data.propertyAddress.streetName || data.propertyAddress.street,
|
|
46695
|
+
Latitude: data.propertyAddress.latitude || data.propertyAddress.Latitude,
|
|
46696
|
+
Longitude: data.propertyAddress.longitude || data.propertyAddress.Longitude,
|
|
46697
|
+
address: data.propertyAddress.addressLine1 || data.propertyAddress.address,
|
|
46698
|
+
Assembly: data.propertyAddress.assembly || data.propertyAddress.Assembly
|
|
46699
|
+
};
|
|
46700
|
+
if (!data.zro && data.propertyAddress.zro) {
|
|
46701
|
+
data.zro = data.propertyAddress.zro;
|
|
46702
|
+
}
|
|
46703
|
+
}
|
|
46704
|
+
if (data !== null && data !== void 0 && data.bankDetails) {
|
|
46705
|
+
data.bankDetails = {
|
|
46706
|
+
...data.bankDetails,
|
|
46707
|
+
branchName: data.bankDetails.branchName || data.bankDetails.bankBranchName,
|
|
46708
|
+
bankBranchName: data.bankDetails.bankBranchName || data.bankDetails.branchName,
|
|
46709
|
+
bankAccountNumber: data.bankDetails.bankAccountNumber || data.bankDetails.accountNumber,
|
|
46710
|
+
accountNumber: data.bankDetails.accountNumber || data.bankDetails.bankAccountNumber
|
|
46711
|
+
};
|
|
46712
|
+
}
|
|
46713
|
+
if (data !== null && data !== void 0 && data.declarationData) {
|
|
46714
|
+
var _data$declarationData, _data$declarationData2, _data$declarationData3, _data$declarationData4, _data$declarationData5, _data$declarationData6;
|
|
46715
|
+
const declarations = (_data$declarationData = data.declarationData) !== null && _data$declarationData !== void 0 && _data$declarationData.agree ? true : false;
|
|
46716
|
+
data.declaration = {
|
|
46717
|
+
...data.declarationData,
|
|
46718
|
+
submittedBy: typeof ((_data$declarationData2 = data.declarationData) === null || _data$declarationData2 === void 0 ? void 0 : _data$declarationData2.submittedBy) === "object" ? (_data$declarationData3 = data.declarationData) === null || _data$declarationData3 === void 0 ? void 0 : (_data$declarationData4 = _data$declarationData3.submittedBy) === null || _data$declarationData4 === void 0 ? void 0 : _data$declarationData4.code : (_data$declarationData5 = data.declarationData) === null || _data$declarationData5 === void 0 ? void 0 : _data$declarationData5.submittedBy,
|
|
46719
|
+
agree: declarations,
|
|
46720
|
+
declarations: ((_data$declarationData6 = data.declarationData) === null || _data$declarationData6 === void 0 ? void 0 : _data$declarationData6.declarations) || Array(9).fill(declarations)
|
|
46721
|
+
};
|
|
46722
|
+
data.declarationData.submittedBy = data.declaration.submittedBy;
|
|
46723
|
+
data.declarationData.agree = data.declaration.agree;
|
|
46724
|
+
data.declarationData.declarations = data.declaration.declarations;
|
|
46725
|
+
}
|
|
45373
46726
|
if (!(data !== null && data !== void 0 && (_data$cpt3 = data.cpt) !== null && _data$cpt3 !== void 0 && _data$cpt3.details)) {
|
|
45374
46727
|
var _propertyDetails$Prop3;
|
|
45375
46728
|
data.cpt = {
|
|
@@ -45377,30 +46730,27 @@ const OLDApplication = () => {
|
|
|
45377
46730
|
};
|
|
45378
46731
|
}
|
|
45379
46732
|
data.channel = "CITIZEN";
|
|
45380
|
-
const connDetail = (data === null || data === void 0 ? void 0 : (_data$ConnectionDetai = data.ConnectionDetails) === null || _data$ConnectionDetai === void 0 ? void 0 : _data$ConnectionDetai[0]) || {};
|
|
45381
46733
|
data.applicationSelection = {
|
|
45382
|
-
serviceType: {
|
|
46734
|
+
serviceType: (connDetail === null || connDetail === void 0 ? void 0 : connDetail.serviceType) || {
|
|
45383
46735
|
code: "WATER"
|
|
45384
46736
|
},
|
|
45385
|
-
connectionType: {
|
|
45386
|
-
code:
|
|
46737
|
+
connectionType: (connDetail === null || connDetail === void 0 ? void 0 : connDetail.connectionType) || {
|
|
46738
|
+
code: "Metered"
|
|
45387
46739
|
},
|
|
45388
|
-
applicantType: {
|
|
46740
|
+
applicantType: (connDetail === null || connDetail === void 0 ? void 0 : connDetail.applicantType) || {
|
|
45389
46741
|
code: "NONPTPRESSURE"
|
|
45390
46742
|
},
|
|
45391
|
-
categoryType: {
|
|
46743
|
+
categoryType: (connDetail === null || connDetail === void 0 ? void 0 : connDetail.categoryType) || {
|
|
45392
46744
|
code: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde = data.ConnectionHolderDetails) === null || _data$ConnectionHolde === void 0 ? void 0 : (_data$ConnectionHolde2 = _data$ConnectionHolde[0]) === null || _data$ConnectionHolde2 === void 0 ? void 0 : (_data$ConnectionHolde3 = _data$ConnectionHolde2.ownerType) === null || _data$ConnectionHolde3 === void 0 ? void 0 : _data$ConnectionHolde3.code) || (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde4 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde4 === void 0 ? void 0 : (_data$ConnectionHolde5 = _data$ConnectionHolde4[0]) === null || _data$ConnectionHolde5 === void 0 ? void 0 : _data$ConnectionHolde5.ownerType) || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop4 = propertyDetails.Properties) === null || _propertyDetails$Prop4 === void 0 ? void 0 : (_propertyDetails$Prop5 = _propertyDetails$Prop4[0]) === null || _propertyDetails$Prop5 === void 0 ? void 0 : (_propertyDetails$Prop6 = _propertyDetails$Prop5.owners) === null || _propertyDetails$Prop6 === void 0 ? void 0 : (_propertyDetails$Prop7 = _propertyDetails$Prop6[0]) === null || _propertyDetails$Prop7 === void 0 ? void 0 : _propertyDetails$Prop7.ownerType) || "NONE"
|
|
45393
46745
|
},
|
|
46746
|
+
domesticType: connDetail === null || connDetail === void 0 ? void 0 : connDetail.domesticType,
|
|
46747
|
+
departmentType: connDetail === null || connDetail === void 0 ? void 0 : connDetail.departmentType,
|
|
46748
|
+
temporaryConnection: connDetail === null || connDetail === void 0 ? void 0 : connDetail.temporaryType,
|
|
46749
|
+
waterDemandType: connDetail === null || connDetail === void 0 ? void 0 : connDetail.waterDemandType,
|
|
45394
46750
|
ownerContactNumber: (data === null || data === void 0 ? void 0 : (_data$ConnectionHolde6 = data.ConnectionHolderDetails) === null || _data$ConnectionHolde6 === void 0 ? void 0 : (_data$ConnectionHolde7 = _data$ConnectionHolde6[0]) === null || _data$ConnectionHolde7 === void 0 ? void 0 : _data$ConnectionHolde7.mobileNumber) || (data === null || data === void 0 ? void 0 : (_data$cpt4 = data.cpt) === null || _data$cpt4 === void 0 ? void 0 : (_data$cpt4$details = _data$cpt4.details) === null || _data$cpt4$details === void 0 ? void 0 : (_data$cpt4$details$ow = _data$cpt4$details.owners) === null || _data$cpt4$details$ow === void 0 ? void 0 : (_data$cpt4$details$ow2 = _data$cpt4$details$ow[0]) === null || _data$cpt4$details$ow2 === void 0 ? void 0 : _data$cpt4$details$ow2.mobileNumber)
|
|
45395
46751
|
};
|
|
45396
|
-
if (data !== null && data !== void 0 && (_data$ConnectionDetai2 = data.ConnectionDetails) !== null && _data$ConnectionDetai2 !== void 0 && _data$ConnectionDetai2[0]) {
|
|
45397
|
-
data.ConnectionDetails[0].water = true;
|
|
45398
|
-
data.ConnectionDetails[0].sewerage = false;
|
|
45399
|
-
data.ConnectionDetails[0].service = "Water";
|
|
45400
|
-
}
|
|
45401
46752
|
const allDetails = cloneDeep_1(data);
|
|
45402
46753
|
const payload = await createPayloadOfWS(data);
|
|
45403
|
-
console.log("[WS] createPayloadOfWS result:", payload);
|
|
45404
46754
|
if (!(payload !== null && payload !== void 0 && payload.water) && !(payload !== null && payload !== void 0 && payload.sewerage)) {
|
|
45405
46755
|
console.error("[WS] onSubmit EXIT: payload has neither water nor sewerage", payload);
|
|
45406
46756
|
setShowToast({
|
|
@@ -45416,47 +46766,137 @@ const OLDApplication = () => {
|
|
|
45416
46766
|
disconnectRequest: false,
|
|
45417
46767
|
reconnectRequest: false
|
|
45418
46768
|
};
|
|
46769
|
+
let sewerageConnection = {
|
|
46770
|
+
SewerageConnection: payload,
|
|
46771
|
+
disconnectRequest: false,
|
|
46772
|
+
reconnectRequest: false
|
|
46773
|
+
};
|
|
45419
46774
|
if (waterAndSewerageLoader) {
|
|
45420
46775
|
setWaterAndSewerageBoth(true);
|
|
45421
46776
|
sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(true));
|
|
45422
46777
|
} else {
|
|
45423
46778
|
sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(false));
|
|
45424
46779
|
}
|
|
45425
|
-
if (payload !== null && payload !== void 0 && payload.water) {
|
|
45426
|
-
if (waterMutation) {
|
|
46780
|
+
if (payload !== null && payload !== void 0 && payload.water && payload !== null && payload !== void 0 && payload.sewerage) {
|
|
46781
|
+
if (waterMutation && sewerageMutation) {
|
|
45427
46782
|
setIsEnableLoader(true);
|
|
45428
46783
|
await waterMutation(waterConnection, {
|
|
45429
46784
|
onError: error => {
|
|
45430
46785
|
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
|
|
45431
46786
|
setIsEnableLoader(false);
|
|
45432
|
-
console.error("[WS] waterMutation error", error);
|
|
45433
46787
|
setShowToast({
|
|
45434
46788
|
key: "error",
|
|
45435
46789
|
message: (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message) || (error === null || error === void 0 ? void 0 : error.message) || "ERR_UNKNOWN"
|
|
45436
46790
|
});
|
|
45437
46791
|
setTimeout(closeToastOfError, 5000);
|
|
45438
46792
|
},
|
|
46793
|
+
onSuccess: async waterData => {
|
|
46794
|
+
var _waterData$WaterConne;
|
|
46795
|
+
let response = await updatePayloadOfWS(waterData === null || waterData === void 0 ? void 0 : (_waterData$WaterConne = waterData.WaterConnection) === null || _waterData$WaterConne === void 0 ? void 0 : _waterData$WaterConne[0], "WATER");
|
|
46796
|
+
let waterConnectionUpdate = {
|
|
46797
|
+
WaterConnection: response,
|
|
46798
|
+
disconnectRequest: false,
|
|
46799
|
+
reconnectRequest: false
|
|
46800
|
+
};
|
|
46801
|
+
waterUpdateMutation(waterConnectionUpdate, {
|
|
46802
|
+
onError: error => {
|
|
46803
|
+
var _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
|
|
46804
|
+
setIsEnableLoader(false);
|
|
46805
|
+
setShowToast({
|
|
46806
|
+
key: "error",
|
|
46807
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : (_error$response2$data3 = _error$response2$data2[0]) === null || _error$response2$data3 === void 0 ? void 0 : _error$response2$data3.message) || (error === null || error === void 0 ? void 0 : error.message) || "ERR_UNKNOWN"
|
|
46808
|
+
});
|
|
46809
|
+
setTimeout(closeToastOfError, 5000);
|
|
46810
|
+
},
|
|
46811
|
+
onSuccess: async waterUpdateData => {
|
|
46812
|
+
setAppDetails(prev => {
|
|
46813
|
+
var _waterUpdateData$Wate;
|
|
46814
|
+
return {
|
|
46815
|
+
...prev,
|
|
46816
|
+
waterConnection: waterUpdateData === null || waterUpdateData === void 0 ? void 0 : (_waterUpdateData$Wate = waterUpdateData.WaterConnection) === null || _waterUpdateData$Wate === void 0 ? void 0 : _waterUpdateData$Wate[0]
|
|
46817
|
+
};
|
|
46818
|
+
});
|
|
46819
|
+
await sewerageMutation(sewerageConnection, {
|
|
46820
|
+
onError: error => {
|
|
46821
|
+
var _error$response3, _error$response3$data, _error$response3$data2, _error$response3$data3;
|
|
46822
|
+
setIsEnableLoader(false);
|
|
46823
|
+
setShowToast({
|
|
46824
|
+
key: "error",
|
|
46825
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : (_error$response3$data2 = _error$response3$data.Errors) === null || _error$response3$data2 === void 0 ? void 0 : (_error$response3$data3 = _error$response3$data2[0]) === null || _error$response3$data3 === void 0 ? void 0 : _error$response3$data3.message) || (error === null || error === void 0 ? void 0 : error.message) || "ERR_UNKNOWN"
|
|
46826
|
+
});
|
|
46827
|
+
setTimeout(closeToastOfError, 5000);
|
|
46828
|
+
},
|
|
46829
|
+
onSuccess: async sewerageData => {
|
|
46830
|
+
var _sewerageData$Sewerag;
|
|
46831
|
+
let response = await updatePayloadOfWS(sewerageData === null || sewerageData === void 0 ? void 0 : (_sewerageData$Sewerag = sewerageData.SewerageConnections) === null || _sewerageData$Sewerag === void 0 ? void 0 : _sewerageData$Sewerag[0], "SEWERAGE");
|
|
46832
|
+
let sewerageConnectionUpdate = {
|
|
46833
|
+
SewerageConnection: response,
|
|
46834
|
+
disconnectRequest: false,
|
|
46835
|
+
reconnectRequest: false
|
|
46836
|
+
};
|
|
46837
|
+
await sewerageUpdateMutation(sewerageConnectionUpdate, {
|
|
46838
|
+
onError: error => {
|
|
46839
|
+
var _error$response4, _error$response4$data, _error$response4$data2, _error$response4$data3;
|
|
46840
|
+
setIsEnableLoader(false);
|
|
46841
|
+
setShowToast({
|
|
46842
|
+
key: "error",
|
|
46843
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.Errors) === null || _error$response4$data2 === void 0 ? void 0 : (_error$response4$data3 = _error$response4$data2[0]) === null || _error$response4$data3 === void 0 ? void 0 : _error$response4$data3.message) || (error === null || error === void 0 ? void 0 : error.message) || "ERR_UNKNOWN"
|
|
46844
|
+
});
|
|
46845
|
+
setTimeout(closeToastOfError, 5000);
|
|
46846
|
+
},
|
|
46847
|
+
onSuccess: async sewerageUpdateData => {
|
|
46848
|
+
var _waterUpdateData$Wate2, _waterUpdateData$Wate3, _sewerageUpdateData$S2, _sewerageUpdateData$S3;
|
|
46849
|
+
setAppDetails(prev => {
|
|
46850
|
+
var _sewerageUpdateData$S;
|
|
46851
|
+
return {
|
|
46852
|
+
...prev,
|
|
46853
|
+
sewerageConnection: sewerageUpdateData === null || sewerageUpdateData === void 0 ? void 0 : (_sewerageUpdateData$S = sewerageUpdateData.SewerageConnections) === null || _sewerageUpdateData$S === void 0 ? void 0 : _sewerageUpdateData$S[0]
|
|
46854
|
+
};
|
|
46855
|
+
});
|
|
46856
|
+
clearSessionFormData();
|
|
46857
|
+
history.push(`/digit-ui/employee/ws/ws-response?applicationNumber=${waterUpdateData === null || waterUpdateData === void 0 ? void 0 : (_waterUpdateData$Wate2 = waterUpdateData.WaterConnection) === null || _waterUpdateData$Wate2 === void 0 ? void 0 : (_waterUpdateData$Wate3 = _waterUpdateData$Wate2[0]) === null || _waterUpdateData$Wate3 === void 0 ? void 0 : _waterUpdateData$Wate3.applicationNo}&applicationNumber1=${sewerageUpdateData === null || sewerageUpdateData === void 0 ? void 0 : (_sewerageUpdateData$S2 = sewerageUpdateData.SewerageConnections) === null || _sewerageUpdateData$S2 === void 0 ? void 0 : (_sewerageUpdateData$S3 = _sewerageUpdateData$S2[0]) === null || _sewerageUpdateData$S3 === void 0 ? void 0 : _sewerageUpdateData$S3.applicationNo}`);
|
|
46858
|
+
}
|
|
46859
|
+
});
|
|
46860
|
+
}
|
|
46861
|
+
});
|
|
46862
|
+
}
|
|
46863
|
+
});
|
|
46864
|
+
}
|
|
46865
|
+
});
|
|
46866
|
+
}
|
|
46867
|
+
} else if (payload !== null && payload !== void 0 && payload.water && !(payload !== null && payload !== void 0 && payload.sewerage)) {
|
|
46868
|
+
if (waterMutation) {
|
|
46869
|
+
setIsEnableLoader(true);
|
|
46870
|
+
await waterMutation(waterConnection, {
|
|
46871
|
+
onError: error => {
|
|
46872
|
+
var _error$response5, _error$response5$data, _error$response5$data2, _error$response5$data3;
|
|
46873
|
+
setIsEnableLoader(false);
|
|
46874
|
+
console.error("[WS] waterMutation error", error);
|
|
46875
|
+
setShowToast({
|
|
46876
|
+
key: "error",
|
|
46877
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : (_error$response5$data = _error$response5.data) === null || _error$response5$data === void 0 ? void 0 : (_error$response5$data2 = _error$response5$data.Errors) === null || _error$response5$data2 === void 0 ? void 0 : (_error$response5$data3 = _error$response5$data2[0]) === null || _error$response5$data3 === void 0 ? void 0 : _error$response5$data3.message) || (error === null || error === void 0 ? void 0 : error.message) || "ERR_UNKNOWN"
|
|
46878
|
+
});
|
|
46879
|
+
setTimeout(closeToastOfError, 5000);
|
|
46880
|
+
},
|
|
45439
46881
|
onSuccess: async data => {
|
|
45440
46882
|
var _data$WaterConnection;
|
|
45441
|
-
console.log("[WS] waterMutation success", data);
|
|
45442
46883
|
let response = await updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : _data$WaterConnection[0], "WATER");
|
|
45443
46884
|
let waterConnectionUpdate = {
|
|
45444
46885
|
WaterConnection: response
|
|
45445
46886
|
};
|
|
45446
46887
|
waterUpdateMutation(waterConnectionUpdate, {
|
|
45447
46888
|
onError: error => {
|
|
45448
|
-
var _error$
|
|
46889
|
+
var _error$response6, _error$response6$data, _error$response6$data2, _error$response6$data3;
|
|
45449
46890
|
setIsEnableLoader(false);
|
|
45450
46891
|
console.error("[WS] waterUpdateMutation error", error);
|
|
45451
46892
|
setShowToast({
|
|
45452
46893
|
key: "error",
|
|
45453
|
-
message: (error === null || error === void 0 ? void 0 : (_error$
|
|
46894
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response6 = error.response) === null || _error$response6 === void 0 ? void 0 : (_error$response6$data = _error$response6.data) === null || _error$response6$data === void 0 ? void 0 : (_error$response6$data2 = _error$response6$data.Errors) === null || _error$response6$data2 === void 0 ? void 0 : (_error$response6$data3 = _error$response6$data2[0]) === null || _error$response6$data3 === void 0 ? void 0 : _error$response6$data3.message) || (error === null || error === void 0 ? void 0 : error.message) || "ERR_UNKNOWN"
|
|
45454
46895
|
});
|
|
45455
46896
|
setTimeout(closeToastOfError, 5000);
|
|
45456
46897
|
},
|
|
45457
46898
|
onSuccess: data => {
|
|
45458
46899
|
var _data$WaterConnection3, _data$WaterConnection4;
|
|
45459
|
-
console.log("[WS] waterUpdateMutation success", data);
|
|
45460
46900
|
setAppDetails(prev => {
|
|
45461
46901
|
var _data$WaterConnection2;
|
|
45462
46902
|
return {
|
|
@@ -45471,6 +46911,53 @@ const OLDApplication = () => {
|
|
|
45471
46911
|
}
|
|
45472
46912
|
});
|
|
45473
46913
|
}
|
|
46914
|
+
} else if (payload !== null && payload !== void 0 && payload.sewerage && !(payload !== null && payload !== void 0 && payload.water)) {
|
|
46915
|
+
if (sewerageMutation) {
|
|
46916
|
+
setIsEnableLoader(true);
|
|
46917
|
+
await sewerageMutation(sewerageConnection, {
|
|
46918
|
+
onError: error => {
|
|
46919
|
+
var _error$response7, _error$response7$data, _error$response7$data2, _error$response7$data3;
|
|
46920
|
+
setIsEnableLoader(false);
|
|
46921
|
+
console.error("[WS] sewerageMutation error", error);
|
|
46922
|
+
setShowToast({
|
|
46923
|
+
key: "error",
|
|
46924
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response7 = error.response) === null || _error$response7 === void 0 ? void 0 : (_error$response7$data = _error$response7.data) === null || _error$response7$data === void 0 ? void 0 : (_error$response7$data2 = _error$response7$data.Errors) === null || _error$response7$data2 === void 0 ? void 0 : (_error$response7$data3 = _error$response7$data2[0]) === null || _error$response7$data3 === void 0 ? void 0 : _error$response7$data3.message) || (error === null || error === void 0 ? void 0 : error.message) || "ERR_UNKNOWN"
|
|
46925
|
+
});
|
|
46926
|
+
setTimeout(closeToastOfError, 5000);
|
|
46927
|
+
},
|
|
46928
|
+
onSuccess: async data => {
|
|
46929
|
+
var _data$SewerageConnect;
|
|
46930
|
+
let response = await updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : _data$SewerageConnect[0], "SEWERAGE");
|
|
46931
|
+
let sewerageConnectionUpdate = {
|
|
46932
|
+
SewerageConnection: response
|
|
46933
|
+
};
|
|
46934
|
+
await sewerageUpdateMutation(sewerageConnectionUpdate, {
|
|
46935
|
+
onError: error => {
|
|
46936
|
+
var _error$response8, _error$response8$data, _error$response8$data2, _error$response8$data3;
|
|
46937
|
+
setIsEnableLoader(false);
|
|
46938
|
+
console.error("[WS] sewerageUpdateMutation error", error);
|
|
46939
|
+
setShowToast({
|
|
46940
|
+
key: "error",
|
|
46941
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response8 = error.response) === null || _error$response8 === void 0 ? void 0 : (_error$response8$data = _error$response8.data) === null || _error$response8$data === void 0 ? void 0 : (_error$response8$data2 = _error$response8$data.Errors) === null || _error$response8$data2 === void 0 ? void 0 : (_error$response8$data3 = _error$response8$data2[0]) === null || _error$response8$data3 === void 0 ? void 0 : _error$response8$data3.message) || (error === null || error === void 0 ? void 0 : error.message) || "ERR_UNKNOWN"
|
|
46942
|
+
});
|
|
46943
|
+
setTimeout(closeToastOfError, 5000);
|
|
46944
|
+
},
|
|
46945
|
+
onSuccess: data => {
|
|
46946
|
+
var _data$SewerageConnect3, _data$SewerageConnect4;
|
|
46947
|
+
setAppDetails(prev => {
|
|
46948
|
+
var _data$SewerageConnect2;
|
|
46949
|
+
return {
|
|
46950
|
+
...prev,
|
|
46951
|
+
sewerageConnection: data === null || data === void 0 ? void 0 : (_data$SewerageConnect2 = data.SewerageConnections) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2[0]
|
|
46952
|
+
};
|
|
46953
|
+
});
|
|
46954
|
+
clearSessionFormData();
|
|
46955
|
+
history.push(`/digit-ui/employee/ws/ws-response?applicationNumber1=${data === null || data === void 0 ? void 0 : (_data$SewerageConnect3 = data.SewerageConnections) === null || _data$SewerageConnect3 === void 0 ? void 0 : (_data$SewerageConnect4 = _data$SewerageConnect3[0]) === null || _data$SewerageConnect4 === void 0 ? void 0 : _data$SewerageConnect4.applicationNo}`);
|
|
46956
|
+
}
|
|
46957
|
+
});
|
|
46958
|
+
}
|
|
46959
|
+
});
|
|
46960
|
+
}
|
|
45474
46961
|
}
|
|
45475
46962
|
};
|
|
45476
46963
|
const closeToast = () => {
|
|
@@ -45480,16 +46967,20 @@ const OLDApplication = () => {
|
|
|
45480
46967
|
return /*#__PURE__*/React.createElement(Loader, null);
|
|
45481
46968
|
}
|
|
45482
46969
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
45483
|
-
|
|
45484
|
-
|
|
45485
|
-
|
|
45486
|
-
|
|
46970
|
+
className: "employee-form-section-wrapper"
|
|
46971
|
+
}, /*#__PURE__*/React.createElement(VerticalTimeline, {
|
|
46972
|
+
config: timelineConfig,
|
|
46973
|
+
currentActiveIndex: currentStep - 1,
|
|
46974
|
+
showFinalStep: false
|
|
46975
|
+
}), /*#__PURE__*/React.createElement(FormComposer, {
|
|
45487
46976
|
config: config.body,
|
|
45488
46977
|
userType: "employee",
|
|
45489
46978
|
onFormValueChange: onFormValueChange,
|
|
45490
46979
|
label: creatingWaterApplicationLoading || creatingSewerageApplicationLoading || updatingWaterApplicationLoading || updatingSewerageApplicationLoading ? t("CS_COMMON_SUBMITTING") : t("CS_COMMON_SUBMIT"),
|
|
45491
46980
|
onSubmit: onSubmit,
|
|
45492
46981
|
defaultValues: sessionFormData,
|
|
46982
|
+
noCard: true,
|
|
46983
|
+
noBreakLine: true,
|
|
45493
46984
|
cardFormWrapperClassName: "new-application-card"
|
|
45494
46985
|
}), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
45495
46986
|
isDleteBtn: true,
|
|
@@ -45498,7 +46989,7 @@ const OLDApplication = () => {
|
|
|
45498
46989
|
label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
|
|
45499
46990
|
onClose: closeToast,
|
|
45500
46991
|
isWarning: showToast === null || showToast === void 0 ? void 0 : showToast.isWarning
|
|
45501
|
-
}));
|
|
46992
|
+
})));
|
|
45502
46993
|
};
|
|
45503
46994
|
|
|
45504
46995
|
const WSModule = ({
|
|
@@ -45524,6 +47015,7 @@ const WSModule = ({
|
|
|
45524
47015
|
});
|
|
45525
47016
|
Digit.SessionStorage.set("WS_TENANTS", tenants);
|
|
45526
47017
|
Digit.SessionStorage.set("PT_TENANTS", tenants);
|
|
47018
|
+
initWSComponents();
|
|
45527
47019
|
if (isLoading) {
|
|
45528
47020
|
return /*#__PURE__*/React.createElement(Loader, null);
|
|
45529
47021
|
}
|
|
@@ -45607,6 +47099,9 @@ const componentsToRegister = {
|
|
|
45607
47099
|
WSDisconnectAcknowledgement,
|
|
45608
47100
|
WSRestorationAcknowledgement: WSDisconnectAcknowledgement$1,
|
|
45609
47101
|
WSDisconnectionAppDetails,
|
|
47102
|
+
WSBankDetails,
|
|
47103
|
+
WSDeclaration,
|
|
47104
|
+
WSDjbEmployee,
|
|
45610
47105
|
WSInbox,
|
|
45611
47106
|
BillAmendmentCard,
|
|
45612
47107
|
WSSearchApplication: SearchApplication,
|