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