@mseva/digit-ui-module-ptr 1.0.94 → 1.0.96

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.
@@ -8391,10 +8391,10 @@ const PTRCitizenPet = ({
8391
8391
  goNext(data);
8392
8392
  return;
8393
8393
  }
8394
+ console.log("data", data);
8394
8395
  const {
8395
8396
  address,
8396
- lastName,
8397
- firstName,
8397
+ name,
8398
8398
  pincode,
8399
8399
  ...filteredOwnerDetails
8400
8400
  } = currentStepData.ownerDetails;
@@ -8402,16 +8402,16 @@ const PTRCitizenPet = ({
8402
8402
  tenantId,
8403
8403
  owner: {
8404
8404
  ...filteredOwnerDetails,
8405
- name: `${firstName} ${lastName}`,
8405
+ name: name,
8406
8406
  userName: filteredOwnerDetails === null || filteredOwnerDetails === void 0 ? void 0 : filteredOwnerDetails.mobileNumber,
8407
8407
  tenantId,
8408
8408
  type: "CITIZEN"
8409
8409
  },
8410
8410
  petDetails: {
8411
8411
  petName: data.petName,
8412
- petType: (_data$petType = data.petType) === null || _data$petType === void 0 ? void 0 : _data$petType.code,
8412
+ petType: (_data$petType = data.petType) === null || _data$petType === void 0 ? void 0 : _data$petType.name,
8413
8413
  breedType: (_data$breedType = data.breedType) === null || _data$breedType === void 0 ? void 0 : _data$breedType.code,
8414
- petGender: (_data$petGender = data.petGender) === null || _data$petGender === void 0 ? void 0 : _data$petGender.code,
8414
+ petGender: (_data$petGender = data.petGender) === null || _data$petGender === void 0 ? void 0 : _data$petGender.name,
8415
8415
  petColor: data.petColor,
8416
8416
  lastVaccineDate: toEpochMilliseconds(data.lastVaccineDate),
8417
8417
  petAge: data.petAge,
@@ -8424,12 +8424,12 @@ const PTRCitizenPet = ({
8424
8424
  addressId: currentStepData.ownerDetails.address
8425
8425
  },
8426
8426
  applicationType: "NEWAPPLICATION",
8427
- ownerName: `${firstName} ${lastName}`,
8427
+ ownerName: name,
8428
8428
  fatherName: filteredOwnerDetails === null || filteredOwnerDetails === void 0 ? void 0 : filteredOwnerDetails.fatherOrHusbandName,
8429
8429
  mobileNumber: filteredOwnerDetails === null || filteredOwnerDetails === void 0 ? void 0 : filteredOwnerDetails.mobileNumber,
8430
8430
  workflow: {
8431
8431
  action: "INITIATE",
8432
- comments: "Initial application submitted",
8432
+ comments: "",
8433
8433
  status: "INITIATED"
8434
8434
  }
8435
8435
  };
@@ -8721,7 +8721,7 @@ const PTRCitizenPet = ({
8721
8721
  rules: {
8722
8722
  required: t("PTR_CLINIC_NAME_REQUIRED"),
8723
8723
  pattern: {
8724
- value: alphaNum,
8724
+ value: /^[a-zA-Z0-9\s&-]+$/,
8725
8725
  message: t("PTR_CLINIC_NAME_INVALID")
8726
8726
  }
8727
8727
  },
@@ -15857,7 +15857,6 @@ const PTRCitizenDetails = ({
15857
15857
  emailId,
15858
15858
  name
15859
15859
  } = userInfo === null || userInfo === void 0 ? void 0 : userInfo.info;
15860
- const [firstName, lastName] = [(name || "").trim().split(" ").slice(0, -1).join(" "), (name || "").trim().split(" ").slice(-1).join(" ")];
15861
15860
  const isCitizen = window.location.href.includes("citizen");
15862
15861
  const {
15863
15862
  control,
@@ -15871,8 +15870,7 @@ const PTRCitizenDetails = ({
15871
15870
  defaultValues: isCitizen ? {
15872
15871
  mobileNumber: mobileNumber || "",
15873
15872
  emailId: emailId || "",
15874
- firstName: firstName || "",
15875
- lastName: lastName || ""
15873
+ name: name || ""
15876
15874
  } : {}
15877
15875
  });
15878
15876
  const onSubmit = data => {
@@ -15897,8 +15895,7 @@ const PTRCitizenDetails = ({
15897
15895
  const error = errors[fieldName];
15898
15896
  if (error.message) return t(error.message);
15899
15897
  const fallbackMessages = {
15900
- firstName: t("PTR_FIRST_NAME_REQUIRED"),
15901
- lastName: t("PTR_LAST_NAME_REQUIRED"),
15898
+ name: t("PTR_FIRST_NAME_REQUIRED"),
15902
15899
  emailId: t("PTR_EMAIL_REQUIRED"),
15903
15900
  mobileNumber: t("PTR_MOBILE_REQUIRED"),
15904
15901
  fatherOrHusbandName: t("PTR_FATHER_HUSBAND_NAME_REQUIRED"),
@@ -15919,16 +15916,16 @@ const PTRCitizenDetails = ({
15919
15916
  className: "card-section-header"
15920
15917
  }, t("PTR_CITIZEN_DETAILS")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
15921
15918
  className: "card-label-smaller"
15922
- }, `${t("NDC_FIRST_NAME")}`, " *"), /*#__PURE__*/React.createElement("div", {
15919
+ }, `${t("ES_NEW_APPLICATION_APPLICANT_NAME")}`, " *"), /*#__PURE__*/React.createElement("div", {
15923
15920
  className: "field"
15924
15921
  }, /*#__PURE__*/React.createElement(Controller, {
15925
15922
  control: control,
15926
- name: "firstName",
15923
+ name: "name",
15927
15924
  rules: {
15928
- required: t("PTR_FIRST_NAME_REQUIRED"),
15925
+ required: t("Applicant Name is Required"),
15929
15926
  pattern: {
15930
15927
  value: /^[A-Za-z]+(?:[ '-][A-Za-z]+)*\s*$/,
15931
- message: t("PTR_FIRST_NAME_INVALID")
15928
+ message: t("Applicant Name is Invalid")
15932
15929
  },
15933
15930
  maxLength: {
15934
15931
  value: 100,
@@ -15948,50 +15945,13 @@ const PTRCitizenDetails = ({
15948
15945
  onChange: e => onChange(e.target.value),
15949
15946
  onBlur: e => {
15950
15947
  onBlur(e);
15951
- trigger("firstName");
15948
+ trigger("name");
15952
15949
  },
15953
15950
  t: t
15954
15951
  })
15955
- }))), errors.firstName && /*#__PURE__*/React.createElement(CardLabelError, {
15952
+ }))), errors.name && /*#__PURE__*/React.createElement(CardLabelError, {
15956
15953
  style: errorStyle
15957
- }, getErrorMessage("firstName")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
15958
- className: "card-label-smaller"
15959
- }, `${t("NDC_LAST_NAME")}`, " *"), /*#__PURE__*/React.createElement("div", {
15960
- className: "field"
15961
- }, /*#__PURE__*/React.createElement(Controller, {
15962
- control: control,
15963
- name: "lastName",
15964
- rules: {
15965
- required: t("PTR_LAST_NAME_REQUIRED"),
15966
- pattern: {
15967
- value: /^[A-Za-z]+(?:[ '-][A-Za-z]+)*\s*$/,
15968
- message: t("PTR_FIRST_NAME_INVALID")
15969
- },
15970
- maxLength: {
15971
- value: 100,
15972
- message: "Maximum 100 characters"
15973
- },
15974
- minLength: {
15975
- value: 2,
15976
- message: "Minimum 2 characters"
15977
- }
15978
- },
15979
- render: ({
15980
- value,
15981
- onChange,
15982
- onBlur
15983
- }) => /*#__PURE__*/React.createElement(TextInput, {
15984
- value: value,
15985
- onChange: e => onChange(e.target.value),
15986
- onBlur: e => {
15987
- onBlur(e);
15988
- trigger("lastName");
15989
- },
15990
- t: t
15991
- })
15992
- }))), errors.lastName && /*#__PURE__*/React.createElement(CardLabelError, {
15993
- style: errorStyle
15994
- }, getErrorMessage("lastName")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
15954
+ }, getErrorMessage("name")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
15995
15955
  className: "card-label-smaller"
15996
15956
  }, `${t("NOC_APPLICANT_EMAIL_LABEL")}`, " *"), /*#__PURE__*/React.createElement("div", {
15997
15957
  className: "field"
@@ -16001,7 +15961,7 @@ const PTRCitizenDetails = ({
16001
15961
  rules: {
16002
15962
  required: t("PTR_EMAIL_REQUIRED"),
16003
15963
  pattern: {
16004
- value: /^[A-Za-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/,
15964
+ value: /^(?!\.)(?!.*\.\.)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/,
16005
15965
  message: t("PTR_EMAIL_INVALID")
16006
15966
  },
16007
15967
  maxLength: {
@@ -16147,14 +16107,6 @@ const PTRCitizenDetails = ({
16147
16107
  pattern: {
16148
16108
  value: /^[1-9][0-9]{5}$/,
16149
16109
  message: t("PTR_PINCODE_INVALID")
16150
- },
16151
- minLength: {
16152
- value: 6,
16153
- message: t("PTR_PINCODE_MIN_LENGTH")
16154
- },
16155
- maxLength: {
16156
- value: 6,
16157
- message: t("PTR_PINCODE_MAX_LENGTH")
16158
16110
  }
16159
16111
  },
16160
16112
  render: ({
@@ -16163,13 +16115,13 @@ const PTRCitizenDetails = ({
16163
16115
  onBlur
16164
16116
  }) => /*#__PURE__*/React.createElement(TextInput, {
16165
16117
  value: value,
16118
+ maxlength: 6,
16166
16119
  onChange: e => onChange(e.target.value.replace(/\D/g, "")),
16167
16120
  onBlur: e => {
16168
16121
  onBlur(e);
16169
16122
  trigger("pincode");
16170
16123
  },
16171
- t: t,
16172
- maxLength: 6
16124
+ t: t
16173
16125
  })
16174
16126
  }))), errors.pincode && /*#__PURE__*/React.createElement(CardLabelError, {
16175
16127
  style: errorStyle
@@ -16985,12 +16937,7 @@ function PTRWFDocument({
16985
16937
  background: "#f6f6f6",
16986
16938
  padding: "8px"
16987
16939
  }
16988
- }), /*#__PURE__*/React.createElement("p", {
16989
- style: {
16990
- marginTop: "8px",
16991
- textAlign: "center"
16992
- }
16993
- }, value !== null && value !== void 0 && value.workflowDocs ? t(`${document === null || document === void 0 ? void 0 : document.documentType}`) : t(`PT_${document === null || document === void 0 ? void 0 : document.documentType}_LABEL`)));
16940
+ }));
16994
16941
  }))));
16995
16942
  }
16996
16943
 
@@ -17091,13 +17038,13 @@ const ModalConfig = ({
17091
17038
  assigneeLabel,
17092
17039
  businessService
17093
17040
  }) => {
17094
- let checkAssigneeVisible = (action === null || action === void 0 ? void 0 : action.action) === "APPROVE" || (action === null || action === void 0 ? void 0 : action.action) === "VERIFY" || (action === null || action === void 0 ? void 0 : action.action) === "FORWARD";
17041
+ let checkAssigneeVisible = (action === null || action === void 0 ? void 0 : action.action) == "SENDBACKTOVERIFIER" || (action === null || action === void 0 ? void 0 : action.action) == "VERIFY" || (action === null || action === void 0 ? void 0 : action.action) == "FORWARD";
17095
17042
  if (action.isTerminateState) {
17096
17043
  checkAssigneeVisible = false;
17097
17044
  }
17098
17045
  return {
17099
17046
  label: {
17100
- heading: t(`WF_${action === null || action === void 0 ? void 0 : action.action}_APPLICATION`),
17047
+ heading: "",
17101
17048
  submit: t(`${action === null || action === void 0 ? void 0 : action.action}`),
17102
17049
  cancel: t("WF_EMPLOYEE_NEWTL_CANCEL")
17103
17050
  },
@@ -17120,13 +17067,8 @@ const ModalConfig = ({
17120
17067
  selected: selectedApprover
17121
17068
  })
17122
17069
  }, {
17123
- label: t("WF_COMMON_COMMENTS"),
17070
+ label: `${t("CS_COMMON_COMMENTS")} *`,
17124
17071
  type: "textarea",
17125
- isMandatory: (action === null || action === void 0 ? void 0 : action.action) === "REJECT" || (action === null || action === void 0 ? void 0 : action.action) === "APPROVE" || (action === null || action === void 0 ? void 0 : action.action) === "VERIFY" || (action === null || action === void 0 ? void 0 : action.action) === "SENDBACKTOCITIZEN" || (action === null || action === void 0 ? void 0 : action.action) === "FORWARD",
17126
- validation: (action === null || action === void 0 ? void 0 : action.action) === "REJECT" || (action === null || action === void 0 ? void 0 : action.action) === "APPROVE" || (action === null || action === void 0 ? void 0 : action.action) === "VERIFY" || (action === null || action === void 0 ? void 0 : action.action) === "SENDBACKTOCITIZEN" || (action === null || action === void 0 ? void 0 : action.action) === "FORWARD" ? {
17127
- required: true,
17128
- message: t("CORE_COMMON_REQUIRED_ERRMSG")
17129
- } : {},
17130
17072
  populators: {
17131
17073
  name: "comments"
17132
17074
  }
@@ -17253,7 +17195,6 @@ const PTRModal = ({
17253
17195
  }
17254
17196
  useEffect(() => {
17255
17197
  (async () => {
17256
- setError(null);
17257
17198
  if (file) {
17258
17199
  if (file.size >= 5242880) {
17259
17200
  setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
@@ -17275,22 +17216,18 @@ const PTRModal = ({
17275
17216
  })();
17276
17217
  }, [file]);
17277
17218
  function submit(data) {
17278
- setShowToast(null);
17279
- setError(null);
17280
- let checkCommentsMandatory = (action === null || action === void 0 ? void 0 : action.action) === "APPROVE" || (action === null || action === void 0 ? void 0 : action.action) === "VERIFY" || (action === null || action === void 0 ? void 0 : action.action) === "REJECT" || (action === null || action === void 0 ? void 0 : action.action) === "SENDBACKTOCITIZEN" || (action === null || action === void 0 ? void 0 : action.action) === "FORWARD";
17281
- if (action !== null && action !== void 0 && action.isTerminateState) checkCommentsMandatory = true;
17282
- const commentsText = data === null || data === void 0 ? void 0 : data.comments;
17283
- if (checkCommentsMandatory && (!commentsText || !commentsText.toString().trim())) {
17284
- setError("Comments are required");
17219
+ let checkAssigneeMandatory = (action === null || action === void 0 ? void 0 : action.action) === "SENDBACKTOVERIFIER" || (action === null || action === void 0 ? void 0 : action.action) === "VERIFY" || (action === null || action === void 0 ? void 0 : action.action) === "FORWARD";
17220
+ if (action !== null && action !== void 0 && action.isTerminateState) checkAssigneeMandatory = false;
17221
+ if (checkAssigneeMandatory && !(selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid)) {
17222
+ setError("Assignee is required");
17285
17223
  setShowToast({
17286
17224
  key: "error"
17287
17225
  });
17288
17226
  return;
17289
17227
  }
17290
- let checkAssigneeMandatory = (action === null || action === void 0 ? void 0 : action.action) === "APPROVE" || (action === null || action === void 0 ? void 0 : action.action) === "VERIFY" || (action === null || action === void 0 ? void 0 : action.action) === "FORWARD";
17291
- if (action !== null && action !== void 0 && action.isTerminateState) checkAssigneeMandatory = false;
17292
- if (checkAssigneeMandatory && !(selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid)) {
17293
- setError("Assignee is required");
17228
+ const commentsText = data === null || data === void 0 ? void 0 : data.comments;
17229
+ if (!commentsText) {
17230
+ setError("Comments are required");
17294
17231
  setShowToast({
17295
17232
  key: "error"
17296
17233
  });
@@ -17347,8 +17284,9 @@ const PTRModal = ({
17347
17284
  defaultValues: defaultValues,
17348
17285
  formId: "modal-action"
17349
17286
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
17350
- error: showToast.key === "error" ? true : false,
17287
+ error: showToast.key == "error" ? true : false,
17351
17288
  label: error,
17289
+ isDleteBtn: true,
17352
17290
  onClose: closeToast
17353
17291
  })) : /*#__PURE__*/React.createElement(Loader, null);
17354
17292
  };
@@ -17377,13 +17315,12 @@ const PTRWFApplicationTimeline = props => {
17377
17315
  refetchOnMount: "always"
17378
17316
  }
17379
17317
  });
17380
- console.log(" majordata :>> ", data);
17318
+ console.log("props.application", props.application);
17381
17319
  function OpenImage(imageSource, index, thumbnailsToShow) {
17382
17320
  var _thumbnailsToShow$ful;
17383
17321
  window.open(thumbnailsToShow === null || thumbnailsToShow === void 0 ? void 0 : (_thumbnailsToShow$ful = thumbnailsToShow.fullImage) === null || _thumbnailsToShow$ful === void 0 ? void 0 : _thumbnailsToShow$ful[0], "_blank");
17384
17322
  }
17385
17323
  const getTimelineCaptions = checkpoint => {
17386
- console.log("checkpoint is :>> ", checkpoint);
17387
17324
  if (checkpoint.state === "OPEN") {
17388
17325
  var _checkpoint$auditDeta, _props$application4;
17389
17326
  const caption = {
@@ -17495,6 +17432,7 @@ const PTRWFApplicationTimeline = props => {
17495
17432
  const closeModal = () => {
17496
17433
  setSelectedAction(null);
17497
17434
  setShowModal(false);
17435
+ setShowToast(false);
17498
17436
  };
17499
17437
  function onActionSelect(action) {
17500
17438
  const payload = {
@@ -17513,15 +17451,12 @@ const PTRWFApplicationTimeline = props => {
17513
17451
  }
17514
17452
  const submitAction = async data => {
17515
17453
  var _data$Licenses;
17516
- console.log("data HUHHHH:>> ", data);
17517
17454
  const payloadData = props.application;
17518
- console.log("payloadData :>> ", payloadData);
17519
17455
  const updatedApplicant = {
17520
17456
  ...payloadData,
17521
17457
  workflow: {}
17522
17458
  };
17523
17459
  const filtData = data === null || data === void 0 ? void 0 : (_data$Licenses = data.Licenses) === null || _data$Licenses === void 0 ? void 0 : _data$Licenses[0];
17524
- console.log("filtData whyy :>> ", filtData);
17525
17460
  setLatestComment(filtData === null || filtData === void 0 ? void 0 : filtData.comment);
17526
17461
  updatedApplicant.workflow = {
17527
17462
  action: filtData.action,
@@ -17529,19 +17464,9 @@ const PTRWFApplicationTimeline = props => {
17529
17464
  comments: filtData === null || filtData === void 0 ? void 0 : filtData.comment,
17530
17465
  documents: filtData !== null && filtData !== void 0 && filtData.wfDocuments ? filtData === null || filtData === void 0 ? void 0 : filtData.wfDocuments : null
17531
17466
  };
17532
- if (!(filtData !== null && filtData !== void 0 && filtData.assignee) && filtData.action == "FORWARD") {
17533
- setShowToast({
17534
- key: "error",
17535
- message: "Assignee is mandatory"
17536
- });
17537
- setError("Assignee is mandatory");
17538
- return;
17539
- }
17540
- console.log("updatedApplicant :>> ", updatedApplicant);
17541
17467
  const finalPayload = {
17542
17468
  PetRegistrationApplications: [updatedApplicant]
17543
17469
  };
17544
- console.log("finalPayload :>> ", finalPayload);
17545
17470
  try {
17546
17471
  var _response$ResponseInf;
17547
17472
  const response = await Digit.PTRService.update({
@@ -17594,7 +17519,7 @@ const PTRWFApplicationTimeline = props => {
17594
17519
  label: t(`ES_PTR_COMMON_STATUS_${data === null || data === void 0 ? void 0 : (_data$processInstance = data.processInstances[index].state) === null || _data$processInstance === void 0 ? void 0 : _data$processInstance["state"]}${timelineStatusPostfix}`),
17595
17520
  customChild: getTimelineCaptions(checkpoint)
17596
17521
  }));
17597
- }))), (actions === null || actions === void 0 ? void 0 : actions.length) > 0 && ((_actions$ = actions[0]) === null || _actions$ === void 0 ? void 0 : _actions$.action) != "PAY" && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu ? /*#__PURE__*/React.createElement(Menu, {
17522
+ }))), (actions === null || actions === void 0 ? void 0 : actions.length) > 0 && ((_actions$ = actions[0]) === null || _actions$ === void 0 ? void 0 : _actions$.action) != "PAY" && !isCitizen && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu ? /*#__PURE__*/React.createElement(Menu, {
17598
17523
  localeKeyPrefix: `WF_EMPLOYEE_${"PTR"}`,
17599
17524
  options: actions,
17600
17525
  optionKey: "action",
@@ -17620,8 +17545,9 @@ const PTRWFApplicationTimeline = props => {
17620
17545
  errors: error,
17621
17546
  setShowToast: setShowToast
17622
17547
  }) : null), data && showNextActions(data === null || data === void 0 ? void 0 : (_data$actionState2 = data.actionState) === null || _data$actionState2 === void 0 ? void 0 : _data$actionState2.nextActions), showToast && /*#__PURE__*/React.createElement(Toast, {
17623
- error: showToast.key === "error" ? true : false,
17548
+ error: showToast.key == "error" ? true : false,
17624
17549
  label: error,
17550
+ isDleteBtn: true,
17625
17551
  onClose: closeToast
17626
17552
  }));
17627
17553
  };
@@ -18107,7 +18033,7 @@ const PTRMyApplications = () => {
18107
18033
  var _ob$referenceId;
18108
18034
  return ob === null || ob === void 0 ? void 0 : (_ob$referenceId = ob.referenceId) === null || _ob$referenceId === void 0 ? void 0 : _ob$referenceId.includes(curservice === null || curservice === void 0 ? void 0 : curservice.applicationNumber);
18109
18035
  });
18110
- if (foundValue) return t("CS_CF_VIEW");else return t("CS_CF_TRACK");
18036
+ if (foundValue) return t("CS_CF_VIEW");else return t("CS_VIEW_DETAILS");
18111
18037
  }
18112
18038
  if (isLoading || serviceloading) {
18113
18039
  return /*#__PURE__*/React.createElement(Loader, null);
@@ -18242,7 +18168,12 @@ function PTRDocument({
18242
18168
  target: "_",
18243
18169
  href: documentLink,
18244
18170
  style: {
18245
- minWidth: "160px"
18171
+ minWidth: "160px",
18172
+ margin: "12px",
18173
+ display: "flex",
18174
+ flexDirection: "column",
18175
+ alignItems: "center",
18176
+ textAlign: "center"
18246
18177
  },
18247
18178
  key: index
18248
18179
  }, /*#__PURE__*/React.createElement(PDFSvg$1, {
@@ -18254,8 +18185,11 @@ function PTRDocument({
18254
18185
  }
18255
18186
  }), /*#__PURE__*/React.createElement("p", {
18256
18187
  style: {
18257
- marginTop: "8px"
18258
- }
18188
+ marginTop: "8px",
18189
+ maxWidth: "140px",
18190
+ wordBreak: "break-word"
18191
+ },
18192
+ title: t(`PT_${document === null || document === void 0 ? void 0 : document.documentType.replace(".", "_")}`)
18259
18193
  }, t(`PT_${document === null || document === void 0 ? void 0 : document.documentType.replace(".", "_")}`)));
18260
18194
  })))));
18261
18195
  }
@@ -18742,7 +18676,7 @@ function get(object, path, defaultValue) {
18742
18676
  var get_1 = get;
18743
18677
 
18744
18678
  const PTRApplicationDetails = () => {
18745
- var _pet_details$addition, _reciept_data$Payment, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai6;
18679
+ var _pet_details$addition, _reciept_data$Payment, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai6;
18746
18680
  const {
18747
18681
  t
18748
18682
  } = useTranslation();
@@ -18753,6 +18687,7 @@ const PTRApplicationDetails = () => {
18753
18687
  } = useParams();
18754
18688
  const [acknowldgementData, setAcknowldgementData] = useState([]);
18755
18689
  const [showOptions, setShowOptions] = useState(false);
18690
+ const isCitizen = window.location.href.includes("citizen");
18756
18691
  const [popup, setpopup] = useState(false);
18757
18692
  const [showToast, setShowToast] = useState(null);
18758
18693
  const {
@@ -18774,7 +18709,7 @@ const PTRApplicationDetails = () => {
18774
18709
  const petId = get_1(data, "PetRegistrationApplications[0].applicationNumber", []);
18775
18710
  const pet_details = PetRegistrationApplications && PetRegistrationApplications.length > 0 && PetRegistrationApplications[0] || {};
18776
18711
  const application = pet_details;
18777
- sessionStorage.setItem("ptr-pet", JSON.stringify(application));
18712
+ console.log("pet_details", pet_details);
18778
18713
  const [loading, setLoading] = useState(false);
18779
18714
  const fetchBillData = async () => {
18780
18715
  setLoading(true);
@@ -19358,42 +19293,42 @@ const PTRApplicationDetails = () => {
19358
19293
  onHeadClick: () => setShowOptions(!showOptions),
19359
19294
  displayOptions: showOptions,
19360
19295
  options: dowloadOptions
19361
- })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
19362
- className: "border-none",
19363
- label: t("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL"),
19364
- text: pet_details === null || pet_details === void 0 ? void 0 : pet_details.applicationNumber
19365
- })), /*#__PURE__*/React.createElement(CardSubHeader, {
19366
- style: {
19367
- fontSize: "24px"
19368
- }
19369
- }, t("WS_COMMON_TABLE_COL_ADDRESS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
19370
- className: "border-none",
19371
- label: t("PTR_ADDRESS"),
19372
- text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.addressId) || t("CS_NA")
19373
- }), /*#__PURE__*/React.createElement(Row, {
19374
- className: "border-none",
19375
- label: t("PTR_PINCODE"),
19376
- text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address2 = pet_details.address) === null || _pet_details$address2 === void 0 ? void 0 : _pet_details$address2.pincode) || t("CS_NA")
19377
- })), /*#__PURE__*/React.createElement(CardSubHeader, {
19296
+ })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, {
19378
19297
  style: {
19379
19298
  fontSize: "24px"
19380
19299
  }
19381
19300
  }, t("ES_TITLE_APPLICANT_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
19382
19301
  className: "border-none",
19383
19302
  label: t("REPORT_FSM_RESULT_APPLICANTNAME"),
19384
- text: (pet_details === null || pet_details === void 0 ? void 0 : pet_details.applicantName) || t("CS_NA")
19303
+ text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$owner = pet_details.owner) === null || _pet_details$owner === void 0 ? void 0 : _pet_details$owner.name) || t("CS_NA")
19385
19304
  }), /*#__PURE__*/React.createElement(Row, {
19386
19305
  className: "border-none",
19387
19306
  label: t("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),
19388
- text: (pet_details === null || pet_details === void 0 ? void 0 : pet_details.fatherName) || (pet_details === null || pet_details === void 0 ? void 0 : pet_details.fatherOrHusbandName) || t("CS_NA")
19307
+ text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$owner2 = pet_details.owner) === null || _pet_details$owner2 === void 0 ? void 0 : _pet_details$owner2.fatherOrHusbandName) || t("CS_NA")
19389
19308
  }), /*#__PURE__*/React.createElement(Row, {
19390
19309
  className: "border-none",
19391
19310
  label: t("MOBILE"),
19392
- text: (pet_details === null || pet_details === void 0 ? void 0 : pet_details.mobileNumber) || t("CS_NA")
19311
+ text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$owner3 = pet_details.owner) === null || _pet_details$owner3 === void 0 ? void 0 : _pet_details$owner3.mobileNumber) || t("CS_NA")
19393
19312
  }), /*#__PURE__*/React.createElement(Row, {
19394
19313
  className: "border-none",
19395
19314
  label: t("CORE_COMMON_PROFILE_EMAIL"),
19396
- text: (pet_details === null || pet_details === void 0 ? void 0 : pet_details.emailId) || t("CS_NA")
19315
+ text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$owner4 = pet_details.owner) === null || _pet_details$owner4 === void 0 ? void 0 : _pet_details$owner4.emailId) || t("CS_NA")
19316
+ }), /*#__PURE__*/React.createElement(Row, {
19317
+ className: "border-none",
19318
+ label: t("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL"),
19319
+ text: pet_details === null || pet_details === void 0 ? void 0 : pet_details.applicationNumber
19320
+ })), /*#__PURE__*/React.createElement(CardSubHeader, {
19321
+ style: {
19322
+ fontSize: "24px"
19323
+ }
19324
+ }, t("WS_COMMON_TABLE_COL_ADDRESS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
19325
+ className: "border-none",
19326
+ label: t("PTR_ADDRESS"),
19327
+ text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.addressId) || t("CS_NA")
19328
+ }), /*#__PURE__*/React.createElement(Row, {
19329
+ className: "border-none",
19330
+ label: t("PTR_PINCODE"),
19331
+ text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address2 = pet_details.address) === null || _pet_details$address2 === void 0 ? void 0 : _pet_details$address2.pincode) || t("CS_NA")
19397
19332
  })), /*#__PURE__*/React.createElement(CardSubHeader, {
19398
19333
  style: {
19399
19334
  fontSize: "24px"
@@ -19417,7 +19352,7 @@ const PTRApplicationDetails = () => {
19417
19352
  }), /*#__PURE__*/React.createElement(Row, {
19418
19353
  className: "border-none",
19419
19354
  label: t("PTR_VACCINATED_DATE"),
19420
- text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai5 = pet_details.petDetails) === null || _pet_details$petDetai5 === void 0 ? void 0 : _pet_details$petDetai5.lastVaccineDate) || t("CS_NA")
19355
+ text: pet_details !== null && pet_details !== void 0 && (_pet_details$petDetai5 = pet_details.petDetails) !== null && _pet_details$petDetai5 !== void 0 && _pet_details$petDetai5.lastVaccineDate ? new Date(Number(pet_details.petDetails.lastVaccineDate)).toLocaleDateString("en-GB") : t("CS_NA")
19421
19356
  }), /*#__PURE__*/React.createElement(Row, {
19422
19357
  className: "border-none",
19423
19358
  label: t("PTR_VACCINATION_NUMBER"),
@@ -19434,7 +19369,12 @@ const PTRApplicationDetails = () => {
19434
19369
  }) : /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
19435
19370
  className: "border-none",
19436
19371
  text: t("PTR_NO_DOCUMENTS_MSG")
19437
- }))), /*#__PURE__*/React.createElement(PTRWFApplicationTimeline, {
19372
+ }))), ((pet_details === null || pet_details === void 0 ? void 0 : pet_details.status) == "CITIZENACTIONREQUIRED" || (pet_details === null || pet_details === void 0 ? void 0 : pet_details.status) == "INITIATED") && isCitizen && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
19373
+ label: t("COMMON_EDIT"),
19374
+ onSubmit: () => {
19375
+ history.push(`/digit-ui/citizen/ptr/petservice/new-application/${acknowledgementIds}`);
19376
+ }
19377
+ })), /*#__PURE__*/React.createElement(PTRWFApplicationTimeline, {
19438
19378
  application: application,
19439
19379
  id: application === null || application === void 0 ? void 0 : application.applicationNumber,
19440
19380
  userType: "citizen"
@@ -19444,6 +19384,7 @@ const PTRApplicationDetails = () => {
19444
19384
  style: {
19445
19385
  bottom: "0px"
19446
19386
  },
19387
+ isDleteBtn: true,
19447
19388
  onClose: () => {
19448
19389
  setShowToast(null);
19449
19390
  }
@@ -21267,7 +21208,7 @@ const NewApplication = () => {
21267
21208
  };
21268
21209
 
21269
21210
  const ApplicationDetails = () => {
21270
- var _pet_details$addition, _reciept_data$Payment2, _pet_details$address, _pet_details$address2, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai6;
21211
+ var _pet_details$addition, _reciept_data$Payment2, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai6;
21271
21212
  const {
21272
21213
  t
21273
21214
  } = useTranslation();
@@ -21301,7 +21242,6 @@ const ApplicationDetails = () => {
21301
21242
  refetchOnMount: "always"
21302
21243
  }
21303
21244
  });
21304
- console.log("data :>> ", data);
21305
21245
  const [billData, setBillData] = useState(null);
21306
21246
  const PetRegistrationApplications = get_1(data, "PetRegistrationApplications", []);
21307
21247
  const petId = get_1(data, "PetRegistrationApplications[0].applicationNumber", []);
@@ -21432,32 +21372,7 @@ const ApplicationDetails = () => {
21432
21372
  marginRight: "auto",
21433
21373
  maxWidth: "960px"
21434
21374
  }
21435
- }, /*#__PURE__*/React.createElement(Header, {
21436
- styles: {
21437
- fontSize: "32px"
21438
- }
21439
- }, t("CS_APPLICATION_DETAILS")), (PetRegistrationApplications === null || PetRegistrationApplications === void 0 ? void 0 : PetRegistrationApplications.status) == "approved" && dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
21440
- className: "multilinkWrapper",
21441
- onHeadClick: () => setShowOptions(!showOptions),
21442
- displayOptions: showOptions,
21443
- options: dowloadOptions
21444
- })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
21445
- className: "border-none",
21446
- label: t("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL"),
21447
- text: pet_details === null || pet_details === void 0 ? void 0 : pet_details.applicationNumber
21448
- })), /*#__PURE__*/React.createElement(CardSubHeader, {
21449
- style: {
21450
- fontSize: "24px"
21451
- }
21452
- }, t("WS_COMMON_TABLE_COL_ADDRESS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
21453
- className: "border-none",
21454
- label: t("PTR_ADDRESS"),
21455
- text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.addressId) || t("CS_NA")
21456
- }), /*#__PURE__*/React.createElement(Row, {
21457
- className: "border-none",
21458
- label: t("PTR_PINCODE"),
21459
- text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address2 = pet_details.address) === null || _pet_details$address2 === void 0 ? void 0 : _pet_details$address2.pincode) || t("CS_NA")
21460
- })), /*#__PURE__*/React.createElement(CardSubHeader, {
21375
+ }), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, {
21461
21376
  style: {
21462
21377
  fontSize: "24px"
21463
21378
  }
@@ -21477,6 +21392,22 @@ const ApplicationDetails = () => {
21477
21392
  className: "border-none",
21478
21393
  label: t("CORE_COMMON_PROFILE_EMAIL"),
21479
21394
  text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$owner4 = pet_details.owner) === null || _pet_details$owner4 === void 0 ? void 0 : _pet_details$owner4.emailId) || t("CS_NA")
