@djb25/digit-ui-module-ekyc 1.0.55 → 1.0.56

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
@@ -226,7 +226,7 @@ const StatusCards = _ref => {
226
226
  alert(t("NO_DATA_FOUND") || "No data found for download.");
227
227
  return;
228
228
  }
229
- const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
229
+ const excludedKeys = ["status", "source", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
230
230
  const headerMapping = {
231
231
  kno: t("KNO"),
232
232
  firstName: t("FIRST_NAME"),
@@ -355,9 +355,16 @@ const StatusCards = _ref => {
355
355
  if (name) {
356
356
  cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(name);
357
357
  }
358
- Object.keys(item).forEach(key => {
358
+ const keys = Object.keys(item);
359
+ const orderedKeys = [...keys.filter(key => key !== "submittedAt"), ...(keys.includes("submittedAt") ? ["submittedAt"] : [])];
360
+ orderedKeys.forEach(key => {
359
361
  if (excludedKeys.includes(key)) return;
360
362
  let val = item[key];
363
+ if (key === "submittedAt" && val) {
364
+ const date = new Date(Number(val));
365
+ const pad = n => String(n).padStart(2, "0");
366
+ val = pad(date.getDate()) + "/" + pad(date.getMonth() + 1) + "/" + date.getFullYear() + " " + pad(date.getHours()) + ":" + pad(date.getMinutes()) + ":" + pad(date.getSeconds());
367
+ }
361
368
  if (typeof val === "object" && val !== null) {
362
369
  return;
363
370
  }
@@ -2108,7 +2115,7 @@ const VendorDetailsCard = () => {
2108
2115
  alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
2109
2116
  return;
2110
2117
  }
2111
- const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
2118
+ const excludedKeys = ["status", "source", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
2112
2119
  const headerMapping = {
2113
2120
  kno: t("KNO"),
2114
2121
  firstName: t("FIRST_NAME"),
@@ -3785,7 +3792,7 @@ const ReviewSection = _ref2 => {
3785
3792
  })))));
3786
3793
  };
3787
3794
  const Review = () => {
3788
- var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _newDataRaw$connectio, _newDataRaw$connectio2, _newDataRaw$connectio3, _newDataRaw$address, _newDataRaw$address2, _newDataRaw$address3, _newDataRaw$address4, _newDataRaw$address5, _newDataRaw$address6, _newDataRaw$address7, _newDataRaw$address8, _newDataRaw$address9, _newDataRaw$address0, _newDataRaw$address1, _newDataRaw$address10, _newDataRaw$address11, _newDataRaw$address12, _newDataRaw$address13, _newDataRaw$address14, _newDataRaw$property, _newDataRaw$property2, _editedProperty$conne, _newDataRaw$property3, _editedProperty$conne2, _newDataRaw$property4, _editedProperty$userT, _newDataRaw$property5, _editedProperty$noOfF, _newDataRaw$property6, _newDataRaw$property7, _newDataRaw$meter, _editedMeter$meterSta, _newDataRaw$meter2, _newDataRaw$meter3, _newDataRaw$meter4, _newDataRaw$meter5, _editedMeter$workingS, _newDataRaw$meter6, _editedMeter$lastBill, _newDataRaw$meter7, _newDataRaw$meter8;
3795
+ var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _newDataRaw$connectio, _newDataRaw$connectio2, _newDataRaw$connectio3, _newDataRaw$address, _newDataRaw$address2, _newDataRaw$address3, _newDataRaw$address4, _newDataRaw$address5, _newDataRaw$address6, _newDataRaw$address7, _newDataRaw$address8, _newDataRaw$address9, _newDataRaw$address0, _newDataRaw$address1, _newDataRaw$address10, _newDataRaw$address11, _newDataRaw$address12, _newDataRaw$address13, _newDataRaw$address14, _newDataRaw$property, _newDataRaw$property2, _editedProperty$conne, _newDataRaw$property3, _editedProperty$conne2, _newDataRaw$property4, _editedProperty$userT, _newDataRaw$property5, _editedProperty$noOfF, _newDataRaw$property6, _newDataRaw$property7, _newDataRaw$meter, _editedMeter$meterSta, _newDataRaw$meter2, _newDataRaw$meter3, _newDataRaw$meter4, _newDataRaw$meter5, _editedMeter$workingS, _newDataRaw$meter6, _editedMeter$lastBill, _newDataRaw$meter7, _newDataRaw$meter8, _Digit$UserService$ge, _supervisorData;
3789
3796
  const _useTranslation = reactI18next.useTranslation(),
3790
3797
  t = _useTranslation.t;
3791
3798
  const history = reactRouterDom.useHistory();
@@ -3846,7 +3853,9 @@ const Review = () => {
3846
3853
  isSearchLoading = _Digit$Hooks$ekyc$use.isLoading;
3847
3854
  const userRoles = ((_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.roles) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.map(ele => ele.code)) || [];
3848
3855
  const isZRO = userRoles.includes("EKYC_ZRO") || userRoles.includes("ZRO");
3849
- const isSupervisorOrSurveyorOrVendor = userRoles.includes("EKYC_SUPERVISOR") || userRoles.includes("EKYC_SURVEYOR") || userRoles.includes("EKYC_VENDOR");
3856
+ const isSupervisorOrSurveyorOrVendor = userRoles.includes("EKYC_SURVEYOR") || userRoles.includes("EKYC_VENDOR");
3857
+ const EKYC_ROLE_PRIORITY = ["EKYC_ZRO", "ZRO", "EKYC_SUPERVISOR", "EKYC_SURVEYOR", "EKYC_VENDOR"];
3858
+ const currentUserRole = EKYC_ROLE_PRIORITY.find(r => userRoles.includes(r)) || userRoles[0] || "EMPLOYEE";
3850
3859
  const isStatusView = location.pathname.includes("/status/");
3851
3860
  const hideEditButton = isSupervisorOrSurveyorOrVendor && !isZRO || isStatusView;
3852
3861
  const _extractReviewData = extractReviewData(searchData, flowState),
@@ -4280,34 +4289,48 @@ const Review = () => {
4280
4289
  label: "EKYC_METER_LONGITUDE1"
4281
4290
  }];
4282
4291
  const handleDeclaration = () => setAgree(!agree);
4292
+ const loggedInUserInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
4293
+ const matchedSupervisor = (_supervisorData = supervisorData) === null || _supervisorData === void 0 ? void 0 : _supervisorData.find(s => (s === null || s === void 0 ? void 0 : s.uuid) === (loggedInUserInfo === null || loggedInUserInfo === void 0 ? void 0 : loggedInUserInfo.uuid) || (s === null || s === void 0 ? void 0 : s.userName) === (loggedInUserInfo === null || loggedInUserInfo === void 0 ? void 0 : loggedInUserInfo.userName));
4294
+ const supervisorId = (matchedSupervisor === null || matchedSupervisor === void 0 ? void 0 : matchedSupervisor.uuid) || (loggedInUserInfo === null || loggedInUserInfo === void 0 ? void 0 : loggedInUserInfo.uuid);
4283
4295
  const handleReject = function () {
4284
4296
  try {
4285
- var _Digit$UserService$ge, _Digit$UserService$ge2, _Digit$UserService$ge3;
4297
+ var _Digit$UserService$ge2;
4286
4298
  const payload = {
4287
4299
  RequestInfo: {
4288
4300
  apiId: "Rainmaker",
4289
4301
  ver: "1.0",
4290
4302
  msgId: "message-id",
4291
4303
  tenantId: tenantId,
4292
- authToken: (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.access_token
4304
+ authToken: (_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.access_token
4293
4305
  },
4294
4306
  kno: activeKno,
4295
4307
  action: "REJECTED",
4296
4308
  remarks: "Application rejected by reviewer",
4297
- reviewedBy: (_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : (_Digit$UserService$ge3 = _Digit$UserService$ge2.info) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.userName,
4298
- role: "ZRO"
4309
+ reviewedBy: supervisorId,
4310
+ role: currentUserRole
4299
4311
  };
4300
4312
  const _temp = _catch(function () {
4301
4313
  return Promise.resolve(workflowMutation.mutateAsync(payload)).then(function (result) {
4302
4314
  if (result) {
4303
- history.push("/digit-ui/employee/ekyc/response", {
4304
- success: true,
4305
- result
4315
+ setToastData({
4316
+ error: true,
4317
+ label: t("EKYC_APPLICATION_REJECT_SUCCESSFUL") || "Application Rejected Successfully"
4306
4318
  });
4319
+ setShowToast(true);
4320
+ setTimeout(() => {
4321
+ history.push("/digit-ui/employee/ekyc/inbox");
4322
+ }, 2000);
4307
4323
  }
4308
4324
  });
4309
4325
  }, function (err) {
4326
+ var _err$response, _err$response$data, _err$response2, _err$response2$data, _err$response2$data$E, _err$response2$data$E2, _err$Errors, _err$Errors$;
4310
4327
  console.error("Reject Error:", err);
4328
+ const errMsg = (err === null || err === void 0 ? void 0 : err.message) || (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.message) || (err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : (_err$response2$data$E = _err$response2$data.Errors) === null || _err$response2$data$E === void 0 ? void 0 : (_err$response2$data$E2 = _err$response2$data$E[0]) === null || _err$response2$data$E2 === void 0 ? void 0 : _err$response2$data$E2.message) || (err === null || err === void 0 ? void 0 : (_err$Errors = err.Errors) === null || _err$Errors === void 0 ? void 0 : (_err$Errors$ = _err$Errors[0]) === null || _err$Errors$ === void 0 ? void 0 : _err$Errors$.message) || t("EKYC_REJECT_ERROR") || "Reject failed. Please try again.";
4329
+ setToastData({
4330
+ error: true,
4331
+ label: errMsg
4332
+ });
4333
+ setShowToast(true);
4311
4334
  });
4312
4335
  return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
4313
4336
  } catch (e) {
@@ -4316,20 +4339,20 @@ const Review = () => {
4316
4339
  };
4317
4340
  const handleApprove = function () {
4318
4341
  try {
4319
- var _Digit$UserService$ge4, _Digit$UserService$ge5, _Digit$UserService$ge6;
4342
+ var _Digit$UserService$ge3;
4320
4343
  const payload = {
4321
4344
  RequestInfo: {
4322
4345
  apiId: "Rainmaker",
4323
4346
  ver: "1.0",
4324
4347
  msgId: "message-id",
4325
4348
  tenantId: tenantId,
4326
- authToken: (_Digit$UserService$ge4 = Digit.UserService.getUser()) === null || _Digit$UserService$ge4 === void 0 ? void 0 : _Digit$UserService$ge4.access_token
4349
+ authToken: (_Digit$UserService$ge3 = Digit.UserService.getUser()) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.access_token
4327
4350
  },
4328
4351
  kno: activeKno,
4329
4352
  action: "APPROVED",
4330
4353
  remarks: "All documents verified",
4331
- reviewedBy: (_Digit$UserService$ge5 = Digit.UserService.getUser()) === null || _Digit$UserService$ge5 === void 0 ? void 0 : (_Digit$UserService$ge6 = _Digit$UserService$ge5.info) === null || _Digit$UserService$ge6 === void 0 ? void 0 : _Digit$UserService$ge6.userName,
4332
- role: "ZRO"
4354
+ reviewedBy: supervisorId,
4355
+ role: currentUserRole
4333
4356
  };
4334
4357
  const _temp2 = _catch(function () {
4335
4358
  return Promise.resolve(workflowMutation.mutateAsync(payload)).then(function (result) {
@@ -4345,11 +4368,12 @@ const Review = () => {
4345
4368
  }
4346
4369
  });
4347
4370
  }, function (err) {
4348
- var _err$response, _err$response$data;
4371
+ var _err$response3, _err$response3$data, _err$response3$data$E, _err$response3$data$E2, _err$Errors2, _err$Errors2$;
4349
4372
  console.error("Approve Error:", err);
4373
+ const errMsg = (err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : (_err$response3$data$E = _err$response3$data.Errors) === null || _err$response3$data$E === void 0 ? void 0 : (_err$response3$data$E2 = _err$response3$data$E[0]) === null || _err$response3$data$E2 === void 0 ? void 0 : _err$response3$data$E2.message) || (err === null || err === void 0 ? void 0 : (_err$Errors2 = err.Errors) === null || _err$Errors2 === void 0 ? void 0 : (_err$Errors2$ = _err$Errors2[0]) === null || _err$Errors2$ === void 0 ? void 0 : _err$Errors2$.message) || (err === null || err === void 0 ? void 0 : err.message) || t("EKYC_APPROVE_ERROR") || "Approve failed. Please try again.";
4350
4374
  setToastData({
4351
4375
  error: true,
4352
- label: (err === null || err === void 0 ? void 0 : err.message) || (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.message) || "Approve Error"
4376
+ label: errMsg
4353
4377
  });
4354
4378
  setShowToast(true);
4355
4379
  });
@@ -4379,9 +4403,9 @@ const Review = () => {
4379
4403
  };
4380
4404
  const handleMenuSelect = option => {
4381
4405
  setShowOptions(false);
4382
- if (option.action === t("Approve")) {
4406
+ if (option.action === t("APPROVE")) {
4383
4407
  handleApprove();
4384
- } else if (option.action === t("Reject")) {
4408
+ } else if (option.action === t("REJECT")) {
4385
4409
  handleReject();
4386
4410
  }
4387
4411
  };
@@ -5911,7 +5935,7 @@ const SupervisorDetailsCard = () => {
5911
5935
  alert(t("NO_DATA_FOUND") || "No data found for download.");
5912
5936
  return;
5913
5937
  }
5914
- const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
5938
+ const excludedKeys = ["status", "source", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
5915
5939
  const headerMapping = {
5916
5940
  kno: t("KNO"),
5917
5941
  firstName: t("FIRST_NAME"),
@@ -7175,7 +7199,7 @@ const SurveyorDetailsDashboard = () => {
7175
7199
  alert(t("NO_DATA_FOUND") || "No data found for download.");
7176
7200
  return;
7177
7201
  }
7178
- const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
7202
+ const excludedKeys = ["status", "source", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
7179
7203
  const headerMapping = {
7180
7204
  kno: t("KNO"),
7181
7205
  firstName: t("FIRST_NAME"),
@@ -9992,7 +10016,7 @@ const CitizenApp = () => {
9992
10016
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
9993
10017
  path: path + "/review",
9994
10018
  component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
9995
- layoutClass: "normal"
10019
+ layoutClass: "action"
9996
10020
  }, /*#__PURE__*/React__default.createElement(Review, null))
9997
10021
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
9998
10022
  path: path + "/assign",