@djb25/digit-ui-module-ws 1.0.99 → 1.0.100

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.
@@ -1321,7 +1321,8 @@ const updatePayloadOfWSRestoration = function (data, type) {
1321
1321
  payload.processInstance = {
1322
1322
  ...payload.processInstance,
1323
1323
  businessService: type === "WATER" ? "WSReconnection" : "SWReconnection",
1324
- action: "SUBMIT_APPLICATION"
1324
+ action: "SUBMIT_APPLICATION",
1325
+ moduleName: "ws-services"
1325
1326
  };
1326
1327
  return payload;
1327
1328
  });
@@ -23364,10 +23365,11 @@ const WSRestorationForm = _ref => {
23364
23365
  var _event$target, _event$target$files;
23365
23366
  const file = event === null || event === void 0 ? void 0 : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : (_event$target$files = _event$target.files) === null || _event$target$files === void 0 ? void 0 : _event$target$files[0];
23366
23367
  if (!file) return Promise.resolve();
23367
- if (file.size > 5242880 || file.type && file.type !== "application/pdf") {
23368
+ const allowedMimeTypes = ["application/pdf", "image/jpeg", "image/jpg"];
23369
+ if (file.size > 5242880 || file.type && !allowedMimeTypes.includes(file.type)) {
23368
23370
  setError({
23369
23371
  key: "error",
23370
- message: "Only PDF files up to 5MB are allowed"
23372
+ message: "Only PDF, JPEG, or JPG files up to 5MB are allowed"
23371
23373
  });
23372
23374
  return Promise.resolve();
23373
23375
  }
@@ -23391,84 +23393,36 @@ const WSRestorationForm = _ref => {
23391
23393
  return Promise.reject(e);
23392
23394
  }
23393
23395
  };
23394
- const handleProceedToDemand = function () {
23395
- try {
23396
- if (!ownershipDocument) {
23397
- setError({
23398
- key: "error",
23399
- message: "Please upload property ownership proof."
23400
- });
23401
- return Promise.resolve();
23402
- }
23403
- setEstimateLoading(true);
23404
- return Promise.resolve(_finallyRethrows(function () {
23405
- return _catch(function () {
23406
- const serviceType = String((connection === null || connection === void 0 ? void 0 : connection.serviceType) || (connection === null || connection === void 0 ? void 0 : connection.service) || "WATER").toUpperCase() === "SEWERAGE" ? "SEWERAGE" : "WATER";
23407
- const connectionKey = serviceType === "WATER" ? "waterConnection" : "sewerageConnection";
23408
- const estimateConnection = {
23409
- ...connection,
23410
- applicationType: serviceType === "WATER" ? "WATER_RECONNECTION" : "SEWERAGE_RECONNECTION",
23411
- dateEffectiveFrom: Date.now(),
23412
- isdisconnection: false,
23413
- isDisconnectionTemporary: true,
23414
- reconnectionReason: "RECONNECTION",
23415
- disconnectionReason: "",
23416
- water: serviceType === "WATER",
23417
- sewerage: serviceType === "SEWERAGE",
23418
- service: serviceType === "WATER" ? "Water" : "Sewerage"
23419
- };
23420
- const estimatePayload = {
23421
- CalculationCriteria: [{
23422
- applicationNo: estimateConnection === null || estimateConnection === void 0 ? void 0 : estimateConnection.applicationNo,
23423
- tenantId: (estimateConnection === null || estimateConnection === void 0 ? void 0 : estimateConnection.tenantId) || tenantId,
23424
- [connectionKey]: estimateConnection
23425
- }],
23426
- isconnectionCalculation: false
23427
- };
23428
- return Promise.resolve(Digit.WSService.wsCalculationEstimate(estimatePayload, serviceType === "WATER" ? "WS" : "SW")).then(function (estimateResponse) {
23429
- var _estimateResponse$Cal, _estimateResponse$Cal2;
23430
- const taxHeadEstimates = (estimateResponse === null || estimateResponse === void 0 ? void 0 : (_estimateResponse$Cal = estimateResponse.Calculation) === null || _estimateResponse$Cal === void 0 ? void 0 : (_estimateResponse$Cal2 = _estimateResponse$Cal[0]) === null || _estimateResponse$Cal2 === void 0 ? void 0 : _estimateResponse$Cal2.taxHeadEstimates) || [];
23431
- const allowedFees = ["WS_RECONNECTION_FEE", "SW_RECONNECTION_FEE", "WS_DISCONNECTION_FEE", "SW_DISCONNECTION_FEE"];
23432
- const validFees = taxHeadEstimates.filter(item => {
23433
- const code = String((item === null || item === void 0 ? void 0 : item.taxHeadCode) || "").toUpperCase();
23434
- return allowedFees.includes(code);
23435
- });
23436
- if (validFees.length === 0) throw new Error("Reconnection fee was not returned by the estimate service");
23437
- const totalAmt = validFees.reduce((acc, curr) => acc + Number((curr === null || curr === void 0 ? void 0 : curr.estimateAmount) ?? (curr === null || curr === void 0 ? void 0 : curr.amount) ?? 0), 0);
23438
- setEstimateData({
23439
- Calculation: [{
23440
- ...estimateResponse.Calculation[0],
23441
- taxHeadEstimates: validFees,
23442
- totalAmount: totalAmt
23443
- }]
23444
- });
23445
- setShowDemandClearance(true);
23446
- Digit.SessionStorage.set("WS_DISCONNECTION", {
23447
- ...applicationData,
23448
- reconnectionValidation: {
23449
- isAltered,
23450
- isModified,
23451
- dwellingUnits,
23452
- extendedArea,
23453
- ownershipProofFileStoreId: ownershipDocument === null || ownershipDocument === void 0 ? void 0 : ownershipDocument.fileStoreId
23454
- }
23455
- });
23456
- });
23457
- }, function (estimateError) {
23458
- var _estimateError$respon, _estimateError$respon2, _estimateError$respon3, _estimateError$respon4;
23459
- setError({
23460
- key: "error",
23461
- message: (estimateError === null || estimateError === void 0 ? void 0 : (_estimateError$respon = estimateError.response) === null || _estimateError$respon === void 0 ? void 0 : (_estimateError$respon2 = _estimateError$respon.data) === null || _estimateError$respon2 === void 0 ? void 0 : (_estimateError$respon3 = _estimateError$respon2.Errors) === null || _estimateError$respon3 === void 0 ? void 0 : (_estimateError$respon4 = _estimateError$respon3[0]) === null || _estimateError$respon4 === void 0 ? void 0 : _estimateError$respon4.message) || "Unable to calculate reconnection demand"
23462
- });
23463
- });
23464
- }, function (_wasThrown, _result3) {
23465
- setEstimateLoading(false);
23466
- if (_wasThrown) throw _result3;
23467
- return _result3;
23468
- }));
23469
- } catch (e) {
23470
- return Promise.reject(e);
23396
+ const handleProceedToDemand = () => {
23397
+ if (!ownershipDocument) {
23398
+ setError({
23399
+ key: "error",
23400
+ message: "Please upload property ownership proof."
23401
+ });
23402
+ return;
23471
23403
  }
23404
+ const staticFee = {
23405
+ taxHeadCode: "WS_RECONNECTION_FEE",
23406
+ estimateAmount: 250,
23407
+ amount: 250
23408
+ };
23409
+ setEstimateData({
23410
+ Calculation: [{
23411
+ taxHeadEstimates: [staticFee],
23412
+ totalAmount: 250
23413
+ }]
23414
+ });
23415
+ setShowDemandClearance(true);
23416
+ Digit.SessionStorage.set("WS_DISCONNECTION", {
23417
+ ...applicationData,
23418
+ reconnectionValidation: {
23419
+ isAltered,
23420
+ isModified,
23421
+ dwellingUnits,
23422
+ extendedArea,
23423
+ ownershipProofFileStoreId: ownershipDocument === null || ownershipDocument === void 0 ? void 0 : ownershipDocument.fileStoreId
23424
+ }
23425
+ });
23472
23426
  };
23473
23427
  const executeMutation = (mutation, payload) => new Promise((resolve, reject) => mutation(payload, {
23474
23428
  onSuccess: resolve,
@@ -23541,7 +23495,8 @@ const WSRestorationForm = _ref => {
23541
23495
  processInstance: {
23542
23496
  ...(connection === null || connection === void 0 ? void 0 : connection.processInstance),
23543
23497
  action: "INITIATE",
23544
- businessService: serviceType === "WATER" ? "WSReconnection" : "SWReconnection"
23498
+ businessService: serviceType === "WATER" ? "WSReconnection" : "SWReconnection",
23499
+ moduleName: "ws-services"
23545
23500
  },
23546
23501
  channel: (user === null || user === void 0 ? void 0 : user.toUpperCase()) === "CITIZEN" ? "CITIZEN" : "CFC_COUNTER"
23547
23502
  },
@@ -23671,8 +23626,8 @@ const WSRestorationForm = _ref => {
23671
23626
  flex: 1,
23672
23627
  padding: "12px 16px",
23673
23628
  borderRadius: "14px",
23674
- border: selected ? "1px solid #4b35f5" : "1px solid #d5deea",
23675
- background: selected ? "#4b35f5" : "#fff",
23629
+ border: selected ? "1px solid linear-gradient(135deg,#1f5fa8,#0b2e5b)" : "1px solid #d5deea",
23630
+ background: selected ? "linear-gradient(135deg,#1f5fa8,#0b2e5b)" : "#fff",
23676
23631
  color: selected ? "#fff" : "#172b4d",
23677
23632
  fontWeight: 700,
23678
23633
  cursor: "pointer"
@@ -23715,11 +23670,10 @@ const WSRestorationForm = _ref => {
23715
23670
  }
23716
23671
  }, "Upload Property Ownership Proof (Registry / Sale Deed)"), /*#__PURE__*/React.createElement(UploadFile, {
23717
23672
  id: "reconnection-ownership-proof",
23718
- accept: ".pdf",
23719
23673
  buttonType: "button",
23720
23674
  onUpload: handleOwnershipUpload,
23721
23675
  onDelete: () => setOwnershipDocument(null),
23722
- message: (ownershipDocument === null || ownershipDocument === void 0 ? void 0 : ownershipDocument.fileName) || "Drag & drop your property deed PDF here or click to browse from files (Max 5MB)"
23676
+ message: (ownershipDocument === null || ownershipDocument === void 0 ? void 0 : ownershipDocument.fileName) || "Drag & drop your file here or click to browse (PDF, JPEG, JPG — Max 5MB)"
23723
23677
  }))), /*#__PURE__*/React.createElement("div", {
23724
23678
  style: {
23725
23679
  background: "#f7f9fc",
@@ -57089,6 +57043,7 @@ const MutationApplication = () => {
57089
57043
  }
57090
57044
  }
57091
57045
  convertAppData.applicationType = resolvedServiceType === "WATER" ? "MUTATION_WATER_CONNECTION" : "MUTATION_SEWERAGE_CONNECTION";
57046
+ delete convertAppData.dueVerification;
57092
57047
  if (isEditFlow) {
57093
57048
  var _applicationDetails$a6, _applicationDetails$a7, _updatePayload, _updatePayload$docume, _Digit, _Digit$Customizations, _Digit$Customizations2;
57094
57049
  let updatePayload = {