@djb25/digit-ui-module-ws 1.0.67 → 1.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1959 -571
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1959 -571
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -10914,6 +10914,11 @@ const BILLSBreadCrumbs = _ref => {
|
|
|
10914
10914
|
path: "/digit-ui/employee/ws/required-documents",
|
|
10915
10915
|
label: t("ES_COMMON_WS_DOCUMENTS_REQUIRED"),
|
|
10916
10916
|
show: location.pathname.includes("/required-documents") ? true : false
|
|
10917
|
+
}, {
|
|
10918
|
+
path: "" + (location === null || location === void 0 ? void 0 : location.pathname) + location.search,
|
|
10919
|
+
label: t("WS_MUTATION_CONNECTION_LABEL"),
|
|
10920
|
+
show: location.pathname.includes("/mutation-application") ? true : false,
|
|
10921
|
+
isBack: true
|
|
10917
10922
|
}, {
|
|
10918
10923
|
path: requestParam ? "/digit-ui/employee/ws/bill-amendment?" + requestParam : "/digit-ui/employee/ws/bill-amendment",
|
|
10919
10924
|
label: t("WS_BILL_AMEND_APP"),
|
|
@@ -11248,6 +11253,9 @@ const App$1 = _ref2 => {
|
|
|
11248
11253
|
let actions = [];
|
|
11249
11254
|
const getAction = flow => {
|
|
11250
11255
|
switch (flow) {
|
|
11256
|
+
case "MUTATION":
|
|
11257
|
+
actions = ['WS_MUTATION_DETAILS', 'WS_MUTATION_NEW_CONSUMER', 'WS_MUTATION_DOCUMENTS', 'WS_MUTATION_PREVIEW'];
|
|
11258
|
+
break;
|
|
11251
11259
|
default:
|
|
11252
11260
|
actions = ['WS_COMMON_PROPERTY_DETAILS', 'WS_COMMON_CONNECTION_DETAIL', 'WS_COMMON_DOCUMENT_DETAILS', 'WS_COMMON_SUMMARY'];
|
|
11253
11261
|
}
|
|
@@ -17403,18 +17411,35 @@ const UploadFileDigiLocker = props => {
|
|
|
17403
17411
|
const _useState4 = useState(null),
|
|
17404
17412
|
showToast = _useState4[0],
|
|
17405
17413
|
setShowToast = _useState4[1];
|
|
17414
|
+
const _useState5 = useState(null),
|
|
17415
|
+
digiLockerPreviewUrl = _useState5[0],
|
|
17416
|
+
setDigiLockerPreviewUrl = _useState5[1];
|
|
17417
|
+
const _useState6 = useState(false),
|
|
17418
|
+
showDigiLockerPreview = _useState6[0],
|
|
17419
|
+
setShowDigiLockerPreview = _useState6[1];
|
|
17420
|
+
const _useState7 = useState(null),
|
|
17421
|
+
digiLockerFilename = _useState7[0],
|
|
17422
|
+
setDigiLockerFilename = _useState7[1];
|
|
17406
17423
|
const user_type = Digit.SessionStorage.get("userType");
|
|
17407
17424
|
const _Digit$Hooks$createTo = Digit.Hooks.createTokenAPI("document");
|
|
17408
17425
|
let extraStyles = {};
|
|
17409
17426
|
const handleChange = () => {
|
|
17410
|
-
if (inpRef.current.files[0]) {
|
|
17427
|
+
if (inpRef.current.files && inpRef.current.files[0]) {
|
|
17411
17428
|
setHasFile(true);
|
|
17412
17429
|
setprevSate(inpRef.current.files[0]);
|
|
17413
|
-
} else
|
|
17430
|
+
} else if (!digiLockerFilename) {
|
|
17431
|
+
setHasFile(false);
|
|
17432
|
+
}
|
|
17414
17433
|
};
|
|
17415
17434
|
extraStyles = getCitizenStyles("OBPS");
|
|
17416
17435
|
const handleDelete = () => {
|
|
17417
17436
|
inpRef.current.value = "";
|
|
17437
|
+
if (digiLockerPreviewUrl) {
|
|
17438
|
+
URL.revokeObjectURL(digiLockerPreviewUrl);
|
|
17439
|
+
setDigiLockerPreviewUrl(null);
|
|
17440
|
+
}
|
|
17441
|
+
setDigiLockerFilename(null);
|
|
17442
|
+
setHasFile(false);
|
|
17418
17443
|
props.onDelete();
|
|
17419
17444
|
};
|
|
17420
17445
|
const handleEmpty = () => {
|
|
@@ -17429,14 +17454,20 @@ const UploadFileDigiLocker = props => {
|
|
|
17429
17454
|
}
|
|
17430
17455
|
useEffect(() => handleEmpty(), [inpRef === null || inpRef === void 0 ? void 0 : (_inpRef$current = inpRef.current) === null || _inpRef$current === void 0 ? void 0 : _inpRef$current.files]);
|
|
17431
17456
|
useEffect(() => handleChange(), [props.message]);
|
|
17457
|
+
useEffect(() => {
|
|
17458
|
+
return () => {
|
|
17459
|
+
if (digiLockerPreviewUrl) URL.revokeObjectURL(digiLockerPreviewUrl);
|
|
17460
|
+
};
|
|
17461
|
+
}, [digiLockerPreviewUrl]);
|
|
17432
17462
|
const dataURItoBlob = dataURI => {
|
|
17433
|
-
var
|
|
17463
|
+
var b64Data = dataURI.split(",")[1].replace(/\s/g, "");
|
|
17464
|
+
var binary = atob(b64Data);
|
|
17434
17465
|
var array = [];
|
|
17435
17466
|
for (var i = 0; i < binary.length; i++) {
|
|
17436
17467
|
array.push(binary.charCodeAt(i));
|
|
17437
17468
|
}
|
|
17438
17469
|
return new Blob([new Uint8Array(array)], {
|
|
17439
|
-
type:
|
|
17470
|
+
type: "application/pdf"
|
|
17440
17471
|
});
|
|
17441
17472
|
};
|
|
17442
17473
|
const fetchDigiLockerDocuments = function (e) {
|
|
@@ -17454,9 +17485,10 @@ const UploadFileDigiLocker = props => {
|
|
|
17454
17485
|
let TokenReq = {
|
|
17455
17486
|
authToken: digiLockerToken
|
|
17456
17487
|
};
|
|
17488
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17457
17489
|
return Promise.resolve(Digit.DigiLockerService.issueDoc({
|
|
17458
17490
|
TokenReq
|
|
17459
|
-
})).then(function (res1) {
|
|
17491
|
+
}, tenantId)).then(function (res1) {
|
|
17460
17492
|
if (!res1 || !res1.IssuedDoc) {
|
|
17461
17493
|
setShowToast({
|
|
17462
17494
|
error: true,
|
|
@@ -17477,7 +17509,7 @@ const UploadFileDigiLocker = props => {
|
|
|
17477
17509
|
};
|
|
17478
17510
|
const aliases = DOCTYPE_ALIASES[doctype] || [doctype];
|
|
17479
17511
|
let uri = res1.IssuedDoc.filter(item => aliases.some(alias => item.doctype === alias));
|
|
17480
|
-
const
|
|
17512
|
+
const _temp7 = function () {
|
|
17481
17513
|
if ((uri === null || uri === void 0 ? void 0 : uri.length) > 0) {
|
|
17482
17514
|
const uriStr = uri[0].uri || "";
|
|
17483
17515
|
const parts = uriStr.split("-");
|
|
@@ -17489,48 +17521,116 @@ const UploadFileDigiLocker = props => {
|
|
|
17489
17521
|
authToken: digiLockerToken,
|
|
17490
17522
|
id: uriStr
|
|
17491
17523
|
};
|
|
17492
|
-
|
|
17524
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17525
|
+
return Promise.resolve(Digit.DigiLockerService.uriFile({
|
|
17493
17526
|
TokenReq: TokenReqNew
|
|
17494
|
-
})).then(function (res2) {
|
|
17495
|
-
|
|
17496
|
-
|
|
17497
|
-
|
|
17527
|
+
}, tenantId)).then(function (res2) {
|
|
17528
|
+
var _res2$headers;
|
|
17529
|
+
function _temp6() {
|
|
17530
|
+
const filename = doctype + "_" + (uri[0].name || "document") + ".pdf";
|
|
17531
|
+
if (blobData && blobData.size > 0) convertToFile(e, blobData, filename);else setShowToast({
|
|
17498
17532
|
error: true,
|
|
17499
17533
|
label: "Failed to read document from DigiLocker."
|
|
17500
17534
|
});
|
|
17501
17535
|
}
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17506
|
-
|
|
17507
|
-
|
|
17508
|
-
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
|
|
17512
|
-
|
|
17513
|
-
|
|
17514
|
-
|
|
17515
|
-
|
|
17516
|
-
|
|
17517
|
-
|
|
17518
|
-
|
|
17536
|
+
console.log("[DigiLocker] uriFile response:", res2);
|
|
17537
|
+
let blobData = null;
|
|
17538
|
+
let contentType = (res2 === null || res2 === void 0 ? void 0 : (_res2$headers = res2.headers) === null || _res2$headers === void 0 ? void 0 : _res2$headers["content-type"]) || "";
|
|
17539
|
+
let isJsonString = contentType.includes("application/json");
|
|
17540
|
+
const _temp5 = function () {
|
|
17541
|
+
if (res2 !== null && res2 !== void 0 && res2.data) {
|
|
17542
|
+
function _temp4() {
|
|
17543
|
+
if (!blobData) {
|
|
17544
|
+
console.log("[DigiLocker] Treating response as raw binary PDF fallback.");
|
|
17545
|
+
blobData = new Blob([(res2 === null || res2 === void 0 ? void 0 : res2.data) || res2], {
|
|
17546
|
+
type: "application/pdf"
|
|
17547
|
+
});
|
|
17548
|
+
}
|
|
17549
|
+
}
|
|
17550
|
+
const firstBytes = new Uint8Array(res2.data, 0, 3);
|
|
17551
|
+
if (firstBytes[0] === 34 && firstBytes[1] === 37 && firstBytes[2] === 80) {
|
|
17552
|
+
isJsonString = true;
|
|
17553
|
+
}
|
|
17554
|
+
const _temp3 = function () {
|
|
17555
|
+
if (isJsonString) {
|
|
17556
|
+
const decoder = new TextDecoder("utf-8");
|
|
17557
|
+
const jsonString = decoder.decode(res2.data);
|
|
17558
|
+
const jsonObj = JSON.parse(jsonString);
|
|
17559
|
+
const findFileStoreId = obj => {
|
|
17560
|
+
if (!obj || typeof obj !== "object") return null;
|
|
17561
|
+
for (let key in obj) {
|
|
17562
|
+
if (key.toLowerCase() === "filestoreid") return obj[key];
|
|
17563
|
+
const found = findFileStoreId(obj[key]);
|
|
17564
|
+
if (found) return found;
|
|
17565
|
+
}
|
|
17566
|
+
return null;
|
|
17567
|
+
};
|
|
17568
|
+
const findBase64 = obj => {
|
|
17569
|
+
if (!obj || typeof obj !== "object") return null;
|
|
17570
|
+
for (let key in obj) {
|
|
17571
|
+
if (["doccontent", "filecontent", "base64"].includes(key.toLowerCase())) return obj[key];
|
|
17572
|
+
const found = findBase64(obj[key]);
|
|
17573
|
+
if (found && typeof found === "string") return found;
|
|
17574
|
+
}
|
|
17575
|
+
return null;
|
|
17576
|
+
};
|
|
17577
|
+
const _temp2 = function () {
|
|
17578
|
+
if (typeof jsonObj === "string") {
|
|
17579
|
+
if (jsonObj.startsWith("%PDF")) {
|
|
17580
|
+
console.log("[DigiLocker] Response is a literal PDF string. Trying to salvage corrupted bytes...");
|
|
17581
|
+
const len = jsonObj.length;
|
|
17582
|
+
const arr = new Uint8Array(len);
|
|
17583
|
+
for (let i = 0; i < len; i++) {
|
|
17584
|
+
arr[i] = jsonObj.charCodeAt(i) & 0xFF;
|
|
17519
17585
|
}
|
|
17520
|
-
|
|
17586
|
+
blobData = new Blob([arr], {
|
|
17587
|
+
type: "application/pdf"
|
|
17588
|
+
});
|
|
17589
|
+
} else {
|
|
17590
|
+
const dataUri = jsonObj.startsWith("data:") ? jsonObj : "data:application/pdf;base64," + jsonObj;
|
|
17591
|
+
try {
|
|
17592
|
+
blobData = dataURItoBlob(dataUri);
|
|
17593
|
+
} catch (e) {
|
|
17594
|
+
console.error("Failed to parse string as base64", e);
|
|
17595
|
+
}
|
|
17596
|
+
}
|
|
17521
17597
|
} else {
|
|
17522
|
-
|
|
17523
|
-
|
|
17524
|
-
|
|
17598
|
+
const fsId = findFileStoreId(jsonObj);
|
|
17599
|
+
const _temp = function () {
|
|
17600
|
+
if (fsId) {
|
|
17601
|
+
console.log("[DigiLocker] Got fileStoreId from JSON:", fsId);
|
|
17602
|
+
return Promise.resolve(Digit.UploadServices.FileFetchbyid(fsId, Digit.ULBService.getStateId())).then(function (fileRes) {
|
|
17603
|
+
var _fileRes$headers;
|
|
17604
|
+
blobData = (fileRes === null || fileRes === void 0 ? void 0 : fileRes.data) instanceof Blob ? fileRes.data : new Blob([(fileRes === null || fileRes === void 0 ? void 0 : fileRes.data) || ""], {
|
|
17605
|
+
type: (fileRes === null || fileRes === void 0 ? void 0 : (_fileRes$headers = fileRes.headers) === null || _fileRes$headers === void 0 ? void 0 : _fileRes$headers["content-type"]) || "application/pdf"
|
|
17606
|
+
});
|
|
17607
|
+
});
|
|
17608
|
+
} else {
|
|
17609
|
+
const b64 = findBase64(jsonObj);
|
|
17610
|
+
if (b64 && typeof b64 === "string") {
|
|
17611
|
+
console.log("[DigiLocker] Got base64 content from JSON field");
|
|
17612
|
+
const dataUri = b64.startsWith("data:") ? b64 : "data:application/pdf;base64," + b64;
|
|
17613
|
+
blobData = dataURItoBlob(dataUri);
|
|
17614
|
+
} else {
|
|
17615
|
+
console.log("[DigiLocker] JSON did not contain filestoreid or base64.");
|
|
17616
|
+
}
|
|
17617
|
+
}
|
|
17618
|
+
}();
|
|
17619
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
17525
17620
|
}
|
|
17526
17621
|
}();
|
|
17527
|
-
if (
|
|
17622
|
+
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
17623
|
+
} else {
|
|
17624
|
+
console.log("[DigiLocker] Treating response as raw binary PDF.", contentType);
|
|
17625
|
+
blobData = new Blob([res2.data], {
|
|
17626
|
+
type: "application/pdf"
|
|
17627
|
+
});
|
|
17528
17628
|
}
|
|
17529
17629
|
}();
|
|
17530
|
-
|
|
17630
|
+
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
|
|
17531
17631
|
}
|
|
17532
17632
|
}();
|
|
17533
|
-
return
|
|
17633
|
+
return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
|
|
17534
17634
|
});
|
|
17535
17635
|
} else {
|
|
17536
17636
|
setShowToast({
|
|
@@ -17539,7 +17639,7 @@ const UploadFileDigiLocker = props => {
|
|
|
17539
17639
|
});
|
|
17540
17640
|
}
|
|
17541
17641
|
}();
|
|
17542
|
-
if (
|
|
17642
|
+
if (_temp7 && _temp7.then) return _temp7.then(function () {});
|
|
17543
17643
|
});
|
|
17544
17644
|
}, function (error) {
|
|
17545
17645
|
console.error("DigiLocker Fetch Error:", error);
|
|
@@ -17556,6 +17656,8 @@ const UploadFileDigiLocker = props => {
|
|
|
17556
17656
|
if (filename === void 0) {
|
|
17557
17657
|
filename = "document.pdf";
|
|
17558
17658
|
}
|
|
17659
|
+
const previewUrl = URL.createObjectURL(blob);
|
|
17660
|
+
setDigiLockerPreviewUrl(previewUrl);
|
|
17559
17661
|
var reader = new FileReader();
|
|
17560
17662
|
reader.readAsDataURL(blob);
|
|
17561
17663
|
reader.onloadend = function () {
|
|
@@ -17564,6 +17666,8 @@ const UploadFileDigiLocker = props => {
|
|
|
17564
17666
|
let newFile = new File([blobData], filename, {
|
|
17565
17667
|
type: "application/pdf"
|
|
17566
17668
|
});
|
|
17669
|
+
setDigiLockerFilename(filename);
|
|
17670
|
+
setHasFile(true);
|
|
17567
17671
|
props.onUpload(e, newFile);
|
|
17568
17672
|
};
|
|
17569
17673
|
};
|
|
@@ -17628,7 +17732,30 @@ const UploadFileDigiLocker = props => {
|
|
|
17628
17732
|
style: {
|
|
17629
17733
|
width: "20px"
|
|
17630
17734
|
}
|
|
17631
|
-
}), t("CS_COMMON_FETCH_FROM_DIGILOCKER")))
|
|
17735
|
+
}), t("CS_COMMON_FETCH_FROM_DIGILOCKER"))), digiLockerPreviewUrl && /*#__PURE__*/React.createElement("button", {
|
|
17736
|
+
type: "button",
|
|
17737
|
+
title: t("WS_VIEW_DOCUMENT") || "Preview document",
|
|
17738
|
+
onClick: () => setShowDigiLockerPreview(true),
|
|
17739
|
+
style: {
|
|
17740
|
+
background: "none",
|
|
17741
|
+
border: "none",
|
|
17742
|
+
cursor: "pointer",
|
|
17743
|
+
display: "flex",
|
|
17744
|
+
alignItems: "center",
|
|
17745
|
+
padding: "4px"
|
|
17746
|
+
}
|
|
17747
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
17748
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17749
|
+
height: "22",
|
|
17750
|
+
viewBox: "0 0 24 24",
|
|
17751
|
+
width: "22",
|
|
17752
|
+
fill: "#00497e"
|
|
17753
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
17754
|
+
d: "M0 0h24v24H0z",
|
|
17755
|
+
fill: "none"
|
|
17756
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
17757
|
+
d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
|
|
17758
|
+
})))), props === null || props === void 0 ? void 0 : (_props$uploadedFiles = props.uploadedFiles) === null || _props$uploadedFiles === void 0 ? void 0 : _props$uploadedFiles.map((file, index) => {
|
|
17632
17759
|
var _extraStyles3;
|
|
17633
17760
|
const fileDetailsData = file[1];
|
|
17634
17761
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -17640,7 +17767,7 @@ const UploadFileDigiLocker = props => {
|
|
|
17640
17767
|
text: file[0],
|
|
17641
17768
|
onClick: e => props === null || props === void 0 ? void 0 : props.removeTargetedFile(fileDetailsData, e)
|
|
17642
17769
|
}));
|
|
17643
|
-
}), !hasFile || props.error ? /*#__PURE__*/React.createElement("h2", {
|
|
17770
|
+
}), !hasFile && !props.file || props.error ? /*#__PURE__*/React.createElement("h2", {
|
|
17644
17771
|
className: "file-upload-status"
|
|
17645
17772
|
}, props.message) : /*#__PURE__*/React.createElement("div", {
|
|
17646
17773
|
className: "tag-container",
|
|
@@ -17651,7 +17778,7 @@ const UploadFileDigiLocker = props => {
|
|
|
17651
17778
|
}, /*#__PURE__*/React.createElement("span", {
|
|
17652
17779
|
className: "text",
|
|
17653
17780
|
style: extraStyles ? (_extraStyles6 = extraStyles) === null || _extraStyles6 === void 0 ? void 0 : _extraStyles6.textStyles : null
|
|
17654
|
-
}, typeof ((_inpRef$current$files = inpRef.current.files[0]) === null || _inpRef$current$files === void 0 ? void 0 : _inpRef$current$files.name) !== "undefined" && !(props !== null && props !== void 0 && props.file) ? (_inpRef$current$files2 = inpRef.current.files[0]) === null || _inpRef$current$files2 === void 0 ? void 0 : _inpRef$current$files2.name : (_props$file = props.file) === null || _props$file === void 0 ? void 0 : _props$file.name), /*#__PURE__*/React.createElement("span", {
|
|
17781
|
+
}, digiLockerFilename ? digiLockerFilename : typeof ((_inpRef$current$files = inpRef.current.files[0]) === null || _inpRef$current$files === void 0 ? void 0 : _inpRef$current$files.name) !== "undefined" && !(props !== null && props !== void 0 && props.file) ? (_inpRef$current$files2 = inpRef.current.files[0]) === null || _inpRef$current$files2 === void 0 ? void 0 : _inpRef$current$files2.name : (_props$file = props.file) === null || _props$file === void 0 ? void 0 : _props$file.name), /*#__PURE__*/React.createElement("span", {
|
|
17655
17782
|
onClick: () => handleDelete(),
|
|
17656
17783
|
style: extraStyles ? (_extraStyles7 = extraStyles) === null || _extraStyles7 === void 0 ? void 0 : _extraStyles7.closeIconStyles : null
|
|
17657
17784
|
}, /*#__PURE__*/React.createElement(Close, {
|
|
@@ -17687,7 +17814,72 @@ const UploadFileDigiLocker = props => {
|
|
|
17687
17814
|
warning: showToast.warning,
|
|
17688
17815
|
label: t(showToast.label),
|
|
17689
17816
|
onClose: () => setShowToast(null)
|
|
17690
|
-
})
|
|
17817
|
+
}), showDigiLockerPreview && digiLockerPreviewUrl && /*#__PURE__*/React.createElement("div", {
|
|
17818
|
+
style: {
|
|
17819
|
+
position: "fixed",
|
|
17820
|
+
top: 0,
|
|
17821
|
+
left: 0,
|
|
17822
|
+
width: "100%",
|
|
17823
|
+
height: "100%",
|
|
17824
|
+
backgroundColor: "rgba(0,0,0,0.7)",
|
|
17825
|
+
zIndex: 9999,
|
|
17826
|
+
display: "flex",
|
|
17827
|
+
flexDirection: "column",
|
|
17828
|
+
alignItems: "center",
|
|
17829
|
+
justifyContent: "center"
|
|
17830
|
+
},
|
|
17831
|
+
onClick: () => setShowDigiLockerPreview(false)
|
|
17832
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17833
|
+
style: {
|
|
17834
|
+
background: "#fff",
|
|
17835
|
+
borderRadius: "8px",
|
|
17836
|
+
width: "85%",
|
|
17837
|
+
maxWidth: "860px",
|
|
17838
|
+
overflow: "hidden",
|
|
17839
|
+
boxShadow: "0 8px 32px rgba(0,0,0,0.4)"
|
|
17840
|
+
},
|
|
17841
|
+
onClick: ev => ev.stopPropagation()
|
|
17842
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17843
|
+
style: {
|
|
17844
|
+
display: "flex",
|
|
17845
|
+
justifyContent: "space-between",
|
|
17846
|
+
alignItems: "center",
|
|
17847
|
+
padding: "12px 16px",
|
|
17848
|
+
background: "#00497e"
|
|
17849
|
+
}
|
|
17850
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
17851
|
+
style: {
|
|
17852
|
+
color: "#fff",
|
|
17853
|
+
fontWeight: "bold",
|
|
17854
|
+
fontSize: "14px"
|
|
17855
|
+
}
|
|
17856
|
+
}, t("WS_VIEW_DOCUMENT") || "View Document"), /*#__PURE__*/React.createElement("button", {
|
|
17857
|
+
type: "button",
|
|
17858
|
+
onClick: () => setShowDigiLockerPreview(false),
|
|
17859
|
+
style: {
|
|
17860
|
+
background: "none",
|
|
17861
|
+
border: "none",
|
|
17862
|
+
cursor: "pointer",
|
|
17863
|
+
padding: "4px"
|
|
17864
|
+
}
|
|
17865
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
17866
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17867
|
+
viewBox: "0 0 24 24",
|
|
17868
|
+
fill: "#fff",
|
|
17869
|
+
width: "22",
|
|
17870
|
+
height: "22"
|
|
17871
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
17872
|
+
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"
|
|
17873
|
+
})))), /*#__PURE__*/React.createElement("embed", {
|
|
17874
|
+
src: digiLockerPreviewUrl,
|
|
17875
|
+
type: "application/pdf",
|
|
17876
|
+
width: "100%",
|
|
17877
|
+
height: "520px",
|
|
17878
|
+
style: {
|
|
17879
|
+
border: "none",
|
|
17880
|
+
display: "block"
|
|
17881
|
+
}
|
|
17882
|
+
}))));
|
|
17691
17883
|
};
|
|
17692
17884
|
|
|
17693
17885
|
const DIGILOCKER_SUPPORTED_CODES = ["AADHAAR", "AADHAR", "DRIVING", "DRVLC", "PAN"];
|
|
@@ -48024,8 +48216,7 @@ const ApplicationDetails$1 = () => {
|
|
|
48024
48216
|
})), /*#__PURE__*/React.createElement("div", {
|
|
48025
48217
|
style: {
|
|
48026
48218
|
flex: "2 1 500px",
|
|
48027
|
-
minWidth: "300px"
|
|
48028
|
-
overflowY: "auto"
|
|
48219
|
+
minWidth: "300px"
|
|
48029
48220
|
}
|
|
48030
48221
|
}, /*#__PURE__*/React.createElement(ApplicationDetails, {
|
|
48031
48222
|
applicationDetails: applicationDetails,
|
|
@@ -48058,11 +48249,11 @@ const ApplicationDetails$1 = () => {
|
|
|
48058
48249
|
};
|
|
48059
48250
|
|
|
48060
48251
|
const GetConnectionDetails = () => {
|
|
48061
|
-
var _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a3, _applicationDetails$a4, _applicationDetails$a5, _applicationDetails$a6, _applicationDetails$a7, _applicationDetails$a8, _applicationDetails$a9, _applicationDetails$a0, _applicationDetails$a1, _applicationDetails$a10, _applicationDetails$a11, _applicationDetails$a12, _mdmsCommonmastersDat, _applicationDetails$a14, _applicationDetails$a18, _applicationDetails$
|
|
48252
|
+
var _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a3, _applicationDetails$a4, _applicationDetails$a5, _applicationDetails$a6, _applicationDetails$a7, _applicationDetails$a8, _applicationDetails$a9, _applicationDetails$a0, _applicationDetails$a1, _applicationDetails$a10, _applicationDetails$a11, _applicationDetails$a12, _mdmsCommonmastersDat, _applicationDetails$a14, _applicationDetails$a18, _applicationDetails$f7, _applicationDetails$p3, _applicationDetails$p4, _applicationDetails$a19, _applicationDetails$a20, _applicationDetails$a21, _applicationDetails$f8, _applicationDetails$f9;
|
|
48062
48253
|
const getBillSearch = function () {
|
|
48063
48254
|
try {
|
|
48064
|
-
const _temp = function (_applicationDetails$
|
|
48065
|
-
if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
48255
|
+
const _temp = function (_applicationDetails$f0) {
|
|
48256
|
+
if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f0 = applicationDetails.fetchBillsData) === null || _applicationDetails$f0 === void 0 ? void 0 : _applicationDetails$f0.length) > 0) {
|
|
48066
48257
|
var _applicationDetails$a22;
|
|
48067
48258
|
const service = serviceType === "WATER" ? "WS" : "SW";
|
|
48068
48259
|
let wsSearchFilters = {
|
|
@@ -48192,7 +48383,7 @@ const GetConnectionDetails = () => {
|
|
|
48192
48383
|
const checkApplicationStatus = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a14 = applicationDetails.applicationData) === null || _applicationDetails$a14 === void 0 ? void 0 : _applicationDetails$a14.status) === "Active" ? true : false;
|
|
48193
48384
|
const checkWorkflow = applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.isApplicationApproved;
|
|
48194
48385
|
const getModifyConnectionButton = () => {
|
|
48195
|
-
var _applicationDetails$f, _applicationDetails$a15, _applicationDetails$p;
|
|
48386
|
+
var _applicationDetails$f, _applicationDetails$f2, _applicationDetails$a15, _applicationDetails$p;
|
|
48196
48387
|
if (!checkApplicationStatus) {
|
|
48197
48388
|
setshowActionToast({
|
|
48198
48389
|
key: "error",
|
|
@@ -48200,7 +48391,7 @@ const GetConnectionDetails = () => {
|
|
|
48200
48391
|
});
|
|
48201
48392
|
return;
|
|
48202
48393
|
}
|
|
48203
|
-
if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f = applicationDetails.fetchBillsData[0]) === null || _applicationDetails$
|
|
48394
|
+
if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f = applicationDetails.fetchBillsData) === null || _applicationDetails$f === void 0 ? void 0 : (_applicationDetails$f2 = _applicationDetails$f[0]) === null || _applicationDetails$f2 === void 0 ? void 0 : _applicationDetails$f2.totalAmount) > 0) {
|
|
48204
48395
|
setshowActionToast({
|
|
48205
48396
|
key: "error",
|
|
48206
48397
|
label: "WS_DUE_AMOUNT_SHOULD_BE_ZERO"
|
|
@@ -48213,7 +48404,7 @@ const GetConnectionDetails = () => {
|
|
|
48213
48404
|
}));
|
|
48214
48405
|
};
|
|
48215
48406
|
const getMutationButton = () => {
|
|
48216
|
-
var _applicationDetails$
|
|
48407
|
+
var _applicationDetails$f3, _applicationDetails$f4, _applicationDetails$a16, _applicationDetails$p2;
|
|
48217
48408
|
if (!checkApplicationStatus) {
|
|
48218
48409
|
setshowActionToast({
|
|
48219
48410
|
key: "error",
|
|
@@ -48221,7 +48412,7 @@ const GetConnectionDetails = () => {
|
|
|
48221
48412
|
});
|
|
48222
48413
|
return;
|
|
48223
48414
|
}
|
|
48224
|
-
if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
48415
|
+
if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f3 = applicationDetails.fetchBillsData) === null || _applicationDetails$f3 === void 0 ? void 0 : (_applicationDetails$f4 = _applicationDetails$f3[0]) === null || _applicationDetails$f4 === void 0 ? void 0 : _applicationDetails$f4.totalAmount) > 0) {
|
|
48225
48416
|
setshowActionToast({
|
|
48226
48417
|
key: "error",
|
|
48227
48418
|
label: "WS_DUE_AMOUNT_SHOULD_BE_ZERO"
|
|
@@ -48275,9 +48466,9 @@ const GetConnectionDetails = () => {
|
|
|
48275
48466
|
label: "WORKFLOW_IN_PROGRESS"
|
|
48276
48467
|
});
|
|
48277
48468
|
} else {
|
|
48278
|
-
var _billData$, _applicationDetails$
|
|
48469
|
+
var _billData$, _applicationDetails$f5;
|
|
48279
48470
|
console.log("due", due, applicationDetails);
|
|
48280
|
-
if (((_billData$ = billData[0]) === null || _billData$ === void 0 ? void 0 : _billData$.status) === "ACTIVE" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
48471
|
+
if (((_billData$ = billData[0]) === null || _billData$ === void 0 ? void 0 : _billData$.status) === "ACTIVE" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f5 = applicationDetails.fetchBillsData) === null || _applicationDetails$f5 === void 0 ? void 0 : _applicationDetails$f5.length) <= 0 || due == "0" || due < 0) {
|
|
48281
48472
|
Digit.SessionStorage.set("WS_DISCONNECTION", applicationDetails);
|
|
48282
48473
|
history.push("" + pathname);
|
|
48283
48474
|
} else {
|
|
@@ -48293,8 +48484,8 @@ const GetConnectionDetails = () => {
|
|
|
48293
48484
|
label: "WORKFLOW_IN_PROGRESS"
|
|
48294
48485
|
});
|
|
48295
48486
|
} else {
|
|
48296
|
-
var _billData$2, _applicationDetails$
|
|
48297
|
-
if (((_billData$2 = billData[0]) === null || _billData$2 === void 0 ? void 0 : _billData$2.status) === "ACTIVE" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
48487
|
+
var _billData$2, _applicationDetails$f6;
|
|
48488
|
+
if (((_billData$2 = billData[0]) === null || _billData$2 === void 0 ? void 0 : _billData$2.status) === "ACTIVE" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f6 = applicationDetails.fetchBillsData) === null || _applicationDetails$f6 === void 0 ? void 0 : _applicationDetails$f6.length) <= 0 || due === "0") {
|
|
48298
48489
|
Digit.SessionStorage.set("WS_DISCONNECTION", applicationDetails);
|
|
48299
48490
|
history.push("" + pathname);
|
|
48300
48491
|
} else {
|
|
@@ -48329,7 +48520,7 @@ const GetConnectionDetails = () => {
|
|
|
48329
48520
|
label: t("WS_CONNECTION_DETAILS"),
|
|
48330
48521
|
onClick: () => downloadConnectionDetails()
|
|
48331
48522
|
};
|
|
48332
|
-
if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
48523
|
+
if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f7 = applicationDetails.fetchBillsData) === null || _applicationDetails$f7 === void 0 ? void 0 : _applicationDetails$f7.length) > 0) dowloadOptions = [appFeeDownloadReceipt, connectionDetailsReceipt];else dowloadOptions = [connectionDetailsReceipt];
|
|
48333
48524
|
const Close = () => /*#__PURE__*/React.createElement("svg", {
|
|
48334
48525
|
xmlns: "http://www.w3.org/2000/svg",
|
|
48335
48526
|
viewBox: "0 0 24 24",
|
|
@@ -48452,7 +48643,7 @@ const GetConnectionDetails = () => {
|
|
|
48452
48643
|
className: "modal-header-ws"
|
|
48453
48644
|
}, t("WS_CLEAR_DUES_DISCONNECTION_SUB_HEADER_LABEL"), " "), /*#__PURE__*/React.createElement("div", {
|
|
48454
48645
|
className: "modal-body-ws"
|
|
48455
|
-
}, /*#__PURE__*/React.createElement("span", null, t("WS_COMMON_TABLE_COL_AMT_DUE_LABEL"), ": \u20B9", due ? due : applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
48646
|
+
}, /*#__PURE__*/React.createElement("span", null, t("WS_COMMON_TABLE_COL_AMT_DUE_LABEL"), ": \u20B9", due ? due : applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$f8 = applicationDetails.fetchBillsData) === null || _applicationDetails$f8 === void 0 ? void 0 : (_applicationDetails$f9 = _applicationDetails$f8[0]) === null || _applicationDetails$f9 === void 0 ? void 0 : _applicationDetails$f9.totalAmount))) : null, showActionToast && /*#__PURE__*/React.createElement(Toast, {
|
|
48456
48647
|
error: showActionToast.key,
|
|
48457
48648
|
label: t("" + showActionToast.label),
|
|
48458
48649
|
onClose: closeBillToast
|
|
@@ -50238,49 +50429,230 @@ const EditModifyApplication = () => {
|
|
|
50238
50429
|
}));
|
|
50239
50430
|
};
|
|
50240
50431
|
|
|
50241
|
-
const
|
|
50242
|
-
var
|
|
50432
|
+
const Step1_ExistingConnection = _ref => {
|
|
50433
|
+
var _appData$connectionHo, _propertyData$Propert, _propertyData$Propert2, _appData$property, _propertyAddress$loca;
|
|
50434
|
+
let applicationDetails = _ref.applicationDetails,
|
|
50435
|
+
propertyId = _ref.propertyId;
|
|
50436
|
+
const getMaskedName = name => {
|
|
50437
|
+
if (!name) return "NA";
|
|
50438
|
+
return name.split("").map((char, index) => index % 2 === 1 && char !== " " ? "*" : char).join("");
|
|
50439
|
+
};
|
|
50440
|
+
const getMaskedPhone = phone => {
|
|
50441
|
+
if (!phone || phone.length < 10) return "NA";
|
|
50442
|
+
return "******" + phone.slice(-4);
|
|
50443
|
+
};
|
|
50444
|
+
const appData = (applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData) || {};
|
|
50445
|
+
const connectionNo = (appData === null || appData === void 0 ? void 0 : appData.connectionNo) || "NA";
|
|
50446
|
+
const meterId = (appData === null || appData === void 0 ? void 0 : appData.meterId) || "NA";
|
|
50447
|
+
const connectionStatus = (appData === null || appData === void 0 ? void 0 : appData.status) || "NA";
|
|
50448
|
+
const holderDetails = (appData === null || appData === void 0 ? void 0 : (_appData$connectionHo = appData.connectionHolders) === null || _appData$connectionHo === void 0 ? void 0 : _appData$connectionHo[0]) || {};
|
|
50449
|
+
const registeredName = getMaskedName(holderDetails === null || holderDetails === void 0 ? void 0 : holderDetails.name);
|
|
50450
|
+
const registeredPhone = getMaskedPhone(holderDetails === null || holderDetails === void 0 ? void 0 : holderDetails.mobileNumber);
|
|
50451
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
50452
|
+
const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
|
|
50453
|
+
filters: {
|
|
50454
|
+
propertyIds: propertyId
|
|
50455
|
+
},
|
|
50456
|
+
tenantId
|
|
50457
|
+
}, {
|
|
50458
|
+
enabled: !!propertyId
|
|
50459
|
+
}),
|
|
50460
|
+
propertyData = _Digit$Hooks$pt$usePr.data;
|
|
50461
|
+
const propertyAddress = (propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert = propertyData.Properties) === null || _propertyData$Propert === void 0 ? void 0 : (_propertyData$Propert2 = _propertyData$Propert[0]) === null || _propertyData$Propert2 === void 0 ? void 0 : _propertyData$Propert2.address) || (appData === null || appData === void 0 ? void 0 : (_appData$property = appData.property) === null || _appData$property === void 0 ? void 0 : _appData$property.address) || {};
|
|
50462
|
+
const formattedAddress = [(propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.houseNo) || (propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.doorNo), propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.buildingName, propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.street, propertyAddress === null || propertyAddress === void 0 ? void 0 : (_propertyAddress$loca = propertyAddress.locality) === null || _propertyAddress$loca === void 0 ? void 0 : _propertyAddress$loca.name, propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.city, propertyAddress === null || propertyAddress === void 0 ? void 0 : propertyAddress.pincode].filter(Boolean).join(", ") || "NA";
|
|
50463
|
+
const missingFields = [];
|
|
50464
|
+
if (connectionNo === "NA") missingFields.push("Connection Number");
|
|
50465
|
+
if (registeredName === "NA") missingFields.push("Owner Name");
|
|
50466
|
+
if (formattedAddress === "NA") missingFields.push("Property Address");
|
|
50467
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
50468
|
+
style: {
|
|
50469
|
+
marginBottom: "20px"
|
|
50470
|
+
}
|
|
50471
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
50472
|
+
style: {
|
|
50473
|
+
padding: "16px",
|
|
50474
|
+
backgroundColor: "#fff3cd",
|
|
50475
|
+
color: "#856404",
|
|
50476
|
+
borderRadius: "8px",
|
|
50477
|
+
border: "1px solid #ffeeba",
|
|
50478
|
+
marginBottom: "20px",
|
|
50479
|
+
display: "flex",
|
|
50480
|
+
alignItems: "center"
|
|
50481
|
+
}
|
|
50482
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
50483
|
+
style: {
|
|
50484
|
+
marginRight: "8px",
|
|
50485
|
+
fontSize: "20px"
|
|
50486
|
+
}
|
|
50487
|
+
}, "\u2139\uFE0F"), /*#__PURE__*/React.createElement("span", {
|
|
50488
|
+
style: {
|
|
50489
|
+
fontWeight: "500"
|
|
50490
|
+
}
|
|
50491
|
+
}, "Name Change / Mutation is limited to changing the name of the consumer/account holder on the existing water connection. It does not constitute or imply transfer of property ownership.")), missingFields.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
50492
|
+
style: {
|
|
50493
|
+
padding: "12px 16px",
|
|
50494
|
+
backgroundColor: "#fdecea",
|
|
50495
|
+
color: "#611a15",
|
|
50496
|
+
borderRadius: "8px",
|
|
50497
|
+
border: "1px solid #f5c6cb",
|
|
50498
|
+
marginBottom: "16px",
|
|
50499
|
+
display: "flex",
|
|
50500
|
+
alignItems: "center"
|
|
50501
|
+
}
|
|
50502
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
50503
|
+
style: {
|
|
50504
|
+
marginRight: "8px",
|
|
50505
|
+
fontSize: "18px"
|
|
50506
|
+
}
|
|
50507
|
+
}, "\u26A0\uFE0F"), /*#__PURE__*/React.createElement("span", {
|
|
50508
|
+
style: {
|
|
50509
|
+
fontWeight: "500",
|
|
50510
|
+
fontSize: "14px"
|
|
50511
|
+
}
|
|
50512
|
+
}, "Please verify the connection data before proceeding.")), /*#__PURE__*/React.createElement("div", {
|
|
50513
|
+
style: {
|
|
50514
|
+
display: "flex",
|
|
50515
|
+
alignItems: "center",
|
|
50516
|
+
marginBottom: "16px"
|
|
50517
|
+
}
|
|
50518
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
50519
|
+
style: {
|
|
50520
|
+
fontSize: "24px",
|
|
50521
|
+
marginRight: "8px"
|
|
50522
|
+
}
|
|
50523
|
+
}, "\uD83C\uDFE2"), /*#__PURE__*/React.createElement("h2", {
|
|
50524
|
+
style: {
|
|
50525
|
+
fontSize: "20px",
|
|
50526
|
+
fontWeight: "700",
|
|
50527
|
+
margin: 0
|
|
50528
|
+
}
|
|
50529
|
+
}, "1. Existing Connection & Current Consumer Details.")), /*#__PURE__*/React.createElement("div", {
|
|
50530
|
+
style: {
|
|
50531
|
+
padding: "16px",
|
|
50532
|
+
backgroundColor: "#f9f9f9",
|
|
50533
|
+
borderRadius: "8px",
|
|
50534
|
+
borderLeft: "4px solid #00497e"
|
|
50535
|
+
}
|
|
50536
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
50537
|
+
style: {
|
|
50538
|
+
display: "grid",
|
|
50539
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
50540
|
+
gap: "16px"
|
|
50541
|
+
}
|
|
50542
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
50543
|
+
style: {
|
|
50544
|
+
color: "#555",
|
|
50545
|
+
fontSize: "14px",
|
|
50546
|
+
marginBottom: "4px"
|
|
50547
|
+
}
|
|
50548
|
+
}, "Connection Number"), /*#__PURE__*/React.createElement("div", {
|
|
50549
|
+
style: {
|
|
50550
|
+
fontWeight: "bold"
|
|
50551
|
+
}
|
|
50552
|
+
}, connectionNo)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
50553
|
+
style: {
|
|
50554
|
+
color: "#555",
|
|
50555
|
+
fontSize: "14px",
|
|
50556
|
+
marginBottom: "4px"
|
|
50557
|
+
}
|
|
50558
|
+
}, "Current Owner Name"), /*#__PURE__*/React.createElement("div", {
|
|
50559
|
+
style: {
|
|
50560
|
+
fontWeight: "bold"
|
|
50561
|
+
}
|
|
50562
|
+
}, registeredName)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
50563
|
+
style: {
|
|
50564
|
+
color: "#555",
|
|
50565
|
+
fontSize: "14px",
|
|
50566
|
+
marginBottom: "4px"
|
|
50567
|
+
}
|
|
50568
|
+
}, "Property Address"), /*#__PURE__*/React.createElement("div", {
|
|
50569
|
+
style: {
|
|
50570
|
+
fontWeight: "bold"
|
|
50571
|
+
}
|
|
50572
|
+
}, formattedAddress)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
50573
|
+
style: {
|
|
50574
|
+
color: "#555",
|
|
50575
|
+
fontSize: "14px",
|
|
50576
|
+
marginBottom: "4px"
|
|
50577
|
+
}
|
|
50578
|
+
}, "Connection Status"), /*#__PURE__*/React.createElement("div", {
|
|
50579
|
+
style: {
|
|
50580
|
+
fontWeight: "bold",
|
|
50581
|
+
color: (connectionStatus === null || connectionStatus === void 0 ? void 0 : connectionStatus.toLowerCase()) === "active" ? "#28a745" : "#dc3545"
|
|
50582
|
+
}
|
|
50583
|
+
}, connectionStatus)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
50584
|
+
style: {
|
|
50585
|
+
color: "#555",
|
|
50586
|
+
fontSize: "14px",
|
|
50587
|
+
marginBottom: "4px"
|
|
50588
|
+
}
|
|
50589
|
+
}, "Meter Number"), /*#__PURE__*/React.createElement("div", {
|
|
50590
|
+
style: {
|
|
50591
|
+
fontWeight: "bold"
|
|
50592
|
+
}
|
|
50593
|
+
}, meterId)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
50594
|
+
style: {
|
|
50595
|
+
color: "#555",
|
|
50596
|
+
fontSize: "14px",
|
|
50597
|
+
marginBottom: "4px"
|
|
50598
|
+
}
|
|
50599
|
+
}, "Mobile Number"), /*#__PURE__*/React.createElement("div", {
|
|
50600
|
+
style: {
|
|
50601
|
+
fontWeight: "bold"
|
|
50602
|
+
}
|
|
50603
|
+
}, registeredPhone)))));
|
|
50604
|
+
};
|
|
50605
|
+
|
|
50606
|
+
const Step2_NewConsumerDetails = _ref => {
|
|
50607
|
+
var _errors$proposedNewCo, _errors$gender, _errors$newOwnerMobil, _errors$newOwnerEmail, _errors$reasonForName, _errors$relationshipW;
|
|
50243
50608
|
let t = _ref.t,
|
|
50244
|
-
|
|
50245
|
-
|
|
50246
|
-
|
|
50247
|
-
clearErrors = _ref.clearErrors;
|
|
50609
|
+
onNext = _ref.onNext,
|
|
50610
|
+
onBack = _ref.onBack,
|
|
50611
|
+
defaultValues = _ref.defaultValues;
|
|
50248
50612
|
const _useForm = useForm({
|
|
50249
|
-
defaultValues:
|
|
50613
|
+
defaultValues: defaultValues || {},
|
|
50614
|
+
mode: "onBlur"
|
|
50250
50615
|
}),
|
|
50251
50616
|
control = _useForm.control,
|
|
50252
|
-
|
|
50253
|
-
|
|
50254
|
-
|
|
50255
|
-
|
|
50617
|
+
handleSubmit = _useForm.handleSubmit,
|
|
50618
|
+
errors = _useForm.formState.errors,
|
|
50619
|
+
trigger = _useForm.trigger,
|
|
50620
|
+
setError = _useForm.setError,
|
|
50621
|
+
clearErrors = _useForm.clearErrors;
|
|
50622
|
+
const _useState = useState(null),
|
|
50623
|
+
showToast = _useState[0],
|
|
50624
|
+
setShowToast = _useState[1];
|
|
50625
|
+
const _useState2 = useState({}),
|
|
50626
|
+
touched = _useState2[0],
|
|
50627
|
+
setTouched = _useState2[1];
|
|
50628
|
+
const selectedReason = useWatch({
|
|
50629
|
+
control,
|
|
50630
|
+
name: "reasonForNameChange"
|
|
50631
|
+
});
|
|
50632
|
+
const isOtherReason = (selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.code) === "OTHER" || selectedReason === "OTHER";
|
|
50633
|
+
const genderOptions = [{
|
|
50634
|
+
code: "MALE",
|
|
50635
|
+
i18nKey: "Male"
|
|
50636
|
+
}, {
|
|
50637
|
+
code: "FEMALE",
|
|
50638
|
+
i18nKey: "Female"
|
|
50639
|
+
}, {
|
|
50640
|
+
code: "TRANSGENDER",
|
|
50641
|
+
i18nKey: "Transgender"
|
|
50642
|
+
}];
|
|
50256
50643
|
const reasonOptions = [{
|
|
50257
50644
|
code: "SALE_PURCHASE",
|
|
50258
|
-
i18nKey: "
|
|
50645
|
+
i18nKey: "Purchase of Property"
|
|
50259
50646
|
}, {
|
|
50260
50647
|
code: "DEVOLUTION_INHERITANCE",
|
|
50261
50648
|
i18nKey: "Devolution/Inheritance"
|
|
50262
50649
|
}, {
|
|
50263
50650
|
code: "OTHER",
|
|
50264
|
-
i18nKey: "Other Reason(Gift, Lease, etc)"
|
|
50651
|
+
i18nKey: "Other Reason(Gift Deed, Lease Agreement, etc)"
|
|
50265
50652
|
}];
|
|
50266
50653
|
const relationshipOptions = [{
|
|
50267
|
-
code: "
|
|
50268
|
-
i18nKey: "
|
|
50269
|
-
}, {
|
|
50270
|
-
code: "FATHER",
|
|
50271
|
-
i18nKey: "Father"
|
|
50272
|
-
}, {
|
|
50273
|
-
code: "SIBLING",
|
|
50274
|
-
i18nKey: "Sibling"
|
|
50275
|
-
}, {
|
|
50276
|
-
code: "SPOUSE",
|
|
50277
|
-
i18nKey: "Spouse"
|
|
50278
|
-
}, {
|
|
50279
|
-
code: "SON",
|
|
50280
|
-
i18nKey: "Son"
|
|
50281
|
-
}, {
|
|
50282
|
-
code: "DAUGHTER",
|
|
50283
|
-
i18nKey: "Daughter"
|
|
50654
|
+
code: "BLOOD_RELATION",
|
|
50655
|
+
i18nKey: "Blood Relation (Son / Daughter / Spouse)"
|
|
50284
50656
|
}, {
|
|
50285
50657
|
code: "LEGAL_HEIR",
|
|
50286
50658
|
i18nKey: "Legal heir"
|
|
@@ -50288,365 +50660,1316 @@ const WSMutationApplicantDetails = _ref => {
|
|
|
50288
50660
|
code: "OTHER",
|
|
50289
50661
|
i18nKey: "Other"
|
|
50290
50662
|
}];
|
|
50291
|
-
const _useState = useState((formData === null || formData === void 0 ? void 0 : (_formData$config$key = formData[config.key]) === null || _formData$config$key === void 0 ? void 0 : _formData$config$key.saleDeedDocumentId) || null),
|
|
50292
|
-
uploadedFile = _useState[0],
|
|
50293
|
-
setUploadedFile = _useState[1];
|
|
50294
|
-
const _useState2 = useState(null),
|
|
50295
|
-
file = _useState2[0],
|
|
50296
|
-
setFile = _useState2[1];
|
|
50297
|
-
const _useState3 = useState(false),
|
|
50298
|
-
isUploading = _useState3[0],
|
|
50299
|
-
setIsUploading = _useState3[1];
|
|
50300
|
-
useEffect(() => {
|
|
50301
|
-
const currentState = _extends({}, formValue, {
|
|
50302
|
-
saleDeedDocumentId: uploadedFile
|
|
50303
|
-
});
|
|
50304
|
-
if (!lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config.key], currentState)) {
|
|
50305
|
-
onSelect(config.key, currentState);
|
|
50306
|
-
}
|
|
50307
|
-
}, [formValue, uploadedFile]);
|
|
50308
|
-
useEffect(() => {
|
|
50309
|
-
(function () {
|
|
50310
|
-
try {
|
|
50311
|
-
const _temp2 = function () {
|
|
50312
|
-
if (file) {
|
|
50313
|
-
const _temp = _finallyRethrows(function () {
|
|
50314
|
-
return _catch(function () {
|
|
50315
|
-
setIsUploading(true);
|
|
50316
|
-
return Promise.resolve(window.Digit.UploadServices.Filestorage("WS", file, window.Digit.ULBService.getStateId())).then(function (response) {
|
|
50317
|
-
var _response$data, _response$data$files;
|
|
50318
|
-
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) {
|
|
50319
|
-
setUploadedFile(response.data.files[0].fileStoreId);
|
|
50320
|
-
clearErrors && clearErrors(config.key);
|
|
50321
|
-
}
|
|
50322
|
-
});
|
|
50323
|
-
}, function (err) {
|
|
50324
|
-
console.error("File upload error", err);
|
|
50325
|
-
});
|
|
50326
|
-
}, function (_wasThrown, _result) {
|
|
50327
|
-
setIsUploading(false);
|
|
50328
|
-
if (_wasThrown) throw _result;
|
|
50329
|
-
return _result;
|
|
50330
|
-
});
|
|
50331
|
-
if (_temp && _temp.then) return _temp.then(function () {});
|
|
50332
|
-
}
|
|
50333
|
-
}();
|
|
50334
|
-
return _temp2 && _temp2.then ? _temp2.then(function () {}) : void 0;
|
|
50335
|
-
} catch (e) {
|
|
50336
|
-
Promise.reject(e);
|
|
50337
|
-
}
|
|
50338
|
-
})();
|
|
50339
|
-
}, [file]);
|
|
50340
50663
|
const errorStyle = {
|
|
50341
50664
|
width: "100%",
|
|
50342
50665
|
marginLeft: "0px",
|
|
50343
50666
|
fontSize: "12px",
|
|
50344
|
-
marginTop: "4px"
|
|
50667
|
+
marginTop: "4px",
|
|
50668
|
+
color: "#d32f2f"
|
|
50345
50669
|
};
|
|
50346
|
-
|
|
50347
|
-
|
|
50670
|
+
const getFieldBorderStyle = fieldName => {
|
|
50671
|
+
if (errors !== null && errors !== void 0 && errors[fieldName]) return {
|
|
50672
|
+
border: "1px solid #d32f2f"
|
|
50673
|
+
};
|
|
50674
|
+
if (touched[fieldName] && !(errors !== null && errors !== void 0 && errors[fieldName])) return {
|
|
50675
|
+
border: "1px solid #28a745"
|
|
50676
|
+
};
|
|
50677
|
+
return {};
|
|
50678
|
+
};
|
|
50679
|
+
const onSubmit = data => {
|
|
50680
|
+
if (data.proposedNewConsumerName && data.proposedNewConsumerName.trim().length < 3) {
|
|
50681
|
+
setError("proposedNewConsumerName", {
|
|
50682
|
+
type: "manual",
|
|
50683
|
+
message: "Name must be at least 3 characters"
|
|
50684
|
+
});
|
|
50685
|
+
return;
|
|
50686
|
+
}
|
|
50687
|
+
if (data.proposedNewConsumerName && !/^[a-zA-Z\s.'-]+$/.test(data.proposedNewConsumerName.trim())) {
|
|
50688
|
+
setError("proposedNewConsumerName", {
|
|
50689
|
+
type: "manual",
|
|
50690
|
+
message: "Name should only contain alphabets, spaces, dots, hyphens"
|
|
50691
|
+
});
|
|
50692
|
+
return;
|
|
50693
|
+
}
|
|
50694
|
+
onNext(data);
|
|
50695
|
+
};
|
|
50696
|
+
const onError = () => {
|
|
50697
|
+
const errorCount = Object.keys(errors).length;
|
|
50698
|
+
setShowToast({
|
|
50699
|
+
key: "error",
|
|
50700
|
+
message: "Please fix " + errorCount + " validation error" + (errorCount > 1 ? "s" : "") + " before proceeding."
|
|
50701
|
+
});
|
|
50702
|
+
};
|
|
50703
|
+
const mandatoryIndicator = /*#__PURE__*/React.createElement("span", {
|
|
50348
50704
|
style: {
|
|
50349
|
-
|
|
50350
|
-
|
|
50351
|
-
|
|
50705
|
+
color: "#d32f2f",
|
|
50706
|
+
marginLeft: "2px"
|
|
50707
|
+
}
|
|
50708
|
+
}, "*");
|
|
50709
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
50710
|
+
style: {
|
|
50711
|
+
marginBottom: "20px"
|
|
50352
50712
|
}
|
|
50353
50713
|
}, /*#__PURE__*/React.createElement("div", {
|
|
50354
50714
|
style: {
|
|
50355
50715
|
display: "flex",
|
|
50356
|
-
|
|
50357
|
-
|
|
50716
|
+
alignItems: "center",
|
|
50717
|
+
marginBottom: "16px"
|
|
50718
|
+
}
|
|
50719
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
50720
|
+
style: {
|
|
50721
|
+
fontSize: "24px",
|
|
50722
|
+
marginRight: "8px"
|
|
50723
|
+
}
|
|
50724
|
+
}, "\uD83D\uDC64"), /*#__PURE__*/React.createElement("h2", {
|
|
50725
|
+
style: {
|
|
50726
|
+
fontSize: "20px",
|
|
50727
|
+
fontWeight: "700",
|
|
50728
|
+
margin: 0
|
|
50358
50729
|
}
|
|
50359
|
-
},
|
|
50730
|
+
}, "2. New Consumer Details.")), Object.keys(errors).length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
50360
50731
|
style: {
|
|
50732
|
+
padding: "12px 16px",
|
|
50733
|
+
backgroundColor: "#fdecea",
|
|
50734
|
+
color: "#611a15",
|
|
50735
|
+
borderRadius: "8px",
|
|
50736
|
+
border: "1px solid #f5c6cb",
|
|
50737
|
+
marginBottom: "16px",
|
|
50361
50738
|
display: "flex",
|
|
50362
|
-
|
|
50363
|
-
alignItems: "flex-start",
|
|
50364
|
-
gap: "4px"
|
|
50739
|
+
alignItems: "center"
|
|
50365
50740
|
}
|
|
50366
|
-
}, /*#__PURE__*/React.createElement(
|
|
50741
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
50367
50742
|
style: {
|
|
50368
|
-
|
|
50743
|
+
marginRight: "8px",
|
|
50744
|
+
fontSize: "18px"
|
|
50745
|
+
}
|
|
50746
|
+
}, "\u26A0\uFE0F"), /*#__PURE__*/React.createElement("span", {
|
|
50747
|
+
style: {
|
|
50748
|
+
fontWeight: "500",
|
|
50749
|
+
fontSize: "14px"
|
|
50750
|
+
}
|
|
50751
|
+
}, "Please fill in all required fields marked with ", /*#__PURE__*/React.createElement("span", {
|
|
50752
|
+
style: {
|
|
50753
|
+
color: "#d32f2f",
|
|
50369
50754
|
fontWeight: "bold"
|
|
50370
50755
|
}
|
|
50371
|
-
}, "
|
|
50372
|
-
|
|
50756
|
+
}, "*"), " before proceeding.")), /*#__PURE__*/React.createElement("form", {
|
|
50757
|
+
onSubmit: handleSubmit(onSubmit, onError)
|
|
50758
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
50373
50759
|
style: {
|
|
50374
|
-
|
|
50760
|
+
display: "grid",
|
|
50761
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
50762
|
+
gap: "24px",
|
|
50763
|
+
padding: "16px 0"
|
|
50375
50764
|
}
|
|
50376
|
-
}, /*#__PURE__*/React.createElement(
|
|
50765
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50766
|
+
style: {
|
|
50767
|
+
fontWeight: "bold"
|
|
50768
|
+
}
|
|
50769
|
+
}, "New Consumer Full Name ", mandatoryIndicator), /*#__PURE__*/React.createElement(Controller, {
|
|
50377
50770
|
control: control,
|
|
50378
50771
|
name: "proposedNewConsumerName",
|
|
50379
50772
|
rules: {
|
|
50380
|
-
required: "
|
|
50773
|
+
required: "Consumer name is required",
|
|
50774
|
+
minLength: {
|
|
50775
|
+
value: 3,
|
|
50776
|
+
message: "Name must be at least 3 characters"
|
|
50777
|
+
},
|
|
50778
|
+
pattern: {
|
|
50779
|
+
value: /^[a-zA-Z\s.'-]+$/,
|
|
50780
|
+
message: "Only alphabets, spaces, dots and hyphens allowed"
|
|
50781
|
+
}
|
|
50381
50782
|
},
|
|
50382
50783
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
50383
50784
|
value: props.value,
|
|
50384
50785
|
onChange: e => {
|
|
50385
50786
|
props.onChange(e.target.value);
|
|
50787
|
+
clearErrors("proposedNewConsumerName");
|
|
50386
50788
|
},
|
|
50387
|
-
|
|
50388
|
-
|
|
50789
|
+
onBlur: () => {
|
|
50790
|
+
props.onBlur();
|
|
50791
|
+
setTouched(p => _extends({}, p, {
|
|
50792
|
+
proposedNewConsumerName: true
|
|
50793
|
+
}));
|
|
50794
|
+
trigger("proposedNewConsumerName");
|
|
50795
|
+
},
|
|
50796
|
+
placeholder: "Enter full name (e.g. Rajesh Kumar)",
|
|
50797
|
+
style: getFieldBorderStyle("proposedNewConsumerName")
|
|
50389
50798
|
})
|
|
50390
|
-
})
|
|
50799
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.proposedNewConsumerName) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
50391
50800
|
style: errorStyle
|
|
50392
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$proposedNewCo = errors.proposedNewConsumerName) === null || _errors$proposedNewCo === void 0 ? void 0 : _errors$proposedNewCo.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(
|
|
50393
|
-
style: {
|
|
50394
|
-
display: "flex",
|
|
50395
|
-
flexDirection: "column",
|
|
50396
|
-
alignItems: "flex-start",
|
|
50397
|
-
gap: "4px"
|
|
50398
|
-
}
|
|
50399
|
-
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50801
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$proposedNewCo = errors.proposedNewConsumerName) === null || _errors$proposedNewCo === void 0 ? void 0 : _errors$proposedNewCo.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50400
50802
|
style: {
|
|
50401
|
-
margin: 0,
|
|
50402
50803
|
fontWeight: "bold"
|
|
50403
50804
|
}
|
|
50404
|
-
}, "
|
|
50405
|
-
|
|
50805
|
+
}, "Gender ", mandatoryIndicator), /*#__PURE__*/React.createElement(Controller, {
|
|
50806
|
+
control: control,
|
|
50807
|
+
name: "gender",
|
|
50808
|
+
rules: {
|
|
50809
|
+
required: "Please select gender"
|
|
50810
|
+
},
|
|
50811
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
50812
|
+
selected: props.value,
|
|
50813
|
+
option: genderOptions,
|
|
50814
|
+
select: val => {
|
|
50815
|
+
props.onChange(val);
|
|
50816
|
+
setTouched(p => _extends({}, p, {
|
|
50817
|
+
gender: true
|
|
50818
|
+
}));
|
|
50819
|
+
},
|
|
50820
|
+
optionKey: "i18nKey",
|
|
50821
|
+
t: t,
|
|
50822
|
+
placeholder: "Select Gender"
|
|
50823
|
+
})
|
|
50824
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.gender) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
50825
|
+
style: errorStyle
|
|
50826
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$gender = errors.gender) === null || _errors$gender === void 0 ? void 0 : _errors$gender.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50406
50827
|
style: {
|
|
50407
|
-
|
|
50828
|
+
fontWeight: "bold"
|
|
50408
50829
|
}
|
|
50409
|
-
}, /*#__PURE__*/React.createElement(Controller, {
|
|
50830
|
+
}, "Mobile Number ", mandatoryIndicator), /*#__PURE__*/React.createElement(Controller, {
|
|
50410
50831
|
control: control,
|
|
50411
50832
|
name: "newOwnerMobileNumber",
|
|
50412
50833
|
rules: {
|
|
50413
|
-
required: "
|
|
50834
|
+
required: "Mobile number is required",
|
|
50414
50835
|
pattern: {
|
|
50415
50836
|
value: /^[6-9]\d{9}$/,
|
|
50416
|
-
message: "
|
|
50837
|
+
message: "Enter a valid 10-digit mobile number starting with 6-9"
|
|
50417
50838
|
}
|
|
50418
50839
|
},
|
|
50419
50840
|
render: props => /*#__PURE__*/React.createElement(MobileNumber, {
|
|
50420
50841
|
value: props.value || "",
|
|
50421
50842
|
onChange: val => {
|
|
50422
50843
|
props.onChange(val);
|
|
50844
|
+
clearErrors("newOwnerMobileNumber");
|
|
50423
50845
|
},
|
|
50424
|
-
|
|
50425
|
-
|
|
50846
|
+
onBlur: () => {
|
|
50847
|
+
setTouched(p => _extends({}, p, {
|
|
50848
|
+
newOwnerMobileNumber: true
|
|
50849
|
+
}));
|
|
50850
|
+
trigger("newOwnerMobileNumber");
|
|
50851
|
+
},
|
|
50852
|
+
placeholder: "Enter 10-digit mobile number",
|
|
50853
|
+
maxLength: 10
|
|
50426
50854
|
})
|
|
50427
|
-
})
|
|
50855
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.newOwnerMobileNumber) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
50428
50856
|
style: errorStyle
|
|
50429
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$newOwnerMobil = errors.newOwnerMobileNumber) === null || _errors$newOwnerMobil === void 0 ? void 0 : _errors$newOwnerMobil.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(
|
|
50430
|
-
style: {
|
|
50431
|
-
display: "flex",
|
|
50432
|
-
flexDirection: "column",
|
|
50433
|
-
alignItems: "flex-start",
|
|
50434
|
-
gap: "4px"
|
|
50435
|
-
}
|
|
50436
|
-
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50857
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$newOwnerMobil = errors.newOwnerMobileNumber) === null || _errors$newOwnerMobil === void 0 ? void 0 : _errors$newOwnerMobil.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50437
50858
|
style: {
|
|
50438
|
-
margin: 0,
|
|
50439
50859
|
fontWeight: "bold"
|
|
50440
50860
|
}
|
|
50441
|
-
}, "
|
|
50442
|
-
className: "field",
|
|
50861
|
+
}, "Email ID ", /*#__PURE__*/React.createElement("span", {
|
|
50443
50862
|
style: {
|
|
50444
|
-
|
|
50863
|
+
color: "#999",
|
|
50864
|
+
fontSize: "12px"
|
|
50445
50865
|
}
|
|
50446
|
-
}, /*#__PURE__*/React.createElement(Controller, {
|
|
50866
|
+
}, "(Optional)")), /*#__PURE__*/React.createElement(Controller, {
|
|
50447
50867
|
control: control,
|
|
50448
50868
|
name: "newOwnerEmailAddress",
|
|
50449
50869
|
rules: {
|
|
50450
50870
|
pattern: {
|
|
50451
50871
|
value: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
50452
|
-
message: "
|
|
50872
|
+
message: "Please enter a valid email address"
|
|
50453
50873
|
}
|
|
50454
50874
|
},
|
|
50455
50875
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
50456
50876
|
value: props.value,
|
|
50457
50877
|
onChange: e => {
|
|
50458
50878
|
props.onChange(e.target.value);
|
|
50879
|
+
clearErrors("newOwnerEmailAddress");
|
|
50459
50880
|
},
|
|
50460
|
-
|
|
50461
|
-
|
|
50881
|
+
onBlur: () => {
|
|
50882
|
+
props.onBlur();
|
|
50883
|
+
setTouched(p => _extends({}, p, {
|
|
50884
|
+
newOwnerEmailAddress: true
|
|
50885
|
+
}));
|
|
50886
|
+
trigger("newOwnerEmailAddress");
|
|
50887
|
+
},
|
|
50888
|
+
placeholder: "example@email.com",
|
|
50889
|
+
style: getFieldBorderStyle("newOwnerEmailAddress")
|
|
50462
50890
|
})
|
|
50463
|
-
})
|
|
50891
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.newOwnerEmailAddress) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
50464
50892
|
style: errorStyle
|
|
50465
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$newOwnerEmail = errors.newOwnerEmailAddress) === null || _errors$newOwnerEmail === void 0 ? void 0 : _errors$newOwnerEmail.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(
|
|
50466
|
-
style: {
|
|
50467
|
-
display: "flex",
|
|
50468
|
-
flexDirection: "column",
|
|
50469
|
-
alignItems: "flex-start",
|
|
50470
|
-
gap: "4px"
|
|
50471
|
-
}
|
|
50472
|
-
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50893
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$newOwnerEmail = errors.newOwnerEmailAddress) === null || _errors$newOwnerEmail === void 0 ? void 0 : _errors$newOwnerEmail.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50473
50894
|
style: {
|
|
50474
|
-
margin: 0,
|
|
50475
50895
|
fontWeight: "bold"
|
|
50476
50896
|
}
|
|
50477
|
-
}, "
|
|
50478
|
-
className: "field",
|
|
50479
|
-
style: {
|
|
50480
|
-
width: "100%"
|
|
50481
|
-
}
|
|
50482
|
-
}, /*#__PURE__*/React.createElement(Controller, {
|
|
50897
|
+
}, "Reason for Name Change / Mutation ", mandatoryIndicator), /*#__PURE__*/React.createElement(Controller, {
|
|
50483
50898
|
control: control,
|
|
50484
|
-
name: "
|
|
50899
|
+
name: "reasonForNameChange",
|
|
50485
50900
|
rules: {
|
|
50486
|
-
required: "
|
|
50901
|
+
required: "Please select a reason for mutation"
|
|
50487
50902
|
},
|
|
50488
50903
|
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
50489
50904
|
selected: props.value,
|
|
50490
|
-
option:
|
|
50491
|
-
select:
|
|
50492
|
-
props.onChange(
|
|
50905
|
+
option: reasonOptions,
|
|
50906
|
+
select: val => {
|
|
50907
|
+
props.onChange(val);
|
|
50908
|
+
setTouched(p => _extends({}, p, {
|
|
50909
|
+
reasonForNameChange: true
|
|
50910
|
+
}));
|
|
50493
50911
|
},
|
|
50494
50912
|
optionKey: "i18nKey",
|
|
50495
50913
|
t: t,
|
|
50496
|
-
placeholder: "Select
|
|
50914
|
+
placeholder: "Select reason"
|
|
50497
50915
|
})
|
|
50498
|
-
})
|
|
50916
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.reasonForNameChange) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
50499
50917
|
style: errorStyle
|
|
50500
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$
|
|
50501
|
-
style: {
|
|
50502
|
-
display: "flex",
|
|
50503
|
-
flexDirection: "column",
|
|
50504
|
-
gap: "20px"
|
|
50505
|
-
}
|
|
50506
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
50507
|
-
style: {
|
|
50508
|
-
display: "flex",
|
|
50509
|
-
flexDirection: "column",
|
|
50510
|
-
alignItems: "flex-start",
|
|
50511
|
-
gap: "4px"
|
|
50512
|
-
}
|
|
50513
|
-
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50514
|
-
style: {
|
|
50515
|
-
margin: 0,
|
|
50516
|
-
fontWeight: "bold"
|
|
50517
|
-
}
|
|
50518
|
-
}, "REASON FOR NAME CHANGE*"), /*#__PURE__*/React.createElement("div", {
|
|
50519
|
-
className: "field",
|
|
50918
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$reasonForName = errors.reasonForNameChange) === null || _errors$reasonForName === void 0 ? void 0 : _errors$reasonForName.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
50520
50919
|
style: {
|
|
50521
|
-
|
|
50920
|
+
fontWeight: "bold",
|
|
50921
|
+
color: isOtherReason ? "inherit" : "#999"
|
|
50522
50922
|
}
|
|
50523
|
-
}, /*#__PURE__*/React.createElement(Controller, {
|
|
50923
|
+
}, "Relationship with Existing Consumer ", isOtherReason && mandatoryIndicator), /*#__PURE__*/React.createElement(Controller, {
|
|
50524
50924
|
control: control,
|
|
50525
|
-
name: "
|
|
50925
|
+
name: "relationshipWithExistingConsumer",
|
|
50526
50926
|
rules: {
|
|
50527
|
-
required: "
|
|
50927
|
+
required: isOtherReason ? "Relationship is required when 'Other Reason' is selected" : false
|
|
50528
50928
|
},
|
|
50529
50929
|
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
50530
50930
|
selected: props.value,
|
|
50531
|
-
option:
|
|
50532
|
-
select:
|
|
50533
|
-
props.onChange(
|
|
50931
|
+
option: relationshipOptions,
|
|
50932
|
+
select: val => {
|
|
50933
|
+
props.onChange(val);
|
|
50934
|
+
setTouched(p => _extends({}, p, {
|
|
50935
|
+
relationshipWithExistingConsumer: true
|
|
50936
|
+
}));
|
|
50534
50937
|
},
|
|
50535
50938
|
optionKey: "i18nKey",
|
|
50536
50939
|
t: t,
|
|
50537
|
-
placeholder: "Select
|
|
50940
|
+
placeholder: "Select relationship",
|
|
50941
|
+
disable: !isOtherReason
|
|
50538
50942
|
})
|
|
50539
|
-
})
|
|
50540
|
-
style: errorStyle
|
|
50541
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$reasonForName = errors.reasonForNameChange) === null || _errors$reasonForName === void 0 ? void 0 : _errors$reasonForName.message)), /*#__PURE__*/React.createElement("div", {
|
|
50943
|
+
}), !isOtherReason && /*#__PURE__*/React.createElement("span", {
|
|
50542
50944
|
style: {
|
|
50543
|
-
|
|
50544
|
-
|
|
50545
|
-
|
|
50546
|
-
|
|
50547
|
-
backgroundColor: "#fafafa"
|
|
50945
|
+
fontSize: "11px",
|
|
50946
|
+
color: "#999",
|
|
50947
|
+
marginTop: "4px",
|
|
50948
|
+
display: "block"
|
|
50548
50949
|
}
|
|
50549
|
-
}, /*#__PURE__*/React.createElement(
|
|
50950
|
+
}, "Enabled only when \"Other Reason\" is selected above"), (errors === null || errors === void 0 ? void 0 : errors.relationshipWithExistingConsumer) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
50951
|
+
style: errorStyle
|
|
50952
|
+
}, errors === null || errors === void 0 ? void 0 : (_errors$relationshipW = errors.relationshipWithExistingConsumer) === null || _errors$relationshipW === void 0 ? void 0 : _errors$relationshipW.message))), /*#__PURE__*/React.createElement("div", {
|
|
50550
50953
|
style: {
|
|
50551
50954
|
display: "flex",
|
|
50552
|
-
|
|
50553
|
-
alignItems: "
|
|
50554
|
-
|
|
50955
|
+
justifyContent: "space-between",
|
|
50956
|
+
alignItems: "center",
|
|
50957
|
+
marginTop: "24px"
|
|
50555
50958
|
}
|
|
50556
|
-
}, /*#__PURE__*/React.createElement(
|
|
50959
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
50960
|
+
type: "button",
|
|
50961
|
+
onClick: onBack,
|
|
50557
50962
|
style: {
|
|
50558
|
-
|
|
50963
|
+
padding: "8px 24px",
|
|
50964
|
+
backgroundColor: "#e0e0e0",
|
|
50965
|
+
border: "none",
|
|
50966
|
+
borderRadius: "4px",
|
|
50967
|
+
cursor: "pointer",
|
|
50559
50968
|
fontWeight: "bold"
|
|
50560
50969
|
}
|
|
50561
|
-
}, "
|
|
50970
|
+
}, "\u2190 Back"), /*#__PURE__*/React.createElement("div", {
|
|
50562
50971
|
style: {
|
|
50563
|
-
|
|
50564
|
-
|
|
50565
|
-
|
|
50566
|
-
marginTop: "5px"
|
|
50972
|
+
display: "flex",
|
|
50973
|
+
alignItems: "center",
|
|
50974
|
+
gap: "12px"
|
|
50567
50975
|
}
|
|
50568
|
-
},
|
|
50569
|
-
className: "field",
|
|
50976
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
50570
50977
|
style: {
|
|
50571
|
-
|
|
50978
|
+
fontSize: "12px",
|
|
50979
|
+
color: "#999"
|
|
50572
50980
|
}
|
|
50573
|
-
}, /*#__PURE__*/React.createElement(
|
|
50574
|
-
|
|
50575
|
-
|
|
50576
|
-
setFile(e.target.files[0]);
|
|
50577
|
-
},
|
|
50578
|
-
onDelete: () => {
|
|
50579
|
-
setUploadedFile(null);
|
|
50580
|
-
setFile(null);
|
|
50581
|
-
},
|
|
50582
|
-
message: uploadedFile ? "1 File Uploaded" : "Click to upload document",
|
|
50583
|
-
accept: "image/*, .pdf, .png, .jpeg, .jpg",
|
|
50584
|
-
uploadedFiles: uploadedFile && !file ? [["Document", {
|
|
50585
|
-
fileStoreId: uploadedFile
|
|
50586
|
-
}]] : undefined,
|
|
50587
|
-
removeTargetedFile: () => {
|
|
50588
|
-
setUploadedFile(null);
|
|
50589
|
-
setFile(null);
|
|
50981
|
+
}, "Fields marked with ", /*#__PURE__*/React.createElement("span", {
|
|
50982
|
+
style: {
|
|
50983
|
+
color: "#d32f2f"
|
|
50590
50984
|
}
|
|
50591
|
-
})
|
|
50985
|
+
}, "*"), " are mandatory"), /*#__PURE__*/React.createElement("button", {
|
|
50986
|
+
type: "submit",
|
|
50592
50987
|
style: {
|
|
50593
|
-
|
|
50594
|
-
|
|
50595
|
-
|
|
50988
|
+
padding: "10px 24px",
|
|
50989
|
+
backgroundColor: "#00497e",
|
|
50990
|
+
color: "white",
|
|
50991
|
+
border: "none",
|
|
50992
|
+
borderRadius: "4px",
|
|
50993
|
+
cursor: "pointer",
|
|
50994
|
+
fontWeight: "bold"
|
|
50596
50995
|
}
|
|
50597
|
-
}, "
|
|
50996
|
+
}, "Save & Proceed to Documents \u2192")))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
50997
|
+
error: showToast.key === "error",
|
|
50998
|
+
warning: showToast.key === "warning",
|
|
50999
|
+
label: t(showToast.message),
|
|
51000
|
+
onClose: () => setShowToast(null),
|
|
51001
|
+
isDleteBtn: true
|
|
51002
|
+
}));
|
|
50598
51003
|
};
|
|
50599
51004
|
|
|
50600
|
-
const
|
|
50601
|
-
var
|
|
50602
|
-
|
|
50603
|
-
|
|
50604
|
-
|
|
50605
|
-
|
|
50606
|
-
|
|
50607
|
-
|
|
50608
|
-
|
|
50609
|
-
const
|
|
50610
|
-
|
|
50611
|
-
|
|
50612
|
-
const
|
|
50613
|
-
|
|
50614
|
-
|
|
50615
|
-
const
|
|
50616
|
-
|
|
50617
|
-
|
|
50618
|
-
const
|
|
50619
|
-
|
|
50620
|
-
|
|
51005
|
+
const Step3_UploadDocuments = _ref => {
|
|
51006
|
+
var _defaultValues$reason;
|
|
51007
|
+
let t = _ref.t,
|
|
51008
|
+
onNext = _ref.onNext,
|
|
51009
|
+
onBack = _ref.onBack,
|
|
51010
|
+
defaultValues = _ref.defaultValues;
|
|
51011
|
+
const _useState = useState((defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.identityProofType) || null),
|
|
51012
|
+
identityProofType = _useState[0],
|
|
51013
|
+
setIdentityProofType = _useState[1];
|
|
51014
|
+
const _useState2 = useState((defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.documentNumber) || ""),
|
|
51015
|
+
documentNumber = _useState2[0],
|
|
51016
|
+
setDocumentNumber = _useState2[1];
|
|
51017
|
+
const _useState3 = useState((defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.identityProofDocumentId) || null),
|
|
51018
|
+
identityProofFile = _useState3[0],
|
|
51019
|
+
setIdentityProofFile = _useState3[1];
|
|
51020
|
+
const _useState4 = useState((defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.saleDeedDocumentId) || null),
|
|
51021
|
+
mutationDocFile = _useState4[0],
|
|
51022
|
+
setMutationDocFile = _useState4[1];
|
|
51023
|
+
const _useState5 = useState({
|
|
51024
|
+
identity: null,
|
|
51025
|
+
mutation: null
|
|
50621
51026
|
}),
|
|
50622
|
-
|
|
50623
|
-
|
|
50624
|
-
const _useState5 = useState(true),
|
|
50625
|
-
enabledLoader = _useState5[0],
|
|
50626
|
-
setEnabledLoader = _useState5[1];
|
|
51027
|
+
rawFiles = _useState5[0],
|
|
51028
|
+
setRawFiles = _useState5[1];
|
|
50627
51029
|
const _useState6 = useState(false),
|
|
50628
|
-
|
|
50629
|
-
|
|
50630
|
-
|
|
50631
|
-
|
|
51030
|
+
isUploading = _useState6[0],
|
|
51031
|
+
setIsUploading = _useState6[1];
|
|
51032
|
+
const _useState7 = useState(null),
|
|
51033
|
+
showToast = _useState7[0],
|
|
51034
|
+
setShowToast = _useState7[1];
|
|
51035
|
+
const _useState8 = useState({}),
|
|
51036
|
+
fieldErrors = _useState8[0],
|
|
51037
|
+
setFieldErrors = _useState8[1];
|
|
51038
|
+
const _useState9 = useState(false),
|
|
51039
|
+
hasAttemptedSubmit = _useState9[0],
|
|
51040
|
+
setHasAttemptedSubmit = _useState9[1];
|
|
51041
|
+
const identityOptions = [{
|
|
51042
|
+
code: "AADHAAR",
|
|
51043
|
+
i18nKey: "Aadhaar Card"
|
|
51044
|
+
}, {
|
|
51045
|
+
code: "VOTER_ID",
|
|
51046
|
+
i18nKey: "Voter ID"
|
|
51047
|
+
}, {
|
|
51048
|
+
code: "PAN",
|
|
51049
|
+
i18nKey: "PAN Card"
|
|
51050
|
+
}, {
|
|
51051
|
+
code: "OTHER",
|
|
51052
|
+
i18nKey: "Any other document configured by DJB"
|
|
51053
|
+
}];
|
|
51054
|
+
const getReasonDocLabel = reasonCode => {
|
|
51055
|
+
switch (reasonCode) {
|
|
51056
|
+
case "SALE_PURCHASE":
|
|
51057
|
+
return "Upload Purchase of Property";
|
|
51058
|
+
case "DEVOLUTION_INHERITANCE":
|
|
51059
|
+
return "Upload Devolution/ Inheritance";
|
|
51060
|
+
case "OTHER":
|
|
51061
|
+
return "Upload Other (Gift Deed, Will registration, etc.)";
|
|
51062
|
+
default:
|
|
51063
|
+
return "Upload Supporting Document";
|
|
51064
|
+
}
|
|
51065
|
+
};
|
|
51066
|
+
const reasonCode = (defaultValues === null || defaultValues === void 0 ? void 0 : (_defaultValues$reason = defaultValues.reasonForNameChange) === null || _defaultValues$reason === void 0 ? void 0 : _defaultValues$reason.code) || (defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.reasonForNameChange);
|
|
51067
|
+
const reasonDocLabel = getReasonDocLabel(reasonCode);
|
|
51068
|
+
const validateDocumentNumber = (value, docType) => {
|
|
51069
|
+
if (!value || !value.trim()) return "Document number is required";
|
|
51070
|
+
const trimmed = value.trim();
|
|
51071
|
+
if ((docType === null || docType === void 0 ? void 0 : docType.code) === "AADHAAR") {
|
|
51072
|
+
if (!/^\d{12}$/.test(trimmed)) return "Aadhaar number must be exactly 12 digits";
|
|
51073
|
+
} else if ((docType === null || docType === void 0 ? void 0 : docType.code) === "PAN") {
|
|
51074
|
+
if (!/^[A-Z]{5}[0-9]{4}[A-Z]{1}$/.test(trimmed.toUpperCase())) return "PAN must be in format ABCDE1234F";
|
|
51075
|
+
} else if ((docType === null || docType === void 0 ? void 0 : docType.code) === "VOTER_ID") {
|
|
51076
|
+
if (!/^[A-Z]{3}\d{7}$/.test(trimmed.toUpperCase())) return "Voter ID must be in format ABC1234567";
|
|
51077
|
+
} else {
|
|
51078
|
+
if (trimmed.length < 3) return "Document number must be at least 3 characters";
|
|
51079
|
+
}
|
|
51080
|
+
return null;
|
|
51081
|
+
};
|
|
51082
|
+
const validateFileSize = file => {
|
|
51083
|
+
const maxSizeMB = 5;
|
|
51084
|
+
if (file.size > maxSizeMB * 1024 * 1024) {
|
|
51085
|
+
return "File size exceeds " + maxSizeMB + "MB limit. Please choose a smaller file.";
|
|
51086
|
+
}
|
|
51087
|
+
return null;
|
|
51088
|
+
};
|
|
51089
|
+
const validateFileType = file => {
|
|
51090
|
+
const allowedTypes = ["image/jpeg", "image/jpg", "image/png", "application/pdf"];
|
|
51091
|
+
if (!allowedTypes.includes(file.type)) {
|
|
51092
|
+
return "Only PDF, PNG, JPEG files are allowed.";
|
|
51093
|
+
}
|
|
51094
|
+
return null;
|
|
51095
|
+
};
|
|
51096
|
+
const handleFileUpload = function (file, type) {
|
|
51097
|
+
try {
|
|
51098
|
+
const sizeError = validateFileSize(file);
|
|
51099
|
+
if (sizeError) {
|
|
51100
|
+
setShowToast({
|
|
51101
|
+
key: "error",
|
|
51102
|
+
message: sizeError
|
|
51103
|
+
});
|
|
51104
|
+
return Promise.resolve();
|
|
51105
|
+
}
|
|
51106
|
+
const typeError = validateFileType(file);
|
|
51107
|
+
if (typeError) {
|
|
51108
|
+
setShowToast({
|
|
51109
|
+
key: "error",
|
|
51110
|
+
message: typeError
|
|
51111
|
+
});
|
|
51112
|
+
return Promise.resolve();
|
|
51113
|
+
}
|
|
51114
|
+
const _temp = _finallyRethrows(function () {
|
|
51115
|
+
return _catch(function () {
|
|
51116
|
+
setIsUploading(true);
|
|
51117
|
+
return Promise.resolve(window.Digit.UploadServices.Filestorage("WS", file, window.Digit.ULBService.getStateId())).then(function (response) {
|
|
51118
|
+
var _response$data, _response$data$files;
|
|
51119
|
+
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) {
|
|
51120
|
+
const fileStoreId = response.data.files[0].fileStoreId;
|
|
51121
|
+
if (type === "identity") {
|
|
51122
|
+
setIdentityProofFile(fileStoreId);
|
|
51123
|
+
setFieldErrors(prev => _extends({}, prev, {
|
|
51124
|
+
identityFile: null
|
|
51125
|
+
}));
|
|
51126
|
+
}
|
|
51127
|
+
if (type === "mutation") {
|
|
51128
|
+
setMutationDocFile(fileStoreId);
|
|
51129
|
+
setFieldErrors(prev => _extends({}, prev, {
|
|
51130
|
+
mutationFile: null
|
|
51131
|
+
}));
|
|
51132
|
+
}
|
|
51133
|
+
setShowToast({
|
|
51134
|
+
key: "success",
|
|
51135
|
+
message: "Document uploaded successfully!"
|
|
51136
|
+
});
|
|
51137
|
+
}
|
|
51138
|
+
});
|
|
51139
|
+
}, function (err) {
|
|
51140
|
+
console.error("File upload error", err);
|
|
51141
|
+
setShowToast({
|
|
51142
|
+
key: "error",
|
|
51143
|
+
message: "File upload failed. Please try again."
|
|
51144
|
+
});
|
|
51145
|
+
});
|
|
51146
|
+
}, function (_wasThrown, _result) {
|
|
51147
|
+
setIsUploading(false);
|
|
51148
|
+
if (_wasThrown) throw _result;
|
|
51149
|
+
return _result;
|
|
51150
|
+
});
|
|
51151
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
51152
|
+
} catch (e) {
|
|
51153
|
+
return Promise.reject(e);
|
|
51154
|
+
}
|
|
51155
|
+
};
|
|
51156
|
+
useEffect(() => {
|
|
51157
|
+
if (rawFiles.identity) handleFileUpload(rawFiles.identity, "identity");
|
|
51158
|
+
}, [rawFiles.identity]);
|
|
51159
|
+
useEffect(() => {
|
|
51160
|
+
if (rawFiles.mutation) handleFileUpload(rawFiles.mutation, "mutation");
|
|
51161
|
+
}, [rawFiles.mutation]);
|
|
51162
|
+
useEffect(() => {
|
|
51163
|
+
if (hasAttemptedSubmit) {
|
|
51164
|
+
const newErrors = {};
|
|
51165
|
+
if (!identityProofType) newErrors.identityType = "Please select a document type";
|
|
51166
|
+
if (!identityProofFile) newErrors.identityFile = "Please upload your identity proof document";
|
|
51167
|
+
if (!mutationDocFile) newErrors.mutationFile = "Please upload the reason-based supporting document";
|
|
51168
|
+
const docError = validateDocumentNumber(documentNumber, identityProofType);
|
|
51169
|
+
if (docError) newErrors.documentNumber = docError;
|
|
51170
|
+
setFieldErrors(newErrors);
|
|
51171
|
+
}
|
|
51172
|
+
}, [identityProofType, documentNumber, identityProofFile, mutationDocFile, hasAttemptedSubmit]);
|
|
51173
|
+
const onProceed = () => {
|
|
51174
|
+
setHasAttemptedSubmit(true);
|
|
51175
|
+
const newErrors = {};
|
|
51176
|
+
if (!identityProofType) newErrors.identityType = "Please select a document type";
|
|
51177
|
+
const docError = validateDocumentNumber(documentNumber, identityProofType);
|
|
51178
|
+
if (docError) newErrors.documentNumber = docError;
|
|
51179
|
+
if (!identityProofFile) newErrors.identityFile = "Please upload your identity proof document";
|
|
51180
|
+
if (!mutationDocFile) newErrors.mutationFile = "Please upload the reason-based supporting document";
|
|
51181
|
+
setFieldErrors(newErrors);
|
|
51182
|
+
if (Object.keys(newErrors).length > 0) {
|
|
51183
|
+
const errorCount = Object.keys(newErrors).length;
|
|
51184
|
+
setShowToast({
|
|
51185
|
+
key: "warning",
|
|
51186
|
+
message: "Please fix " + errorCount + " issue" + (errorCount > 1 ? "s" : "") + " before proceeding."
|
|
51187
|
+
});
|
|
51188
|
+
return;
|
|
51189
|
+
}
|
|
51190
|
+
onNext({
|
|
51191
|
+
identityProofType,
|
|
51192
|
+
documentNumber: documentNumber.trim(),
|
|
51193
|
+
identityProofDocumentId: identityProofFile,
|
|
51194
|
+
saleDeedDocumentId: mutationDocFile
|
|
51195
|
+
});
|
|
51196
|
+
};
|
|
51197
|
+
const uploadBoxStyle = (hasError, hasFile) => ({
|
|
51198
|
+
border: hasError ? "2px dashed #d32f2f" : hasFile ? "2px dashed #28a745" : "1px dashed #ccc",
|
|
51199
|
+
padding: "20px",
|
|
51200
|
+
borderRadius: "8px",
|
|
51201
|
+
backgroundColor: hasError ? "#fef2f2" : hasFile ? "#f0fff4" : "#f4f9fc",
|
|
51202
|
+
textAlign: "center",
|
|
51203
|
+
marginTop: "8px",
|
|
51204
|
+
transition: "all 0.2s ease"
|
|
51205
|
+
});
|
|
51206
|
+
const errorTextStyle = {
|
|
51207
|
+
fontSize: "12px",
|
|
51208
|
+
color: "#d32f2f",
|
|
51209
|
+
marginTop: "4px"
|
|
51210
|
+
};
|
|
51211
|
+
const successTextStyle = {
|
|
51212
|
+
fontSize: "12px",
|
|
51213
|
+
color: "#28a745",
|
|
51214
|
+
marginTop: "4px",
|
|
51215
|
+
fontWeight: "500"
|
|
51216
|
+
};
|
|
51217
|
+
const mandatoryIndicator = /*#__PURE__*/React.createElement("span", {
|
|
51218
|
+
style: {
|
|
51219
|
+
color: "#d32f2f",
|
|
51220
|
+
marginLeft: "2px"
|
|
51221
|
+
}
|
|
51222
|
+
}, "*");
|
|
51223
|
+
const errorCount = Object.keys(fieldErrors).length;
|
|
51224
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
51225
|
+
style: {
|
|
51226
|
+
marginBottom: "20px"
|
|
51227
|
+
}
|
|
51228
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
51229
|
+
style: {
|
|
51230
|
+
display: "flex",
|
|
51231
|
+
alignItems: "center",
|
|
51232
|
+
marginBottom: "8px"
|
|
51233
|
+
}
|
|
51234
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
51235
|
+
style: {
|
|
51236
|
+
fontSize: "24px",
|
|
51237
|
+
marginRight: "8px"
|
|
51238
|
+
}
|
|
51239
|
+
}, "\uD83D\uDCC4"), /*#__PURE__*/React.createElement("h2", {
|
|
51240
|
+
style: {
|
|
51241
|
+
fontSize: "20px",
|
|
51242
|
+
fontWeight: "700",
|
|
51243
|
+
margin: 0
|
|
51244
|
+
}
|
|
51245
|
+
}, "3. Upload Verification Documents")), /*#__PURE__*/React.createElement("p", {
|
|
51246
|
+
style: {
|
|
51247
|
+
color: "#666",
|
|
51248
|
+
marginBottom: "20px"
|
|
51249
|
+
}
|
|
51250
|
+
}, "Please upload legible scanned copies or photos (PDF, PNG, JPEG - Max 5MB)."), hasAttemptedSubmit && errorCount > 0 && /*#__PURE__*/React.createElement("div", {
|
|
51251
|
+
style: {
|
|
51252
|
+
padding: "12px 16px",
|
|
51253
|
+
backgroundColor: "#fdecea",
|
|
51254
|
+
color: "#611a15",
|
|
51255
|
+
borderRadius: "8px",
|
|
51256
|
+
border: "1px solid #f5c6cb",
|
|
51257
|
+
marginBottom: "16px",
|
|
51258
|
+
display: "flex",
|
|
51259
|
+
alignItems: "center"
|
|
51260
|
+
}
|
|
51261
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
51262
|
+
style: {
|
|
51263
|
+
marginRight: "8px",
|
|
51264
|
+
fontSize: "18px"
|
|
51265
|
+
}
|
|
51266
|
+
}, "\u26A0\uFE0F"), /*#__PURE__*/React.createElement("span", {
|
|
51267
|
+
style: {
|
|
51268
|
+
fontWeight: "500",
|
|
51269
|
+
fontSize: "14px"
|
|
51270
|
+
}
|
|
51271
|
+
}, errorCount, " required item", errorCount > 1 ? "s" : "", " still need", errorCount === 1 ? "s" : "", " your attention before proceeding.")), /*#__PURE__*/React.createElement("div", {
|
|
51272
|
+
style: {
|
|
51273
|
+
display: "grid",
|
|
51274
|
+
gridTemplateColumns: "1fr 1fr",
|
|
51275
|
+
gap: "24px"
|
|
51276
|
+
}
|
|
51277
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
51278
|
+
style: {
|
|
51279
|
+
fontWeight: "bold"
|
|
51280
|
+
}
|
|
51281
|
+
}, "1. Address / Identity Proof ", mandatoryIndicator), /*#__PURE__*/React.createElement(Dropdown, {
|
|
51282
|
+
selected: identityProofType,
|
|
51283
|
+
option: identityOptions,
|
|
51284
|
+
select: val => {
|
|
51285
|
+
setIdentityProofType(val);
|
|
51286
|
+
setFieldErrors(prev => _extends({}, prev, {
|
|
51287
|
+
identityType: null
|
|
51288
|
+
}));
|
|
51289
|
+
},
|
|
51290
|
+
optionKey: "i18nKey",
|
|
51291
|
+
t: t,
|
|
51292
|
+
placeholder: "Select Document Type",
|
|
51293
|
+
style: {
|
|
51294
|
+
marginBottom: "12px"
|
|
51295
|
+
}
|
|
51296
|
+
}), fieldErrors.identityType && /*#__PURE__*/React.createElement("div", {
|
|
51297
|
+
style: errorTextStyle
|
|
51298
|
+
}, fieldErrors.identityType), /*#__PURE__*/React.createElement(CardLabel, {
|
|
51299
|
+
style: {
|
|
51300
|
+
fontWeight: "bold",
|
|
51301
|
+
marginTop: "8px"
|
|
51302
|
+
}
|
|
51303
|
+
}, "Document Number ", mandatoryIndicator), /*#__PURE__*/React.createElement(TextInput, {
|
|
51304
|
+
value: documentNumber,
|
|
51305
|
+
onChange: e => {
|
|
51306
|
+
setDocumentNumber(e.target.value);
|
|
51307
|
+
setFieldErrors(prev => _extends({}, prev, {
|
|
51308
|
+
documentNumber: null
|
|
51309
|
+
}));
|
|
51310
|
+
},
|
|
51311
|
+
onBlur: () => {
|
|
51312
|
+
if (hasAttemptedSubmit) {
|
|
51313
|
+
const err = validateDocumentNumber(documentNumber, identityProofType);
|
|
51314
|
+
if (err) setFieldErrors(prev => _extends({}, prev, {
|
|
51315
|
+
documentNumber: err
|
|
51316
|
+
}));
|
|
51317
|
+
}
|
|
51318
|
+
},
|
|
51319
|
+
placeholder: (identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code) === "AADHAAR" ? "Enter 12-digit Aadhaar number" : (identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code) === "PAN" ? "Enter PAN (e.g. ABCDE1234F)" : "Enter Document Number",
|
|
51320
|
+
style: _extends({
|
|
51321
|
+
marginBottom: "4px"
|
|
51322
|
+
}, fieldErrors.documentNumber ? {
|
|
51323
|
+
border: "1px solid #d32f2f"
|
|
51324
|
+
} : {})
|
|
51325
|
+
}), fieldErrors.documentNumber && /*#__PURE__*/React.createElement("div", {
|
|
51326
|
+
style: errorTextStyle
|
|
51327
|
+
}, fieldErrors.documentNumber), (identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code) === "AADHAAR" && !fieldErrors.documentNumber && /*#__PURE__*/React.createElement("span", {
|
|
51328
|
+
style: {
|
|
51329
|
+
fontSize: "11px",
|
|
51330
|
+
color: "#999"
|
|
51331
|
+
}
|
|
51332
|
+
}, "Format: 12-digit numeric (e.g. 123456789012)"), (identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code) === "PAN" && !fieldErrors.documentNumber && /*#__PURE__*/React.createElement("span", {
|
|
51333
|
+
style: {
|
|
51334
|
+
fontSize: "11px",
|
|
51335
|
+
color: "#999"
|
|
51336
|
+
}
|
|
51337
|
+
}, "Format: ABCDE1234F"), /*#__PURE__*/React.createElement("div", {
|
|
51338
|
+
style: uploadBoxStyle(!!fieldErrors.identityFile, !!identityProofFile)
|
|
51339
|
+
}, /*#__PURE__*/React.createElement(UploadFile, {
|
|
51340
|
+
id: "identity-upload",
|
|
51341
|
+
onUpload: e => setRawFiles(prev => _extends({}, prev, {
|
|
51342
|
+
identity: e.target.files[0]
|
|
51343
|
+
})),
|
|
51344
|
+
onDelete: () => {
|
|
51345
|
+
setIdentityProofFile(null);
|
|
51346
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
51347
|
+
identity: null
|
|
51348
|
+
}));
|
|
51349
|
+
},
|
|
51350
|
+
message: identityProofFile ? "Uploaded" : "Click to Choose File",
|
|
51351
|
+
accept: "image/*, .pdf, .png, .jpeg, .jpg",
|
|
51352
|
+
uploadedFiles: identityProofFile && !rawFiles.identity ? [["Document", {
|
|
51353
|
+
fileStoreId: identityProofFile
|
|
51354
|
+
}]] : undefined,
|
|
51355
|
+
removeTargetedFile: () => {
|
|
51356
|
+
setIdentityProofFile(null);
|
|
51357
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
51358
|
+
identity: null
|
|
51359
|
+
}));
|
|
51360
|
+
}
|
|
51361
|
+
})), fieldErrors.identityFile && /*#__PURE__*/React.createElement("div", {
|
|
51362
|
+
style: errorTextStyle
|
|
51363
|
+
}, fieldErrors.identityFile), identityProofFile && /*#__PURE__*/React.createElement("div", {
|
|
51364
|
+
style: successTextStyle
|
|
51365
|
+
}, "\u2713 Document uploaded successfully")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
51366
|
+
style: {
|
|
51367
|
+
fontWeight: "bold"
|
|
51368
|
+
}
|
|
51369
|
+
}, "2. Reason-Based Supporting Document ", mandatoryIndicator), /*#__PURE__*/React.createElement("div", {
|
|
51370
|
+
style: {
|
|
51371
|
+
padding: "10px",
|
|
51372
|
+
backgroundColor: "#e9ecef",
|
|
51373
|
+
borderRadius: "4px",
|
|
51374
|
+
marginBottom: "12px",
|
|
51375
|
+
color: "#495057",
|
|
51376
|
+
fontSize: "14px",
|
|
51377
|
+
minHeight: "42px",
|
|
51378
|
+
display: "flex",
|
|
51379
|
+
alignItems: "center"
|
|
51380
|
+
}
|
|
51381
|
+
}, reasonDocLabel), /*#__PURE__*/React.createElement("div", {
|
|
51382
|
+
style: uploadBoxStyle(!!fieldErrors.mutationFile, !!mutationDocFile)
|
|
51383
|
+
}, /*#__PURE__*/React.createElement(UploadFile, {
|
|
51384
|
+
id: "mutation-upload",
|
|
51385
|
+
onUpload: e => setRawFiles(prev => _extends({}, prev, {
|
|
51386
|
+
mutation: e.target.files[0]
|
|
51387
|
+
})),
|
|
51388
|
+
onDelete: () => {
|
|
51389
|
+
setMutationDocFile(null);
|
|
51390
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
51391
|
+
mutation: null
|
|
51392
|
+
}));
|
|
51393
|
+
},
|
|
51394
|
+
message: mutationDocFile ? "Uploaded" : "Click to Upload",
|
|
51395
|
+
accept: "image/*, .pdf, .png, .jpeg, .jpg",
|
|
51396
|
+
uploadedFiles: mutationDocFile && !rawFiles.mutation ? [["Document", {
|
|
51397
|
+
fileStoreId: mutationDocFile
|
|
51398
|
+
}]] : undefined,
|
|
51399
|
+
removeTargetedFile: () => {
|
|
51400
|
+
setMutationDocFile(null);
|
|
51401
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
51402
|
+
mutation: null
|
|
51403
|
+
}));
|
|
51404
|
+
}
|
|
51405
|
+
})), fieldErrors.mutationFile && /*#__PURE__*/React.createElement("div", {
|
|
51406
|
+
style: errorTextStyle
|
|
51407
|
+
}, fieldErrors.mutationFile), mutationDocFile && /*#__PURE__*/React.createElement("div", {
|
|
51408
|
+
style: successTextStyle
|
|
51409
|
+
}, "\u2713 Document uploaded successfully"))), /*#__PURE__*/React.createElement("div", {
|
|
51410
|
+
style: {
|
|
51411
|
+
display: "flex",
|
|
51412
|
+
justifyContent: "space-between",
|
|
51413
|
+
alignItems: "center",
|
|
51414
|
+
marginTop: "32px"
|
|
51415
|
+
}
|
|
51416
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
51417
|
+
type: "button",
|
|
51418
|
+
onClick: onBack,
|
|
51419
|
+
style: {
|
|
51420
|
+
padding: "8px 24px",
|
|
51421
|
+
backgroundColor: "#e0e0e0",
|
|
51422
|
+
border: "none",
|
|
51423
|
+
borderRadius: "4px",
|
|
51424
|
+
cursor: "pointer",
|
|
51425
|
+
fontWeight: "bold"
|
|
51426
|
+
}
|
|
51427
|
+
}, "\u2190 Back"), /*#__PURE__*/React.createElement("div", {
|
|
51428
|
+
style: {
|
|
51429
|
+
display: "flex",
|
|
51430
|
+
alignItems: "center",
|
|
51431
|
+
gap: "12px"
|
|
51432
|
+
}
|
|
51433
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
51434
|
+
style: {
|
|
51435
|
+
fontSize: "12px",
|
|
51436
|
+
color: "#999"
|
|
51437
|
+
}
|
|
51438
|
+
}, "All documents are mandatory"), /*#__PURE__*/React.createElement("button", {
|
|
51439
|
+
type: "button",
|
|
51440
|
+
onClick: onProceed,
|
|
51441
|
+
disabled: isUploading,
|
|
51442
|
+
style: {
|
|
51443
|
+
padding: "10px 24px",
|
|
51444
|
+
backgroundColor: isUploading ? "#ccc" : "#00497e",
|
|
51445
|
+
color: "white",
|
|
51446
|
+
border: "none",
|
|
51447
|
+
borderRadius: "4px",
|
|
51448
|
+
cursor: isUploading ? "not-allowed" : "pointer",
|
|
51449
|
+
fontWeight: "bold"
|
|
51450
|
+
}
|
|
51451
|
+
}, isUploading ? "Uploading..." : "Proceed to Application Preview →"))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
51452
|
+
error: showToast.key === "error",
|
|
51453
|
+
warning: showToast.key === "warning",
|
|
51454
|
+
success: showToast.key === "success",
|
|
51455
|
+
label: t(showToast.message),
|
|
51456
|
+
onClose: () => setShowToast(null),
|
|
51457
|
+
isDleteBtn: true
|
|
51458
|
+
}));
|
|
51459
|
+
};
|
|
51460
|
+
|
|
51461
|
+
const Step4_Preview = _ref => {
|
|
51462
|
+
var _appData$connectionHo, _appData$property, _address$locality;
|
|
51463
|
+
let formData = _ref.formData,
|
|
51464
|
+
applicationDetails = _ref.applicationDetails,
|
|
51465
|
+
onBack = _ref.onBack,
|
|
51466
|
+
onSubmit = _ref.onSubmit,
|
|
51467
|
+
isLoading = _ref.isLoading;
|
|
51468
|
+
const _useState = useState(false),
|
|
51469
|
+
agreed = _useState[0],
|
|
51470
|
+
setAgreed = _useState[1];
|
|
51471
|
+
const _useState2 = useState(0),
|
|
51472
|
+
fee = _useState2[0],
|
|
51473
|
+
setFee = _useState2[1];
|
|
51474
|
+
const _useState3 = useState("Calculating..."),
|
|
51475
|
+
slab = _useState3[0],
|
|
51476
|
+
setSlab = _useState3[1];
|
|
51477
|
+
const getMaskedName = name => {
|
|
51478
|
+
if (!name) return "NA";
|
|
51479
|
+
return name.split("").map((char, index) => index % 2 === 1 && char !== " " ? "*" : char).join("");
|
|
51480
|
+
};
|
|
51481
|
+
const getMaskedPhone = phone => {
|
|
51482
|
+
if (!phone || phone.length < 10) return "NA";
|
|
51483
|
+
return "******" + phone.slice(-4);
|
|
51484
|
+
};
|
|
51485
|
+
const appData = (applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData) || {};
|
|
51486
|
+
const connectionNo = (appData === null || appData === void 0 ? void 0 : appData.connectionNo) || "NA";
|
|
51487
|
+
const meterId = (appData === null || appData === void 0 ? void 0 : appData.meterId) || "NA";
|
|
51488
|
+
const propertyId = (appData === null || appData === void 0 ? void 0 : appData.propertyId) || "NA";
|
|
51489
|
+
const oldHolder = (appData === null || appData === void 0 ? void 0 : (_appData$connectionHo = appData.connectionHolders) === null || _appData$connectionHo === void 0 ? void 0 : _appData$connectionHo[0]) || {};
|
|
51490
|
+
const oldName = getMaskedName(oldHolder === null || oldHolder === void 0 ? void 0 : oldHolder.name);
|
|
51491
|
+
const oldPhone = getMaskedPhone(oldHolder === null || oldHolder === void 0 ? void 0 : oldHolder.mobileNumber);
|
|
51492
|
+
const address = (appData === null || appData === void 0 ? void 0 : (_appData$property = appData.property) === null || _appData$property === void 0 ? void 0 : _appData$property.address) || {};
|
|
51493
|
+
const oldAddress = [address === null || address === void 0 ? void 0 : address.doorNo, address === null || address === void 0 ? void 0 : address.buildingName, address === null || address === void 0 ? void 0 : address.street, address === null || address === void 0 ? void 0 : (_address$locality = address.locality) === null || _address$locality === void 0 ? void 0 : _address$locality.name, address === null || address === void 0 ? void 0 : address.city].filter(Boolean).join(", ") || "NA";
|
|
51494
|
+
const proposedNewConsumerName = formData.proposedNewConsumerName,
|
|
51495
|
+
newOwnerMobileNumber = formData.newOwnerMobileNumber,
|
|
51496
|
+
relationshipWithExistingConsumer = formData.relationshipWithExistingConsumer,
|
|
51497
|
+
reasonForNameChange = formData.reasonForNameChange,
|
|
51498
|
+
identityProofType = formData.identityProofType,
|
|
51499
|
+
documentNumber = formData.documentNumber,
|
|
51500
|
+
identityProofDocumentId = formData.identityProofDocumentId,
|
|
51501
|
+
saleDeedDocumentId = formData.saleDeedDocumentId;
|
|
51502
|
+
const getRelationshipName = code => {
|
|
51503
|
+
if (code !== null && code !== void 0 && code.code) return code.i18nKey;
|
|
51504
|
+
const map = {
|
|
51505
|
+
"BLOOD_RELATION": "Blood Relation",
|
|
51506
|
+
"LEGAL_HEIR": "Legal Heir",
|
|
51507
|
+
"OTHER": "Other"
|
|
51508
|
+
};
|
|
51509
|
+
return map[code] || code;
|
|
51510
|
+
};
|
|
51511
|
+
const getReasonName = code => {
|
|
51512
|
+
if (code !== null && code !== void 0 && code.code) return code.i18nKey;
|
|
51513
|
+
const map = {
|
|
51514
|
+
"SALE_PURCHASE": "Sale / Purchase of Property",
|
|
51515
|
+
"DEVOLUTION_INHERITANCE": "Inheritance / Succession",
|
|
51516
|
+
"OTHER": "Other"
|
|
51517
|
+
};
|
|
51518
|
+
return map[code] || code;
|
|
51519
|
+
};
|
|
51520
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
51521
|
+
const viewDocument = function (fileStoreId) {
|
|
51522
|
+
try {
|
|
51523
|
+
if (!fileStoreId) return Promise.resolve();
|
|
51524
|
+
const _temp = _catch(function () {
|
|
51525
|
+
const stateId = Digit.ULBService.getStateId();
|
|
51526
|
+
return Promise.resolve(window.Digit.UploadServices.Filefetch([fileStoreId], stateId)).then(function (res) {
|
|
51527
|
+
var _res$data;
|
|
51528
|
+
if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data[fileStoreId]) {
|
|
51529
|
+
const fileUrl = res.data[fileStoreId].split(",")[0];
|
|
51530
|
+
window.open(fileUrl, "_blank");
|
|
51531
|
+
}
|
|
51532
|
+
});
|
|
51533
|
+
}, function (err) {
|
|
51534
|
+
console.error("Failed to fetch document", err);
|
|
51535
|
+
});
|
|
51536
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
51537
|
+
} catch (e) {
|
|
51538
|
+
return Promise.reject(e);
|
|
51539
|
+
}
|
|
51540
|
+
};
|
|
51541
|
+
useEffect(() => {
|
|
51542
|
+
const relationCode = (relationshipWithExistingConsumer === null || relationshipWithExistingConsumer === void 0 ? void 0 : relationshipWithExistingConsumer.code) || relationshipWithExistingConsumer;
|
|
51543
|
+
if (relationCode && relationCode !== "OTHER") {
|
|
51544
|
+
setFee(100);
|
|
51545
|
+
setSlab("Blood relation slab");
|
|
51546
|
+
} else {
|
|
51547
|
+
setFee(1350);
|
|
51548
|
+
setSlab("Other Slab");
|
|
51549
|
+
}
|
|
51550
|
+
}, [relationshipWithExistingConsumer]);
|
|
51551
|
+
const sectionStyle = {
|
|
51552
|
+
border: "1px solid #e0e0e0",
|
|
51553
|
+
borderRadius: "8px",
|
|
51554
|
+
padding: "16px",
|
|
51555
|
+
marginBottom: "16px"
|
|
51556
|
+
};
|
|
51557
|
+
const labelStyle = {
|
|
51558
|
+
color: "#666",
|
|
51559
|
+
fontSize: "14px",
|
|
51560
|
+
marginBottom: "4px"
|
|
51561
|
+
};
|
|
51562
|
+
const valueStyle = {
|
|
51563
|
+
fontWeight: "bold",
|
|
51564
|
+
fontSize: "16px"
|
|
51565
|
+
};
|
|
51566
|
+
const uploadDocStatusStyle = {
|
|
51567
|
+
fontSize: "14px",
|
|
51568
|
+
fontWeight: "bold"
|
|
51569
|
+
};
|
|
51570
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
51571
|
+
style: {
|
|
51572
|
+
marginBottom: "20px"
|
|
51573
|
+
}
|
|
51574
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
51575
|
+
style: {
|
|
51576
|
+
display: "flex",
|
|
51577
|
+
alignItems: "center",
|
|
51578
|
+
marginBottom: "16px"
|
|
51579
|
+
}
|
|
51580
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
51581
|
+
style: {
|
|
51582
|
+
fontSize: "24px",
|
|
51583
|
+
marginRight: "8px"
|
|
51584
|
+
}
|
|
51585
|
+
}, "\uD83D\uDCCB"), /*#__PURE__*/React.createElement("h2", {
|
|
51586
|
+
style: {
|
|
51587
|
+
fontSize: "20px",
|
|
51588
|
+
fontWeight: "700",
|
|
51589
|
+
margin: 0
|
|
51590
|
+
}
|
|
51591
|
+
}, "4. Application Preview & Final Declaration")), /*#__PURE__*/React.createElement("div", {
|
|
51592
|
+
style: _extends({}, sectionStyle, {
|
|
51593
|
+
borderLeft: "4px solid #00497e"
|
|
51594
|
+
})
|
|
51595
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
51596
|
+
style: {
|
|
51597
|
+
fontSize: "16px",
|
|
51598
|
+
fontWeight: "bold",
|
|
51599
|
+
color: "#00497e",
|
|
51600
|
+
marginBottom: "12px"
|
|
51601
|
+
}
|
|
51602
|
+
}, "Property & Connection Summary"), /*#__PURE__*/React.createElement("div", {
|
|
51603
|
+
style: {
|
|
51604
|
+
display: "flex",
|
|
51605
|
+
justifyContent: "space-between"
|
|
51606
|
+
}
|
|
51607
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51608
|
+
style: labelStyle
|
|
51609
|
+
}, "Connection No"), /*#__PURE__*/React.createElement("div", {
|
|
51610
|
+
style: valueStyle
|
|
51611
|
+
}, connectionNo)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51612
|
+
style: labelStyle
|
|
51613
|
+
}, "Meter Number"), /*#__PURE__*/React.createElement("div", {
|
|
51614
|
+
style: valueStyle
|
|
51615
|
+
}, meterId)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51616
|
+
style: labelStyle
|
|
51617
|
+
}, "Property ID"), /*#__PURE__*/React.createElement("div", {
|
|
51618
|
+
style: valueStyle
|
|
51619
|
+
}, propertyId)))), /*#__PURE__*/React.createElement("div", {
|
|
51620
|
+
style: _extends({}, sectionStyle, {
|
|
51621
|
+
borderLeft: "4px solid #f29c1f"
|
|
51622
|
+
})
|
|
51623
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
51624
|
+
style: {
|
|
51625
|
+
fontSize: "16px",
|
|
51626
|
+
fontWeight: "bold",
|
|
51627
|
+
color: "#f29c1f",
|
|
51628
|
+
marginBottom: "12px"
|
|
51629
|
+
}
|
|
51630
|
+
}, "\uD83D\uDD12 Existing / Previous Owner Details (Masked Information)"), /*#__PURE__*/React.createElement("div", {
|
|
51631
|
+
style: {
|
|
51632
|
+
display: "flex",
|
|
51633
|
+
justifyContent: "space-between",
|
|
51634
|
+
marginBottom: "12px"
|
|
51635
|
+
}
|
|
51636
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51637
|
+
style: labelStyle
|
|
51638
|
+
}, "Registered Name:"), /*#__PURE__*/React.createElement("div", {
|
|
51639
|
+
style: valueStyle
|
|
51640
|
+
}, oldName)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51641
|
+
style: labelStyle
|
|
51642
|
+
}, "Meter Number:"), /*#__PURE__*/React.createElement("div", {
|
|
51643
|
+
style: valueStyle
|
|
51644
|
+
}, meterId)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51645
|
+
style: labelStyle
|
|
51646
|
+
}, "Registered Phone:"), /*#__PURE__*/React.createElement("div", {
|
|
51647
|
+
style: valueStyle
|
|
51648
|
+
}, oldPhone))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51649
|
+
style: labelStyle
|
|
51650
|
+
}, "Registered Address:"), /*#__PURE__*/React.createElement("div", {
|
|
51651
|
+
style: valueStyle
|
|
51652
|
+
}, oldAddress))), /*#__PURE__*/React.createElement("div", {
|
|
51653
|
+
style: _extends({}, sectionStyle, {
|
|
51654
|
+
borderLeft: "4px solid #00497e"
|
|
51655
|
+
})
|
|
51656
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
51657
|
+
style: {
|
|
51658
|
+
fontSize: "16px",
|
|
51659
|
+
fontWeight: "bold",
|
|
51660
|
+
color: "#00497e",
|
|
51661
|
+
marginBottom: "12px"
|
|
51662
|
+
}
|
|
51663
|
+
}, "\uD83D\uDC64 Transferee (New Owner) Summary"), /*#__PURE__*/React.createElement("div", {
|
|
51664
|
+
style: {
|
|
51665
|
+
display: "flex",
|
|
51666
|
+
justifyContent: "space-between"
|
|
51667
|
+
}
|
|
51668
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51669
|
+
style: labelStyle
|
|
51670
|
+
}, "New Owner Name"), /*#__PURE__*/React.createElement("div", {
|
|
51671
|
+
style: valueStyle
|
|
51672
|
+
}, proposedNewConsumerName)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51673
|
+
style: labelStyle
|
|
51674
|
+
}, "Mobile Number"), /*#__PURE__*/React.createElement("div", {
|
|
51675
|
+
style: valueStyle
|
|
51676
|
+
}, newOwnerMobileNumber)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51677
|
+
style: labelStyle
|
|
51678
|
+
}, "Relation Type"), /*#__PURE__*/React.createElement("div", {
|
|
51679
|
+
style: valueStyle
|
|
51680
|
+
}, getRelationshipName(relationshipWithExistingConsumer))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51681
|
+
style: labelStyle
|
|
51682
|
+
}, "Transfer Reason"), /*#__PURE__*/React.createElement("div", {
|
|
51683
|
+
style: valueStyle
|
|
51684
|
+
}, getReasonName(reasonForNameChange))))), /*#__PURE__*/React.createElement("div", {
|
|
51685
|
+
style: _extends({}, sectionStyle, {
|
|
51686
|
+
borderLeft: "4px solid #17a2b8"
|
|
51687
|
+
})
|
|
51688
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
51689
|
+
style: {
|
|
51690
|
+
fontSize: "16px",
|
|
51691
|
+
fontWeight: "bold",
|
|
51692
|
+
color: "#17a2b8",
|
|
51693
|
+
marginBottom: "12px"
|
|
51694
|
+
}
|
|
51695
|
+
}, "Uploaded Documents"), /*#__PURE__*/React.createElement("div", {
|
|
51696
|
+
style: {
|
|
51697
|
+
display: "grid",
|
|
51698
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
51699
|
+
gap: "16px"
|
|
51700
|
+
}
|
|
51701
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51702
|
+
style: labelStyle
|
|
51703
|
+
}, "Address / Identity Proof"), /*#__PURE__*/React.createElement("div", {
|
|
51704
|
+
style: {
|
|
51705
|
+
display: "flex",
|
|
51706
|
+
alignItems: "center",
|
|
51707
|
+
gap: "8px"
|
|
51708
|
+
}
|
|
51709
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
51710
|
+
style: uploadDocStatusStyle
|
|
51711
|
+
}, "\u2713 ", (identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.i18nKey) || "Document"), identityProofDocumentId && /*#__PURE__*/React.createElement("button", {
|
|
51712
|
+
type: "button",
|
|
51713
|
+
onClick: () => viewDocument(identityProofDocumentId),
|
|
51714
|
+
style: {
|
|
51715
|
+
color: "#00497e",
|
|
51716
|
+
background: "none",
|
|
51717
|
+
border: "none",
|
|
51718
|
+
textDecoration: "underline",
|
|
51719
|
+
cursor: "pointer",
|
|
51720
|
+
fontSize: "14px",
|
|
51721
|
+
fontWeight: "bold"
|
|
51722
|
+
}
|
|
51723
|
+
}, "View"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51724
|
+
style: labelStyle
|
|
51725
|
+
}, "Document Number"), /*#__PURE__*/React.createElement("div", {
|
|
51726
|
+
style: valueStyle
|
|
51727
|
+
}, documentNumber || "NA")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51728
|
+
style: labelStyle
|
|
51729
|
+
}, "Reason-Based Proof"), /*#__PURE__*/React.createElement("div", {
|
|
51730
|
+
style: {
|
|
51731
|
+
display: "flex",
|
|
51732
|
+
alignItems: "center",
|
|
51733
|
+
gap: "8px"
|
|
51734
|
+
}
|
|
51735
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
51736
|
+
style: uploadDocStatusStyle
|
|
51737
|
+
}, "\u2713 Uploaded"), saleDeedDocumentId && /*#__PURE__*/React.createElement("button", {
|
|
51738
|
+
type: "button",
|
|
51739
|
+
onClick: () => viewDocument(saleDeedDocumentId),
|
|
51740
|
+
style: {
|
|
51741
|
+
color: "#00497e",
|
|
51742
|
+
background: "none",
|
|
51743
|
+
border: "none",
|
|
51744
|
+
textDecoration: "underline",
|
|
51745
|
+
cursor: "pointer",
|
|
51746
|
+
fontSize: "14px",
|
|
51747
|
+
fontWeight: "bold"
|
|
51748
|
+
}
|
|
51749
|
+
}, "View"))))), /*#__PURE__*/React.createElement("div", {
|
|
51750
|
+
style: _extends({}, sectionStyle, {
|
|
51751
|
+
backgroundColor: "#f2fff5",
|
|
51752
|
+
border: "1px solid #c3e6cb",
|
|
51753
|
+
borderLeft: "4px solid #28a745"
|
|
51754
|
+
})
|
|
51755
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
51756
|
+
style: {
|
|
51757
|
+
fontSize: "16px",
|
|
51758
|
+
fontWeight: "bold",
|
|
51759
|
+
color: "#28a745",
|
|
51760
|
+
marginBottom: "12px"
|
|
51761
|
+
}
|
|
51762
|
+
}, "\uD83D\uDCB5 Mutation Fee Details (Money to Pay in Mutation)"), /*#__PURE__*/React.createElement("div", {
|
|
51763
|
+
style: {
|
|
51764
|
+
display: "flex",
|
|
51765
|
+
justifyContent: "space-between"
|
|
51766
|
+
}
|
|
51767
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51768
|
+
style: labelStyle
|
|
51769
|
+
}, "Mutation Money to Pay:"), /*#__PURE__*/React.createElement("div", {
|
|
51770
|
+
style: _extends({}, valueStyle, {
|
|
51771
|
+
color: "#28a745",
|
|
51772
|
+
fontSize: "20px"
|
|
51773
|
+
})
|
|
51774
|
+
}, "\u20B9 ", fee, ".00")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51775
|
+
style: labelStyle
|
|
51776
|
+
}, "Fee Status:"), /*#__PURE__*/React.createElement("span", {
|
|
51777
|
+
style: {
|
|
51778
|
+
padding: "4px 8px",
|
|
51779
|
+
backgroundColor: "#d1ecf1",
|
|
51780
|
+
color: "#0c5460",
|
|
51781
|
+
borderRadius: "16px",
|
|
51782
|
+
fontSize: "12px",
|
|
51783
|
+
fontWeight: "bold"
|
|
51784
|
+
}
|
|
51785
|
+
}, "PAYABLE POST VERIFICATION")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
51786
|
+
style: labelStyle
|
|
51787
|
+
}, "Applicable Slab:"), /*#__PURE__*/React.createElement("div", {
|
|
51788
|
+
style: valueStyle
|
|
51789
|
+
}, slab)))), /*#__PURE__*/React.createElement("div", {
|
|
51790
|
+
style: {
|
|
51791
|
+
padding: "16px",
|
|
51792
|
+
backgroundColor: "#fffbeb",
|
|
51793
|
+
border: "1px solid #ffeeba",
|
|
51794
|
+
borderRadius: "8px",
|
|
51795
|
+
marginBottom: "24px"
|
|
51796
|
+
}
|
|
51797
|
+
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
51798
|
+
label: "I want to go ahead with submitting this application. I confirm that the details and information provided by me are true and correct to the best of my knowledge.",
|
|
51799
|
+
onChange: e => setAgreed(e.target.checked),
|
|
51800
|
+
checked: agreed
|
|
51801
|
+
})), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement("button", {
|
|
51802
|
+
type: "button",
|
|
51803
|
+
onClick: onBack,
|
|
51804
|
+
style: {
|
|
51805
|
+
padding: "8px 24px",
|
|
51806
|
+
backgroundColor: "#e0e0e0",
|
|
51807
|
+
border: "none",
|
|
51808
|
+
borderRadius: "4px",
|
|
51809
|
+
cursor: "pointer",
|
|
51810
|
+
fontWeight: "bold",
|
|
51811
|
+
marginRight: "16px"
|
|
51812
|
+
}
|
|
51813
|
+
}, "\u2190 Edit Information"), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
51814
|
+
label: isLoading ? "Submitting..." : "Submit Mutation Application",
|
|
51815
|
+
onSubmit: onSubmit,
|
|
51816
|
+
disabled: !agreed || isLoading
|
|
51817
|
+
})));
|
|
51818
|
+
};
|
|
51819
|
+
|
|
51820
|
+
const Step5_Submission = _ref => {
|
|
51821
|
+
let applicationNumber = _ref.applicationNumber,
|
|
51822
|
+
serviceType = _ref.serviceType,
|
|
51823
|
+
t = _ref.t;
|
|
51824
|
+
const history = useHistory();
|
|
51825
|
+
const _useState = useState(null),
|
|
51826
|
+
showToast = _useState[0],
|
|
51827
|
+
setShowToast = _useState[1];
|
|
51828
|
+
const _useState2 = useState(false);
|
|
51829
|
+
const _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSApplicationActions(serviceType);
|
|
51830
|
+
const goHome = () => {
|
|
51831
|
+
history.push("/digit-ui/employee");
|
|
51832
|
+
};
|
|
51833
|
+
const bannerStyle = {
|
|
51834
|
+
backgroundColor: "#fff",
|
|
51835
|
+
border: "1px solid #d4edda",
|
|
51836
|
+
borderTop: "4px solid #28a745",
|
|
51837
|
+
borderRadius: "8px",
|
|
51838
|
+
padding: "20px",
|
|
51839
|
+
display: "flex",
|
|
51840
|
+
justifyContent: "space-between",
|
|
51841
|
+
alignItems: "center",
|
|
51842
|
+
marginBottom: "20px"
|
|
51843
|
+
};
|
|
51844
|
+
const statusPanelStyle = {
|
|
51845
|
+
backgroundColor: "#fff",
|
|
51846
|
+
border: "1px solid #e0e0e0",
|
|
51847
|
+
borderRadius: "8px",
|
|
51848
|
+
padding: "20px"
|
|
51849
|
+
};
|
|
51850
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51851
|
+
style: {
|
|
51852
|
+
padding: "20px 0"
|
|
51853
|
+
}
|
|
51854
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
51855
|
+
style: bannerStyle
|
|
51856
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", {
|
|
51857
|
+
style: {
|
|
51858
|
+
color: "#28a745",
|
|
51859
|
+
fontSize: "20px",
|
|
51860
|
+
fontWeight: "bold",
|
|
51861
|
+
margin: 0,
|
|
51862
|
+
display: "flex",
|
|
51863
|
+
alignItems: "center"
|
|
51864
|
+
}
|
|
51865
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
51866
|
+
style: {
|
|
51867
|
+
marginRight: "8px"
|
|
51868
|
+
}
|
|
51869
|
+
}, "\u2705"), " Application Submitted Successfully!"), /*#__PURE__*/React.createElement("div", {
|
|
51870
|
+
style: {
|
|
51871
|
+
color: "#666",
|
|
51872
|
+
marginTop: "4px"
|
|
51873
|
+
}
|
|
51874
|
+
}, "Application Reference No: ", /*#__PURE__*/React.createElement("strong", {
|
|
51875
|
+
style: {
|
|
51876
|
+
color: "#00497e"
|
|
51877
|
+
}
|
|
51878
|
+
}, applicationNumber))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
51879
|
+
style: {
|
|
51880
|
+
padding: "6px 12px",
|
|
51881
|
+
backgroundColor: "#fff3cd",
|
|
51882
|
+
color: "#856404",
|
|
51883
|
+
borderRadius: "16px",
|
|
51884
|
+
fontSize: "12px",
|
|
51885
|
+
fontWeight: "bold"
|
|
51886
|
+
}
|
|
51887
|
+
}, "PENDING_APPROVAL_FOR_MUTATION"))), /*#__PURE__*/React.createElement("div", {
|
|
51888
|
+
style: statusPanelStyle
|
|
51889
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
51890
|
+
style: {
|
|
51891
|
+
color: "#00497e",
|
|
51892
|
+
fontSize: "16px",
|
|
51893
|
+
fontWeight: "bold",
|
|
51894
|
+
margin: "0 0 16px 0",
|
|
51895
|
+
display: "flex",
|
|
51896
|
+
alignItems: "center"
|
|
51897
|
+
}
|
|
51898
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
51899
|
+
style: {
|
|
51900
|
+
marginRight: "8px"
|
|
51901
|
+
}
|
|
51902
|
+
}, "\uD83D\uDCCC"), " Current Workflow Status"), /*#__PURE__*/React.createElement("hr", {
|
|
51903
|
+
style: {
|
|
51904
|
+
border: "0",
|
|
51905
|
+
borderTop: "1px solid #e0e0e0",
|
|
51906
|
+
margin: "0 0 16px 0"
|
|
51907
|
+
}
|
|
51908
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
51909
|
+
style: {
|
|
51910
|
+
color: "#333",
|
|
51911
|
+
fontSize: "14px",
|
|
51912
|
+
margin: 0
|
|
51913
|
+
}
|
|
51914
|
+
}, "Application has been routed to ", /*#__PURE__*/React.createElement("strong", null, "Water Supply Department Verification Officer"), ".")), /*#__PURE__*/React.createElement("div", {
|
|
51915
|
+
style: {
|
|
51916
|
+
marginTop: "24px",
|
|
51917
|
+
textAlign: "center"
|
|
51918
|
+
}
|
|
51919
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
51920
|
+
onClick: goHome,
|
|
51921
|
+
style: {
|
|
51922
|
+
padding: "10px 24px",
|
|
51923
|
+
backgroundColor: "#00497e",
|
|
51924
|
+
color: "white",
|
|
51925
|
+
border: "none",
|
|
51926
|
+
borderRadius: "4px",
|
|
51927
|
+
cursor: "pointer",
|
|
51928
|
+
fontWeight: "bold"
|
|
51929
|
+
}
|
|
51930
|
+
}, "Go to Home")), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
51931
|
+
error: showToast.key === "error",
|
|
51932
|
+
warning: showToast.key === "warning",
|
|
51933
|
+
label: t(showToast.message),
|
|
51934
|
+
onClose: () => setShowToast(null)
|
|
51935
|
+
}));
|
|
51936
|
+
};
|
|
51937
|
+
|
|
51938
|
+
const MutationApplication = () => {
|
|
51939
|
+
var _state, _details$applicationD, _applicationDetails$a, _applicationDetails$a3, _applicationDetails$a4;
|
|
51940
|
+
const _useTranslation = useTranslation(),
|
|
51941
|
+
t = _useTranslation.t;
|
|
51942
|
+
let _useLocation = useLocation(),
|
|
51943
|
+
state = _useLocation.state;
|
|
51944
|
+
state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
|
|
51945
|
+
const history = useHistory();
|
|
51946
|
+
let filters = getQueryStringParams(location.search);
|
|
51947
|
+
const _useState = useState(1),
|
|
51948
|
+
currentStep = _useState[0],
|
|
51949
|
+
setCurrentStep = _useState[1];
|
|
51950
|
+
const _useState2 = useState({}),
|
|
51951
|
+
formData = _useState2[0],
|
|
51952
|
+
setFormData = _useState2[1];
|
|
51953
|
+
const _useState3 = useState(null),
|
|
51954
|
+
showToast = _useState3[0],
|
|
51955
|
+
setShowToast = _useState3[1];
|
|
51956
|
+
const _useState4 = useState(null),
|
|
51957
|
+
generatedAppNo = _useState4[0],
|
|
51958
|
+
setGeneratedAppNo = _useState4[1];
|
|
51959
|
+
const _useState5 = useState(false),
|
|
51960
|
+
isSubmitting = _useState5[0],
|
|
51961
|
+
setIsSubmitting = _useState5[1];
|
|
51962
|
+
const _useState6 = useState(new Set()),
|
|
51963
|
+
setCompletedSteps = _useState6[1];
|
|
50632
51964
|
let tenantId = Digit.ULBService.getCurrentTenantId();
|
|
50633
51965
|
const applicationNumber = filters === null || filters === void 0 ? void 0 : filters.applicationNumber;
|
|
50634
51966
|
const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
|
|
50635
|
-
const stateId = Digit.ULBService.getStateId();
|
|
50636
|
-
let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
|
|
50637
|
-
newConfig = _Digit$Hooks$ws$useWS.data,
|
|
50638
|
-
isConfigLoading = _Digit$Hooks$ws$useWS.isLoading;
|
|
50639
51967
|
let details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
|
|
50640
|
-
let _Digit$Hooks$ws$
|
|
50641
|
-
|
|
50642
|
-
|
|
50643
|
-
const
|
|
50644
|
-
propertyId =
|
|
50645
|
-
setPropertyId = _useState8[1];
|
|
50646
|
-
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
|
|
50647
|
-
sessionFormData = _Digit$Hooks$useSessi[0],
|
|
50648
|
-
setSessionFormData = _Digit$Hooks$useSessi[1],
|
|
50649
|
-
clearSessionFormData = _Digit$Hooks$useSessi[2];
|
|
51968
|
+
let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, (details === null || details === void 0 ? void 0 : details.applicationNo) || applicationNumber, (serviceType === null || serviceType === void 0 ? void 0 : serviceType.toUpperCase()) || (details === null || details === void 0 ? void 0 : (_details$applicationD = details.applicationData) === null || _details$applicationD === void 0 ? void 0 : _details$applicationD.serviceType)),
|
|
51969
|
+
isDetailsLoading = _Digit$Hooks$ws$useWS.isLoading,
|
|
51970
|
+
applicationDetails = _Digit$Hooks$ws$useWS.data;
|
|
51971
|
+
const _useState7 = useState(new URLSearchParams(useLocation().search).get("propertyId") || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a = applicationDetails.applicationData) === null || _applicationDetails$a === void 0 ? void 0 : _applicationDetails$a.propertyId)),
|
|
51972
|
+
propertyId = _useState7[0];
|
|
50650
51973
|
const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
|
|
50651
51974
|
filters: {
|
|
50652
51975
|
propertyIds: propertyId
|
|
@@ -50657,63 +51980,37 @@ const MutationApplication = () => {
|
|
|
50657
51980
|
propertyIds: propertyId
|
|
50658
51981
|
},
|
|
50659
51982
|
tenantId: tenantId,
|
|
50660
|
-
enabled: propertyId
|
|
51983
|
+
enabled: !!propertyId
|
|
50661
51984
|
}),
|
|
50662
|
-
propertyDetails = _Digit$Hooks$pt$usePr.data
|
|
51985
|
+
propertyDetails = _Digit$Hooks$pt$usePr.data,
|
|
51986
|
+
isPropertyLoading = _Digit$Hooks$pt$usePr.isLoading;
|
|
51987
|
+
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
|
|
51988
|
+
sessionFormData = _Digit$Hooks$useSessi[0],
|
|
51989
|
+
setSessionFormData = _Digit$Hooks$useSessi[1],
|
|
51990
|
+
clearSessionFormData = _Digit$Hooks$useSessi[2];
|
|
50663
51991
|
useEffect(() => {
|
|
50664
|
-
|
|
50665
|
-
|
|
50666
|
-
|
|
50667
|
-
|
|
50668
|
-
|
|
50669
|
-
|
|
50670
|
-
|
|
50671
|
-
|
|
50672
|
-
|
|
50673
|
-
|
|
50674
|
-
|
|
50675
|
-
bdyData.head = "";
|
|
50676
|
-
bdyData.className = "mutation-disabled-section";
|
|
50677
|
-
} else if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) === "WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER") {
|
|
50678
|
-
bdyData.head = "Specify ownership updates and transfer reason:";
|
|
50679
|
-
bdyData.body = [{
|
|
50680
|
-
type: "component",
|
|
50681
|
-
key: "MutationApplicantDetails",
|
|
50682
|
-
component: WSMutationApplicantDetails,
|
|
50683
|
-
withoutLabel: true
|
|
50684
|
-
}];
|
|
50685
|
-
} else {
|
|
50686
|
-
bdyData.head = "";
|
|
50687
|
-
bdyData.className = "mutation-hidden-section";
|
|
51992
|
+
var _applicationDetails$a2;
|
|
51993
|
+
const fetchAppData = function () {
|
|
51994
|
+
try {
|
|
51995
|
+
const dataToConvert = applicationDetails || details;
|
|
51996
|
+
const _temp = function (_dataToConvert$applic) {
|
|
51997
|
+
if (dataToConvert !== null && dataToConvert !== void 0 && (_dataToConvert$applic = dataToConvert.applicationData) !== null && _dataToConvert$applic !== void 0 && _dataToConvert$applic.id) {
|
|
51998
|
+
var _dataToConvert$applic2;
|
|
51999
|
+
return Promise.resolve(convertApplicationData(dataToConvert, (serviceType === null || serviceType === void 0 ? void 0 : serviceType.toUpperCase()) || (dataToConvert === null || dataToConvert === void 0 ? void 0 : (_dataToConvert$applic2 = dataToConvert.applicationData) === null || _dataToConvert$applic2 === void 0 ? void 0 : _dataToConvert$applic2.serviceType), true, undefined, t)).then(function (convertAppData) {
|
|
52000
|
+
setSessionFormData(prev => _extends({}, prev, convertAppData));
|
|
52001
|
+
sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
|
|
52002
|
+
});
|
|
50688
52003
|
}
|
|
50689
|
-
});
|
|
50690
|
-
|
|
50691
|
-
|
|
52004
|
+
}();
|
|
52005
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
52006
|
+
} catch (e) {
|
|
52007
|
+
return Promise.reject(e);
|
|
50692
52008
|
}
|
|
52009
|
+
};
|
|
52010
|
+
if (applicationDetails !== null && applicationDetails !== void 0 && (_applicationDetails$a2 = applicationDetails.applicationData) !== null && _applicationDetails$a2 !== void 0 && _applicationDetails$a2.id && !(sessionFormData !== null && sessionFormData !== void 0 && sessionFormData.applicationData)) {
|
|
52011
|
+
fetchAppData();
|
|
50693
52012
|
}
|
|
50694
|
-
}, [
|
|
50695
|
-
useEffect(() => {
|
|
50696
|
-
var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
|
|
50697
|
-
!propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
|
|
50698
|
-
}, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
50699
|
-
useEffect(function () {
|
|
50700
|
-
try {
|
|
50701
|
-
const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false;
|
|
50702
|
-
const _temp = function (_details3, _details3$application) {
|
|
50703
|
-
if ((_details3 = details) !== null && _details3 !== void 0 && (_details3$application = _details3.applicationData) !== null && _details3$application !== void 0 && _details3$application.id) {
|
|
50704
|
-
var _details4, _details4$application;
|
|
50705
|
-
return Promise.resolve(convertApplicationData(details, (serviceType === null || serviceType === void 0 ? void 0 : serviceType.toUpperCase()) || ((_details4 = details) === null || _details4 === void 0 ? void 0 : (_details4$application = _details4.applicationData) === null || _details4$application === void 0 ? void 0 : _details4$application.serviceType), true, undefined, t)).then(function (convertAppData) {
|
|
50706
|
-
setSessionFormData(prev => _extends({}, prev, convertAppData));
|
|
50707
|
-
setAppData(prev => _extends({}, prev, convertAppData));
|
|
50708
|
-
sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
|
|
50709
|
-
});
|
|
50710
|
-
}
|
|
50711
|
-
}();
|
|
50712
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
50713
|
-
} catch (e) {
|
|
50714
|
-
return Promise.reject(e);
|
|
50715
|
-
}
|
|
50716
|
-
}, [details, applicationDetails]);
|
|
52013
|
+
}, [applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a3 = applicationDetails.applicationData) === null || _applicationDetails$a3 === void 0 ? void 0 : _applicationDetails$a3.id]);
|
|
50717
52014
|
useEffect(() => {
|
|
50718
52015
|
var _propertyDetails$Prop;
|
|
50719
52016
|
if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop = propertyDetails.Properties) !== null && _propertyDetails$Prop !== void 0 && _propertyDetails$Prop[0]) {
|
|
@@ -50727,220 +52024,311 @@ const MutationApplication = () => {
|
|
|
50727
52024
|
});
|
|
50728
52025
|
}
|
|
50729
52026
|
}, [propertyDetails]);
|
|
50730
|
-
useEffect(() => {
|
|
50731
|
-
var _sessionFormData$Conn, _sessionFormData$Conn2;
|
|
50732
|
-
if (sessionFormData !== null && sessionFormData !== void 0 && (_sessionFormData$Conn = sessionFormData.ConnectionDetails) !== null && _sessionFormData$Conn !== void 0 && (_sessionFormData$Conn2 = _sessionFormData$Conn[0]) !== null && _sessionFormData$Conn2 !== void 0 && _sessionFormData$Conn2.applicationNo) {
|
|
50733
|
-
setEnabledLoader(false);
|
|
50734
|
-
}
|
|
50735
|
-
}, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
50736
|
-
useEffect(() => {
|
|
50737
|
-
const timer = setTimeout(() => {
|
|
50738
|
-
var _sessionFormData$Conn3, _sessionFormData$Conn4, _sessionFormData$Conn5, _sessionFormData$Conn6, _sessionFormData$Conn7;
|
|
50739
|
-
if (isAppDetailsPage) window.location.href = window.location.origin + "/digit-ui/employee/ws/application-details?applicationNumber=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn3 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn3 === void 0 ? void 0 : (_sessionFormData$Conn4 = _sessionFormData$Conn3[0]) === null || _sessionFormData$Conn4 === void 0 ? void 0 : _sessionFormData$Conn4.applicationNo) + "&service=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn5 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn5 === void 0 ? void 0 : (_sessionFormData$Conn6 = _sessionFormData$Conn5[0]) === null || _sessionFormData$Conn6 === void 0 ? void 0 : (_sessionFormData$Conn7 = _sessionFormData$Conn6.serviceName) === null || _sessionFormData$Conn7 === void 0 ? void 0 : _sessionFormData$Conn7.toUpperCase());
|
|
50740
|
-
}, 3000);
|
|
50741
|
-
return () => clearTimeout(timer);
|
|
50742
|
-
}, [isAppDetailsPage]);
|
|
50743
52027
|
const _Digit$Hooks$ws$useWa = Digit.Hooks.ws.useWaterCreateAPI("WATER"),
|
|
50744
52028
|
waterMutation = _Digit$Hooks$ws$useWa.mutate;
|
|
50745
|
-
const _Digit$Hooks$ws$useWS3 = Digit.Hooks.ws.useWSApplicationActions("WATER");
|
|
50746
52029
|
const _Digit$Hooks$ws$useWa2 = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),
|
|
50747
52030
|
sewerageMutation = _Digit$Hooks$ws$useWa2.mutate;
|
|
50748
|
-
const _Digit$Hooks$ws$
|
|
50749
|
-
|
|
50750
|
-
|
|
50751
|
-
|
|
50752
|
-
|
|
50753
|
-
|
|
50754
|
-
|
|
50755
|
-
|
|
52031
|
+
const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions("WATER"),
|
|
52032
|
+
waterUpdateMutation = _Digit$Hooks$ws$useWS2.mutate;
|
|
52033
|
+
const _Digit$Hooks$ws$useWS3 = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),
|
|
52034
|
+
sewerageUpdateMutation = _Digit$Hooks$ws$useWS3.mutate;
|
|
52035
|
+
const handleNextStep2 = data => {
|
|
52036
|
+
setFormData(prev => _extends({}, prev, data));
|
|
52037
|
+
setCompletedSteps(prev => new Set([...prev, 2]));
|
|
52038
|
+
setCurrentStep(3);
|
|
50756
52039
|
};
|
|
50757
|
-
const
|
|
52040
|
+
const handleNextStep3 = data => {
|
|
52041
|
+
setFormData(prev => _extends({}, prev, data));
|
|
52042
|
+
setCompletedSteps(prev => new Set([...prev, 3]));
|
|
52043
|
+
setCurrentStep(4);
|
|
52044
|
+
};
|
|
52045
|
+
const submitApplication = function () {
|
|
50758
52046
|
try {
|
|
50759
|
-
|
|
50760
|
-
|
|
50761
|
-
|
|
50762
|
-
|
|
50763
|
-
if (!(finalData !== null && finalData !== void 0 && (_finalData$
|
|
50764
|
-
|
|
50765
|
-
|
|
50766
|
-
|
|
50767
|
-
}
|
|
50768
|
-
return Promise.resolve();
|
|
52047
|
+
setIsSubmitting(true);
|
|
52048
|
+
const _temp2 = _catch(function () {
|
|
52049
|
+
var _finalData$cpt;
|
|
52050
|
+
let finalData = _extends({}, sessionFormData);
|
|
52051
|
+
if (!(finalData !== null && finalData !== void 0 && (_finalData$cpt = finalData.cpt) !== null && _finalData$cpt !== void 0 && _finalData$cpt.details)) {
|
|
52052
|
+
var _propertyDetails$Prop3;
|
|
52053
|
+
finalData.cpt = {
|
|
52054
|
+
details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3[0]
|
|
52055
|
+
};
|
|
50769
52056
|
}
|
|
50770
|
-
|
|
50771
|
-
|
|
50772
|
-
|
|
50773
|
-
|
|
50774
|
-
|
|
50775
|
-
|
|
50776
|
-
|
|
50777
|
-
|
|
50778
|
-
|
|
50779
|
-
|
|
50780
|
-
}
|
|
50781
|
-
|
|
50782
|
-
|
|
50783
|
-
|
|
50784
|
-
|
|
50785
|
-
|
|
50786
|
-
|
|
52057
|
+
finalData.MutationApplicantDetails = {
|
|
52058
|
+
proposedNewConsumerName: formData.proposedNewConsumerName,
|
|
52059
|
+
newOwnerMobileNumber: formData.newOwnerMobileNumber,
|
|
52060
|
+
newOwnerEmailAddress: formData.newOwnerEmailAddress,
|
|
52061
|
+
reasonForNameChange: formData.reasonForNameChange,
|
|
52062
|
+
relationshipWithExistingConsumer: formData.relationshipWithExistingConsumer,
|
|
52063
|
+
saleDeedDocumentId: formData.saleDeedDocumentId,
|
|
52064
|
+
identityProofType: formData.identityProofType,
|
|
52065
|
+
identityProofDocumentId: formData.identityProofDocumentId,
|
|
52066
|
+
documentNumber: formData.documentNumber
|
|
52067
|
+
};
|
|
52068
|
+
if (finalData !== null && finalData !== void 0 && finalData.MutationApplicantDetails) {
|
|
52069
|
+
var _finalData$Connection;
|
|
52070
|
+
const mutDetails = finalData.MutationApplicantDetails;
|
|
52071
|
+
const existingHolder = (finalData === null || finalData === void 0 ? void 0 : (_finalData$Connection = finalData.ConnectionHolderDetails) === null || _finalData$Connection === void 0 ? void 0 : _finalData$Connection[0]) || {};
|
|
52072
|
+
finalData.ConnectionHolderDetails = [_extends({}, existingHolder, {
|
|
52073
|
+
name: mutDetails.proposedNewConsumerName || existingHolder.name,
|
|
52074
|
+
mobileNumber: mutDetails.newOwnerMobileNumber || existingHolder.mobileNumber,
|
|
52075
|
+
emailId: mutDetails.newOwnerEmailAddress || existingHolder.emailId,
|
|
52076
|
+
sameAsOwnerDetails: false
|
|
52077
|
+
})];
|
|
52078
|
+
}
|
|
52079
|
+
const sessionDetails = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
|
|
52080
|
+
return Promise.resolve(convertModifyApplicationDetails(finalData, sessionDetails, "INITIATE")).then(function (convertAppData) {
|
|
52081
|
+
if (!convertAppData.dateEffectiveFrom) {
|
|
52082
|
+
convertAppData.dateEffectiveFrom = Date.now();
|
|
50787
52083
|
}
|
|
50788
52084
|
if (finalData !== null && finalData !== void 0 && finalData.MutationApplicantDetails) {
|
|
50789
|
-
var
|
|
52085
|
+
var _mutDetails$reasonFor;
|
|
50790
52086
|
const mutDetails = finalData.MutationApplicantDetails;
|
|
50791
|
-
|
|
50792
|
-
|
|
50793
|
-
|
|
50794
|
-
|
|
50795
|
-
|
|
50796
|
-
|
|
50797
|
-
|
|
50798
|
-
}
|
|
50799
|
-
const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
|
|
50800
|
-
return Promise.resolve(convertModifyApplicationDetails(finalData, details, "APPLY_MUTATION")).then(function (convertAppData) {
|
|
50801
|
-
function _temp6() {
|
|
50802
|
-
const _temp4 = function () {
|
|
50803
|
-
if (serviceType !== "WATER") {
|
|
50804
|
-
const _temp3 = function () {
|
|
50805
|
-
if (sewerageMutation) {
|
|
50806
|
-
setIsEnableLoader(true);
|
|
50807
|
-
return Promise.resolve(sewerageMutation(reqDetails, {
|
|
50808
|
-
onError: (error, variables) => {
|
|
50809
|
-
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2, _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
|
|
50810
|
-
setIsEnableLoader(false);
|
|
50811
|
-
setShowToast({
|
|
50812
|
-
key: "error",
|
|
50813
|
-
message: error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && (_error$response$data = _error$response.data) !== null && _error$response$data !== void 0 && (_error$response$data$ = _error$response$data.Errors) !== null && _error$response$data$ !== void 0 && (_error$response$data$2 = _error$response$data$[0]) !== null && _error$response$data$2 !== void 0 && _error$response$data$2.message ? error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : (_error$response2$data3 = _error$response2$data2[0]) === null || _error$response2$data3 === void 0 ? void 0 : _error$response2$data3.message : error
|
|
50814
|
-
});
|
|
50815
|
-
setTimeout(closeToastOfError, 5000);
|
|
50816
|
-
},
|
|
50817
|
-
onSuccess: function (data, variables) {
|
|
50818
|
-
try {
|
|
50819
|
-
var _data$SewerageConnect, _data$SewerageConnect2;
|
|
50820
|
-
clearSessionFormData();
|
|
50821
|
-
history.push("/digit-ui/employee/ws/ws-response?applicationNumber1=" + (data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : (_data$SewerageConnect2 = _data$SewerageConnect[0]) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2.applicationNo));
|
|
50822
|
-
return Promise.resolve();
|
|
50823
|
-
} catch (e) {
|
|
50824
|
-
return Promise.reject(e);
|
|
50825
|
-
}
|
|
50826
|
-
}
|
|
50827
|
-
})).then(function () {});
|
|
50828
|
-
}
|
|
50829
|
-
}();
|
|
50830
|
-
if (_temp3 && _temp3.then) return _temp3.then(function () {});
|
|
50831
|
-
}
|
|
50832
|
-
}();
|
|
50833
|
-
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
52087
|
+
if (!convertAppData.additionalDetails) convertAppData.additionalDetails = {};
|
|
52088
|
+
if (mutDetails.reasonForNameChange) convertAppData.additionalDetails.reasonForNameChange = ((_mutDetails$reasonFor = mutDetails.reasonForNameChange) === null || _mutDetails$reasonFor === void 0 ? void 0 : _mutDetails$reasonFor.code) || mutDetails.reasonForNameChange;
|
|
52089
|
+
if (mutDetails.relationshipWithExistingConsumer) {
|
|
52090
|
+
var _mutDetails$relations;
|
|
52091
|
+
const relationCode = ((_mutDetails$relations = mutDetails.relationshipWithExistingConsumer) === null || _mutDetails$relations === void 0 ? void 0 : _mutDetails$relations.code) || mutDetails.relationshipWithExistingConsumer;
|
|
52092
|
+
convertAppData.additionalDetails.relationshipWithExistingConsumer = relationCode;
|
|
52093
|
+
convertAppData.additionalDetails.isBloodRelation = relationCode !== "OTHER";
|
|
50834
52094
|
}
|
|
50835
|
-
if (
|
|
50836
|
-
|
|
50837
|
-
|
|
50838
|
-
|
|
50839
|
-
|
|
50840
|
-
|
|
50841
|
-
|
|
50842
|
-
|
|
50843
|
-
|
|
50844
|
-
|
|
50845
|
-
|
|
50846
|
-
|
|
50847
|
-
|
|
50848
|
-
|
|
50849
|
-
|
|
50850
|
-
|
|
50851
|
-
|
|
50852
|
-
|
|
52095
|
+
if (mutDetails.saleDeedDocumentId) {
|
|
52096
|
+
convertAppData.additionalDetails.saleDeedDocumentId = mutDetails.saleDeedDocumentId;
|
|
52097
|
+
if (!convertAppData.documents) convertAppData.documents = [];
|
|
52098
|
+
convertAppData.documents.push({
|
|
52099
|
+
documentType: "REGISTERED_SALE_DEED",
|
|
52100
|
+
fileStoreId: mutDetails.saleDeedDocumentId,
|
|
52101
|
+
documentUid: mutDetails.saleDeedDocumentId,
|
|
52102
|
+
status: "ACTIVE"
|
|
52103
|
+
});
|
|
52104
|
+
}
|
|
52105
|
+
if (mutDetails.identityProofDocumentId) {
|
|
52106
|
+
var _mutDetails$identityP;
|
|
52107
|
+
if (!convertAppData.documents) convertAppData.documents = [];
|
|
52108
|
+
convertAppData.documents.push({
|
|
52109
|
+
documentType: ((_mutDetails$identityP = mutDetails.identityProofType) === null || _mutDetails$identityP === void 0 ? void 0 : _mutDetails$identityP.code) || "IDENTITY_PROOF",
|
|
52110
|
+
fileStoreId: mutDetails.identityProofDocumentId,
|
|
52111
|
+
documentUid: mutDetails.documentNumber || mutDetails.identityProofDocumentId,
|
|
52112
|
+
documentNumber: mutDetails.documentNumber,
|
|
52113
|
+
status: "ACTIVE"
|
|
52114
|
+
});
|
|
52115
|
+
}
|
|
52116
|
+
}
|
|
52117
|
+
convertAppData.applicationType = serviceType == "WATER" ? "MUTATION_WATER_CONNECTION" : "MUTATION_SEWERAGE_CONNECTION";
|
|
52118
|
+
const reqDetails = serviceType == "WATER" ? {
|
|
52119
|
+
WaterConnection: convertAppData,
|
|
52120
|
+
reconnectRequest: false,
|
|
52121
|
+
disconnectRequest: false
|
|
52122
|
+
} : {
|
|
52123
|
+
SewerageConnection: convertAppData,
|
|
52124
|
+
reconnectRequest: false,
|
|
52125
|
+
disconnectRequest: false
|
|
52126
|
+
};
|
|
52127
|
+
const mutation = serviceType == "WATER" ? waterMutation : sewerageMutation;
|
|
52128
|
+
return Promise.resolve(mutation(reqDetails, {
|
|
52129
|
+
onError: error => {
|
|
52130
|
+
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
|
|
52131
|
+
setIsSubmitting(false);
|
|
52132
|
+
setShowToast({
|
|
52133
|
+
key: "error",
|
|
52134
|
+
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) || "Failed to submit application"
|
|
52135
|
+
});
|
|
52136
|
+
},
|
|
52137
|
+
onSuccess: data => {
|
|
52138
|
+
var _data$response, _data$response$data;
|
|
52139
|
+
if (data instanceof Error || data !== null && data !== void 0 && data.isAxiosError || data !== null && data !== void 0 && (_data$response = data.response) !== null && _data$response !== void 0 && (_data$response$data = _data$response.data) !== null && _data$response$data !== void 0 && _data$response$data.Errors) {
|
|
52140
|
+
var _data$response2, _data$response2$data, _apiErrors$;
|
|
52141
|
+
setIsSubmitting(false);
|
|
52142
|
+
const apiErrors = data === null || data === void 0 ? void 0 : (_data$response2 = data.response) === null || _data$response2 === void 0 ? void 0 : (_data$response2$data = _data$response2.data) === null || _data$response2$data === void 0 ? void 0 : _data$response2$data.Errors;
|
|
52143
|
+
const errorMessage = (apiErrors === null || apiErrors === void 0 ? void 0 : (_apiErrors$ = apiErrors[0]) === null || _apiErrors$ === void 0 ? void 0 : _apiErrors$.message) || (data === null || data === void 0 ? void 0 : data.message) || "Failed to submit application";
|
|
52144
|
+
setShowToast({
|
|
52145
|
+
key: "error",
|
|
52146
|
+
message: errorMessage
|
|
50853
52147
|
});
|
|
52148
|
+
return;
|
|
50854
52149
|
}
|
|
50855
|
-
|
|
50856
|
-
|
|
50857
|
-
|
|
50858
|
-
|
|
50859
|
-
|
|
50860
|
-
|
|
50861
|
-
|
|
50862
|
-
|
|
50863
|
-
|
|
50864
|
-
|
|
50865
|
-
|
|
50866
|
-
|
|
50867
|
-
|
|
50868
|
-
|
|
50869
|
-
|
|
50870
|
-
|
|
50871
|
-
|
|
50872
|
-
|
|
50873
|
-
|
|
50874
|
-
|
|
50875
|
-
|
|
50876
|
-
|
|
50877
|
-
|
|
50878
|
-
|
|
50879
|
-
|
|
50880
|
-
|
|
50881
|
-
|
|
50882
|
-
|
|
50883
|
-
|
|
50884
|
-
|
|
50885
|
-
|
|
50886
|
-
|
|
50887
|
-
|
|
50888
|
-
|
|
50889
|
-
|
|
50890
|
-
|
|
50891
|
-
|
|
52150
|
+
if (data !== null && data !== void 0 && data.Errors && data.Errors.length > 0) {
|
|
52151
|
+
setIsSubmitting(false);
|
|
52152
|
+
setShowToast({
|
|
52153
|
+
key: "error",
|
|
52154
|
+
message: data.Errors[0].message || "Failed to submit application"
|
|
52155
|
+
});
|
|
52156
|
+
} else {
|
|
52157
|
+
var _data$WaterConnection, _data$SewerageConnect, _Digit, _Digit$Customizations, _Digit$Customizations2;
|
|
52158
|
+
const updateMutation = serviceType == "WATER" ? waterUpdateMutation : sewerageUpdateMutation;
|
|
52159
|
+
const createdConnection = serviceType == "WATER" ? data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : _data$WaterConnection[0] : data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : _data$SewerageConnect[0];
|
|
52160
|
+
let updatePayload = _extends({}, createdConnection, {
|
|
52161
|
+
dateEffectiveFrom: (createdConnection === null || createdConnection === void 0 ? void 0 : createdConnection.dateEffectiveFrom) || Date.now(),
|
|
52162
|
+
processInstance: _extends({}, createdConnection === null || createdConnection === void 0 ? void 0 : createdConnection.processInstance, {
|
|
52163
|
+
action: "APPLY_MUTATION"
|
|
52164
|
+
})
|
|
52165
|
+
});
|
|
52166
|
+
if ((_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.customiseUpdatePayloadOfWS) {
|
|
52167
|
+
updatePayload = Digit.Customizations.WS.customiseUpdatePayloadOfWS(createdConnection, updatePayload, serviceType);
|
|
52168
|
+
}
|
|
52169
|
+
let reqDetailsUpdate = serviceType == "WATER" ? {
|
|
52170
|
+
WaterConnection: updatePayload,
|
|
52171
|
+
reconnectRequest: false,
|
|
52172
|
+
disconnectRequest: false
|
|
52173
|
+
} : {
|
|
52174
|
+
SewerageConnection: updatePayload,
|
|
52175
|
+
reconnectRequest: false,
|
|
52176
|
+
disconnectRequest: false
|
|
52177
|
+
};
|
|
52178
|
+
updateMutation(reqDetailsUpdate, {
|
|
52179
|
+
onError: error => {
|
|
52180
|
+
var _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
|
|
52181
|
+
setIsSubmitting(false);
|
|
52182
|
+
setShowToast({
|
|
52183
|
+
key: "error",
|
|
52184
|
+
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) || "Failed to update workflow"
|
|
52185
|
+
});
|
|
52186
|
+
},
|
|
52187
|
+
onSuccess: updateData => {
|
|
52188
|
+
var _updateData$response, _updateData$response$, _updateData$WaterConn, _updateData$WaterConn2, _updateData$SewerageC, _updateData$SewerageC2;
|
|
52189
|
+
setIsSubmitting(false);
|
|
52190
|
+
if (updateData instanceof Error || updateData !== null && updateData !== void 0 && updateData.isAxiosError || updateData !== null && updateData !== void 0 && (_updateData$response = updateData.response) !== null && _updateData$response !== void 0 && (_updateData$response$ = _updateData$response.data) !== null && _updateData$response$ !== void 0 && _updateData$response$.Errors) {
|
|
52191
|
+
var _updateData$response2, _updateData$response3, _apiErrors$2;
|
|
52192
|
+
const apiErrors = updateData === null || updateData === void 0 ? void 0 : (_updateData$response2 = updateData.response) === null || _updateData$response2 === void 0 ? void 0 : (_updateData$response3 = _updateData$response2.data) === null || _updateData$response3 === void 0 ? void 0 : _updateData$response3.Errors;
|
|
52193
|
+
const errorMessage = (apiErrors === null || apiErrors === void 0 ? void 0 : (_apiErrors$2 = apiErrors[0]) === null || _apiErrors$2 === void 0 ? void 0 : _apiErrors$2.message) || (updateData === null || updateData === void 0 ? void 0 : updateData.message) || "Failed to update workflow";
|
|
52194
|
+
setShowToast({
|
|
52195
|
+
key: "error",
|
|
52196
|
+
message: errorMessage
|
|
52197
|
+
});
|
|
52198
|
+
return;
|
|
52199
|
+
}
|
|
52200
|
+
if (updateData !== null && updateData !== void 0 && updateData.Errors && updateData.Errors.length > 0) {
|
|
52201
|
+
setShowToast({
|
|
52202
|
+
key: "error",
|
|
52203
|
+
message: updateData.Errors[0].message || "Failed to update workflow"
|
|
52204
|
+
});
|
|
52205
|
+
return;
|
|
52206
|
+
}
|
|
52207
|
+
clearSessionFormData();
|
|
52208
|
+
const newAppNo = serviceType == "WATER" ? updateData === null || updateData === void 0 ? void 0 : (_updateData$WaterConn = updateData.WaterConnection) === null || _updateData$WaterConn === void 0 ? void 0 : (_updateData$WaterConn2 = _updateData$WaterConn[0]) === null || _updateData$WaterConn2 === void 0 ? void 0 : _updateData$WaterConn2.applicationNo : updateData === null || updateData === void 0 ? void 0 : (_updateData$SewerageC = updateData.SewerageConnections) === null || _updateData$SewerageC === void 0 ? void 0 : (_updateData$SewerageC2 = _updateData$SewerageC[0]) === null || _updateData$SewerageC2 === void 0 ? void 0 : _updateData$SewerageC2.applicationNo;
|
|
52209
|
+
setGeneratedAppNo(newAppNo);
|
|
52210
|
+
setCurrentStep(5);
|
|
50892
52211
|
}
|
|
50893
|
-
}
|
|
50894
|
-
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
52212
|
+
});
|
|
50895
52213
|
}
|
|
50896
|
-
}
|
|
50897
|
-
|
|
50898
|
-
|
|
50899
|
-
|
|
50900
|
-
|
|
50901
|
-
|
|
52214
|
+
}
|
|
52215
|
+
})).then(function () {});
|
|
52216
|
+
});
|
|
52217
|
+
}, function (e) {
|
|
52218
|
+
console.error(e);
|
|
52219
|
+
setIsSubmitting(false);
|
|
52220
|
+
setShowToast({
|
|
52221
|
+
key: "error",
|
|
52222
|
+
message: "Failed to submit application"
|
|
52223
|
+
});
|
|
52224
|
+
});
|
|
52225
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
50902
52226
|
} catch (e) {
|
|
50903
52227
|
return Promise.reject(e);
|
|
50904
52228
|
}
|
|
50905
52229
|
};
|
|
50906
|
-
const
|
|
50907
|
-
|
|
50908
|
-
|
|
50909
|
-
|
|
50910
|
-
|
|
52230
|
+
const handleTimelineSelect = (route, index) => {
|
|
52231
|
+
const targetStep = index + 1;
|
|
52232
|
+
if (targetStep < currentStep) {
|
|
52233
|
+
setCurrentStep(targetStep);
|
|
52234
|
+
return;
|
|
52235
|
+
}
|
|
52236
|
+
if (targetStep === currentStep) return;
|
|
52237
|
+
if (targetStep > currentStep) {
|
|
52238
|
+
setShowToast({
|
|
52239
|
+
key: "warning",
|
|
52240
|
+
message: "Please complete Step " + currentStep + " before proceeding to Step " + targetStep + "."
|
|
52241
|
+
});
|
|
52242
|
+
}
|
|
50911
52243
|
};
|
|
50912
|
-
|
|
52244
|
+
const timelineConfig = [{
|
|
52245
|
+
sectionId: "application",
|
|
52246
|
+
route: "application-selection",
|
|
52247
|
+
actions: "Existing Connection"
|
|
52248
|
+
}, {
|
|
52249
|
+
sectionId: "applicant",
|
|
52250
|
+
route: "applicant-details",
|
|
52251
|
+
actions: "New Consumer Details"
|
|
52252
|
+
}, {
|
|
52253
|
+
sectionId: "documents",
|
|
52254
|
+
route: "documents",
|
|
52255
|
+
actions: "Documents"
|
|
52256
|
+
}, {
|
|
52257
|
+
sectionId: "Review",
|
|
52258
|
+
route: "review",
|
|
52259
|
+
actions: "Preview"
|
|
52260
|
+
}].map((step, index) => _extends({}, step, {
|
|
52261
|
+
timeLine: [{
|
|
52262
|
+
actions: step.actions,
|
|
52263
|
+
currentStep: index + 1
|
|
52264
|
+
}]
|
|
52265
|
+
}));
|
|
52266
|
+
if (isDetailsLoading || propertyId && isPropertyLoading) {
|
|
50913
52267
|
return /*#__PURE__*/React.createElement(Loader, null);
|
|
50914
52268
|
}
|
|
50915
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("
|
|
50916
|
-
|
|
50917
|
-
|
|
50918
|
-
|
|
50919
|
-
|
|
50920
|
-
|
|
50921
|
-
|
|
50922
|
-
|
|
50923
|
-
|
|
50924
|
-
|
|
50925
|
-
|
|
50926
|
-
|
|
50927
|
-
}
|
|
50928
|
-
|
|
50929
|
-
|
|
50930
|
-
|
|
50931
|
-
|
|
50932
|
-
|
|
50933
|
-
|
|
50934
|
-
|
|
50935
|
-
|
|
50936
|
-
|
|
50937
|
-
|
|
52269
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
52270
|
+
className: "employee-form-section-wrapper"
|
|
52271
|
+
}, currentStep !== 5 && /*#__PURE__*/React.createElement(VerticalTimeline, {
|
|
52272
|
+
config: timelineConfig,
|
|
52273
|
+
currentActiveIndex: currentStep - 1,
|
|
52274
|
+
showFinalStep: false,
|
|
52275
|
+
onSelect: handleTimelineSelect
|
|
52276
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
52277
|
+
style: {
|
|
52278
|
+
flex: "1",
|
|
52279
|
+
minWidth: 0
|
|
52280
|
+
}
|
|
52281
|
+
}, currentStep === 1 && /*#__PURE__*/React.createElement(Fragment$2, null, /*#__PURE__*/React.createElement(Step1_ExistingConnection, {
|
|
52282
|
+
t: t,
|
|
52283
|
+
applicationDetails: applicationDetails,
|
|
52284
|
+
propertyId: propertyId
|
|
52285
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
52286
|
+
style: {
|
|
52287
|
+
display: "flex",
|
|
52288
|
+
justifyContent: "flex-end"
|
|
52289
|
+
}
|
|
52290
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
52291
|
+
onClick: () => {
|
|
52292
|
+
setCompletedSteps(prev => new Set([...prev, 1]));
|
|
52293
|
+
setCurrentStep(2);
|
|
52294
|
+
},
|
|
52295
|
+
style: {
|
|
52296
|
+
padding: "10px 24px",
|
|
52297
|
+
backgroundColor: "#00497e",
|
|
52298
|
+
color: "white",
|
|
52299
|
+
border: "none",
|
|
52300
|
+
borderRadius: "4px",
|
|
52301
|
+
cursor: "pointer",
|
|
52302
|
+
fontWeight: "bold"
|
|
52303
|
+
}
|
|
52304
|
+
}, "Proceed to New Consumer Details \u2192"))), currentStep === 2 && /*#__PURE__*/React.createElement(Step2_NewConsumerDetails, {
|
|
52305
|
+
t: t,
|
|
52306
|
+
defaultValues: formData,
|
|
52307
|
+
onNext: handleNextStep2,
|
|
52308
|
+
onBack: () => setCurrentStep(1)
|
|
52309
|
+
}), currentStep === 3 && /*#__PURE__*/React.createElement(Step3_UploadDocuments, {
|
|
52310
|
+
t: t,
|
|
52311
|
+
defaultValues: formData,
|
|
52312
|
+
onNext: handleNextStep3,
|
|
52313
|
+
onBack: () => setCurrentStep(2)
|
|
52314
|
+
}), currentStep === 4 && /*#__PURE__*/React.createElement(Step4_Preview, {
|
|
52315
|
+
t: t,
|
|
52316
|
+
formData: formData,
|
|
52317
|
+
applicationDetails: applicationDetails,
|
|
52318
|
+
onBack: () => setCurrentStep(3),
|
|
52319
|
+
onSubmit: submitApplication,
|
|
52320
|
+
isLoading: isSubmitting
|
|
52321
|
+
}), currentStep === 5 && /*#__PURE__*/React.createElement(Step5_Submission, {
|
|
52322
|
+
t: t,
|
|
52323
|
+
applicationNumber: generatedAppNo,
|
|
52324
|
+
serviceType: serviceType || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a4 = applicationDetails.applicationData) === null || _applicationDetails$a4 === void 0 ? void 0 : _applicationDetails$a4.serviceType)
|
|
50938
52325
|
}), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
50939
|
-
|
|
50940
|
-
|
|
52326
|
+
error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error",
|
|
52327
|
+
warning: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "warning",
|
|
50941
52328
|
label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
|
|
50942
|
-
onClose:
|
|
50943
|
-
|
|
52329
|
+
onClose: () => setShowToast(null),
|
|
52330
|
+
isDleteBtn: true
|
|
52331
|
+
}))));
|
|
50944
52332
|
};
|
|
50945
52333
|
|
|
50946
52334
|
const getPath$5 = (path, params) => {
|