21395
+ }), /*#__PURE__*/React.createElement(Row, {
21396
+ className: "border-none",
21397
+ label: t("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL"),
21398
+ text: pet_details === null || pet_details === void 0 ? void 0 : pet_details.applicationNumber
21399
+ })), /*#__PURE__*/React.createElement(CardSubHeader, {
21400
+ style: {
21401
+ fontSize: "24px"
21402
+ }
21403
+ }, t("WS_COMMON_TABLE_COL_ADDRESS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
21404
+ className: "border-none",
21405
+ label: t("PTR_ADDRESS"),
21406
+ text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.addressId) || t("CS_NA")
21407
+ }), /*#__PURE__*/React.createElement(Row, {
21408
+ className: "border-none",
21409
+ label: t("PTR_PINCODE"),
21410
+ text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address2 = pet_details.address) === null || _pet_details$address2 === void 0 ? void 0 : _pet_details$address2.pincode) || t("CS_NA")
21480
21411
  })), /*#__PURE__*/React.createElement(CardSubHeader, {
21481
21412
  style: {
21482
21413
  fontSize: "24px"
@@ -21500,7 +21431,7 @@ const ApplicationDetails = () => {
21500
21431
  }), /*#__PURE__*/React.createElement(Row, {
21501
21432
  className: "border-none",
21502
21433
  label: t("PTR_VACCINATED_DATE"),
21503
- text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$petDetai5 = pet_details.petDetails) === null || _pet_details$petDetai5 === void 0 ? void 0 : _pet_details$petDetai5.lastVaccineDate) || t("CS_NA")
21434
+ text: pet_details !== null && pet_details !== void 0 && (_pet_details$petDetai5 = pet_details.petDetails) !== null && _pet_details$petDetai5 !== void 0 && _pet_details$petDetai5.lastVaccineDate ? new Date(Number(pet_details.petDetails.lastVaccineDate)).toLocaleDateString("en-GB") : t("CS_NA")
21504
21435
  }), /*#__PURE__*/React.createElement(Row, {
21505
21436
  className: "border-none",
21506
21437
  label: t("PTR_VACCINATION_NUMBER"),
@@ -21530,11 +21461,7 @@ const ApplicationDetails = () => {
21530
21461
  onClose: () => {
21531
21462
  setShowToast(null);
21532
21463
  }
21533
- })), popup && /*#__PURE__*/React.createElement(PTCitizenFeedbackPopUp, {
21534
- setpopup: setpopup,
21535
- setShowToast: setShowToast,
21536
- data: data
21537
- })));
21464
+ }))));
21538
21465
  };
