@djb25/digit-ui-module-ws 1.0.80 → 1.0.81
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 +904 -383
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +904 -383
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -13397,7 +13397,7 @@ const createConnectionHolderDetails = () => ({
|
|
|
13397
13397
|
isWatsappSameAsMobile: false
|
|
13398
13398
|
});
|
|
13399
13399
|
const WSConnectionHolderDetails = _ref => {
|
|
13400
|
-
var _formData$
|
|
13400
|
+
var _formData$ConnectionH16;
|
|
13401
13401
|
let config = _ref.config,
|
|
13402
13402
|
onSelect = _ref.onSelect,
|
|
13403
13403
|
userType = _ref.userType,
|
|
@@ -13409,7 +13409,35 @@ const WSConnectionHolderDetails = _ref => {
|
|
|
13409
13409
|
t = _useTranslation.t;
|
|
13410
13410
|
const _useLocation = useLocation();
|
|
13411
13411
|
const filters = getQueryStringParams(location.search);
|
|
13412
|
-
const _useState = useState(
|
|
13412
|
+
const _useState = useState(() => {
|
|
13413
|
+
if (formData !== null && formData !== void 0 && formData.ConnectionHolderDetails) {
|
|
13414
|
+
var _formData$ConnectionH;
|
|
13415
|
+
return [_extends({}, formData === null || formData === void 0 ? void 0 : (_formData$ConnectionH = formData.ConnectionHolderDetails) === null || _formData$ConnectionH === void 0 ? void 0 : _formData$ConnectionH[0])];
|
|
13416
|
+
} else {
|
|
13417
|
+
var _Digit$UserService$ge;
|
|
13418
|
+
let initData = createConnectionHolderDetails();
|
|
13419
|
+
const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
|
|
13420
|
+
if (userInfo && userInfo.type === "CITIZEN" && window.location.href.includes("citizen")) {
|
|
13421
|
+
initData = _extends({}, initData, {
|
|
13422
|
+
name: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || "",
|
|
13423
|
+
mobileNumber: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.mobileNumber) || "",
|
|
13424
|
+
emailId: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.emailId) || "",
|
|
13425
|
+
gender: userInfo !== null && userInfo !== void 0 && userInfo.gender ? {
|
|
13426
|
+
code: userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender,
|
|
13427
|
+
i18nKey: "COMMON_GENDER_" + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender),
|
|
13428
|
+
value: userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender
|
|
13429
|
+
} : "",
|
|
13430
|
+
guardian: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.fatherOrHusbandName) || "",
|
|
13431
|
+
relationship: userInfo !== null && userInfo !== void 0 && userInfo.relationship ? {
|
|
13432
|
+
code: userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship,
|
|
13433
|
+
name: userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship,
|
|
13434
|
+
i18nKey: "COMMON_MASTERS_OWNERTYPE_" + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship)
|
|
13435
|
+
} : ""
|
|
13436
|
+
});
|
|
13437
|
+
}
|
|
13438
|
+
return [initData];
|
|
13439
|
+
}
|
|
13440
|
+
}),
|
|
13413
13441
|
connectionHolderDetails = _useState[0],
|
|
13414
13442
|
setConnectionHolderDetails = _useState[1];
|
|
13415
13443
|
const _useState2 = useState({
|
|
@@ -13474,7 +13502,28 @@ const WSConnectionHolderDetails = _ref => {
|
|
|
13474
13502
|
}, [formData === null || formData === void 0 ? void 0 : (_formData$ConnectionH16 = formData.ConnectionHolderDetails) === null || _formData$ConnectionH16 === void 0 ? void 0 : _formData$ConnectionH16[0], connectionHolderDetails, formData]);
|
|
13475
13503
|
useEffect(() => {
|
|
13476
13504
|
if (!(formData !== null && formData !== void 0 && formData.ConnectionHolderDetails)) {
|
|
13477
|
-
|
|
13505
|
+
var _Digit$UserService$ge2;
|
|
13506
|
+
let initData = createConnectionHolderDetails();
|
|
13507
|
+
const userInfo = (_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.info;
|
|
13508
|
+
if (userInfo && userInfo.type === "CITIZEN" && window.location.href.includes("citizen")) {
|
|
13509
|
+
initData = _extends({}, initData, {
|
|
13510
|
+
name: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || "",
|
|
13511
|
+
mobileNumber: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.mobileNumber) || "",
|
|
13512
|
+
emailId: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.emailId) || "",
|
|
13513
|
+
gender: userInfo !== null && userInfo !== void 0 && userInfo.gender ? {
|
|
13514
|
+
code: userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender,
|
|
13515
|
+
i18nKey: "COMMON_GENDER_" + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender),
|
|
13516
|
+
value: userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender
|
|
13517
|
+
} : "",
|
|
13518
|
+
guardian: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.fatherOrHusbandName) || "",
|
|
13519
|
+
relationship: userInfo !== null && userInfo !== void 0 && userInfo.relationship ? {
|
|
13520
|
+
code: userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship,
|
|
13521
|
+
name: userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship,
|
|
13522
|
+
i18nKey: "COMMON_MASTERS_OWNERTYPE_" + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship)
|
|
13523
|
+
} : ""
|
|
13524
|
+
});
|
|
13525
|
+
}
|
|
13526
|
+
setConnectionHolderDetails([initData]);
|
|
13478
13527
|
}
|
|
13479
13528
|
}, [formData === null || formData === void 0 ? void 0 : formData.ConnectionHolderDetails]);
|
|
13480
13529
|
const commonProps = {
|
|
@@ -17603,217 +17652,249 @@ const UploadFileDigiLocker = props => {
|
|
|
17603
17652
|
};
|
|
17604
17653
|
const fetchDigiLockerDocuments = function (e) {
|
|
17605
17654
|
try {
|
|
17655
|
+
let _exit = false;
|
|
17606
17656
|
e.preventDefault();
|
|
17607
17657
|
return Promise.resolve(_catch$1(function () {
|
|
17608
|
-
|
|
17609
|
-
|
|
17610
|
-
|
|
17611
|
-
|
|
17612
|
-
label: "Please login to DigiLocker first to fetch documents."
|
|
17613
|
-
});
|
|
17614
|
-
return;
|
|
17615
|
-
}
|
|
17616
|
-
let TokenReq = {
|
|
17617
|
-
authToken: digiLockerToken
|
|
17618
|
-
};
|
|
17619
|
-
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17620
|
-
return Promise.resolve(Digit.DigiLockerService.issueDoc({
|
|
17621
|
-
TokenReq
|
|
17622
|
-
}, tenantId)).then(function (res1) {
|
|
17623
|
-
if (!res1 || !res1.IssuedDoc) {
|
|
17624
|
-
setShowToast({
|
|
17625
|
-
error: true,
|
|
17626
|
-
label: "Failed to fetch documents from DigiLocker. Please login again."
|
|
17627
|
-
});
|
|
17628
|
-
return;
|
|
17629
|
-
}
|
|
17630
|
-
let doctype = "DRVLC";
|
|
17631
|
-
if (props !== null && props !== void 0 && props.documentType) {
|
|
17632
|
-
const code = props.documentType.toUpperCase();
|
|
17633
|
-
if (code.includes("AADHAAR") || code.includes("AADHAR")) doctype = "ADHAR";else if (code.includes("DRIVING") || code.includes("DRVLC")) doctype = "DRVLC";else if (code.includes("PAN")) doctype = "PANCR";else if (code.includes("VOTER")) doctype = "VOTER";
|
|
17634
|
-
}
|
|
17635
|
-
const DOCTYPE_ALIASES = {
|
|
17636
|
-
ADHAR: ["ADHAR", "AADHAAR", "AADHAR"],
|
|
17637
|
-
DRVLC: ["DRVLC", "DRIVING"],
|
|
17638
|
-
PANCR: ["PANCR", "PANCH", "PAN"],
|
|
17639
|
-
VOTER: ["VOTER", "VOTERID"]
|
|
17658
|
+
function _temp13(_result) {
|
|
17659
|
+
if (_exit) return _result;
|
|
17660
|
+
let TokenReq = {
|
|
17661
|
+
authToken: digiLockerToken
|
|
17640
17662
|
};
|
|
17641
|
-
const
|
|
17642
|
-
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17668
|
-
|
|
17669
|
-
|
|
17670
|
-
|
|
17671
|
-
|
|
17672
|
-
|
|
17673
|
-
|
|
17674
|
-
|
|
17675
|
-
|
|
17676
|
-
|
|
17677
|
-
|
|
17678
|
-
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
|
|
17682
|
-
|
|
17683
|
-
|
|
17684
|
-
|
|
17685
|
-
|
|
17686
|
-
|
|
17687
|
-
|
|
17663
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17664
|
+
return Promise.resolve(Digit.DigiLockerService.issueDoc({
|
|
17665
|
+
TokenReq
|
|
17666
|
+
}, tenantId)).then(function (res1) {
|
|
17667
|
+
if (!res1 || !res1.IssuedDoc) {
|
|
17668
|
+
setShowToast({
|
|
17669
|
+
error: true,
|
|
17670
|
+
label: "Failed to fetch documents from DigiLocker. Please login again."
|
|
17671
|
+
});
|
|
17672
|
+
return;
|
|
17673
|
+
}
|
|
17674
|
+
let doctype = "DRVLC";
|
|
17675
|
+
if (props !== null && props !== void 0 && props.documentType) {
|
|
17676
|
+
const code = props.documentType.toUpperCase();
|
|
17677
|
+
if (code.includes("AADHAAR") || code.includes("AADHAR")) doctype = "ADHAR";else if (code.includes("DRIVING") || code.includes("DRVLC")) doctype = "DRVLC";else if (code.includes("PAN")) doctype = "PANCR";else if (code.includes("VOTER")) doctype = "VOTER";
|
|
17678
|
+
}
|
|
17679
|
+
const DOCTYPE_ALIASES = {
|
|
17680
|
+
ADHAR: ["ADHAR", "AADHAAR", "AADHAR"],
|
|
17681
|
+
DRVLC: ["DRVLC", "DRIVING"],
|
|
17682
|
+
PANCR: ["PANCR", "PANCH", "PAN"],
|
|
17683
|
+
VOTER: ["VOTER", "VOTERID"]
|
|
17684
|
+
};
|
|
17685
|
+
const aliases = DOCTYPE_ALIASES[doctype] || [doctype];
|
|
17686
|
+
let uri = res1.IssuedDoc.filter(item => aliases.some(alias => item.doctype === alias));
|
|
17687
|
+
const _temp11 = function () {
|
|
17688
|
+
if ((uri === null || uri === void 0 ? void 0 : uri.length) > 0) {
|
|
17689
|
+
const uriStr = uri[0].uri || "";
|
|
17690
|
+
const parts = uriStr.split("-");
|
|
17691
|
+
const documentNumber = parts.length > 1 ? parts[parts.length - 1] : "";
|
|
17692
|
+
if (documentNumber && props !== null && props !== void 0 && props.onDocumentNumber) {
|
|
17693
|
+
props.onDocumentNumber(documentNumber);
|
|
17694
|
+
}
|
|
17695
|
+
let TokenReqNew = {
|
|
17696
|
+
authToken: digiLockerToken,
|
|
17697
|
+
id: uriStr
|
|
17698
|
+
};
|
|
17699
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17700
|
+
return Promise.resolve(Digit.DigiLockerService.uriFile({
|
|
17701
|
+
TokenReq: TokenReqNew
|
|
17702
|
+
}, tenantId)).then(function (res2) {
|
|
17703
|
+
var _res2$headers;
|
|
17704
|
+
console.log("[DigiLocker] uriFile response:", res2);
|
|
17705
|
+
let blobData = null;
|
|
17706
|
+
let contentType = (res2 === null || res2 === void 0 ? void 0 : (_res2$headers = res2.headers) === null || _res2$headers === void 0 ? void 0 : _res2$headers["content-type"]) || "";
|
|
17707
|
+
let isJsonString = contentType.includes("application/json");
|
|
17708
|
+
const _temp10 = function () {
|
|
17709
|
+
if (res2 !== null && res2 !== void 0 && res2.data) {
|
|
17710
|
+
function _temp1() {
|
|
17711
|
+
const filename = doctype + "_" + (uri[0].name || "document") + ".pdf";
|
|
17712
|
+
if (blobData && blobData.size > 0) convertToFile(e, blobData, filename);else setShowToast({
|
|
17713
|
+
error: true,
|
|
17714
|
+
label: "Failed to read document from DigiLocker."
|
|
17715
|
+
});
|
|
17716
|
+
}
|
|
17717
|
+
const _temp0 = function () {
|
|
17718
|
+
if (res2 !== null && res2 !== void 0 && res2.data) {
|
|
17719
|
+
const rawBytes = new Uint8Array(res2.data);
|
|
17720
|
+
const _temp9 = function () {
|
|
17721
|
+
if (rawBytes.length > 5 && rawBytes[0] === 0x22 && rawBytes[1] === 0x25 && rawBytes[2] === 0x50 && rawBytes[3] === 0x44 && rawBytes[4] === 0x46) {
|
|
17722
|
+
console.log("[DigiLocker] Response is a JSON-encoded binary PDF string. Unescaping bytes...");
|
|
17723
|
+
const unescaped = new Uint8Array(rawBytes.length);
|
|
17724
|
+
let outIdx = 0;
|
|
17725
|
+
for (let i = 1; i < rawBytes.length - 1; i++) {
|
|
17726
|
+
if (rawBytes[i] === 0x5c) {
|
|
17727
|
+
i++;
|
|
17728
|
+
const next = rawBytes[i];
|
|
17729
|
+
if (next === 0x6e) unescaped[outIdx++] = 0x0a;else if (next === 0x72) unescaped[outIdx++] = 0x0d;else if (next === 0x74) unescaped[outIdx++] = 0x09;else if (next === 0x22) unescaped[outIdx++] = 0x22;else if (next === 0x5c) unescaped[outIdx++] = 0x5c;else if (next === 0x62) unescaped[outIdx++] = 0x08;else if (next === 0x66) unescaped[outIdx++] = 0x0c;else unescaped[outIdx++] = next;
|
|
17730
|
+
} else {
|
|
17731
|
+
unescaped[outIdx++] = rawBytes[i];
|
|
17732
|
+
}
|
|
17688
17733
|
}
|
|
17689
|
-
|
|
17690
|
-
|
|
17691
|
-
|
|
17692
|
-
}
|
|
17693
|
-
|
|
17694
|
-
|
|
17695
|
-
|
|
17696
|
-
|
|
17697
|
-
|
|
17698
|
-
|
|
17699
|
-
}
|
|
17700
|
-
|
|
17701
|
-
|
|
17702
|
-
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
17709
|
-
|
|
17710
|
-
|
|
17711
|
-
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
}
|
|
17716
|
-
|
|
17717
|
-
|
|
17718
|
-
|
|
17719
|
-
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
17724
|
-
|
|
17725
|
-
}
|
|
17726
|
-
|
|
17727
|
-
|
|
17728
|
-
|
|
17729
|
-
|
|
17730
|
-
|
|
17731
|
-
|
|
17732
|
-
|
|
17733
|
-
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17745
|
-
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
|
|
17753
|
-
|
|
17754
|
-
|
|
17734
|
+
blobData = new Blob([unescaped.slice(0, outIdx)], {
|
|
17735
|
+
type: "application/pdf"
|
|
17736
|
+
});
|
|
17737
|
+
} else {
|
|
17738
|
+
const _temp8 = function () {
|
|
17739
|
+
if (rawBytes.length > 4 && rawBytes[0] === 0x25 && rawBytes[1] === 0x50 && rawBytes[2] === 0x44 && rawBytes[3] === 0x46) {
|
|
17740
|
+
console.log("[DigiLocker] Response is a raw binary PDF.");
|
|
17741
|
+
blobData = new Blob([res2.data], {
|
|
17742
|
+
type: "application/pdf"
|
|
17743
|
+
});
|
|
17744
|
+
} else {
|
|
17745
|
+
const decoder = new TextDecoder("utf-8");
|
|
17746
|
+
const textStr = decoder.decode(res2.data);
|
|
17747
|
+
let parsedJson = null;
|
|
17748
|
+
try {
|
|
17749
|
+
parsedJson = JSON.parse(textStr);
|
|
17750
|
+
} catch (e) {}
|
|
17751
|
+
const _temp7 = function () {
|
|
17752
|
+
if (parsedJson) {
|
|
17753
|
+
const _temp6 = function () {
|
|
17754
|
+
if (Array.isArray(parsedJson)) {
|
|
17755
|
+
console.log("[DigiLocker] Response is a JSON array of bytes.");
|
|
17756
|
+
const arr = new Uint8Array(parsedJson);
|
|
17757
|
+
blobData = new Blob([arr], {
|
|
17758
|
+
type: "application/pdf"
|
|
17759
|
+
});
|
|
17760
|
+
} else {
|
|
17761
|
+
const _temp5 = function () {
|
|
17762
|
+
if (typeof parsedJson === "string") {
|
|
17763
|
+
console.log("[DigiLocker] Response is a base64 string in JSON.");
|
|
17764
|
+
const dataUri = parsedJson.startsWith("data:") ? parsedJson : "data:application/pdf;base64," + parsedJson;
|
|
17765
|
+
try {
|
|
17766
|
+
blobData = dataURItoBlob(dataUri);
|
|
17767
|
+
} catch (e) {
|
|
17768
|
+
console.error("Failed to parse JSON string as base64", e);
|
|
17769
|
+
}
|
|
17770
|
+
} else {
|
|
17771
|
+
const _temp4 = function () {
|
|
17772
|
+
if (typeof parsedJson === "object") {
|
|
17773
|
+
const findFileStoreId = obj => {
|
|
17774
|
+
if (!obj || typeof obj !== "object") return null;
|
|
17775
|
+
for (let key in obj) {
|
|
17776
|
+
if (key.toLowerCase() === "filestoreid") return obj[key];
|
|
17777
|
+
const found = findFileStoreId(obj[key]);
|
|
17778
|
+
if (found) return found;
|
|
17779
|
+
}
|
|
17780
|
+
return null;
|
|
17781
|
+
};
|
|
17782
|
+
const findBase64 = obj => {
|
|
17783
|
+
if (!obj || typeof obj !== "object") return null;
|
|
17784
|
+
for (let key in obj) {
|
|
17785
|
+
if (["doccontent", "filecontent", "base64"].includes(key.toLowerCase())) return obj[key];
|
|
17786
|
+
const found = findBase64(obj[key]);
|
|
17787
|
+
if (found && typeof found === "string") return found;
|
|
17788
|
+
}
|
|
17789
|
+
return null;
|
|
17790
|
+
};
|
|
17791
|
+
const fsId = findFileStoreId(parsedJson);
|
|
17792
|
+
const _temp3 = function () {
|
|
17793
|
+
if (fsId) {
|
|
17794
|
+
console.log("[DigiLocker] Got fileStoreId from JSON:", fsId);
|
|
17795
|
+
return Promise.resolve(Digit.UploadServices.FileFetchbyid(fsId, Digit.ULBService.getStateId())).then(function (fileRes) {
|
|
17796
|
+
var _fileRes$headers;
|
|
17797
|
+
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) || ""], {
|
|
17798
|
+
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"
|
|
17799
|
+
});
|
|
17755
17800
|
});
|
|
17756
|
-
});
|
|
17757
|
-
} else {
|
|
17758
|
-
const b64 = findBase64(parsedJson);
|
|
17759
|
-
if (b64 && typeof b64 === "string") {
|
|
17760
|
-
console.log("[DigiLocker] Got base64 content from JSON field");
|
|
17761
|
-
const dataUri = b64.startsWith("data:") ? b64 : "data:application/pdf;base64," + b64;
|
|
17762
|
-
blobData = dataURItoBlob(dataUri);
|
|
17763
17801
|
} else {
|
|
17764
|
-
|
|
17802
|
+
const b64 = findBase64(parsedJson);
|
|
17803
|
+
if (b64 && typeof b64 === "string") {
|
|
17804
|
+
console.log("[DigiLocker] Got base64 content from JSON field");
|
|
17805
|
+
const dataUri = b64.startsWith("data:") ? b64 : "data:application/pdf;base64," + b64;
|
|
17806
|
+
blobData = dataURItoBlob(dataUri);
|
|
17807
|
+
} else {
|
|
17808
|
+
console.log("[DigiLocker] JSON did not contain filestoreid or base64.");
|
|
17809
|
+
}
|
|
17765
17810
|
}
|
|
17766
|
-
}
|
|
17767
|
-
|
|
17768
|
-
|
|
17769
|
-
}
|
|
17770
|
-
|
|
17771
|
-
|
|
17772
|
-
}
|
|
17773
|
-
|
|
17774
|
-
|
|
17775
|
-
}
|
|
17776
|
-
|
|
17777
|
-
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
17778
|
-
} else {
|
|
17779
|
-
if (textStr.startsWith("JVBERi0x")) {
|
|
17780
|
-
console.log("[DigiLocker] Response is a raw base64 string.");
|
|
17781
|
-
try {
|
|
17782
|
-
blobData = dataURItoBlob("data:application/pdf;base64," + textStr);
|
|
17783
|
-
} catch (e) {
|
|
17784
|
-
console.error("Failed to parse raw text as base64", e);
|
|
17785
|
-
}
|
|
17811
|
+
}();
|
|
17812
|
+
if (_temp3 && _temp3.then) return _temp3.then(function () {});
|
|
17813
|
+
}
|
|
17814
|
+
}();
|
|
17815
|
+
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
17816
|
+
}
|
|
17817
|
+
}();
|
|
17818
|
+
if (_temp5 && _temp5.then) return _temp5.then(function () {});
|
|
17819
|
+
}
|
|
17820
|
+
}();
|
|
17821
|
+
if (_temp6 && _temp6.then) return _temp6.then(function () {});
|
|
17786
17822
|
} else {
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17823
|
+
if (textStr.startsWith("JVBERi0x")) {
|
|
17824
|
+
console.log("[DigiLocker] Response is a raw base64 string.");
|
|
17825
|
+
try {
|
|
17826
|
+
blobData = dataURItoBlob("data:application/pdf;base64," + textStr);
|
|
17827
|
+
} catch (e) {
|
|
17828
|
+
console.error("Failed to parse raw text as base64", e);
|
|
17829
|
+
}
|
|
17830
|
+
} else {
|
|
17831
|
+
console.log("[DigiLocker] Response is unknown format, attempting binary PDF fallback.");
|
|
17832
|
+
blobData = new Blob([res2.data], {
|
|
17833
|
+
type: "application/pdf"
|
|
17834
|
+
});
|
|
17835
|
+
}
|
|
17791
17836
|
}
|
|
17792
|
-
}
|
|
17793
|
-
|
|
17794
|
-
|
|
17795
|
-
}
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
}
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
}
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17805
|
-
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
}
|
|
17809
|
-
}
|
|
17810
|
-
|
|
17811
|
-
|
|
17812
|
-
}
|
|
17837
|
+
}();
|
|
17838
|
+
if (_temp7 && _temp7.then) return _temp7.then(function () {});
|
|
17839
|
+
}
|
|
17840
|
+
}();
|
|
17841
|
+
if (_temp8 && _temp8.then) return _temp8.then(function () {});
|
|
17842
|
+
}
|
|
17843
|
+
}();
|
|
17844
|
+
if (_temp9 && _temp9.then) return _temp9.then(function () {});
|
|
17845
|
+
}
|
|
17846
|
+
}();
|
|
17847
|
+
return _temp0 && _temp0.then ? _temp0.then(_temp1) : _temp1(_temp0);
|
|
17848
|
+
} else {
|
|
17849
|
+
setShowToast({
|
|
17850
|
+
error: true,
|
|
17851
|
+
label: "Selected document (" + ((props === null || props === void 0 ? void 0 : props.documentType) || doctype) + ") is not available in your DigiLocker."
|
|
17852
|
+
});
|
|
17853
|
+
}
|
|
17854
|
+
}();
|
|
17855
|
+
if (_temp10 && _temp10.then) return _temp10.then(function () {});
|
|
17856
|
+
});
|
|
17857
|
+
}
|
|
17858
|
+
}();
|
|
17859
|
+
if (_temp11 && _temp11.then) return _temp11.then(function () {});
|
|
17860
|
+
});
|
|
17861
|
+
}
|
|
17862
|
+
const digiLockerToken = sessionStorage.getItem("DigiLocker.token1");
|
|
17863
|
+
const _temp12 = function () {
|
|
17864
|
+
if (!digiLockerToken) {
|
|
17865
|
+
function _temp2() {
|
|
17866
|
+
_exit = true;
|
|
17813
17867
|
}
|
|
17814
|
-
|
|
17815
|
-
|
|
17816
|
-
|
|
17868
|
+
const _temp = _catch$1(function () {
|
|
17869
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17870
|
+
return Promise.resolve(Digit.DigiLockerService.authorization({
|
|
17871
|
+
module: "WS",
|
|
17872
|
+
tenantId
|
|
17873
|
+
})).then(function (data) {
|
|
17874
|
+
const redirectUrl = (data === null || data === void 0 ? void 0 : data.redirectURL) || (data === null || data === void 0 ? void 0 : data.redirectUrl);
|
|
17875
|
+
const verifier = (data === null || data === void 0 ? void 0 : data.dlReqRef) || (data === null || data === void 0 ? void 0 : data.codeverifier) || (data === null || data === void 0 ? void 0 : data.codeVerifier) || (data === null || data === void 0 ? void 0 : data.code_verifier);
|
|
17876
|
+
if (verifier) {
|
|
17877
|
+
sessionStorage.setItem("code_verfier_register", verifier);
|
|
17878
|
+
}
|
|
17879
|
+
if (redirectUrl) {
|
|
17880
|
+
window.location.href = redirectUrl;
|
|
17881
|
+
} else {
|
|
17882
|
+
setShowToast({
|
|
17883
|
+
error: true,
|
|
17884
|
+
label: "No redirect URL returned from DigiLocker API."
|
|
17885
|
+
});
|
|
17886
|
+
}
|
|
17887
|
+
});
|
|
17888
|
+
}, function () {
|
|
17889
|
+
setShowToast({
|
|
17890
|
+
error: true,
|
|
17891
|
+
label: "Error fetching DigiLocker authorization URL."
|
|
17892
|
+
});
|
|
17893
|
+
});
|
|
17894
|
+
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
|
17895
|
+
}
|
|
17896
|
+
}();
|
|
17897
|
+
return _temp12 && _temp12.then ? _temp12.then(_temp13) : _temp13(_temp12);
|
|
17817
17898
|
}, function (error) {
|
|
17818
17899
|
console.error("DigiLocker Fetch Error:", error);
|
|
17819
17900
|
setShowToast({
|
|
@@ -23372,7 +23453,11 @@ const WSDjbEmployee = _ref => {
|
|
|
23372
23453
|
const FormContent = /*#__PURE__*/React.createElement(CollapsibleCardPage, {
|
|
23373
23454
|
title: t("WS_DJB_EMPLOYEE"),
|
|
23374
23455
|
defaultOpen: true
|
|
23375
|
-
}, /*#__PURE__*/React.createElement("div",
|
|
23456
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
23457
|
+
style: {
|
|
23458
|
+
width: "max-content"
|
|
23459
|
+
}
|
|
23460
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
23376
23461
|
control: control,
|
|
23377
23462
|
name: "isDjbEmployee",
|
|
23378
23463
|
render: props => /*#__PURE__*/React.createElement(CheckBox, {
|
|
@@ -32336,31 +32421,31 @@ const checkForNA$1 = value => {
|
|
|
32336
32421
|
return value ? value : "CS_NA";
|
|
32337
32422
|
};
|
|
32338
32423
|
const WSApplicationDetails = () => {
|
|
32339
|
-
var _user$info, _user$info$userName, _user$info2, _user$info3, _Digit$SessionStorage, _user$info4, _data$WaterConnection, _data$WaterConnection2, _data$SewerageConnect, _data$SewerageConnect2, _data$WaterConnection3, _data$WaterConnection4, _data$SewerageConnect3, _data$SewerageConnect4, _data$WaterConnection5, _data$WaterConnection6, _data$WaterConnection7, _data$SewerageConnect5, _data$SewerageConnect6, _data$SewerageConnect7, _data$WaterConnection8, _data$WaterConnection9, _data$SewerageConnect8, _data$SewerageConnect9, _data$WaterConnection0, _data$WaterConnection1, _data$SewerageConnect0, _data$SewerageConnect1, _data$WaterConnection10, _data$WaterConnection11, _data$SewerageConnect10, _data$SewerageConnect11, _data$WaterConnection12, _data$SewerageConnect12, _PTData$Properties, _PTData$Properties$, _data$WaterConnection13, _data$WaterConnection14, _data$WaterConnection15, _data$WaterConnection16, _data$SewerageConnect13, _data$SewerageConnect14, _data$SewerageConnect15, _data$SewerageConnect16, _data$WaterConnection17, _data$WaterConnection18, _data$SewerageConnect17, _data$SewerageConnect18, _appDetailsData$appli, _data$WaterConnection37, _data$WaterConnection38, _data$SewerageConnect33, _data$SewerageConnect34, _data$WaterConnection39, _data$WaterConnection40, _data$SewerageConnect35, _data$SewerageConnect36, _data$WaterConnection41, _data$WaterConnection42, _data$SewerageConnect37, _data$SewerageConnect38, _data$WaterConnection43, _data$WaterConnection44, _data$SewerageConnect39, _data$SewerageConnect40, _data$WaterConnection45, _data$WaterConnection46, _data$SewerageConnect41, _data$WaterConnection47, _data$WaterConnection48, _data$SewerageConnect42, _data$SewerageConnect43, _data$WaterConnection49, _data$WaterConnection50, _data$SewerageConnect44, _data$SewerageConnect45, _data$WaterConnection51, _data$WaterConnection52, _data$SewerageConnect46, _data$SewerageConnect47, _data$WaterConnection53, _data$WaterConnection54, _data$SewerageConnect48, _data$SewerageConnect49, _data$WaterConnection55, _data$WaterConnection56, _data$SewerageConnect50, _data$SewerageConnect51, _data$WaterConnection57, _data$WaterConnection58, _data$SewerageConnect52, _data$SewerageConnect53, _data$WaterConnection59, _data$WaterConnection60, _data$SewerageConnect54, _data$SewerageConnect55, _data$WaterConnection61, _data$WaterConnection62, _data$SewerageConnect56, _data$SewerageConnect57, _data$WaterConnection63, _data$WaterConnection64, _data$SewerageConnect58, _data$SewerageConnect59, _data$WaterConnection65, _data$WaterConnection66, _data$SewerageConnect60, _data$SewerageConnect61, _data$WaterConnection67, _data$WaterConnection68, _data$WaterConnection69, _data$WaterConnection70, _data$SewerageConnect62, _data$SewerageConnect63, _data$SewerageConnect64, _data$SewerageConnect65, _connectionDetails$se, _connectionDetails$se2, _connectionDetails$co, _connectionDetails$co2, _connectionDetails$wa, _connectionDetails$wa2, _connectionDetails$ap, _connectionDetails$ap2, _connectionDetails$do, _connectionDetails$do2, _connectionDetails$do3, _connectionDetails$de, _connectionDetails$de2, _data$WaterConnection71, _data$WaterConnection72, _data$WaterConnection73, _data$SewerageConnect66, _data$SewerageConnect67, _data$SewerageConnect68, _data$WaterConnection74, _data$WaterConnection75, _data$WaterConnection76, _data$WaterConnection77, _data$SewerageConnect69, _data$SewerageConnect70, _data$SewerageConnect71, _data$SewerageConnect72, _data$WaterConnection78, _data$WaterConnection79, _data$WaterConnection80, _data$WaterConnection81, _data$SewerageConnect73, _data$SewerageConnect74, _data$SewerageConnect75, _data$SewerageConnect76, _data$WaterConnection82, _data$WaterConnection83, _data$WaterConnection84, _data$WaterConnection85, _data$SewerageConnect77, _data$SewerageConnect78, _data$SewerageConnect79, _data$SewerageConnect80, _data$WaterConnection86, _data$WaterConnection87, _data$WaterConnection88, _data$WaterConnection89, _data$SewerageConnect81, _data$SewerageConnect82, _data$SewerageConnect83, _data$SewerageConnect84, _data$WaterConnection90, _data$WaterConnection91, _data$WaterConnection92, _data$WaterConnection93, _data$SewerageConnect85, _data$SewerageConnect86, _data$SewerageConnect87, _data$SewerageConnect88, _data$WaterConnection94, _data$WaterConnection95, _data$WaterConnection96, _data$WaterConnection97, _data$SewerageConnect89, _data$SewerageConnect90, _data$SewerageConnect91, _data$SewerageConnect92, _data$WaterConnection98, _data$WaterConnection99, _data$WaterConnection100, _data$WaterConnection101, _data$SewerageConnect93, _data$SewerageConnect94, _data$SewerageConnect95, _data$SewerageConnect96, _data$WaterConnection102, _data$WaterConnection103, _data$WaterConnection104, _data$WaterConnection105, _data$SewerageConnect97, _data$SewerageConnect98, _data$SewerageConnect99, _data$SewerageConnect100, _data$WaterConnection106, _data$WaterConnection107, _data$WaterConnection108, _data$WaterConnection109, _data$SewerageConnect101, _data$SewerageConnect102, _data$SewerageConnect103, _data$SewerageConnect104, _data$WaterConnection110, _data$WaterConnection111, _data$WaterConnection112, _data$WaterConnection113, _data$SewerageConnect105, _data$SewerageConnect106, _data$SewerageConnect107, _data$SewerageConnect108, _data$WaterConnection114, _data$WaterConnection115, _data$WaterConnection116, _data$WaterConnection117, _data$SewerageConnect109, _data$SewerageConnect110, _data$SewerageConnect111, _data$SewerageConnect112, _data$WaterConnection118, _data$WaterConnection119, _data$WaterConnection120, _data$WaterConnection121, _data$SewerageConnect113, _data$SewerageConnect114, _data$SewerageConnect115, _data$SewerageConnect116, _data$WaterConnection122, _data$WaterConnection123, _data$WaterConnection124, _data$WaterConnection125, _data$SewerageConnect117, _data$SewerageConnect118, _data$SewerageConnect119, _data$SewerageConnect120, _data$WaterConnection126, _data$WaterConnection127, _data$SewerageConnect121, _data$SewerageConnect122, _PTData$Properties4, _PTData$Properties4$, _PTData$Properties4$$, _PTData$Properties4$$2, _PTData$Properties5, _PTData$Properties5$, _PTData$Properties6, _PTData$Properties6$, _PTData$Properties6$$, _PTData$Properties6$$2, _PTData$Properties7, _PTData$Properties7$, _data$WaterConnection128, _data$WaterConnection129, _data$SewerageConnect123, _data$SewerageConnect124, _data$WaterConnection130, _data$WaterConnection131, _data$SewerageConnect125, _data$SewerageConnect126, _propertyAddress$city, _propertyAddress$city2, _propertyAddress$loca, _propertyAddress$loca2, _propertyAddress$subL, _propertyAddress$subL2, _propertyAddress$asse, _propertyAddress$asse2, _propertyAddress$bloc, _propertyAddress$bloc2, _propertyAddress$ward, _propertyAddress$ward2, _propertyAddress$zone, _propertyAddress$zone2, _propertyAddress$zone3, _propertyAddress$zone4, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$noOfFloor, _useDetails$noOfFloor2, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _data$WaterConnection132, _data$WaterConnection133, _data$WaterConnection134, _data$WaterConnection135, _data$SewerageConnect127, _data$SewerageConnect128, _data$SewerageConnect129, _data$SewerageConnect130, _data$WaterConnection140, _data$WaterConnection141, _data$WaterConnection142, _data$WaterConnection143, _data$
|
|
32424
|
+
var _user$info, _user$info$userName, _user$info2, _user$info3, _Digit$SessionStorage, _user$info4, _data$WaterConnection, _data$WaterConnection2, _data$SewerageConnect, _data$SewerageConnect2, _data$WaterConnection3, _data$WaterConnection4, _data$SewerageConnect3, _data$SewerageConnect4, _data$WaterConnection5, _data$WaterConnection6, _data$WaterConnection7, _data$SewerageConnect5, _data$SewerageConnect6, _data$SewerageConnect7, _data$WaterConnection8, _data$WaterConnection9, _data$SewerageConnect8, _data$SewerageConnect9, _data$WaterConnection0, _data$WaterConnection1, _data$SewerageConnect0, _data$SewerageConnect1, _data$WaterConnection10, _data$WaterConnection11, _data$SewerageConnect10, _data$SewerageConnect11, _data$WaterConnection12, _data$SewerageConnect12, _PTData$Properties, _PTData$Properties$, _data$WaterConnection13, _data$WaterConnection14, _data$WaterConnection15, _data$WaterConnection16, _data$SewerageConnect13, _data$SewerageConnect14, _data$SewerageConnect15, _data$SewerageConnect16, _data$WaterConnection17, _data$WaterConnection18, _data$SewerageConnect17, _data$SewerageConnect18, _appDetailsData$appli, _data$WaterConnection37, _data$WaterConnection38, _data$SewerageConnect33, _data$SewerageConnect34, _data$WaterConnection39, _data$WaterConnection40, _data$SewerageConnect35, _data$SewerageConnect36, _data$WaterConnection41, _data$WaterConnection42, _data$SewerageConnect37, _data$SewerageConnect38, _data$WaterConnection43, _data$WaterConnection44, _data$SewerageConnect39, _data$SewerageConnect40, _data$WaterConnection45, _data$WaterConnection46, _data$SewerageConnect41, _data$WaterConnection47, _data$WaterConnection48, _data$SewerageConnect42, _data$SewerageConnect43, _data$WaterConnection49, _data$WaterConnection50, _data$SewerageConnect44, _data$SewerageConnect45, _data$WaterConnection51, _data$WaterConnection52, _data$SewerageConnect46, _data$SewerageConnect47, _data$WaterConnection53, _data$WaterConnection54, _data$SewerageConnect48, _data$SewerageConnect49, _data$WaterConnection55, _data$WaterConnection56, _data$SewerageConnect50, _data$SewerageConnect51, _data$WaterConnection57, _data$WaterConnection58, _data$SewerageConnect52, _data$SewerageConnect53, _data$WaterConnection59, _data$WaterConnection60, _data$SewerageConnect54, _data$SewerageConnect55, _data$WaterConnection61, _data$WaterConnection62, _data$SewerageConnect56, _data$SewerageConnect57, _data$WaterConnection63, _data$WaterConnection64, _data$SewerageConnect58, _data$SewerageConnect59, _data$WaterConnection65, _data$WaterConnection66, _data$SewerageConnect60, _data$SewerageConnect61, _data$WaterConnection67, _data$WaterConnection68, _data$WaterConnection69, _data$WaterConnection70, _data$SewerageConnect62, _data$SewerageConnect63, _data$SewerageConnect64, _data$SewerageConnect65, _connectionDetails$se, _connectionDetails$se2, _connectionDetails$co, _connectionDetails$co2, _connectionDetails$wa, _connectionDetails$wa2, _connectionDetails$ap, _connectionDetails$ap2, _connectionDetails$do, _connectionDetails$do2, _connectionDetails$do3, _connectionDetails$de, _connectionDetails$de2, _data$WaterConnection71, _data$WaterConnection72, _data$WaterConnection73, _data$SewerageConnect66, _data$SewerageConnect67, _data$SewerageConnect68, _data$WaterConnection74, _data$WaterConnection75, _data$WaterConnection76, _data$WaterConnection77, _data$SewerageConnect69, _data$SewerageConnect70, _data$SewerageConnect71, _data$SewerageConnect72, _data$WaterConnection78, _data$WaterConnection79, _data$WaterConnection80, _data$WaterConnection81, _data$SewerageConnect73, _data$SewerageConnect74, _data$SewerageConnect75, _data$SewerageConnect76, _data$WaterConnection82, _data$WaterConnection83, _data$WaterConnection84, _data$WaterConnection85, _data$SewerageConnect77, _data$SewerageConnect78, _data$SewerageConnect79, _data$SewerageConnect80, _data$WaterConnection86, _data$WaterConnection87, _data$WaterConnection88, _data$WaterConnection89, _data$SewerageConnect81, _data$SewerageConnect82, _data$SewerageConnect83, _data$SewerageConnect84, _data$WaterConnection90, _data$WaterConnection91, _data$WaterConnection92, _data$WaterConnection93, _data$SewerageConnect85, _data$SewerageConnect86, _data$SewerageConnect87, _data$SewerageConnect88, _data$WaterConnection94, _data$WaterConnection95, _data$WaterConnection96, _data$WaterConnection97, _data$SewerageConnect89, _data$SewerageConnect90, _data$SewerageConnect91, _data$SewerageConnect92, _data$WaterConnection98, _data$WaterConnection99, _data$WaterConnection100, _data$WaterConnection101, _data$SewerageConnect93, _data$SewerageConnect94, _data$SewerageConnect95, _data$SewerageConnect96, _data$WaterConnection102, _data$WaterConnection103, _data$WaterConnection104, _data$WaterConnection105, _data$SewerageConnect97, _data$SewerageConnect98, _data$SewerageConnect99, _data$SewerageConnect100, _data$WaterConnection106, _data$WaterConnection107, _data$WaterConnection108, _data$WaterConnection109, _data$SewerageConnect101, _data$SewerageConnect102, _data$SewerageConnect103, _data$SewerageConnect104, _data$WaterConnection110, _data$WaterConnection111, _data$WaterConnection112, _data$WaterConnection113, _data$SewerageConnect105, _data$SewerageConnect106, _data$SewerageConnect107, _data$SewerageConnect108, _data$WaterConnection114, _data$WaterConnection115, _data$WaterConnection116, _data$WaterConnection117, _data$SewerageConnect109, _data$SewerageConnect110, _data$SewerageConnect111, _data$SewerageConnect112, _data$WaterConnection118, _data$WaterConnection119, _data$WaterConnection120, _data$WaterConnection121, _data$SewerageConnect113, _data$SewerageConnect114, _data$SewerageConnect115, _data$SewerageConnect116, _data$WaterConnection122, _data$WaterConnection123, _data$WaterConnection124, _data$WaterConnection125, _data$SewerageConnect117, _data$SewerageConnect118, _data$SewerageConnect119, _data$SewerageConnect120, _data$WaterConnection126, _data$WaterConnection127, _data$SewerageConnect121, _data$SewerageConnect122, _PTData$Properties4, _PTData$Properties4$, _PTData$Properties4$$, _PTData$Properties4$$2, _PTData$Properties5, _PTData$Properties5$, _PTData$Properties6, _PTData$Properties6$, _PTData$Properties6$$, _PTData$Properties6$$2, _PTData$Properties7, _PTData$Properties7$, _data$WaterConnection128, _data$WaterConnection129, _data$SewerageConnect123, _data$SewerageConnect124, _data$WaterConnection130, _data$WaterConnection131, _data$SewerageConnect125, _data$SewerageConnect126, _propertyAddress$city, _propertyAddress$city2, _propertyAddress$loca, _propertyAddress$loca2, _propertyAddress$subL, _propertyAddress$subL2, _propertyAddress$asse, _propertyAddress$asse2, _propertyAddress$bloc, _propertyAddress$bloc2, _propertyAddress$ward, _propertyAddress$ward2, _propertyAddress$zone, _propertyAddress$zone2, _propertyAddress$zone3, _propertyAddress$zone4, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$noOfFloor, _useDetails$noOfFloor2, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _data$WaterConnection132, _data$WaterConnection133, _data$WaterConnection134, _data$WaterConnection135, _data$SewerageConnect127, _data$SewerageConnect128, _data$SewerageConnect129, _data$SewerageConnect130, _data$WaterConnection138, _data$WaterConnection139, _data$WaterConnection140, _data$WaterConnection141, _data$WaterConnection142, _data$WaterConnection143, _data$SewerageConnect133, _data$SewerageConnect134, _data$SewerageConnect135, _data$SewerageConnect136, _data$SewerageConnect137, _data$SewerageConnect138, _paymentDetails$data, _paymentDetails$data$, _paymentDetails$data$2, _paymentDetails$data2, _paymentDetails$data3, _paymentDetails$data4, _data$WaterConnection144, _data$WaterConnection145, _data$SewerageConnect139, _data$SewerageConnect140, _data$WaterConnection146, _data$WaterConnection147, _data$WaterConnection148, _data$SewerageConnect141, _data$SewerageConnect142, _data$SewerageConnect143, _PTData$Properties8, _PTData$Properties8$, _PTData$Properties8$$, _paymentDetails$data5, _paymentDetails$data6, _paymentDetails$data7, _data$WaterConnection149, _data$WaterConnection150, _data$WaterConnection151, _data$WaterConnection152, _data$SewerageConnect144, _data$SewerageConnect145, _data$SewerageConnect146, _data$SewerageConnect147, _data$WaterConnection153, _data$WaterConnection154, _data$SewerageConnect148, _data$SewerageConnect149, _data$WaterConnection155, _data$WaterConnection156, _data$SewerageConnect150, _data$SewerageConnect151, _data$WaterConnection157, _data$WaterConnection158, _data$SewerageConnect152, _data$SewerageConnect153, _data$WaterConnection159, _data$WaterConnection160, _data$WaterConnection161, _data$SewerageConnect154, _data$SewerageConnect155, _data$WaterConnection162, _data$WaterConnection163, _data$SewerageConnect156, _data$SewerageConnect157, _data$WaterConnection164, _data$WaterConnection165, _data$WaterConnection166, _data$WaterConnection167, _data$SewerageConnect158, _data$SewerageConnect159, _data$SewerageConnect160, _data$SewerageConnect161, _data$WaterConnection168, _data$WaterConnection169, _data$SewerageConnect162, _data$SewerageConnect163, _data$SewerageConnect164, _data$SewerageConnect165, _data$SewerageConnect166, _data$SewerageConnect167, _data$SewerageConnect168, _data$SewerageConnect169, _data$SewerageConnect170, _data$SewerageConnect171, _data$SewerageConnect172, _data$WaterConnection170, _data$WaterConnection171, _data$WaterConnection172, _data$WaterConnection173, _data$WaterConnection174, _data$WaterConnection175, _data$WaterConnection176, _data$WaterConnection177, _data$WaterConnection178;
|
|
32340
32425
|
const getDisconnectionNoticeSearch = function () {
|
|
32341
32426
|
try {
|
|
32342
|
-
var _data$
|
|
32427
|
+
var _data$WaterConnection180, _data$WaterConnection181, _data$SewerageConnect174, _data$SewerageConnect175;
|
|
32343
32428
|
let key = "ws-waterdisconnectionnotice";
|
|
32344
32429
|
let details = {};
|
|
32345
32430
|
if (applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("WS")) {
|
|
32346
|
-
var _data$
|
|
32431
|
+
var _data$WaterConnection179, _PTData$Properties9;
|
|
32347
32432
|
details = {
|
|
32348
|
-
WaterConnection: [_extends({}, data === null || data === void 0 ? void 0 : (_data$
|
|
32433
|
+
WaterConnection: [_extends({}, data === null || data === void 0 ? void 0 : (_data$WaterConnection179 = data.WaterConnection) === null || _data$WaterConnection179 === void 0 ? void 0 : _data$WaterConnection179[0], {
|
|
32349
32434
|
property: PTData === null || PTData === void 0 ? void 0 : (_PTData$Properties9 = PTData.Properties) === null || _PTData$Properties9 === void 0 ? void 0 : _PTData$Properties9[0]
|
|
32350
32435
|
})]
|
|
32351
32436
|
};
|
|
32352
32437
|
} else {
|
|
32353
|
-
var _data$
|
|
32438
|
+
var _data$SewerageConnect173, _PTData$Properties0;
|
|
32354
32439
|
key = "ws-seweragedisconnectionnotice";
|
|
32355
32440
|
details = {
|
|
32356
|
-
SewerageConnection: [_extends({}, data === null || data === void 0 ? void 0 : (_data$
|
|
32441
|
+
SewerageConnection: [_extends({}, data === null || data === void 0 ? void 0 : (_data$SewerageConnect173 = data.SewerageConnections) === null || _data$SewerageConnect173 === void 0 ? void 0 : _data$SewerageConnect173[0], {
|
|
32357
32442
|
property: PTData === null || PTData === void 0 ? void 0 : (_PTData$Properties0 = PTData.Properties) === null || _PTData$Properties0 === void 0 ? void 0 : _PTData$Properties0[0]
|
|
32358
32443
|
})]
|
|
32359
32444
|
};
|
|
32360
32445
|
}
|
|
32361
|
-
return Promise.resolve(Digit.WSService.WSDisconnectionNotice((data === null || data === void 0 ? void 0 : (_data$
|
|
32362
|
-
var _data$
|
|
32363
|
-
return Promise.resolve(Digit.PaymentService.printReciept((data === null || data === void 0 ? void 0 : (_data$
|
|
32446
|
+
return Promise.resolve(Digit.WSService.WSDisconnectionNotice((data === null || data === void 0 ? void 0 : (_data$WaterConnection180 = data.WaterConnection) === null || _data$WaterConnection180 === void 0 ? void 0 : (_data$WaterConnection181 = _data$WaterConnection180[0]) === null || _data$WaterConnection181 === void 0 ? void 0 : _data$WaterConnection181.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect174 = data.SewerageConnections) === null || _data$SewerageConnect174 === void 0 ? void 0 : (_data$SewerageConnect175 = _data$SewerageConnect174[0]) === null || _data$SewerageConnect175 === void 0 ? void 0 : _data$SewerageConnect175.tenantId), details, key)).then(function (response) {
|
|
32447
|
+
var _data$WaterConnection182, _data$WaterConnection183, _data$SewerageConnect176, _data$SewerageConnect177;
|
|
32448
|
+
return Promise.resolve(Digit.PaymentService.printReciept((data === null || data === void 0 ? void 0 : (_data$WaterConnection182 = data.WaterConnection) === null || _data$WaterConnection182 === void 0 ? void 0 : (_data$WaterConnection183 = _data$WaterConnection182[0]) === null || _data$WaterConnection183 === void 0 ? void 0 : _data$WaterConnection183.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect176 = data.SewerageConnections) === null || _data$SewerageConnect176 === void 0 ? void 0 : (_data$SewerageConnect177 = _data$SewerageConnect176[0]) === null || _data$SewerageConnect177 === void 0 ? void 0 : _data$SewerageConnect177.tenantId), {
|
|
32364
32449
|
fileStoreIds: response.filestoreIds[0]
|
|
32365
32450
|
})).then(function (fileStore) {
|
|
32366
32451
|
window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
|
|
@@ -33073,15 +33158,22 @@ const WSApplicationDetails = () => {
|
|
|
33073
33158
|
styles: {
|
|
33074
33159
|
fontSize: "28px"
|
|
33075
33160
|
}
|
|
33076
|
-
}, t("WS_COMMON_DOCUMENT_DETAILS")), (data === null || data === void 0 ? void 0 : (_data$WaterConnection132 = data.WaterConnection) === null || _data$WaterConnection132 === void 0 ? void 0 : (_data$WaterConnection133 = _data$WaterConnection132[0]) === null || _data$WaterConnection133 === void 0 ? void 0 : _data$WaterConnection133.documents) && (data === null || data === void 0 ? void 0 : (_data$WaterConnection134 = data.WaterConnection) === null || _data$WaterConnection134 === void 0 ? void 0 : (_data$WaterConnection135 = _data$WaterConnection134[0]) === null || _data$WaterConnection135 === void 0 ? void 0 : _data$WaterConnection135.documents.
|
|
33077
|
-
|
|
33161
|
+
}, t("WS_COMMON_DOCUMENT_DETAILS")), (data === null || data === void 0 ? void 0 : (_data$WaterConnection132 = data.WaterConnection) === null || _data$WaterConnection132 === void 0 ? void 0 : (_data$WaterConnection133 = _data$WaterConnection132[0]) === null || _data$WaterConnection133 === void 0 ? void 0 : _data$WaterConnection133.documents) && (data === null || data === void 0 ? void 0 : (_data$WaterConnection134 = data.WaterConnection) === null || _data$WaterConnection134 === void 0 ? void 0 : (_data$WaterConnection135 = _data$WaterConnection134[0]) === null || _data$WaterConnection135 === void 0 ? void 0 : _data$WaterConnection135.documents.reduce((acc, current) => {
|
|
33162
|
+
const x = acc.find(item => item.documentType === current.documentType);
|
|
33163
|
+
if (!x) {
|
|
33164
|
+
return acc.concat([current]);
|
|
33165
|
+
} else {
|
|
33166
|
+
return acc;
|
|
33167
|
+
}
|
|
33168
|
+
}, []).map((doc, index, array) => {
|
|
33169
|
+
var _doc$documentType, _data$WaterConnection136, _data$WaterConnection137;
|
|
33078
33170
|
return /*#__PURE__*/React.createElement("div", {
|
|
33079
33171
|
key: "doc-" + index
|
|
33080
33172
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardSectionHeader, null, t(doc === null || doc === void 0 ? void 0 : (_doc$documentType = doc.documentType) === null || _doc$documentType === void 0 ? void 0 : _doc$documentType.split(".").slice(0, 2).join("_"))), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(WSDocument, {
|
|
33081
33173
|
value: data === null || data === void 0 ? void 0 : (_data$WaterConnection136 = data.WaterConnection) === null || _data$WaterConnection136 === void 0 ? void 0 : (_data$WaterConnection137 = _data$WaterConnection136[0]) === null || _data$WaterConnection137 === void 0 ? void 0 : _data$WaterConnection137.documents,
|
|
33082
33174
|
Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
|
|
33083
33175
|
index: index
|
|
33084
|
-
}),
|
|
33176
|
+
}), array.length != index + 1 ? /*#__PURE__*/React.createElement("hr", {
|
|
33085
33177
|
style: {
|
|
33086
33178
|
color: "#cccccc",
|
|
33087
33179
|
backgroundColor: "#cccccc",
|
|
@@ -33090,15 +33182,22 @@ const WSApplicationDetails = () => {
|
|
|
33090
33182
|
marginBottom: "20px"
|
|
33091
33183
|
}
|
|
33092
33184
|
}) : null)));
|
|
33093
|
-
})), (data === null || data === void 0 ? void 0 : (_data$SewerageConnect127 = data.SewerageConnections) === null || _data$SewerageConnect127 === void 0 ? void 0 : (_data$SewerageConnect128 = _data$SewerageConnect127[0]) === null || _data$SewerageConnect128 === void 0 ? void 0 : _data$SewerageConnect128.documents) && (data === null || data === void 0 ? void 0 : (_data$SewerageConnect129 = data.SewerageConnections) === null || _data$SewerageConnect129 === void 0 ? void 0 : (_data$SewerageConnect130 = _data$SewerageConnect129[0]) === null || _data$SewerageConnect130 === void 0 ? void 0 : _data$SewerageConnect130.documents.
|
|
33094
|
-
|
|
33185
|
+
})), (data === null || data === void 0 ? void 0 : (_data$SewerageConnect127 = data.SewerageConnections) === null || _data$SewerageConnect127 === void 0 ? void 0 : (_data$SewerageConnect128 = _data$SewerageConnect127[0]) === null || _data$SewerageConnect128 === void 0 ? void 0 : _data$SewerageConnect128.documents) && (data === null || data === void 0 ? void 0 : (_data$SewerageConnect129 = data.SewerageConnections) === null || _data$SewerageConnect129 === void 0 ? void 0 : (_data$SewerageConnect130 = _data$SewerageConnect129[0]) === null || _data$SewerageConnect130 === void 0 ? void 0 : _data$SewerageConnect130.documents.reduce((acc, current) => {
|
|
33186
|
+
const x = acc.find(item => item.documentType === current.documentType);
|
|
33187
|
+
if (!x) {
|
|
33188
|
+
return acc.concat([current]);
|
|
33189
|
+
} else {
|
|
33190
|
+
return acc;
|
|
33191
|
+
}
|
|
33192
|
+
}, []).map((doc, index, array) => {
|
|
33193
|
+
var _doc$documentType2, _data$SewerageConnect131, _data$SewerageConnect132;
|
|
33095
33194
|
return /*#__PURE__*/React.createElement("div", {
|
|
33096
33195
|
key: "doc-" + index
|
|
33097
33196
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardSectionHeader, null, t(doc === null || doc === void 0 ? void 0 : (_doc$documentType2 = doc.documentType) === null || _doc$documentType2 === void 0 ? void 0 : _doc$documentType2.split(".").slice(0, 2).join("_"))), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(WSDocument, {
|
|
33098
33197
|
value: data === null || data === void 0 ? void 0 : (_data$SewerageConnect131 = data.SewerageConnections) === null || _data$SewerageConnect131 === void 0 ? void 0 : (_data$SewerageConnect132 = _data$SewerageConnect131[0]) === null || _data$SewerageConnect132 === void 0 ? void 0 : _data$SewerageConnect132.documents,
|
|
33099
33198
|
Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
|
|
33100
33199
|
index: index
|
|
33101
|
-
}),
|
|
33200
|
+
}), array.length != index + 1 ? /*#__PURE__*/React.createElement("hr", {
|
|
33102
33201
|
style: {
|
|
33103
33202
|
color: "white",
|
|
33104
33203
|
backgroundColor: "white",
|
|
@@ -33107,40 +33206,40 @@ const WSApplicationDetails = () => {
|
|
|
33107
33206
|
marginBottom: "20px"
|
|
33108
33207
|
}
|
|
33109
33208
|
}) : null)));
|
|
33110
|
-
})), (data === null || data === void 0 ? void 0 : (_data$
|
|
33209
|
+
})), (data === null || data === void 0 ? void 0 : (_data$WaterConnection138 = data.WaterConnection) === null || _data$WaterConnection138 === void 0 ? void 0 : (_data$WaterConnection139 = _data$WaterConnection138[0]) === null || _data$WaterConnection139 === void 0 ? void 0 : _data$WaterConnection139.applicationStatus) === "PENDING_FOR_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$WaterConnection140 = data.WaterConnection) === null || _data$WaterConnection140 === void 0 ? void 0 : (_data$WaterConnection141 = _data$WaterConnection140[0]) === null || _data$WaterConnection141 === void 0 ? void 0 : _data$WaterConnection141.applicationStatus) === "PENDING_FOR_FINAL_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$WaterConnection142 = data.WaterConnection) === null || _data$WaterConnection142 === void 0 ? void 0 : (_data$WaterConnection143 = _data$WaterConnection142[0]) === null || _data$WaterConnection143 === void 0 ? void 0 : _data$WaterConnection143.applicationStatus) === "PENDING_FOR_ADDITIONAL_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect133 = data.SewerageConnections) === null || _data$SewerageConnect133 === void 0 ? void 0 : (_data$SewerageConnect134 = _data$SewerageConnect133[0]) === null || _data$SewerageConnect134 === void 0 ? void 0 : _data$SewerageConnect134.applicationStatus) === "PENDING_FOR_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect135 = data.SewerageConnections) === null || _data$SewerageConnect135 === void 0 ? void 0 : (_data$SewerageConnect136 = _data$SewerageConnect135[0]) === null || _data$SewerageConnect136 === void 0 ? void 0 : _data$SewerageConnect136.applicationStatus) === "PENDING_FOR_FINAL_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect137 = data.SewerageConnections) === null || _data$SewerageConnect137 === void 0 ? void 0 : (_data$SewerageConnect138 = _data$SewerageConnect137[0]) === null || _data$SewerageConnect138 === void 0 ? void 0 : _data$SewerageConnect138.applicationStatus) === "PENDING_FOR_ADDITIONAL_PAYMENT" ? /*#__PURE__*/React.createElement(Link, {
|
|
33111
33210
|
to: {
|
|
33112
33211
|
pathname: "/digit-ui/citizen/payment/my-bills/" + (paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data = paymentDetails.data) === null || _paymentDetails$data === void 0 ? void 0 : (_paymentDetails$data$ = _paymentDetails$data.Bill) === null || _paymentDetails$data$ === void 0 ? void 0 : (_paymentDetails$data$2 = _paymentDetails$data$[0]) === null || _paymentDetails$data$2 === void 0 ? void 0 : _paymentDetails$data$2.businessService) + "/" + stringReplaceAll(paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data2 = paymentDetails.data) === null || _paymentDetails$data2 === void 0 ? void 0 : (_paymentDetails$data3 = _paymentDetails$data2.Bill) === null || _paymentDetails$data3 === void 0 ? void 0 : (_paymentDetails$data4 = _paymentDetails$data3[0]) === null || _paymentDetails$data4 === void 0 ? void 0 : _paymentDetails$data4.consumerCode, "/", "+"),
|
|
33113
|
-
search: "?workflow=WNS&tenantId=" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33212
|
+
search: "?workflow=WNS&tenantId=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection144 = data.WaterConnection) === null || _data$WaterConnection144 === void 0 ? void 0 : (_data$WaterConnection145 = _data$WaterConnection144[0]) === null || _data$WaterConnection145 === void 0 ? void 0 : _data$WaterConnection145.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect139 = data.SewerageConnections) === null || _data$SewerageConnect139 === void 0 ? void 0 : (_data$SewerageConnect140 = _data$SewerageConnect139[0]) === null || _data$SewerageConnect140 === void 0 ? void 0 : _data$SewerageConnect140.tenantId)) + "&ConsumerName=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection146 = data.WaterConnection) === null || _data$WaterConnection146 === void 0 ? void 0 : (_data$WaterConnection147 = _data$WaterConnection146[0]) === null || _data$WaterConnection147 === void 0 ? void 0 : (_data$WaterConnection148 = _data$WaterConnection147.connectionHolders) === null || _data$WaterConnection148 === void 0 ? void 0 : _data$WaterConnection148.map(owner => owner.name).join(",")) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect141 = data.SewerageConnections) === null || _data$SewerageConnect141 === void 0 ? void 0 : (_data$SewerageConnect142 = _data$SewerageConnect141[0]) === null || _data$SewerageConnect142 === void 0 ? void 0 : (_data$SewerageConnect143 = _data$SewerageConnect142.connectionHolders) === null || _data$SewerageConnect143 === void 0 ? void 0 : _data$SewerageConnect143.map(owner => owner.name).join(",")) || (PTData === null || PTData === void 0 ? void 0 : (_PTData$Properties8 = PTData.Properties) === null || _PTData$Properties8 === void 0 ? void 0 : (_PTData$Properties8$ = _PTData$Properties8[0]) === null || _PTData$Properties8$ === void 0 ? void 0 : (_PTData$Properties8$$ = _PTData$Properties8$.owners) === null || _PTData$Properties8$$ === void 0 ? void 0 : _PTData$Properties8$$.map(owner => owner.name).join(","))) + "&isDisoconnectFlow=" + (applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("DC") ? true : false) + "&consumerCode=" + (paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data5 = paymentDetails.data) === null || _paymentDetails$data5 === void 0 ? void 0 : (_paymentDetails$data6 = _paymentDetails$data5.Bill) === null || _paymentDetails$data6 === void 0 ? void 0 : (_paymentDetails$data7 = _paymentDetails$data6[0]) === null || _paymentDetails$data7 === void 0 ? void 0 : _paymentDetails$data7.consumerCode),
|
|
33114
33213
|
state: {
|
|
33115
33214
|
fromApplicationDetails: true
|
|
33116
33215
|
}
|
|
33117
33216
|
}
|
|
33118
33217
|
}, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
33119
33218
|
label: t("MAKE_PAYMENT")
|
|
33120
|
-
})) : null, !(data !== null && data !== void 0 && (_data$
|
|
33219
|
+
})) : null, !(data !== null && data !== void 0 && (_data$WaterConnection149 = data.WaterConnection) !== null && _data$WaterConnection149 !== void 0 && (_data$WaterConnection150 = _data$WaterConnection149[0]) !== null && _data$WaterConnection150 !== void 0 && _data$WaterConnection150.applicationType.includes("DISCONNECT")) && data !== null && data !== void 0 && (_data$WaterConnection151 = data.WaterConnection) !== null && _data$WaterConnection151 !== void 0 && (_data$WaterConnection152 = _data$WaterConnection151[0]) !== null && _data$WaterConnection152 !== void 0 && _data$WaterConnection152.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION") || !(data !== null && data !== void 0 && (_data$SewerageConnect144 = data.SewerageConnections) !== null && _data$SewerageConnect144 !== void 0 && (_data$SewerageConnect145 = _data$SewerageConnect144[0]) !== null && _data$SewerageConnect145 !== void 0 && _data$SewerageConnect145.applicationType.includes("DISCONNECT")) && data !== null && data !== void 0 && (_data$SewerageConnect146 = data.SewerageConnections) !== null && _data$SewerageConnect146 !== void 0 && (_data$SewerageConnect147 = _data$SewerageConnect146[0]) !== null && _data$SewerageConnect147 !== void 0 && _data$SewerageConnect147.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION") ? /*#__PURE__*/React.createElement(Link, {
|
|
33121
33220
|
to: {
|
|
33122
|
-
pathname: isMutation ? "/digit-ui/citizen/ws/mutation-application" : "/digit-ui/citizen/ws/edit-application/" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33123
|
-
search: isMutation ? "?applicationNumber=" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33221
|
+
pathname: isMutation ? "/digit-ui/citizen/ws/mutation-application" : "/digit-ui/citizen/ws/edit-application/" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection153 = data.WaterConnection) === null || _data$WaterConnection153 === void 0 ? void 0 : (_data$WaterConnection154 = _data$WaterConnection153[0]) === null || _data$WaterConnection154 === void 0 ? void 0 : _data$WaterConnection154.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect148 = data.SewerageConnections) === null || _data$SewerageConnect148 === void 0 ? void 0 : (_data$SewerageConnect149 = _data$SewerageConnect148[0]) === null || _data$SewerageConnect149 === void 0 ? void 0 : _data$SewerageConnect149.tenantId)),
|
|
33222
|
+
search: isMutation ? "?applicationNumber=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection155 = data.WaterConnection) === null || _data$WaterConnection155 === void 0 ? void 0 : (_data$WaterConnection156 = _data$WaterConnection155[0]) === null || _data$WaterConnection156 === void 0 ? void 0 : _data$WaterConnection156.applicationNo) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect150 = data.SewerageConnections) === null || _data$SewerageConnect150 === void 0 ? void 0 : (_data$SewerageConnect151 = _data$SewerageConnect150[0]) === null || _data$SewerageConnect151 === void 0 ? void 0 : _data$SewerageConnect151.applicationNo)) + "&tenantId=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection157 = data.WaterConnection) === null || _data$WaterConnection157 === void 0 ? void 0 : (_data$WaterConnection158 = _data$WaterConnection157[0]) === null || _data$WaterConnection158 === void 0 ? void 0 : _data$WaterConnection158.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect152 = data.SewerageConnections) === null || _data$SewerageConnect152 === void 0 ? void 0 : (_data$SewerageConnect153 = _data$SewerageConnect152[0]) === null || _data$SewerageConnect153 === void 0 ? void 0 : _data$SewerageConnect153.tenantId)) + "&service=" + (data !== null && data !== void 0 && (_data$WaterConnection159 = data.WaterConnection) !== null && _data$WaterConnection159 !== void 0 && _data$WaterConnection159[0] ? "WATER" : "SEWERAGE") + "&propertyId=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection160 = data.WaterConnection) === null || _data$WaterConnection160 === void 0 ? void 0 : (_data$WaterConnection161 = _data$WaterConnection160[0]) === null || _data$WaterConnection161 === void 0 ? void 0 : _data$WaterConnection161.propertyId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect154 = data.SewerageConnections) === null || _data$SewerageConnect154 === void 0 ? void 0 : (_data$SewerageConnect155 = _data$SewerageConnect154[0]) === null || _data$SewerageConnect155 === void 0 ? void 0 : _data$SewerageConnect155.propertyId)) : "",
|
|
33124
33223
|
state: {
|
|
33125
|
-
id: "" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33224
|
+
id: "" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection162 = data.WaterConnection) === null || _data$WaterConnection162 === void 0 ? void 0 : (_data$WaterConnection163 = _data$WaterConnection162[0]) === null || _data$WaterConnection163 === void 0 ? void 0 : _data$WaterConnection163.applicationNo) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect156 = data.SewerageConnections) === null || _data$SewerageConnect156 === void 0 ? void 0 : (_data$SewerageConnect157 = _data$SewerageConnect156[0]) === null || _data$SewerageConnect157 === void 0 ? void 0 : _data$SewerageConnect157.applicationNo))
|
|
33126
33225
|
}
|
|
33127
33226
|
}
|
|
33128
33227
|
}, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
33129
33228
|
label: t("COMMON_EDIT")
|
|
33130
|
-
})) : null, data !== null && data !== void 0 && (_data$
|
|
33229
|
+
})) : null, data !== null && data !== void 0 && (_data$WaterConnection164 = data.WaterConnection) !== null && _data$WaterConnection164 !== void 0 && (_data$WaterConnection165 = _data$WaterConnection164[0]) !== null && _data$WaterConnection165 !== void 0 && _data$WaterConnection165.applicationType.includes("DISCONNECT") && data !== null && data !== void 0 && (_data$WaterConnection166 = data.WaterConnection) !== null && _data$WaterConnection166 !== void 0 && (_data$WaterConnection167 = _data$WaterConnection166[0]) !== null && _data$WaterConnection167 !== void 0 && _data$WaterConnection167.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION") || data !== null && data !== void 0 && (_data$SewerageConnect158 = data.SewerageConnections) !== null && _data$SewerageConnect158 !== void 0 && (_data$SewerageConnect159 = _data$SewerageConnect158[0]) !== null && _data$SewerageConnect159 !== void 0 && _data$SewerageConnect159.applicationType.includes("DISCONNECT") && data !== null && data !== void 0 && (_data$SewerageConnect160 = data.SewerageConnections) !== null && _data$SewerageConnect160 !== void 0 && (_data$SewerageConnect161 = _data$SewerageConnect160[0]) !== null && _data$SewerageConnect161 !== void 0 && _data$SewerageConnect161.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION") ? /*#__PURE__*/React.createElement(Link, {
|
|
33131
33230
|
to: {
|
|
33132
33231
|
pathname: "/digit-ui/citizen/ws/resubmit-disconnect-application",
|
|
33133
33232
|
state: {
|
|
33134
|
-
id: "" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33233
|
+
id: "" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection168 = data.WaterConnection) === null || _data$WaterConnection168 === void 0 ? void 0 : (_data$WaterConnection169 = _data$WaterConnection168[0]) === null || _data$WaterConnection169 === void 0 ? void 0 : _data$WaterConnection169.applicationNo) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect162 = data.SewerageConnections) === null || _data$SewerageConnect162 === void 0 ? void 0 : (_data$SewerageConnect163 = _data$SewerageConnect162[0]) === null || _data$SewerageConnect163 === void 0 ? void 0 : _data$SewerageConnect163.applicationNo))
|
|
33135
33234
|
}
|
|
33136
33235
|
}
|
|
33137
33236
|
}, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
33138
33237
|
label: t("RESUBMIT_APPLICATION"),
|
|
33139
33238
|
onSubmit: Digit.SessionStorage.set("WS_DISCONNECTION", applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("SW") ? {
|
|
33140
|
-
applicationData: data === null || data === void 0 ? void 0 : (_data$
|
|
33239
|
+
applicationData: data === null || data === void 0 ? void 0 : (_data$SewerageConnect164 = data.SewerageConnections) === null || _data$SewerageConnect164 === void 0 ? void 0 : _data$SewerageConnect164[0],
|
|
33141
33240
|
serviceType: "SEWERAGE",
|
|
33142
33241
|
WSDisconnectionForm: {
|
|
33143
|
-
type: data !== null && data !== void 0 && (_data$
|
|
33242
|
+
type: data !== null && data !== void 0 && (_data$SewerageConnect165 = data.SewerageConnections) !== null && _data$SewerageConnect165 !== void 0 && (_data$SewerageConnect166 = _data$SewerageConnect165[0]) !== null && _data$SewerageConnect166 !== void 0 && _data$SewerageConnect166.isDisconnectionTemporary ? {
|
|
33144
33243
|
code: "type",
|
|
33145
33244
|
value: {
|
|
33146
33245
|
name: "Temporary",
|
|
@@ -33157,18 +33256,18 @@ const WSApplicationDetails = () => {
|
|
|
33157
33256
|
code: "Permanent"
|
|
33158
33257
|
}
|
|
33159
33258
|
},
|
|
33160
|
-
date: convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$
|
|
33259
|
+
date: convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$SewerageConnect167 = data.SewerageConnections) === null || _data$SewerageConnect167 === void 0 ? void 0 : (_data$SewerageConnect168 = _data$SewerageConnect167[0]) === null || _data$SewerageConnect168 === void 0 ? void 0 : _data$SewerageConnect168.dateEffectiveFrom, true),
|
|
33161
33260
|
reason: {
|
|
33162
33261
|
code: "reason",
|
|
33163
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
33262
|
+
value: data === null || data === void 0 ? void 0 : (_data$SewerageConnect169 = data.SewerageConnections) === null || _data$SewerageConnect169 === void 0 ? void 0 : (_data$SewerageConnect170 = _data$SewerageConnect169[0]) === null || _data$SewerageConnect170 === void 0 ? void 0 : _data$SewerageConnect170.disconnectionReason
|
|
33164
33263
|
},
|
|
33165
|
-
documents: data === null || data === void 0 ? void 0 : (_data$
|
|
33264
|
+
documents: data === null || data === void 0 ? void 0 : (_data$SewerageConnect171 = data.SewerageConnections) === null || _data$SewerageConnect171 === void 0 ? void 0 : (_data$SewerageConnect172 = _data$SewerageConnect171[0]) === null || _data$SewerageConnect172 === void 0 ? void 0 : _data$SewerageConnect172.documents
|
|
33166
33265
|
}
|
|
33167
33266
|
} : {
|
|
33168
|
-
applicationData: data === null || data === void 0 ? void 0 : (_data$
|
|
33267
|
+
applicationData: data === null || data === void 0 ? void 0 : (_data$WaterConnection170 = data.WaterConnection) === null || _data$WaterConnection170 === void 0 ? void 0 : _data$WaterConnection170[0],
|
|
33169
33268
|
serviceType: "WATER",
|
|
33170
33269
|
WSDisconnectionForm: {
|
|
33171
|
-
type: data !== null && data !== void 0 && (_data$
|
|
33270
|
+
type: data !== null && data !== void 0 && (_data$WaterConnection171 = data.WaterConnection) !== null && _data$WaterConnection171 !== void 0 && (_data$WaterConnection172 = _data$WaterConnection171[0]) !== null && _data$WaterConnection172 !== void 0 && _data$WaterConnection172.isDisconnectionTemporary ? {
|
|
33172
33271
|
code: "type",
|
|
33173
33272
|
value: {
|
|
33174
33273
|
name: "Temporary",
|
|
@@ -33185,12 +33284,12 @@ const WSApplicationDetails = () => {
|
|
|
33185
33284
|
code: "Permanent"
|
|
33186
33285
|
}
|
|
33187
33286
|
},
|
|
33188
|
-
date: convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$
|
|
33287
|
+
date: convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$WaterConnection173 = data.WaterConnection) === null || _data$WaterConnection173 === void 0 ? void 0 : (_data$WaterConnection174 = _data$WaterConnection173[0]) === null || _data$WaterConnection174 === void 0 ? void 0 : _data$WaterConnection174.dateEffectiveFrom, true),
|
|
33189
33288
|
reason: {
|
|
33190
33289
|
code: "reason",
|
|
33191
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
33290
|
+
value: data === null || data === void 0 ? void 0 : (_data$WaterConnection175 = data.WaterConnection) === null || _data$WaterConnection175 === void 0 ? void 0 : (_data$WaterConnection176 = _data$WaterConnection175[0]) === null || _data$WaterConnection176 === void 0 ? void 0 : _data$WaterConnection176.disconnectionReason
|
|
33192
33291
|
},
|
|
33193
|
-
documents: data === null || data === void 0 ? void 0 : (_data$
|
|
33292
|
+
documents: data === null || data === void 0 ? void 0 : (_data$WaterConnection177 = data.WaterConnection) === null || _data$WaterConnection177 === void 0 ? void 0 : (_data$WaterConnection178 = _data$WaterConnection177[0]) === null || _data$WaterConnection178 === void 0 ? void 0 : _data$WaterConnection178.documents
|
|
33194
33293
|
}
|
|
33195
33294
|
})
|
|
33196
33295
|
})) : null)))));
|
|
@@ -36797,6 +36896,10 @@ const BillSearchResults = () => {
|
|
|
36797
36896
|
})));
|
|
36798
36897
|
};
|
|
36799
36898
|
|
|
36899
|
+
const getMaskedPhone = phone => {
|
|
36900
|
+
if (!phone || phone.length < 10) return "NA";
|
|
36901
|
+
return "******" + phone.slice(-4);
|
|
36902
|
+
};
|
|
36800
36903
|
const getAddress$1 = (address, t) => {
|
|
36801
36904
|
return (address !== null && address !== void 0 && address.doorNo ? (address === null || address === void 0 ? void 0 : address.doorNo) + ", " : "") + " " + (address !== null && address !== void 0 && address.street ? (address === null || address === void 0 ? void 0 : address.street) + ", " : "") + (address !== null && address !== void 0 && address.landmark ? (address === null || address === void 0 ? void 0 : address.landmark) + ", " : "") + t(Digit.Utils.pt.getMohallaLocale(address === null || address === void 0 ? void 0 : address.locality.code, address === null || address === void 0 ? void 0 : address.tenantId)) + ", " + t(Digit.Utils.pt.getCityLocale(address === null || address === void 0 ? void 0 : address.tenantId)) + (address !== null && address !== void 0 && address.pincode && t(address === null || address === void 0 ? void 0 : address.pincode) ? ", " + address.pincode : " ");
|
|
36802
36905
|
};
|
|
@@ -36817,6 +36920,21 @@ const WSInfoPage = () => {
|
|
|
36817
36920
|
const _useState3 = useState(""),
|
|
36818
36921
|
searchMobileNumber = _useState3[0],
|
|
36819
36922
|
setSearchMobileNumber = _useState3[1];
|
|
36923
|
+
const _useState4 = useState(false),
|
|
36924
|
+
showOtpVerification = _useState4[0],
|
|
36925
|
+
setShowOtpVerification = _useState4[1];
|
|
36926
|
+
const _useState5 = useState(""),
|
|
36927
|
+
otp = _useState5[0],
|
|
36928
|
+
setOtp = _useState5[1];
|
|
36929
|
+
const _useState6 = useState(false),
|
|
36930
|
+
isOtpSending = _useState6[0],
|
|
36931
|
+
setIsOtpSending = _useState6[1];
|
|
36932
|
+
const _useState7 = useState(false),
|
|
36933
|
+
isOtpVerifying = _useState7[0],
|
|
36934
|
+
setIsOtpVerifying = _useState7[1];
|
|
36935
|
+
const _useState8 = useState(null),
|
|
36936
|
+
showToast = _useState8[0],
|
|
36937
|
+
setShowToast = _useState8[1];
|
|
36820
36938
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
36821
36939
|
const userMobileNumber = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.mobileNumber;
|
|
36822
36940
|
const mobileNumberToSearch = isEmployee ? searchMobileNumber : userMobileNumber;
|
|
@@ -36841,15 +36959,171 @@ const WSInfoPage = () => {
|
|
|
36841
36959
|
code: "NO",
|
|
36842
36960
|
i18nKey: "TL_COMMON_NO"
|
|
36843
36961
|
}];
|
|
36844
|
-
const
|
|
36962
|
+
const proceedToNext = () => {
|
|
36845
36963
|
const isEmployee = window.location.href.includes("/employee");
|
|
36846
36964
|
const baseUrl = isEmployee ? "/digit-ui/employee/ws" : "/digit-ui/citizen/ws";
|
|
36847
36965
|
if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && selectedProperty) {
|
|
36848
36966
|
history.push(baseUrl + "/old-application?propertyId=" + selectedProperty.propertyId);
|
|
36967
|
+
} else {
|
|
36968
|
+
history.push(baseUrl + "/old-application");
|
|
36969
|
+
}
|
|
36970
|
+
};
|
|
36971
|
+
const handleSendOtp = function (e) {
|
|
36972
|
+
try {
|
|
36973
|
+
if (e) {
|
|
36974
|
+
if (e.preventDefault) e.preventDefault();
|
|
36975
|
+
if (e.stopPropagation) e.stopPropagation();
|
|
36976
|
+
}
|
|
36977
|
+
setIsOtpSending(true);
|
|
36978
|
+
return Promise.resolve(_catch(function () {
|
|
36979
|
+
const payload = {
|
|
36980
|
+
otp: {
|
|
36981
|
+
mobileNumber: mobileNumberToSearch,
|
|
36982
|
+
tenantId: "dl",
|
|
36983
|
+
type: "register",
|
|
36984
|
+
userType: isEmployee ? "EMPLOYEE" : "CITIZEN"
|
|
36985
|
+
}
|
|
36986
|
+
};
|
|
36987
|
+
return Promise.resolve(Digit.UserService.sendOtp(payload, "dl")).then(function (response) {
|
|
36988
|
+
var _response$data, _response$data3;
|
|
36989
|
+
if (!response) {
|
|
36990
|
+
setIsOtpSending(false);
|
|
36991
|
+
setShowToast({
|
|
36992
|
+
key: "error",
|
|
36993
|
+
message: "Failed to send OTP (No response)"
|
|
36994
|
+
});
|
|
36995
|
+
return;
|
|
36996
|
+
}
|
|
36997
|
+
if (response !== null && response !== void 0 && response.error || response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.error) {
|
|
36998
|
+
var _response$data2, _errObj$fields, _errObj$fields$;
|
|
36999
|
+
const errObj = (response === null || response === void 0 ? void 0 : response.error) || (response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.error);
|
|
37000
|
+
setIsOtpSending(false);
|
|
37001
|
+
setShowToast({
|
|
37002
|
+
key: "error",
|
|
37003
|
+
message: (errObj === null || errObj === void 0 ? void 0 : (_errObj$fields = errObj.fields) === null || _errObj$fields === void 0 ? void 0 : (_errObj$fields$ = _errObj$fields[0]) === null || _errObj$fields$ === void 0 ? void 0 : _errObj$fields$.message) || (errObj === null || errObj === void 0 ? void 0 : errObj.message) || "Failed to send OTP"
|
|
37004
|
+
});
|
|
37005
|
+
return;
|
|
37006
|
+
}
|
|
37007
|
+
if (response !== null && response !== void 0 && response.Errors || response !== null && response !== void 0 && (_response$data3 = response.data) !== null && _response$data3 !== void 0 && _response$data3.Errors) {
|
|
37008
|
+
var _response$data4, _errObj$;
|
|
37009
|
+
const errObj = (response === null || response === void 0 ? void 0 : response.Errors) || (response === null || response === void 0 ? void 0 : (_response$data4 = response.data) === null || _response$data4 === void 0 ? void 0 : _response$data4.Errors);
|
|
37010
|
+
setIsOtpSending(false);
|
|
37011
|
+
setShowToast({
|
|
37012
|
+
key: "error",
|
|
37013
|
+
message: (errObj === null || errObj === void 0 ? void 0 : (_errObj$ = errObj[0]) === null || _errObj$ === void 0 ? void 0 : _errObj$.message) || "Failed to send OTP"
|
|
37014
|
+
});
|
|
37015
|
+
return;
|
|
37016
|
+
}
|
|
37017
|
+
setIsOtpSending(false);
|
|
37018
|
+
setShowOtpVerification(true);
|
|
37019
|
+
setShowToast({
|
|
37020
|
+
key: "success",
|
|
37021
|
+
message: "OTP sent successfully!"
|
|
37022
|
+
});
|
|
37023
|
+
});
|
|
37024
|
+
}, function (err) {
|
|
37025
|
+
var _err$response, _err$response$data, _err$response2, _err$response2$data;
|
|
37026
|
+
setIsOtpSending(false);
|
|
37027
|
+
let errMsg = "Failed to send OTP";
|
|
37028
|
+
if (err !== null && err !== void 0 && (_err$response = err.response) !== null && _err$response !== void 0 && (_err$response$data = _err$response.data) !== null && _err$response$data !== void 0 && _err$response$data.error) {
|
|
37029
|
+
var _err$response$data$er, _err$response$data$er2, _err$response$data$er3, _err$response$data$er4;
|
|
37030
|
+
errMsg = ((_err$response$data$er = err.response.data.error) === null || _err$response$data$er === void 0 ? void 0 : (_err$response$data$er2 = _err$response$data$er.fields) === null || _err$response$data$er2 === void 0 ? void 0 : (_err$response$data$er3 = _err$response$data$er2[0]) === null || _err$response$data$er3 === void 0 ? void 0 : _err$response$data$er3.message) || ((_err$response$data$er4 = err.response.data.error) === null || _err$response$data$er4 === void 0 ? void 0 : _err$response$data$er4.message) || errMsg;
|
|
37031
|
+
} else if (err !== null && err !== void 0 && (_err$response2 = err.response) !== null && _err$response2 !== void 0 && (_err$response2$data = _err$response2.data) !== null && _err$response2$data !== void 0 && _err$response2$data.Errors) {
|
|
37032
|
+
var _err$response$data$Er, _err$response$data$Er2;
|
|
37033
|
+
errMsg = ((_err$response$data$Er = err.response.data.Errors) === null || _err$response$data$Er === void 0 ? void 0 : (_err$response$data$Er2 = _err$response$data$Er[0]) === null || _err$response$data$Er2 === void 0 ? void 0 : _err$response$data$Er2.message) || errMsg;
|
|
37034
|
+
} else if (err.message) {
|
|
37035
|
+
errMsg = err.message;
|
|
37036
|
+
}
|
|
37037
|
+
setShowToast({
|
|
37038
|
+
key: "error",
|
|
37039
|
+
message: errMsg
|
|
37040
|
+
});
|
|
37041
|
+
}));
|
|
37042
|
+
} catch (e) {
|
|
37043
|
+
return Promise.reject(e);
|
|
37044
|
+
}
|
|
37045
|
+
};
|
|
37046
|
+
const handleVerifyOtp = function (e) {
|
|
37047
|
+
try {
|
|
37048
|
+
if (e) {
|
|
37049
|
+
if (e.preventDefault) e.preventDefault();
|
|
37050
|
+
if (e.stopPropagation) e.stopPropagation();
|
|
37051
|
+
}
|
|
37052
|
+
if (!otp || otp.length < 6) {
|
|
37053
|
+
setShowToast({
|
|
37054
|
+
key: "warning",
|
|
37055
|
+
message: "Please enter a valid 6-digit OTP"
|
|
37056
|
+
});
|
|
37057
|
+
return Promise.resolve();
|
|
37058
|
+
}
|
|
37059
|
+
setIsOtpVerifying(true);
|
|
37060
|
+
return Promise.resolve(_catch(function () {
|
|
37061
|
+
const payload = {
|
|
37062
|
+
otp: {
|
|
37063
|
+
otp: otp,
|
|
37064
|
+
identity: mobileNumberToSearch,
|
|
37065
|
+
tenantId: "dl"
|
|
37066
|
+
}
|
|
37067
|
+
};
|
|
37068
|
+
return Promise.resolve(Digit.UserService.validateOtp(payload)).then(function (response) {
|
|
37069
|
+
var _response$data5, _response$data7;
|
|
37070
|
+
if (!response || typeof response === "object" && Object.keys(response).length === 0) {
|
|
37071
|
+
throw new Error("OTP validation unsuccessful");
|
|
37072
|
+
}
|
|
37073
|
+
if (response !== null && response !== void 0 && response.error || response !== null && response !== void 0 && (_response$data5 = response.data) !== null && _response$data5 !== void 0 && _response$data5.error) {
|
|
37074
|
+
var _response$data6, _errObj$fields2, _errObj$fields2$;
|
|
37075
|
+
const errObj = (response === null || response === void 0 ? void 0 : response.error) || (response === null || response === void 0 ? void 0 : (_response$data6 = response.data) === null || _response$data6 === void 0 ? void 0 : _response$data6.error);
|
|
37076
|
+
throw new Error((errObj === null || errObj === void 0 ? void 0 : (_errObj$fields2 = errObj.fields) === null || _errObj$fields2 === void 0 ? void 0 : (_errObj$fields2$ = _errObj$fields2[0]) === null || _errObj$fields2$ === void 0 ? void 0 : _errObj$fields2$.message) || (errObj === null || errObj === void 0 ? void 0 : errObj.message) || "Failed to verify OTP");
|
|
37077
|
+
}
|
|
37078
|
+
if (response !== null && response !== void 0 && response.Errors || response !== null && response !== void 0 && (_response$data7 = response.data) !== null && _response$data7 !== void 0 && _response$data7.Errors) {
|
|
37079
|
+
var _response$data8, _errObj$2;
|
|
37080
|
+
const errObj = (response === null || response === void 0 ? void 0 : response.Errors) || (response === null || response === void 0 ? void 0 : (_response$data8 = response.data) === null || _response$data8 === void 0 ? void 0 : _response$data8.Errors);
|
|
37081
|
+
throw new Error((errObj === null || errObj === void 0 ? void 0 : (_errObj$2 = errObj[0]) === null || _errObj$2 === void 0 ? void 0 : _errObj$2.message) || "Failed to verify OTP");
|
|
37082
|
+
}
|
|
37083
|
+
setIsOtpVerifying(false);
|
|
37084
|
+
setShowToast({
|
|
37085
|
+
key: "success",
|
|
37086
|
+
message: "OTP verified successfully!"
|
|
37087
|
+
});
|
|
37088
|
+
proceedToNext();
|
|
37089
|
+
});
|
|
37090
|
+
}, function (err) {
|
|
37091
|
+
var _err$response3, _err$response3$data, _err$response4, _err$response4$data;
|
|
37092
|
+
setIsOtpVerifying(false);
|
|
37093
|
+
let errMsg = err.message || "Failed to verify OTP";
|
|
37094
|
+
if (err !== null && err !== void 0 && (_err$response3 = err.response) !== null && _err$response3 !== void 0 && (_err$response3$data = _err$response3.data) !== null && _err$response3$data !== void 0 && _err$response3$data.error) {
|
|
37095
|
+
var _err$response$data$er5, _err$response$data$er6, _err$response$data$er7, _err$response$data$er8;
|
|
37096
|
+
errMsg = ((_err$response$data$er5 = err.response.data.error) === null || _err$response$data$er5 === void 0 ? void 0 : (_err$response$data$er6 = _err$response$data$er5.fields) === null || _err$response$data$er6 === void 0 ? void 0 : (_err$response$data$er7 = _err$response$data$er6[0]) === null || _err$response$data$er7 === void 0 ? void 0 : _err$response$data$er7.message) || ((_err$response$data$er8 = err.response.data.error) === null || _err$response$data$er8 === void 0 ? void 0 : _err$response$data$er8.message) || errMsg;
|
|
37097
|
+
} else if (err !== null && err !== void 0 && (_err$response4 = err.response) !== null && _err$response4 !== void 0 && (_err$response4$data = _err$response4.data) !== null && _err$response4$data !== void 0 && _err$response4$data.Errors) {
|
|
37098
|
+
var _err$response$data$Er3, _err$response$data$Er4;
|
|
37099
|
+
errMsg = ((_err$response$data$Er3 = err.response.data.Errors) === null || _err$response$data$Er3 === void 0 ? void 0 : (_err$response$data$Er4 = _err$response$data$Er3[0]) === null || _err$response$data$Er4 === void 0 ? void 0 : _err$response$data$Er4.message) || errMsg;
|
|
37100
|
+
} else if (err.message) {
|
|
37101
|
+
errMsg = err.message;
|
|
37102
|
+
}
|
|
37103
|
+
setShowToast({
|
|
37104
|
+
key: "error",
|
|
37105
|
+
message: errMsg
|
|
37106
|
+
});
|
|
37107
|
+
}));
|
|
37108
|
+
} catch (e) {
|
|
37109
|
+
return Promise.reject(e);
|
|
37110
|
+
}
|
|
37111
|
+
};
|
|
37112
|
+
const handleNext = e => {
|
|
37113
|
+
if (e) {
|
|
37114
|
+
if (e.preventDefault) e.preventDefault();
|
|
37115
|
+
if (e.stopPropagation) e.stopPropagation();
|
|
37116
|
+
}
|
|
37117
|
+
if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && selectedProperty) {
|
|
37118
|
+
if (!isEmployee) {
|
|
37119
|
+
proceedToNext();
|
|
37120
|
+
} else {
|
|
37121
|
+
handleSendOtp(e);
|
|
37122
|
+
}
|
|
36849
37123
|
} else if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && !selectedProperty) {
|
|
36850
37124
|
return;
|
|
36851
37125
|
} else {
|
|
36852
|
-
|
|
37126
|
+
proceedToNext();
|
|
36853
37127
|
}
|
|
36854
37128
|
};
|
|
36855
37129
|
const handleCreateProperty = () => {
|
|
@@ -36859,6 +37133,66 @@ const WSInfoPage = () => {
|
|
|
36859
37133
|
const propertyOptions = (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop.map(prop => _extends({}, prop, {
|
|
36860
37134
|
displayName: prop.propertyId + " - " + getAddress$1(prop.address, t)
|
|
36861
37135
|
}))) || [];
|
|
37136
|
+
if (showOtpVerification) {
|
|
37137
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("form", {
|
|
37138
|
+
onSubmit: handleVerifyOtp
|
|
37139
|
+
}, /*#__PURE__*/React.createElement(CardHeader, null, t("WS_VERIFY_OTP_HEADER") || "Verify OTP"), /*#__PURE__*/React.createElement("div", {
|
|
37140
|
+
style: {
|
|
37141
|
+
marginBottom: "24px"
|
|
37142
|
+
}
|
|
37143
|
+
}, /*#__PURE__*/React.createElement(Label, null, t("WS_ENTER_OTP_SENT_TO") || "Enter OTP sent to", " +91 ", getMaskedPhone(mobileNumberToSearch), " *"), /*#__PURE__*/React.createElement(TextInput, {
|
|
37144
|
+
t: t,
|
|
37145
|
+
type: "number",
|
|
37146
|
+
isMandatory: false,
|
|
37147
|
+
value: otp,
|
|
37148
|
+
onChange: e => setOtp(e.target.value.replace(/\D/g, '').slice(0, 6)),
|
|
37149
|
+
placeholder: t("WS_ENTER_6_DIGIT_OTP") || "Enter 6-digit OTP",
|
|
37150
|
+
style: {
|
|
37151
|
+
width: "100%",
|
|
37152
|
+
maxWidth: "300px"
|
|
37153
|
+
}
|
|
37154
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
37155
|
+
style: {
|
|
37156
|
+
display: "flex",
|
|
37157
|
+
gap: "16px",
|
|
37158
|
+
marginBottom: "24px"
|
|
37159
|
+
}
|
|
37160
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
37161
|
+
type: "button",
|
|
37162
|
+
onClick: handleSendOtp,
|
|
37163
|
+
disabled: isOtpSending,
|
|
37164
|
+
style: {
|
|
37165
|
+
color: "#f47738",
|
|
37166
|
+
background: "none",
|
|
37167
|
+
border: "none",
|
|
37168
|
+
cursor: "pointer",
|
|
37169
|
+
fontWeight: "bold",
|
|
37170
|
+
textDecoration: "underline"
|
|
37171
|
+
}
|
|
37172
|
+
}, isOtpSending ? t("WS_SENDING_OTP") || "Sending..." : t("WS_RESEND_OTP") || "Resend OTP"), /*#__PURE__*/React.createElement("button", {
|
|
37173
|
+
type: "button",
|
|
37174
|
+
onClick: () => setShowOtpVerification(false),
|
|
37175
|
+
style: {
|
|
37176
|
+
color: "#f47738",
|
|
37177
|
+
background: "none",
|
|
37178
|
+
border: "none",
|
|
37179
|
+
cursor: "pointer",
|
|
37180
|
+
fontWeight: "bold",
|
|
37181
|
+
textDecoration: "underline"
|
|
37182
|
+
}
|
|
37183
|
+
}, t("CS_COMMON_CANCEL") || "Cancel")), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
37184
|
+
label: t("WS_VERIFY_OTP_AND_PROCEED") || "Verify & Proceed",
|
|
37185
|
+
onSubmit: handleVerifyOtp,
|
|
37186
|
+
disabled: otp.length < 6 || isOtpVerifying,
|
|
37187
|
+
submit: true
|
|
37188
|
+
}))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
37189
|
+
error: showToast.key === "error",
|
|
37190
|
+
warning: showToast.key === "warning",
|
|
37191
|
+
label: t(showToast.message),
|
|
37192
|
+
onClose: () => setShowToast(null),
|
|
37193
|
+
isDleteBtn: true
|
|
37194
|
+
}));
|
|
37195
|
+
}
|
|
36862
37196
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardHeader, null, t("WS_COMMON_APPL_NEW_CONNECTION")), /*#__PURE__*/React.createElement(CitizenInfoLabel, {
|
|
36863
37197
|
style: {
|
|
36864
37198
|
margin: "0px",
|
|
@@ -36883,6 +37217,8 @@ const WSInfoPage = () => {
|
|
|
36883
37217
|
onSelect: val => {
|
|
36884
37218
|
setHasProperty(val);
|
|
36885
37219
|
setSelectedProperty(null);
|
|
37220
|
+
setShowOtpVerification(false);
|
|
37221
|
+
setOtp("");
|
|
36886
37222
|
},
|
|
36887
37223
|
style: {
|
|
36888
37224
|
display: "flex",
|
|
@@ -36893,10 +37229,16 @@ const WSInfoPage = () => {
|
|
|
36893
37229
|
marginBottom: "24px"
|
|
36894
37230
|
}
|
|
36895
37231
|
}, isEmployee && /*#__PURE__*/React.createElement("div", {
|
|
37232
|
+
style: {
|
|
37233
|
+
display: "flex",
|
|
37234
|
+
flexDirection: "column",
|
|
37235
|
+
gap: "16px",
|
|
37236
|
+
marginBottom: "16px"
|
|
37237
|
+
}
|
|
37238
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
36896
37239
|
style: {
|
|
36897
37240
|
display: "flex",
|
|
36898
37241
|
gap: "24px",
|
|
36899
|
-
marginBottom: "16px",
|
|
36900
37242
|
alignItems: "flex-end"
|
|
36901
37243
|
}
|
|
36902
37244
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -36914,6 +37256,8 @@ const WSInfoPage = () => {
|
|
|
36914
37256
|
if (val.length <= 10) {
|
|
36915
37257
|
setSearchMobileNumber(val);
|
|
36916
37258
|
setSelectedProperty(null);
|
|
37259
|
+
setShowOtpVerification(false);
|
|
37260
|
+
setOtp("");
|
|
36917
37261
|
}
|
|
36918
37262
|
},
|
|
36919
37263
|
placeholder: t("Enter mobile number"),
|
|
@@ -36930,11 +37274,35 @@ const WSInfoPage = () => {
|
|
|
36930
37274
|
optionKey: "displayName",
|
|
36931
37275
|
id: "propertyId",
|
|
36932
37276
|
selected: selectedProperty,
|
|
36933
|
-
select:
|
|
37277
|
+
select: val => {
|
|
37278
|
+
setSelectedProperty(val);
|
|
37279
|
+
setShowOtpVerification(false);
|
|
37280
|
+
setOtp("");
|
|
37281
|
+
},
|
|
36934
37282
|
t: t,
|
|
36935
37283
|
placeholder: t("PT_SELECT_PROPERTY"),
|
|
36936
37284
|
disable: isLoading || propertyOptions.length === 0
|
|
36937
|
-
})))),
|
|
37285
|
+
})))), (searchMobileNumber === null || searchMobileNumber === void 0 ? void 0 : searchMobileNumber.length) === 10 && !isLoading && propertyOptions.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
37286
|
+
style: {
|
|
37287
|
+
display: "flex",
|
|
37288
|
+
flexDirection: "column",
|
|
37289
|
+
gap: "16px"
|
|
37290
|
+
}
|
|
37291
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
37292
|
+
style: {
|
|
37293
|
+
color: "#d63031",
|
|
37294
|
+
fontWeight: "bold"
|
|
37295
|
+
}
|
|
37296
|
+
}, t("WS_NO_PROPERTY_FOUND_ON_THIS_NUMBER") || "No property found on this number, please create the property first."), /*#__PURE__*/React.createElement("span", {
|
|
37297
|
+
onClick: handleCreateProperty
|
|
37298
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
37299
|
+
className: "submit-bar",
|
|
37300
|
+
type: "button",
|
|
37301
|
+
style: {
|
|
37302
|
+
color: "white",
|
|
37303
|
+
margin: 0
|
|
37304
|
+
}
|
|
37305
|
+
}, t("CPT_CREATE_PROPERTY"))))), !isEmployee && (isLoading || propertyOptions.length > 0) && /*#__PURE__*/React.createElement(Label, null, t("WS_SELECT_EXISTING_PROPERTY")), isLoading && !isEmployee ? /*#__PURE__*/React.createElement(Loader, null) : !isEmployee ? propertyOptions.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
36938
37306
|
style: {
|
|
36939
37307
|
display: "flex",
|
|
36940
37308
|
flexDirection: "column",
|
|
@@ -36945,7 +37313,11 @@ const WSInfoPage = () => {
|
|
|
36945
37313
|
optionKey: "displayName",
|
|
36946
37314
|
id: "propertyId",
|
|
36947
37315
|
selected: selectedProperty,
|
|
36948
|
-
select:
|
|
37316
|
+
select: val => {
|
|
37317
|
+
setSelectedProperty(val);
|
|
37318
|
+
setShowOtpVerification(false);
|
|
37319
|
+
setOtp("");
|
|
37320
|
+
},
|
|
36949
37321
|
t: t,
|
|
36950
37322
|
placeholder: t("PT_SELECT_PROPERTY")
|
|
36951
37323
|
}), /*#__PURE__*/React.createElement("span", {
|
|
@@ -36953,7 +37325,28 @@ const WSInfoPage = () => {
|
|
|
36953
37325
|
fontSize: "14px",
|
|
36954
37326
|
color: "#505A5F"
|
|
36955
37327
|
}
|
|
36956
|
-
}, t("WS_PROPERTY_AUTOFILL_MSG")))
|
|
37328
|
+
}, t("WS_PROPERTY_AUTOFILL_MSG"))) : /*#__PURE__*/React.createElement("div", {
|
|
37329
|
+
style: {
|
|
37330
|
+
display: "flex",
|
|
37331
|
+
flexDirection: "column",
|
|
37332
|
+
gap: "16px",
|
|
37333
|
+
marginTop: "16px"
|
|
37334
|
+
}
|
|
37335
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
37336
|
+
style: {
|
|
37337
|
+
color: "#d63031",
|
|
37338
|
+
fontWeight: "bold"
|
|
37339
|
+
}
|
|
37340
|
+
}, t("WS_NO_PROPERTY_FOUND_ON_THIS_NUMBER") || "No property found on this number, please create the property first."), /*#__PURE__*/React.createElement("span", {
|
|
37341
|
+
onClick: handleCreateProperty
|
|
37342
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
37343
|
+
className: "submit-bar",
|
|
37344
|
+
type: "button",
|
|
37345
|
+
style: {
|
|
37346
|
+
color: "white",
|
|
37347
|
+
margin: 0
|
|
37348
|
+
}
|
|
37349
|
+
}, t("CPT_CREATE_PROPERTY")))) : null), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "NO" && /*#__PURE__*/React.createElement("div", {
|
|
36957
37350
|
style: {
|
|
36958
37351
|
marginBottom: "24px",
|
|
36959
37352
|
display: "flex",
|
|
@@ -37104,7 +37497,13 @@ const WSInfoPage = () => {
|
|
|
37104
37497
|
return Promise.reject(e);
|
|
37105
37498
|
}
|
|
37106
37499
|
}
|
|
37107
|
-
})))
|
|
37500
|
+
}))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
37501
|
+
error: showToast.key === "error",
|
|
37502
|
+
warning: showToast.key === "warning",
|
|
37503
|
+
label: t(showToast.message),
|
|
37504
|
+
onClose: () => setShowToast(null),
|
|
37505
|
+
isDleteBtn: true
|
|
37506
|
+
}));
|
|
37108
37507
|
};
|
|
37109
37508
|
|
|
37110
37509
|
const WSPropertyLocationDetails = props => {
|
|
@@ -41514,9 +41913,7 @@ const configWSApproverApplication = _ref => {
|
|
|
41514
41913
|
error = _ref.error,
|
|
41515
41914
|
isReasonRequiredAction = _ref.isReasonRequiredAction,
|
|
41516
41915
|
selectedReason = _ref.selectedReason,
|
|
41517
|
-
setSelectedReason = _ref.setSelectedReason
|
|
41518
|
-
otherReasonText = _ref.otherReasonText,
|
|
41519
|
-
setOtherReasonText = _ref.setOtherReasonText;
|
|
41916
|
+
setSelectedReason = _ref.setSelectedReason;
|
|
41520
41917
|
if (action !== null && action !== void 0 && (_action$action = action.action) !== null && _action$action !== void 0 && _action$action.includes("SEND_BACK") || (action === null || action === void 0 ? void 0 : action.action) == "APPROVE_FOR_CONNECTION") ;
|
|
41521
41918
|
const reasonOptions = [{
|
|
41522
41919
|
code: "INCOMPLETE_DOCUMENTS",
|
|
@@ -41537,7 +41934,7 @@ const configWSApproverApplication = _ref => {
|
|
|
41537
41934
|
}];
|
|
41538
41935
|
const commentsField = isReasonRequiredAction ? [{
|
|
41539
41936
|
label: t("WF_REASON_LABEL") || t("Reason"),
|
|
41540
|
-
isMandatory:
|
|
41937
|
+
isMandatory: false,
|
|
41541
41938
|
populators: /*#__PURE__*/React.createElement(Dropdown, {
|
|
41542
41939
|
option: reasonOptions,
|
|
41543
41940
|
autoComplete: "off",
|
|
@@ -41545,30 +41942,18 @@ const configWSApproverApplication = _ref => {
|
|
|
41545
41942
|
id: "mutationActionReason",
|
|
41546
41943
|
select: val => {
|
|
41547
41944
|
setSelectedReason(val);
|
|
41548
|
-
if ((val === null || val === void 0 ? void 0 : val.code) !== "OTHER") {
|
|
41549
|
-
setOtherReasonText("");
|
|
41550
|
-
}
|
|
41551
41945
|
},
|
|
41552
41946
|
selected: selectedReason,
|
|
41553
41947
|
t: t,
|
|
41554
41948
|
placeholder: t("WF_SELECT_REASON_PLACEHOLDER") || "Select Reason"
|
|
41555
41949
|
})
|
|
41556
|
-
},
|
|
41557
|
-
label: t("
|
|
41558
|
-
|
|
41559
|
-
populators:
|
|
41560
|
-
|
|
41561
|
-
|
|
41562
|
-
|
|
41563
|
-
height: "80px",
|
|
41564
|
-
resize: "vertical",
|
|
41565
|
-
marginTop: "4px"
|
|
41566
|
-
},
|
|
41567
|
-
value: otherReasonText,
|
|
41568
|
-
onChange: e => setOtherReasonText(e.target.value),
|
|
41569
|
-
placeholder: t("WF_ENTER_OTHER_REASON_PLACEHOLDER") || "Enter reason details..."
|
|
41570
|
-
})
|
|
41571
|
-
}] : [])] : [{
|
|
41950
|
+
}, {
|
|
41951
|
+
label: t("WF_COMMON_COMMENTS"),
|
|
41952
|
+
type: "textarea",
|
|
41953
|
+
populators: {
|
|
41954
|
+
name: "comments"
|
|
41955
|
+
}
|
|
41956
|
+
}] : [{
|
|
41572
41957
|
label: t("WF_COMMON_COMMENTS"),
|
|
41573
41958
|
type: "textarea",
|
|
41574
41959
|
populators: {
|
|
@@ -43136,7 +43521,7 @@ const ActionModal$5 = _ref => {
|
|
|
43136
43521
|
otherReasonText = _useState9[0],
|
|
43137
43522
|
setOtherReasonText = _useState9[1];
|
|
43138
43523
|
const isMutationApp = ((_applicationData = applicationData) === null || _applicationData === void 0 ? void 0 : (_applicationData$appl = _applicationData.applicationType) === null || _applicationData$appl === void 0 ? void 0 : _applicationData$appl.includes("MUTATION")) || ((_applicationData2 = applicationData) === null || _applicationData2 === void 0 ? void 0 : (_applicationData2$bus = _applicationData2.businessService) === null || _applicationData2$bus === void 0 ? void 0 : _applicationData2$bus.includes("MUTATION")) || (businessService === null || businessService === void 0 ? void 0 : businessService.includes("MUTATION")) || ((_applicationData3 = applicationData) === null || _applicationData3 === void 0 ? void 0 : (_applicationData3$app = _applicationData3.applicationNo) === null || _applicationData3$app === void 0 ? void 0 : _applicationData3$app.includes("MUT"));
|
|
43139
|
-
const isReasonRequiredAction =
|
|
43524
|
+
const isReasonRequiredAction = (action === null || action === void 0 ? void 0 : (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.includes("SEND_BACK")) || (action === null || action === void 0 ? void 0 : (_action$action2 = action.action) === null || _action$action2 === void 0 ? void 0 : _action$action2.includes("REJECT"));
|
|
43140
43525
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
43141
43526
|
const isEmployee = window.location.href.includes("/employee");
|
|
43142
43527
|
useEffect(() => {
|
|
@@ -43200,18 +43585,14 @@ const ActionModal$5 = _ref => {
|
|
|
43200
43585
|
var _applicationData4, _applicationData0, _applicationData1, _applicationData1$app, _applicationData10, _applicationData10$pr, _applicationData11, _applicationData11$pr, _applicationData13, _applicationData14;
|
|
43201
43586
|
let commentValue = (data === null || data === void 0 ? void 0 : data.comments) || "";
|
|
43202
43587
|
if (isReasonRequiredAction) {
|
|
43203
|
-
|
|
43204
|
-
|
|
43588
|
+
var _commentValue;
|
|
43589
|
+
if (!selectedReason && !((_commentValue = commentValue) !== null && _commentValue !== void 0 && _commentValue.trim())) {
|
|
43590
|
+
setError(t("PLEASE_PROVIDE_REASON_OR_COMMENT") || "Please provide a reason or comment");
|
|
43205
43591
|
return;
|
|
43206
43592
|
}
|
|
43207
|
-
if (
|
|
43208
|
-
|
|
43209
|
-
|
|
43210
|
-
return;
|
|
43211
|
-
}
|
|
43212
|
-
commentValue = otherReasonText.trim();
|
|
43213
|
-
} else {
|
|
43214
|
-
commentValue = (selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.name) || (selectedReason !== null && selectedReason !== void 0 && selectedReason.i18nKey ? t(selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.i18nKey) : selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.code);
|
|
43593
|
+
if (selectedReason) {
|
|
43594
|
+
const reasonValue = (selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.name) || (selectedReason !== null && selectedReason !== void 0 && selectedReason.i18nKey ? t(selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.i18nKey) : selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.code);
|
|
43595
|
+
commentValue = commentValue ? reasonValue + "\n" + commentValue : reasonValue;
|
|
43215
43596
|
}
|
|
43216
43597
|
}
|
|
43217
43598
|
if ((_applicationData4 = applicationData) !== null && _applicationData4 !== void 0 && _applicationData4.isBillAmend) {
|
|
@@ -50973,7 +51354,8 @@ const EditModifyApplication = () => {
|
|
|
50973
51354
|
|
|
50974
51355
|
const Step1_SearchConnection = _ref => {
|
|
50975
51356
|
let defaultKNumber = _ref.defaultKNumber,
|
|
50976
|
-
onNext = _ref.onNext
|
|
51357
|
+
onNext = _ref.onNext,
|
|
51358
|
+
isEditFlow = _ref.isEditFlow;
|
|
50977
51359
|
const _useState = useState(defaultKNumber || ""),
|
|
50978
51360
|
kNumber = _useState[0],
|
|
50979
51361
|
setKNumber = _useState[1];
|
|
@@ -51012,7 +51394,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51012
51394
|
setIsLoading(false);
|
|
51013
51395
|
setShowToast({
|
|
51014
51396
|
key: "error",
|
|
51015
|
-
message: "
|
|
51397
|
+
message: "Active connection not found for the given K Number"
|
|
51016
51398
|
});
|
|
51017
51399
|
return;
|
|
51018
51400
|
}
|
|
@@ -51039,11 +51421,12 @@ const Step1_SearchConnection = _ref => {
|
|
|
51039
51421
|
onNext({
|
|
51040
51422
|
kNumber,
|
|
51041
51423
|
mobileNumber: fetchedMobileNumber,
|
|
51042
|
-
serviceType: detectedServiceType
|
|
51424
|
+
serviceType: detectedServiceType,
|
|
51425
|
+
activeConnection: connection
|
|
51043
51426
|
});
|
|
51044
51427
|
});
|
|
51045
51428
|
}
|
|
51046
|
-
let connection = wsResponse === null || wsResponse === void 0 ? void 0 : (_wsResponse$WaterConn = wsResponse.WaterConnection) === null || _wsResponse$WaterConn === void 0 ? void 0 : _wsResponse$WaterConn
|
|
51429
|
+
let connection = wsResponse === null || wsResponse === void 0 ? void 0 : (_wsResponse$WaterConn = wsResponse.WaterConnection) === null || _wsResponse$WaterConn === void 0 ? void 0 : _wsResponse$WaterConn.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED');
|
|
51047
51430
|
const _temp = function () {
|
|
51048
51431
|
if (!connection) {
|
|
51049
51432
|
return Promise.resolve(Digit.WSService.search({
|
|
@@ -51052,7 +51435,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51052
51435
|
businessService: "SW"
|
|
51053
51436
|
}).catch(() => null)).then(function (swResponse) {
|
|
51054
51437
|
var _swResponse$SewerageC;
|
|
51055
|
-
connection = swResponse === null || swResponse === void 0 ? void 0 : (_swResponse$SewerageC = swResponse.SewerageConnections) === null || _swResponse$SewerageC === void 0 ? void 0 : _swResponse$SewerageC
|
|
51438
|
+
connection = swResponse === null || swResponse === void 0 ? void 0 : (_swResponse$SewerageC = swResponse.SewerageConnections) === null || _swResponse$SewerageC === void 0 ? void 0 : _swResponse$SewerageC.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED');
|
|
51056
51439
|
if (connection) detectedServiceType = "SEWERAGE";
|
|
51057
51440
|
});
|
|
51058
51441
|
}
|
|
@@ -51124,7 +51507,8 @@ const Step1_SearchConnection = _ref => {
|
|
|
51124
51507
|
placeholder: "Enter K Number",
|
|
51125
51508
|
style: {
|
|
51126
51509
|
width: "100%"
|
|
51127
|
-
}
|
|
51510
|
+
},
|
|
51511
|
+
disabled: isEditFlow
|
|
51128
51512
|
})), /*#__PURE__*/React.createElement("div", {
|
|
51129
51513
|
style: {
|
|
51130
51514
|
display: "flex",
|
|
@@ -51936,6 +52320,12 @@ const Step3_UploadDocuments = _ref => {
|
|
|
51936
52320
|
const _useState9 = useState(false),
|
|
51937
52321
|
hasAttemptedSubmit = _useState9[0],
|
|
51938
52322
|
setHasAttemptedSubmit = _useState9[1];
|
|
52323
|
+
const _useState0 = useState(false),
|
|
52324
|
+
digiLockerUpload = _useState0[0],
|
|
52325
|
+
setDigilockerUpload = _useState0[1];
|
|
52326
|
+
const _useState1 = useState(false),
|
|
52327
|
+
isDocumentUidLocked = _useState1[0],
|
|
52328
|
+
setIsDocumentUidLocked = _useState1[1];
|
|
51939
52329
|
const identityOptions = [{
|
|
51940
52330
|
code: "AADHAAR",
|
|
51941
52331
|
i18nKey: "Aadhaar Card"
|
|
@@ -52051,24 +52441,30 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52051
52441
|
return Promise.reject(e);
|
|
52052
52442
|
}
|
|
52053
52443
|
};
|
|
52444
|
+
useEffect(() => {
|
|
52445
|
+
const DIGILOCKER_SUPPORTED_CODES = ["AADHAAR", "AADHAR", "DRIVING", "DRVLC", "PAN"];
|
|
52446
|
+
const upper = ((identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code) || "").toUpperCase();
|
|
52447
|
+
const eligible = DIGILOCKER_SUPPORTED_CODES.some(keyword => upper.includes(keyword));
|
|
52448
|
+
setDigilockerUpload(eligible);
|
|
52449
|
+
}, [identityProofType]);
|
|
52054
52450
|
useEffect(() => {
|
|
52055
52451
|
if (rawFiles.identity) handleFileUpload(rawFiles.identity, "identity");
|
|
52056
52452
|
}, [rawFiles.identity]);
|
|
52057
52453
|
useEffect(() => {
|
|
52058
52454
|
if (rawFiles.mutation) handleFileUpload(rawFiles.mutation, "mutation");
|
|
52059
52455
|
}, [rawFiles.mutation]);
|
|
52060
|
-
const _useState0 = useState(""),
|
|
52061
|
-
identityFileName = _useState0[0],
|
|
52062
|
-
setIdentityFileName = _useState0[1];
|
|
52063
|
-
const _useState1 = useState(""),
|
|
52064
|
-
mutationFileName = _useState1[0],
|
|
52065
|
-
setMutationFileName = _useState1[1];
|
|
52066
52456
|
const _useState10 = useState(""),
|
|
52067
|
-
|
|
52068
|
-
|
|
52457
|
+
identityFileName = _useState10[0],
|
|
52458
|
+
setIdentityFileName = _useState10[1];
|
|
52069
52459
|
const _useState11 = useState(""),
|
|
52070
|
-
|
|
52071
|
-
|
|
52460
|
+
mutationFileName = _useState11[0],
|
|
52461
|
+
setMutationFileName = _useState11[1];
|
|
52462
|
+
const _useState12 = useState(""),
|
|
52463
|
+
identityFileUrl = _useState12[0],
|
|
52464
|
+
setIdentityFileUrl = _useState12[1];
|
|
52465
|
+
const _useState13 = useState(""),
|
|
52466
|
+
mutationFileUrl = _useState13[0],
|
|
52467
|
+
setMutationFileUrl = _useState13[1];
|
|
52072
52468
|
useEffect(() => {
|
|
52073
52469
|
const fetchFileDetails = function () {
|
|
52074
52470
|
try {
|
|
@@ -52258,6 +52654,14 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52258
52654
|
selected: identityProofType,
|
|
52259
52655
|
option: identityOptions,
|
|
52260
52656
|
select: val => {
|
|
52657
|
+
if (val.code !== (identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code)) {
|
|
52658
|
+
setIdentityProofFile(null);
|
|
52659
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52660
|
+
identity: null
|
|
52661
|
+
}));
|
|
52662
|
+
setDocumentNumber("");
|
|
52663
|
+
setIsDocumentUidLocked(false);
|
|
52664
|
+
}
|
|
52261
52665
|
setIdentityProofType(val);
|
|
52262
52666
|
setFieldErrors(prev => _extends({}, prev, {
|
|
52263
52667
|
identityType: null
|
|
@@ -52279,10 +52683,12 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52279
52683
|
}, "Document Number ", mandatoryIndicator), /*#__PURE__*/React.createElement(TextInput, {
|
|
52280
52684
|
value: documentNumber,
|
|
52281
52685
|
onChange: e => {
|
|
52282
|
-
|
|
52283
|
-
|
|
52284
|
-
|
|
52285
|
-
|
|
52686
|
+
if (!isDocumentUidLocked) {
|
|
52687
|
+
setDocumentNumber(e.target.value);
|
|
52688
|
+
setFieldErrors(prev => _extends({}, prev, {
|
|
52689
|
+
documentNumber: null
|
|
52690
|
+
}));
|
|
52691
|
+
}
|
|
52286
52692
|
},
|
|
52287
52693
|
onBlur: () => {
|
|
52288
52694
|
if (hasAttemptedSubmit) {
|
|
@@ -52293,10 +52699,15 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52293
52699
|
}
|
|
52294
52700
|
},
|
|
52295
52701
|
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",
|
|
52702
|
+
disabled: isDocumentUidLocked,
|
|
52296
52703
|
style: _extends({
|
|
52297
52704
|
marginBottom: "4px"
|
|
52298
52705
|
}, fieldErrors.documentNumber ? {
|
|
52299
52706
|
border: "1px solid #d32f2f"
|
|
52707
|
+
} : {}, isDocumentUidLocked ? {
|
|
52708
|
+
backgroundColor: "#f0f0f0",
|
|
52709
|
+
cursor: "not-allowed",
|
|
52710
|
+
color: "#555"
|
|
52300
52711
|
} : {})
|
|
52301
52712
|
}), fieldErrors.documentNumber && /*#__PURE__*/React.createElement("div", {
|
|
52302
52713
|
style: errorTextStyle
|
|
@@ -52312,7 +52723,49 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52312
52723
|
}
|
|
52313
52724
|
}, "Format: ABCDE1234F"), /*#__PURE__*/React.createElement("div", {
|
|
52314
52725
|
style: uploadBoxStyle(!!fieldErrors.identityFile, !!identityProofFile)
|
|
52315
|
-
}, /*#__PURE__*/React.createElement(
|
|
52726
|
+
}, digiLockerUpload ? /*#__PURE__*/React.createElement(UploadFileDigiLocker, {
|
|
52727
|
+
id: "identity-upload",
|
|
52728
|
+
onUpload: (e, newFile) => {
|
|
52729
|
+
if (newFile) {
|
|
52730
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52731
|
+
identity: newFile
|
|
52732
|
+
}));
|
|
52733
|
+
} else {
|
|
52734
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52735
|
+
identity: e.target.files[0]
|
|
52736
|
+
}));
|
|
52737
|
+
}
|
|
52738
|
+
},
|
|
52739
|
+
onDelete: () => {
|
|
52740
|
+
setIdentityProofFile(null);
|
|
52741
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52742
|
+
identity: null
|
|
52743
|
+
}));
|
|
52744
|
+
setDocumentNumber("");
|
|
52745
|
+
setIsDocumentUidLocked(false);
|
|
52746
|
+
},
|
|
52747
|
+
message: identityProofFile ? "Uploaded" : "Click to Choose File",
|
|
52748
|
+
accept: "image/*, .pdf, .png, .jpeg, .jpg",
|
|
52749
|
+
uploadedFiles: identityProofFile && !rawFiles.identity ? [["Document", {
|
|
52750
|
+
fileStoreId: identityProofFile
|
|
52751
|
+
}]] : undefined,
|
|
52752
|
+
removeTargetedFile: () => {
|
|
52753
|
+
setIdentityProofFile(null);
|
|
52754
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52755
|
+
identity: null
|
|
52756
|
+
}));
|
|
52757
|
+
setDocumentNumber("");
|
|
52758
|
+
setIsDocumentUidLocked(false);
|
|
52759
|
+
},
|
|
52760
|
+
documentType: identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code,
|
|
52761
|
+
onDocumentNumber: num => {
|
|
52762
|
+
setDocumentNumber(num);
|
|
52763
|
+
setIsDocumentUidLocked(true);
|
|
52764
|
+
setFieldErrors(prev => _extends({}, prev, {
|
|
52765
|
+
documentNumber: null
|
|
52766
|
+
}));
|
|
52767
|
+
}
|
|
52768
|
+
}) : /*#__PURE__*/React.createElement(UploadFile, {
|
|
52316
52769
|
id: "identity-upload",
|
|
52317
52770
|
onUpload: e => setRawFiles(prev => _extends({}, prev, {
|
|
52318
52771
|
identity: e.target.files[0]
|
|
@@ -53018,45 +53471,54 @@ const MutationApplication = () => {
|
|
|
53018
53471
|
var _Digit$SessionStorage, _user$info, _state, _user$info2, _user$info2$userName, _user$info3, _user$info4, _details$applicationD, _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a4, _applicationDetails$a8, _applicationDetails$a9;
|
|
53019
53472
|
const _useTranslation = useTranslation(),
|
|
53020
53473
|
t = _useTranslation.t;
|
|
53021
|
-
|
|
53022
|
-
|
|
53474
|
+
const _useRouteMatch = useRouteMatch(),
|
|
53475
|
+
path = _useRouteMatch.path;
|
|
53476
|
+
const location = useLocation();
|
|
53477
|
+
let state = location.state;
|
|
53023
53478
|
state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
|
|
53024
53479
|
const history = useHistory();
|
|
53025
53480
|
let filters = getQueryStringParams(location.search);
|
|
53026
|
-
const
|
|
53027
|
-
|
|
53028
|
-
|
|
53029
|
-
|
|
53030
|
-
|
|
53031
|
-
|
|
53032
|
-
|
|
53033
|
-
|
|
53034
|
-
|
|
53035
|
-
|
|
53036
|
-
|
|
53037
|
-
|
|
53038
|
-
|
|
53039
|
-
|
|
53040
|
-
|
|
53041
|
-
|
|
53042
|
-
|
|
53043
|
-
const
|
|
53044
|
-
isMobile =
|
|
53045
|
-
setIsMobile =
|
|
53481
|
+
const currentStep = location.pathname.includes("/search-connection") ? 1 : location.pathname.includes("/existing-connection") ? 2 : location.pathname.includes("/consumer-details") ? 3 : location.pathname.includes("/document") ? 4 : location.pathname.includes("/preview") ? 5 : location.pathname.includes("/submission") ? 6 : 1;
|
|
53482
|
+
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("MUTATION_APP_FORM_DATA", {}),
|
|
53483
|
+
formData = _Digit$Hooks$useSessi[0],
|
|
53484
|
+
setFormData = _Digit$Hooks$useSessi[1],
|
|
53485
|
+
clearFormData = _Digit$Hooks$useSessi[2];
|
|
53486
|
+
const _useState = useState(null),
|
|
53487
|
+
showToast = _useState[0],
|
|
53488
|
+
setShowToast = _useState[1];
|
|
53489
|
+
const _useState2 = useState(null),
|
|
53490
|
+
generatedAppNo = _useState2[0],
|
|
53491
|
+
setGeneratedAppNo = _useState2[1];
|
|
53492
|
+
const _useState3 = useState(false),
|
|
53493
|
+
isSubmitting = _useState3[0],
|
|
53494
|
+
setIsSubmitting = _useState3[1];
|
|
53495
|
+
const _Digit$Hooks$useSessi2 = Digit.Hooks.useSessionStorage("MUTATION_APP_COMPLETED_STEPS", []),
|
|
53496
|
+
setCompletedSteps = _Digit$Hooks$useSessi2[1],
|
|
53497
|
+
clearCompletedSteps = _Digit$Hooks$useSessi2[2];
|
|
53498
|
+
const _useState4 = useState(window.innerWidth < 768),
|
|
53499
|
+
isMobile = _useState4[0],
|
|
53500
|
+
setIsMobile = _useState4[1];
|
|
53046
53501
|
useEffect(() => {
|
|
53047
53502
|
const handleResize = () => setIsMobile(window.innerWidth < 768);
|
|
53048
53503
|
window.addEventListener("resize", handleResize);
|
|
53049
53504
|
return () => window.removeEventListener("resize", handleResize);
|
|
53050
53505
|
}, []);
|
|
53051
|
-
const
|
|
53052
|
-
authKNumber =
|
|
53053
|
-
setAuthKNumber =
|
|
53054
|
-
|
|
53055
|
-
|
|
53056
|
-
|
|
53057
|
-
|
|
53058
|
-
|
|
53059
|
-
|
|
53506
|
+
const _Digit$Hooks$useSessi3 = Digit.Hooks.useSessionStorage("MUTATION_APP_K_NUMBER", ""),
|
|
53507
|
+
authKNumber = _Digit$Hooks$useSessi3[0],
|
|
53508
|
+
setAuthKNumber = _Digit$Hooks$useSessi3[1],
|
|
53509
|
+
clearAuthKNumber = _Digit$Hooks$useSessi3[2];
|
|
53510
|
+
const _Digit$Hooks$useSessi4 = Digit.Hooks.useSessionStorage("MUTATION_APP_MOBILE", ""),
|
|
53511
|
+
authMobileNumber = _Digit$Hooks$useSessi4[0],
|
|
53512
|
+
setAuthMobileNumber = _Digit$Hooks$useSessi4[1],
|
|
53513
|
+
clearAuthMobileNumber = _Digit$Hooks$useSessi4[2];
|
|
53514
|
+
const _Digit$Hooks$useSessi5 = Digit.Hooks.useSessionStorage("MUTATION_APP_SERVICE", ""),
|
|
53515
|
+
authServiceType = _Digit$Hooks$useSessi5[0],
|
|
53516
|
+
setAuthServiceType = _Digit$Hooks$useSessi5[1],
|
|
53517
|
+
clearAuthServiceType = _Digit$Hooks$useSessi5[2];
|
|
53518
|
+
const _Digit$Hooks$useSessi6 = Digit.Hooks.useSessionStorage("MUTATION_APP_ACTIVE_CONN", null),
|
|
53519
|
+
authActiveConnection = _Digit$Hooks$useSessi6[0],
|
|
53520
|
+
setAuthActiveConnection = _Digit$Hooks$useSessi6[1],
|
|
53521
|
+
clearAuthActiveConnection = _Digit$Hooks$useSessi6[2];
|
|
53060
53522
|
const user = Digit.UserService.getUser();
|
|
53061
53523
|
let tenantId = (filters === null || filters === void 0 ? void 0 : filters.tenantId) || ((_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code) || (user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.permanentCity) || Digit.ULBService.getCurrentTenantId();
|
|
53062
53524
|
const applicationNumber = filters === null || filters === void 0 ? void 0 : filters.applicationNumber;
|
|
@@ -53091,7 +53553,7 @@ const MutationApplication = () => {
|
|
|
53091
53553
|
applicationNumber: querySearchParam
|
|
53092
53554
|
} : {
|
|
53093
53555
|
connectionNumber: querySearchParam,
|
|
53094
|
-
|
|
53556
|
+
searchType: 'CONNECTION'
|
|
53095
53557
|
};
|
|
53096
53558
|
Object.keys(params).forEach(k => params[k] == null && delete params[k]);
|
|
53097
53559
|
return Promise.resolve(Digit.WSService.search({
|
|
@@ -53099,8 +53561,14 @@ const MutationApplication = () => {
|
|
|
53099
53561
|
filters: params,
|
|
53100
53562
|
businessService
|
|
53101
53563
|
})).then(function (rawData) {
|
|
53102
|
-
|
|
53103
|
-
|
|
53564
|
+
let wsData;
|
|
53565
|
+
if (businessService === "WS") {
|
|
53566
|
+
var _rawData$WaterConnect, _rawData$WaterConnect2;
|
|
53567
|
+
wsData = (rawData === null || rawData === void 0 ? void 0 : (_rawData$WaterConnect = rawData.WaterConnection) === null || _rawData$WaterConnect === void 0 ? void 0 : _rawData$WaterConnect.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED')) || (rawData === null || rawData === void 0 ? void 0 : (_rawData$WaterConnect2 = rawData.WaterConnection) === null || _rawData$WaterConnect2 === void 0 ? void 0 : _rawData$WaterConnect2[0]);
|
|
53568
|
+
} else {
|
|
53569
|
+
var _rawData$SewerageConn, _rawData$SewerageConn2;
|
|
53570
|
+
wsData = (rawData === null || rawData === void 0 ? void 0 : (_rawData$SewerageConn = rawData.SewerageConnections) === null || _rawData$SewerageConn === void 0 ? void 0 : _rawData$SewerageConn.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED')) || (rawData === null || rawData === void 0 ? void 0 : (_rawData$SewerageConn2 = rawData.SewerageConnections) === null || _rawData$SewerageConn2 === void 0 ? void 0 : _rawData$SewerageConn2[0]);
|
|
53571
|
+
}
|
|
53104
53572
|
return wsData ? {
|
|
53105
53573
|
applicationData: wsData,
|
|
53106
53574
|
WaterConnection: rawData === null || rawData === void 0 ? void 0 : rawData.WaterConnection,
|
|
@@ -53119,8 +53587,8 @@ const MutationApplication = () => {
|
|
|
53119
53587
|
fetchedApplicationDetails = _useQuery2.data;
|
|
53120
53588
|
const applicationDetails = hasStateData ? details : fetchedApplicationDetails;
|
|
53121
53589
|
const resolvedServiceType = serviceType || authServiceType || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a = applicationDetails.applicationData) === null || _applicationDetails$a === void 0 ? void 0 : _applicationDetails$a.serviceType) || "WATER";
|
|
53122
|
-
const
|
|
53123
|
-
propertyId =
|
|
53590
|
+
const _useState5 = useState(new URLSearchParams(useLocation().search).get("propertyId") || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a2 = applicationDetails.applicationData) === null || _applicationDetails$a2 === void 0 ? void 0 : _applicationDetails$a2.propertyId)),
|
|
53591
|
+
propertyId = _useState5[0];
|
|
53124
53592
|
const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
|
|
53125
53593
|
filters: {
|
|
53126
53594
|
propertyIds: propertyId
|
|
@@ -53135,10 +53603,10 @@ const MutationApplication = () => {
|
|
|
53135
53603
|
}),
|
|
53136
53604
|
propertyDetails = _Digit$Hooks$pt$usePr.data,
|
|
53137
53605
|
isPropertyLoading = _Digit$Hooks$pt$usePr.isLoading;
|
|
53138
|
-
const _Digit$Hooks$
|
|
53139
|
-
sessionFormData = _Digit$Hooks$
|
|
53140
|
-
setSessionFormData = _Digit$Hooks$
|
|
53141
|
-
clearSessionFormData = _Digit$Hooks$
|
|
53606
|
+
const _Digit$Hooks$useSessi7 = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
|
|
53607
|
+
sessionFormData = _Digit$Hooks$useSessi7[0],
|
|
53608
|
+
setSessionFormData = _Digit$Hooks$useSessi7[1],
|
|
53609
|
+
clearSessionFormData = _Digit$Hooks$useSessi7[2];
|
|
53142
53610
|
useEffect(() => {
|
|
53143
53611
|
var _applicationDetails$a3;
|
|
53144
53612
|
const fetchAppData = function () {
|
|
@@ -53253,16 +53721,6 @@ const MutationApplication = () => {
|
|
|
53253
53721
|
waterUpdateMutation = _Digit$Hooks$ws$useWS.mutate;
|
|
53254
53722
|
const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),
|
|
53255
53723
|
sewerageUpdateMutation = _Digit$Hooks$ws$useWS2.mutate;
|
|
53256
|
-
const handleNextStep2 = data => {
|
|
53257
|
-
setFormData(prev => _extends({}, prev, data));
|
|
53258
|
-
setCompletedSteps(prev => new Set([...prev, 3]));
|
|
53259
|
-
setCurrentStep(4);
|
|
53260
|
-
};
|
|
53261
|
-
const handleNextStep3 = data => {
|
|
53262
|
-
setFormData(prev => _extends({}, prev, data));
|
|
53263
|
-
setCompletedSteps(prev => new Set([...prev, 4]));
|
|
53264
|
-
setCurrentStep(5);
|
|
53265
|
-
};
|
|
53266
53724
|
const submitApplication = function () {
|
|
53267
53725
|
try {
|
|
53268
53726
|
setIsSubmitting(true);
|
|
@@ -53300,7 +53758,6 @@ const MutationApplication = () => {
|
|
|
53300
53758
|
const sessionDetails = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
|
|
53301
53759
|
const existingDocs = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a5 = applicationDetails.applicationData) === null || _applicationDetails$a5 === void 0 ? void 0 : _applicationDetails$a5.documents) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$W = applicationDetails.WaterConnection) === null || _applicationDetails$W === void 0 ? void 0 : (_applicationDetails$W2 = _applicationDetails$W[0]) === null || _applicationDetails$W2 === void 0 ? void 0 : _applicationDetails$W2.documents) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$S = applicationDetails.SewerageConnections) === null || _applicationDetails$S === void 0 ? void 0 : (_applicationDetails$S2 = _applicationDetails$S[0]) === null || _applicationDetails$S2 === void 0 ? void 0 : _applicationDetails$S2.documents) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.documents) || (details === null || details === void 0 ? void 0 : (_details$applicationD2 = details.applicationData) === null || _details$applicationD2 === void 0 ? void 0 : _details$applicationD2.documents) || (details === null || details === void 0 ? void 0 : details.documents) || [];
|
|
53302
53760
|
return Promise.resolve(convertModifyApplicationDetails(finalData, sessionDetails, "INITIATE")).then(function (convertAppData) {
|
|
53303
|
-
var _convertAppData$docum;
|
|
53304
53761
|
if (!convertAppData.dateEffectiveFrom) {
|
|
53305
53762
|
convertAppData.dateEffectiveFrom = Date.now() + 86400000;
|
|
53306
53763
|
}
|
|
@@ -53341,9 +53798,6 @@ const MutationApplication = () => {
|
|
|
53341
53798
|
convertAppData.additionalDetails.identityProofDocumentId = mutDetails.identityProofDocumentId || "";
|
|
53342
53799
|
}
|
|
53343
53800
|
}
|
|
53344
|
-
if ((convertAppData === null || convertAppData === void 0 ? void 0 : (_convertAppData$docum = convertAppData.documents) === null || _convertAppData$docum === void 0 ? void 0 : _convertAppData$docum.length) > 0 && existingDocs.length > 0) {
|
|
53345
|
-
convertAppData.documents = mapExistingDocIdsToPayload(convertAppData.documents, existingDocs);
|
|
53346
|
-
}
|
|
53347
53801
|
convertAppData.applicationType = resolvedServiceType === "WATER" ? "MUTATION_WATER_CONNECTION" : "MUTATION_SEWERAGE_CONNECTION";
|
|
53348
53802
|
if (isEditFlow) {
|
|
53349
53803
|
var _applicationDetails$a6, _applicationDetails$a7, _updatePayload, _updatePayload$docume, _Digit, _Digit$Customizations, _Digit$Customizations2;
|
|
@@ -53355,7 +53809,33 @@ const MutationApplication = () => {
|
|
|
53355
53809
|
})
|
|
53356
53810
|
});
|
|
53357
53811
|
if (((_updatePayload = updatePayload) === null || _updatePayload === void 0 ? void 0 : (_updatePayload$docume = _updatePayload.documents) === null || _updatePayload$docume === void 0 ? void 0 : _updatePayload$docume.length) > 0 && existingDocs.length > 0) {
|
|
53358
|
-
|
|
53812
|
+
const activePayloadDocs = updatePayload.documents;
|
|
53813
|
+
let finalDocs = [];
|
|
53814
|
+
activePayloadDocs.forEach(newDoc => {
|
|
53815
|
+
const oldDoc = existingDocs.find(d => d.documentType === newDoc.documentType);
|
|
53816
|
+
if (oldDoc) {
|
|
53817
|
+
if (oldDoc.fileStoreId === newDoc.fileStoreId) {
|
|
53818
|
+
finalDocs.push(_extends({}, newDoc, {
|
|
53819
|
+
id: oldDoc.id
|
|
53820
|
+
}));
|
|
53821
|
+
} else {
|
|
53822
|
+
finalDocs.push(newDoc);
|
|
53823
|
+
finalDocs.push(_extends({}, oldDoc, {
|
|
53824
|
+
status: "INACTIVE"
|
|
53825
|
+
}));
|
|
53826
|
+
}
|
|
53827
|
+
} else {
|
|
53828
|
+
finalDocs.push(newDoc);
|
|
53829
|
+
}
|
|
53830
|
+
});
|
|
53831
|
+
existingDocs.forEach(oldDoc => {
|
|
53832
|
+
if (!activePayloadDocs.find(d => d.documentType === oldDoc.documentType)) {
|
|
53833
|
+
finalDocs.push(_extends({}, oldDoc, {
|
|
53834
|
+
status: "INACTIVE"
|
|
53835
|
+
}));
|
|
53836
|
+
}
|
|
53837
|
+
});
|
|
53838
|
+
updatePayload.documents = finalDocs;
|
|
53359
53839
|
}
|
|
53360
53840
|
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) {
|
|
53361
53841
|
updatePayload = Digit.Customizations.WS.customiseUpdatePayloadOfWS((applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData) || {}, updatePayload, resolvedServiceType);
|
|
@@ -53400,9 +53880,15 @@ const MutationApplication = () => {
|
|
|
53400
53880
|
return;
|
|
53401
53881
|
}
|
|
53402
53882
|
clearSessionFormData();
|
|
53883
|
+
clearFormData();
|
|
53884
|
+
clearCompletedSteps();
|
|
53885
|
+
clearAuthKNumber();
|
|
53886
|
+
clearAuthMobileNumber();
|
|
53887
|
+
clearAuthServiceType();
|
|
53888
|
+
clearAuthActiveConnection();
|
|
53403
53889
|
const newAppNo = resolvedServiceType === "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;
|
|
53404
53890
|
setGeneratedAppNo(newAppNo);
|
|
53405
|
-
|
|
53891
|
+
history.push(path + "/submission");
|
|
53406
53892
|
}
|
|
53407
53893
|
});
|
|
53408
53894
|
return;
|
|
@@ -53501,9 +53987,15 @@ const MutationApplication = () => {
|
|
|
53501
53987
|
return;
|
|
53502
53988
|
}
|
|
53503
53989
|
clearSessionFormData();
|
|
53990
|
+
clearFormData();
|
|
53991
|
+
clearCompletedSteps();
|
|
53992
|
+
clearAuthKNumber();
|
|
53993
|
+
clearAuthMobileNumber();
|
|
53994
|
+
clearAuthServiceType();
|
|
53995
|
+
clearAuthActiveConnection();
|
|
53504
53996
|
const newAppNo = resolvedServiceType === "WATER" ? updateData === null || updateData === void 0 ? void 0 : (_updateData$WaterConn3 = updateData.WaterConnection) === null || _updateData$WaterConn3 === void 0 ? void 0 : (_updateData$WaterConn4 = _updateData$WaterConn3[0]) === null || _updateData$WaterConn4 === void 0 ? void 0 : _updateData$WaterConn4.applicationNo : updateData === null || updateData === void 0 ? void 0 : (_updateData$SewerageC3 = updateData.SewerageConnections) === null || _updateData$SewerageC3 === void 0 ? void 0 : (_updateData$SewerageC4 = _updateData$SewerageC3[0]) === null || _updateData$SewerageC4 === void 0 ? void 0 : _updateData$SewerageC4.applicationNo;
|
|
53505
53997
|
setGeneratedAppNo(newAppNo);
|
|
53506
|
-
|
|
53998
|
+
history.push(path + "/submission");
|
|
53507
53999
|
}
|
|
53508
54000
|
});
|
|
53509
54001
|
}
|
|
@@ -53525,11 +54017,8 @@ const MutationApplication = () => {
|
|
|
53525
54017
|
const handleTimelineSelect = (route, index) => {
|
|
53526
54018
|
const targetStep = index + 1;
|
|
53527
54019
|
if (targetStep < currentStep) {
|
|
53528
|
-
|
|
53529
|
-
|
|
53530
|
-
}
|
|
53531
|
-
if (targetStep === currentStep) return;
|
|
53532
|
-
if (targetStep > currentStep) {
|
|
54020
|
+
if (targetStep === 1) history.push(path + "/search-connection");else if (targetStep === 2) history.push(path + "/existing-connection");else if (targetStep === 3) history.push(path + "/consumer-details");else if (targetStep === 4) history.push(path + "/document");else if (targetStep === 5) history.push(path + "/preview");
|
|
54021
|
+
} else if (targetStep > currentStep) {
|
|
53533
54022
|
setShowToast({
|
|
53534
54023
|
key: "warning",
|
|
53535
54024
|
message: "Please complete Step " + currentStep + " before proceeding to Step " + targetStep + "."
|
|
@@ -53578,51 +54067,83 @@ const MutationApplication = () => {
|
|
|
53578
54067
|
overflowY: "auto",
|
|
53579
54068
|
minWidth: 0
|
|
53580
54069
|
}
|
|
53581
|
-
},
|
|
54070
|
+
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
54071
|
+
path: path + "/search-connection"
|
|
54072
|
+
}, /*#__PURE__*/React.createElement(Step1_SearchConnection, {
|
|
53582
54073
|
t: t,
|
|
53583
54074
|
defaultKNumber: isEditFlow ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a8 = applicationDetails.applicationData) === null || _applicationDetails$a8 === void 0 ? void 0 : _applicationDetails$a8.connectionNo : "",
|
|
54075
|
+
isEditFlow: isEditFlow,
|
|
53584
54076
|
onNext: _ref => {
|
|
53585
54077
|
let kNumber = _ref.kNumber,
|
|
53586
54078
|
mobileNumber = _ref.mobileNumber,
|
|
53587
|
-
detectedServiceType = _ref.serviceType
|
|
54079
|
+
detectedServiceType = _ref.serviceType,
|
|
54080
|
+
activeConnection = _ref.activeConnection;
|
|
53588
54081
|
setAuthKNumber(kNumber);
|
|
53589
54082
|
setAuthMobileNumber(mobileNumber);
|
|
53590
54083
|
if (detectedServiceType) setAuthServiceType(detectedServiceType);
|
|
53591
|
-
|
|
53592
|
-
|
|
54084
|
+
if (activeConnection) setAuthActiveConnection(activeConnection);
|
|
54085
|
+
setCompletedSteps(prev => [...new Set([...prev, 1])]);
|
|
54086
|
+
history.push(path + "/existing-connection");
|
|
53593
54087
|
}
|
|
53594
|
-
}),
|
|
54088
|
+
})), /*#__PURE__*/React.createElement(Route, {
|
|
54089
|
+
path: path + "/existing-connection"
|
|
54090
|
+
}, /*#__PURE__*/React.createElement(Fragment$2, null, /*#__PURE__*/React.createElement(Step1_ExistingConnection, {
|
|
53595
54091
|
t: t,
|
|
53596
|
-
applicationDetails:
|
|
53597
|
-
|
|
54092
|
+
applicationDetails: authActiveConnection ? {
|
|
54093
|
+
applicationData: authActiveConnection
|
|
54094
|
+
} : applicationDetails,
|
|
54095
|
+
propertyId: (authActiveConnection === null || authActiveConnection === void 0 ? void 0 : authActiveConnection.propertyId) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a9 = applicationDetails.applicationData) === null || _applicationDetails$a9 === void 0 ? void 0 : _applicationDetails$a9.propertyId),
|
|
53598
54096
|
mobileNumber: authMobileNumber,
|
|
53599
54097
|
onVerify: () => {
|
|
53600
|
-
setCompletedSteps(prev => new Set([...prev, 2]));
|
|
53601
|
-
|
|
54098
|
+
setCompletedSteps(prev => [...new Set([...prev, 2])]);
|
|
54099
|
+
history.push(path + "/consumer-details");
|
|
53602
54100
|
}
|
|
53603
|
-
})),
|
|
54101
|
+
}))), /*#__PURE__*/React.createElement(Route, {
|
|
54102
|
+
path: path + "/consumer-details"
|
|
54103
|
+
}, /*#__PURE__*/React.createElement(Step2_NewConsumerDetails, {
|
|
53604
54104
|
t: t,
|
|
53605
54105
|
defaultValues: formData,
|
|
53606
|
-
onNext:
|
|
53607
|
-
|
|
53608
|
-
|
|
54106
|
+
onNext: data => {
|
|
54107
|
+
setFormData(prev => _extends({}, prev, data));
|
|
54108
|
+
setCompletedSteps(prev => [...new Set([...prev, 3])]);
|
|
54109
|
+
history.push(path + "/document");
|
|
54110
|
+
},
|
|
54111
|
+
onBack: () => history.push(path + "/existing-connection")
|
|
54112
|
+
})), /*#__PURE__*/React.createElement(Route, {
|
|
54113
|
+
path: path + "/document"
|
|
54114
|
+
}, /*#__PURE__*/React.createElement(Step3_UploadDocuments, {
|
|
53609
54115
|
t: t,
|
|
53610
54116
|
defaultValues: formData,
|
|
53611
|
-
onNext:
|
|
53612
|
-
|
|
53613
|
-
|
|
54117
|
+
onNext: data => {
|
|
54118
|
+
setFormData(prev => _extends({}, prev, data));
|
|
54119
|
+
setCompletedSteps(prev => [...new Set([...prev, 4])]);
|
|
54120
|
+
history.push(path + "/preview");
|
|
54121
|
+
},
|
|
54122
|
+
onBack: () => history.push(path + "/consumer-details")
|
|
54123
|
+
})), /*#__PURE__*/React.createElement(Route, {
|
|
54124
|
+
path: path + "/preview"
|
|
54125
|
+
}, /*#__PURE__*/React.createElement(Step4_Preview, {
|
|
53614
54126
|
t: t,
|
|
53615
54127
|
formData: formData,
|
|
53616
|
-
applicationDetails:
|
|
54128
|
+
applicationDetails: authActiveConnection ? {
|
|
54129
|
+
applicationData: authActiveConnection
|
|
54130
|
+
} : applicationDetails,
|
|
53617
54131
|
resolvedServiceType: resolvedServiceType,
|
|
53618
|
-
onBack: () =>
|
|
54132
|
+
onBack: () => history.push(path + "/document"),
|
|
53619
54133
|
onSubmit: submitApplication,
|
|
53620
54134
|
isLoading: isSubmitting
|
|
53621
|
-
}),
|
|
54135
|
+
})), /*#__PURE__*/React.createElement(Route, {
|
|
54136
|
+
path: path + "/submission"
|
|
54137
|
+
}, /*#__PURE__*/React.createElement(Step5_Submission, {
|
|
53622
54138
|
t: t,
|
|
53623
54139
|
applicationNumber: generatedAppNo,
|
|
53624
54140
|
serviceType: resolvedServiceType
|
|
53625
|
-
}),
|
|
54141
|
+
})), /*#__PURE__*/React.createElement(Route, {
|
|
54142
|
+
exact: true,
|
|
54143
|
+
path: path
|
|
54144
|
+
}, /*#__PURE__*/React.createElement(Redirect, {
|
|
54145
|
+
to: path + "/search-connection"
|
|
54146
|
+
}))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
53626
54147
|
error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error",
|
|
53627
54148
|
warning: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "warning",
|
|
53628
54149
|
label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
|