@djb25/digit-ui-module-ws 1.0.98 → 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,75 +23393,36 @@ const WSRestorationForm = _ref => {
23391
23393
  return Promise.reject(e);
23392
23394
  }
23393
23395
  };
23394
- const handleProceedToDemand = function () {
23395
- try {
23396
- setEstimateLoading(true);
23397
- return Promise.resolve(_finallyRethrows(function () {
23398
- return _catch(function () {
23399
- 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";
23400
- const connectionKey = serviceType === "WATER" ? "waterConnection" : "sewerageConnection";
23401
- const estimateConnection = {
23402
- ...connection,
23403
- applicationType: serviceType === "WATER" ? "WATER_RECONNECTION" : "SEWERAGE_RECONNECTION",
23404
- dateEffectiveFrom: Date.now(),
23405
- isdisconnection: false,
23406
- isDisconnectionTemporary: true,
23407
- reconnectionReason: "RECONNECTION",
23408
- disconnectionReason: "",
23409
- water: serviceType === "WATER",
23410
- sewerage: serviceType === "SEWERAGE",
23411
- service: serviceType === "WATER" ? "Water" : "Sewerage"
23412
- };
23413
- const estimatePayload = {
23414
- CalculationCriteria: [{
23415
- applicationNo: estimateConnection === null || estimateConnection === void 0 ? void 0 : estimateConnection.applicationNo,
23416
- tenantId: (estimateConnection === null || estimateConnection === void 0 ? void 0 : estimateConnection.tenantId) || tenantId,
23417
- [connectionKey]: estimateConnection
23418
- }],
23419
- isconnectionCalculation: false
23420
- };
23421
- return Promise.resolve(Digit.WSService.wsCalculationEstimate(estimatePayload, serviceType === "WATER" ? "WS" : "SW")).then(function (estimateResponse) {
23422
- var _estimateResponse$Cal, _estimateResponse$Cal2;
23423
- 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) || [];
23424
- const reconnectionFee = taxHeadEstimates.find(item => {
23425
- const code = String((item === null || item === void 0 ? void 0 : item.taxHeadCode) || "").toUpperCase();
23426
- return code === "WS_RECONNECTION_FEE" || code === "SW_RECONNECTION_FEE" || code === "WS_REOPENING_FEE" || code === "SW_REOPENING_FEE";
23427
- });
23428
- if (!reconnectionFee) throw new Error("Reconnection fee was not returned by the estimate service");
23429
- setEstimateData({
23430
- Calculation: [{
23431
- ...estimateResponse.Calculation[0],
23432
- taxHeadEstimates: [reconnectionFee],
23433
- totalAmount: Number((reconnectionFee === null || reconnectionFee === void 0 ? void 0 : reconnectionFee.estimateAmount) ?? (reconnectionFee === null || reconnectionFee === void 0 ? void 0 : reconnectionFee.amount) ?? 0)
23434
- }]
23435
- });
23436
- setShowDemandClearance(true);
23437
- Digit.SessionStorage.set("WS_DISCONNECTION", {
23438
- ...applicationData,
23439
- reconnectionValidation: {
23440
- isAltered,
23441
- isModified,
23442
- dwellingUnits,
23443
- extendedArea,
23444
- ownershipProofFileStoreId: ownershipDocument === null || ownershipDocument === void 0 ? void 0 : ownershipDocument.fileStoreId
23445
- }
23446
- });
23447
- });
23448
- }, function (estimateError) {
23449
- var _estimateError$respon, _estimateError$respon2, _estimateError$respon3, _estimateError$respon4;
23450
- setError({
23451
- key: "error",
23452
- 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"
23453
- });
23454
- });
23455
- }, function (_wasThrown, _result3) {
23456
- setEstimateLoading(false);
23457
- if (_wasThrown) throw _result3;
23458
- return _result3;
23459
- }));
23460
- } catch (e) {
23461
- 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;
23462
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
+ });
23463
23426
  };