21539
21466
 
21540
21467
  const GetMessage = (type, action, isSuccess, isEmployee, t) => {
@@ -22496,38 +22423,30 @@ const NewPTRStepFormThree = ({
22496
22423
  const currentStepData = useSelector(function (state) {
22497
22424
  return state.ptr.PTRNewApplicationFormReducer.formData && state.ptr.PTRNewApplicationFormReducer.formData[config === null || config === void 0 ? void 0 : config.key] ? state.ptr.PTRNewApplicationFormReducer.formData[config === null || config === void 0 ? void 0 : config.key] : {};
22498
22425
  });
22499
- const makeDocumentsValidator = mdms => {
22500
- const requiredDocs = (mdms || []).filter(d => d === null || d === void 0 ? void 0 : d.required);
22501
- return (documents = []) => {
22502
- const errors = {};
22503
- const missingDocs = [];
22504
- const docsArray = Array.isArray(documents) ? documents : [];
22505
- if (!requiredDocs.length) return errors;
22506
- for (const doc of requiredDocs) {
22507
- const satisfied = docsArray.some(d => {
22508
- var _d$documentType;
22509
- return ((_d$documentType = d.documentType) === null || _d$documentType === void 0 ? void 0 : _d$documentType.includes(doc.code)) && (d.filestoreId || d.fileStoreId);
22510
- });
22511
- if (!satisfied) {
22512
- missingDocs.push(doc.name || t(doc.code.replaceAll(".", "_")));
22513
- }
22514
- }
22515
- if (missingDocs.length > 0) {
22516
- errors.missingRequired = "PTR_MISSING_REQUIRED_DOCUMENTS";
22517
- errors.missingDocs = missingDocs;
22518
- }
22519
- return errors;
22520
- };
22521
- };
22426
+ function validation(documents) {
22427
+ if (!isLoading) {
22428
+ var _documents$documents, _ptrDocumentsType$fil;
22429
+ const ptrDocumentsType = mdmsDocsData || [];
22430
+ const documentsData = (documents === null || documents === void 0 ? void 0 : (_documents$documents = documents.documents) === null || _documents$documents === void 0 ? void 0 : _documents$documents.documents) || [];
22431
+ console.log("ptrDocumentsType", ptrDocumentsType);
22432
+ console.log("documentsData", documentsData);
22433
+ console.log("mdmsDocsData", mdmsDocsData);
22434
+ console.log("documentsData===", documents);
22435
+ const requiredDocs = ptrDocumentsType === null || ptrDocumentsType === void 0 ? void 0 : (_ptrDocumentsType$fil = ptrDocumentsType.filter(doc => doc.required)) === null || _ptrDocumentsType$fil === void 0 ? void 0 : _ptrDocumentsType$fil.map(doc => doc.code);
22436
+ const uploadedDocs = documentsData === null || documentsData === void 0 ? void 0 : documentsData.map(doc => doc.documentType);
22437
+ const missingDocs = requiredDocs.filter(reqDoc => !(uploadedDocs !== null && uploadedDocs !== void 0 && uploadedDocs.includes(reqDoc)));
22438
+ return missingDocs;
22439
+ }
22440
+ return [];
22441
+ }
22522
22442
  function goNext(data) {
22523
- var _data$documents;
22524
- const validator = makeDocumentsValidator(mdmsDocsData);
22525
- const docErrors = validator((data === null || data === void 0 ? void 0 : (_data$documents = data.documents) === null || _data$documents === void 0 ? void 0 : _data$documents.documents) || []);
22526
- if (docErrors !== null && docErrors !== void 0 && docErrors.missingRequired) {
22527
- var _docErrors$missingDoc;
22528
- const missingDocNames = ((_docErrors$missingDoc = docErrors.missingDocs) === null || _docErrors$missingDoc === void 0 ? void 0 : _docErrors$missingDoc.join(", ")) || "";
22529
- setError(`You haven't uploaded: ${missingDocNames}`);
22443
+ const missingFields = validation(data);
22444
+ if (missingFields.length > 0) {
22445
+ setError(`${t(missingFields[0].replace(".", "_").toUpperCase())} is required`);
22530
22446
  setShowToast(true);
22447
+ setTimeout(() => {
22448
+ setShowToast(false);
22449
+ }, 3000);
22531
22450
  return;
22532
22451
  }
22533
22452
  onGoNext();
@@ -22660,7 +22579,7 @@ const NewPTRStepFormFour = ({
22660
22579
  workflow: {
22661
22580
  ...existingWorkflow,
22662
22581
  action: (selectedAction === null || selectedAction === void 0 ? void 0 : selectedAction.action) || "",
22663
- comments: (selectedAction === null || selectedAction === void 0 ? void 0 : selectedAction.action) || "",
22582
+ comments: "",
22664
22583
  status: (selectedAction === null || selectedAction === void 0 ? void 0 : selectedAction.action) || ""
22665
22584
  },
22666
22585
  ownerName: `${ownerDetails === null || ownerDetails === void 0 ? void 0 : ownerDetails.firstName} ${ownerDetails === null || ownerDetails === void 0 ? void 0 : ownerDetails.lastName}`,
@@ -23035,7 +22954,6 @@ const updatedCreateEmployeeconfig$1 = createEmployeeConfig$1.map(item => {
23035
22954
  currStepConfig: citizenConfig$2.filter(newConfigItem => newConfigItem.stepNumber === item.stepNumber)
23036
22955
  };
23037
22956
  });
23038
- console.log("updatedCreateEmployeeconfig1", updatedCreateEmployeeconfig$1);
23039
22957
  const RenewPTRStepForm = () => {
23040
22958
  var _data$applicationData;
23041
22959
  const history = useHistory();