23464
23427
  const executeMutation = (mutation, payload) => new Promise((resolve, reject) => mutation(payload, {
23465
23428
  onSuccess: resolve,
@@ -23496,10 +23459,23 @@ const WSRestorationForm = _ref => {
23496
23459
  const ownershipProof = ownershipDocument ? [{
23497
23460
  fileStoreId: ownershipDocument.fileStoreId,
23498
23461
  documentUid: ownershipDocument.fileStoreId,
23499
- documentType: "PROPERTY_OWNERSHIP_PROOF"
23462
+ documentType: "PROPERTY_OWNERSHIP_PROOF",
23463
+ status: "ACTIVE",
23464
+ id: null
23500
23465
  }] : [];
23501
23466
  const docs = [...existingDocuments, ...ownershipProof];
23502
23467
  const reconnectionValidation = (latestApplicationData === null || latestApplicationData === void 0 ? void 0 : latestApplicationData.reconnectionValidation) || {};
23468
+ const baseAdditionalDetails = {
23469
+ ...(submittedConnection === null || submittedConnection === void 0 ? void 0 : submittedConnection.additionalDetails),
23470
+ ...reconnectionValidation,
23471
+ isAltered: reconnectionValidation.isAltered ?? isAltered,
23472
+ isModified: reconnectionValidation.isModified ?? isModified,
23473
+ ownershipProofFileStoreId: reconnectionValidation.ownershipProofFileStoreId || (ownershipDocument === null || ownershipDocument === void 0 ? void 0 : ownershipDocument.fileStoreId)
23474
+ };
23475
+ const finalDwellingUnits = reconnectionValidation.dwellingUnits ?? dwellingUnits;
23476
+ if (finalDwellingUnits) baseAdditionalDetails.dwellingUnits = finalDwellingUnits;
23477
+ const finalExtendedArea = reconnectionValidation.extendedArea ?? extendedArea;
23478
+ if (finalExtendedArea) baseAdditionalDetails.extendedArea = finalExtendedArea;
23503
23479
  const createPayload = {
23504
23480
  [connectionKey]: {
23505
23481
  ...submittedConnection,
@@ -23515,19 +23491,12 @@ const WSRestorationForm = _ref => {
23515
23491
  water: serviceType === "WATER",
23516
23492
  sewerage: serviceType === "SEWERAGE",
23517
23493
  service: serviceType === "WATER" ? "Water" : "Sewerage",
23518
- additionalDetails: {
23519
- ...(submittedConnection === null || submittedConnection === void 0 ? void 0 : submittedConnection.additionalDetails),
23520
- ...reconnectionValidation,
23521
- isAltered: reconnectionValidation.isAltered ?? isAltered,
23522
- isModified: reconnectionValidation.isModified ?? isModified,
23523
- dwellingUnits: reconnectionValidation.dwellingUnits ?? dwellingUnits,
23524
- extendedArea: reconnectionValidation.extendedArea ?? extendedArea,
23525
- ownershipProofFileStoreId: reconnectionValidation.ownershipProofFileStoreId || (ownershipDocument === null || ownershipDocument === void 0 ? void 0 : ownershipDocument.fileStoreId)
23526
- },
23494
+ additionalDetails: baseAdditionalDetails,
23527
23495
  processInstance: {
23528
23496
  ...(connection === null || connection === void 0 ? void 0 : connection.processInstance),
23529
23497
  action: "INITIATE",
23530
- businessService: serviceType === "WATER" ? "WSReconnection" : "SWReconnection"
23498
+ businessService: serviceType === "WATER" ? "WSReconnection" : "SWReconnection",
23499
+ moduleName: "ws-services"
23531
23500
  },
23532
23501
  channel: (user === null || user === void 0 ? void 0 : user.toUpperCase()) === "CITIZEN" ? "CITIZEN" : "CFC_COUNTER"
23533
23502
  },
@@ -23657,8 +23626,8 @@ const WSRestorationForm = _ref => {
23657
23626
  flex: 1,
23658
23627
  padding: "12px 16px",
23659
23628
  borderRadius: "14px",
23660
- border: selected ? "1px solid #4b35f5" : "1px solid #d5deea",
23661
- 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",
23662
23631
  color: selected ? "#fff" : "#172b4d",
23663
23632
  fontWeight: 700,
23664
23633
  cursor: "pointer"
@@ -23701,11 +23670,10 @@ const WSRestorationForm = _ref => {
23701
23670
  }
23702
23671
  }, "Upload Property Ownership Proof (Registry / Sale Deed)"), /*#__PURE__*/React.createElement(UploadFile, {
23703
23672
  id: "reconnection-ownership-proof",
23704
- accept: ".pdf",
23705
23673
  buttonType: "button",
23706
23674
  onUpload: handleOwnershipUpload,
23707
23675
  onDelete: () => setOwnershipDocument(null),
23708
- 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)"
23709
23677
  }))), /*#__PURE__*/React.createElement("div", {
23710
23678
  style: {
23711
23679
  background: "#f7f9fc",
@@ -33022,8 +32990,8 @@ const WSFeeEstimation = _ref => {
33022
32990
  const [values, setValues] = useState(wsAdditionalDetails.additionalDetails.values ? wsAdditionalDetails.additionalDetails.values : []);
33023
32991
  const isDisconnectionExecuted = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$2 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$2 === void 0 ? void 0 : (_wsAdditionalDetails$3 = _wsAdditionalDetails$2.appDetails) === null || _wsAdditionalDetails$3 === void 0 ? void 0 : _wsAdditionalDetails$3.applicationStatus) === "DISCONNECTION_EXECUTED";
33024
32992
  const billRows = (billDetails === null || billDetails === void 0 ? void 0 : (_billDetails$billDeta = billDetails.billDetails) === null || _billDetails$billDeta === void 0 ? void 0 : (_billDetails$billDeta2 = _billDetails$billDeta[0]) === null || _billDetails$billDeta2 === void 0 ? void 0 : _billDetails$billDeta2.billAccountDetails) || (billDetails === null || billDetails === void 0 ? void 0 : billDetails.taxHeadEstimates) || [];
33025
- const disconnectionFee = billRows.find(row => (row === null || row === void 0 ? void 0 : row.taxHeadCode) === "WS_DISCONNECTION_FEE");
33026
- const displayedValues = onlyDisconnectionFee || isDisconnectionExecuted ? values.filter(value => (value === null || value === void 0 ? void 0 : value.title) === "WS_DISCONNECTION_FEE") : values;
32993
+ const disconnectionFee = billRows.find(row => (row === null || row === void 0 ? void 0 : row.taxHeadCode) === "WS_DISCONNECTION_FEE" || (row === null || row === void 0 ? void 0 : row.taxHeadCode) === "SW_DISCONNECTION_FEE");
32994
+ const displayedValues = onlyDisconnectionFee || isDisconnectionExecuted ? values.filter(value => (value === null || value === void 0 ? void 0 : value.title) === "WS_DISCONNECTION_FEE" || (value === null || value === void 0 ? void 0 : value.title) === "SW_DISCONNECTION_FEE") : values;
33027
32995
  const displayedTotalAmount = onlyDisconnectionFee || isDisconnectionExecuted ? (disconnectionFee === null || disconnectionFee === void 0 ? void 0 : disconnectionFee.amount) ?? (disconnectionFee === null || disconnectionFee === void 0 ? void 0 : disconnectionFee.estimateAmount) ?? 0 : billDetails === null || billDetails === void 0 ? void 0 : billDetails.totalAmount;
33028
32996
  const displayedIsPaid = isDisconnectionExecuted ? (disconnectionFee === null || disconnectionFee === void 0 ? void 0 : disconnectionFee.status) === "PAID" : isPaid;
33029
32997
  const stateCode = Digit.ULBService.getStateId();
@@ -51198,12 +51166,15 @@ const ApplicationDetails = props => {
51198
51166
  }
51199
51167
  try {
51200
51168
  if (moduleCode !== null && moduleCode !== void 0 && moduleCode.includes("WS")) {
51201
- setShowConfirmation({
51202
- data,
51203
- nocData,
51204
- isOBPS
51205
- });
51206
- return Promise.resolve();
51169
+ const actionStr = (selectedAction === null || selectedAction === void 0 ? void 0 : selectedAction.action) || "";
51170
+ if (actionStr === "INITIATE" || actionStr === "EXECUTE_DISCONNECTION") {
51171
+ setShowConfirmation({
51172
+ data,
51173
+ nocData,
51174
+ isOBPS
51175
+ });
51176
+ return Promise.resolve();
51177
+ }
51207
51178
  }
51208
51179
  return executeSubmitAction(data, nocData, isOBPS);
51209
51180
  } catch (e) {
@@ -57072,6 +57043,7 @@ const MutationApplication = () => {
57072
57043
  }
57073
57044
  }
57074
57045
  convertAppData.applicationType = resolvedServiceType === "WATER" ? "MUTATION_WATER_CONNECTION" : "MUTATION_SEWERAGE_CONNECTION";
57046
+ delete convertAppData.dueVerification;
57075
57047
  if (isEditFlow) {
57076
57048
  var _applicationDetails$a6, _applicationDetails$a7, _updatePayload, _updatePayload$docume, _Digit, _Digit$Customizations, _Digit$Customizations2;
57077
57049
  let updatePayload = {