{`${t("BPA_APPROVED_COLONY")}`}
@@ -241,7 +365,7 @@
control={control}
name={"approvedColony"}
defaultValue={approvedColony}
- rules={{ required: t("CORE_COMMON_REQUIRED_ERRMSG") }}
+ rules={{ required: t("CORE_COMMON_REQUIRED_ERRMSG")}}
render={(props) => (
(
- {`${t("BPA_DISTRICT")}`}
+ {`${t("BPA_CORE_AREA")}`}
(
+
+ )}
+
+ />
+
+ {`${t("BPA_ULB_TYPE")}`}
+ (
+
+ )}
+ />
+
+ {`${t("BPA_ULB_NAME")}`}
+ (
+
- {`${t("BPA_ULB_TYPE")}`}
+ {`${t("BPA_DISTRICT")}`}
(
(
(
)}
/>
+ {renderschemedropdown()}
+
{`${t("BPA_PURCHASED_FAR")}`}
(
(
(
(
- {bpaTaxDocuments?.map((document, index) => {
+ {/* {bpaTaxDocuments?.map((document, index) => { */}
+ {bpaTaxDocuments?.filter(document => document.code !== "ARCHITECT.UNDERTAKING" && document.code !== "CITIZEN.UNDERTAKING").map((document, index) => {
return (
{
if (formData?.owners?.purchasedFAR?.code) payload.additionalDetails.purchasedFAR = formData?.owners?.purchasedFAR?.code;
if (formData?.owners?.restrictedArea?.code) payload.additionalDetails.restrictedArea = formData?.owners?.restrictedArea?.code;
if (formData?.owners?.schemes?.i18nKey) payload.additionalDetails.schemes = formData?.owners?.schemes?.i18nKey;
- if (formData?.owners?.district?.code) payload.additionalDetails.district = formData?.owners?.district?.code;
- if (formData?.owners?.ulbType?.code) payload.additionalDetails.ulbType = formData?.owners?.ulbType?.code;
+ if (formData?.owners?.UlbName?.code) payload.additionalDetails.UlbName = formData?.owners?.UlbName?.code;
+ if (formData?.owners?.District?.code) payload.additionalDetails.District = formData?.owners?.District?.code;
if (formData?.owners?.nameofApprovedcolony) payload.additionalDetails.nameofApprovedcolony = formData?.owners?.nameofApprovedcolony;
if (formData?.owners?.NocNumber) payload.additionalDetails.NocNumber = formData?.owners?.NocNumber;
+ if (formData?.owners?.coreArea?.code) payload.additionalDetails.coreArea = formData?.owners?.coreArea?.code;
+ if (formData?.owners?.schemesselection?.i18nKey) payload.additionalDetails.schemesselection = formData?.owners?.schemesselection?.i18nKey;
+ if (formData?.owners?.schemeName) payload.additionalDetails.schemeName = formData?.owners?.schemeName;
+ if (formData?.owners?.transferredscheme) payload.additionalDetails.transferredscheme = formData?.owners?.transferredscheme;
+ if (formData?.owners?.Ulblisttype?.code) payload.additionalDetails.Ulblisttype = formData?.owners?.Ulblisttype?.code;
//For LandInfo
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/BpaApplicationDetail/CitizenConsent.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/BpaApplicationDetail/CitizenConsent.js
new file mode 100644
index 00000000000..0c3bfbb6612
--- /dev/null
+++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/BpaApplicationDetail/CitizenConsent.js
@@ -0,0 +1,228 @@
+
+ import React, { useState } from 'react';
+ import Modal from 'react-modal';
+ import jsPDF from 'jspdf';
+ import { useLocation } from "react-router-dom";
+ import { SubmitBar, CitizenConsentForm } from '@upyog/digit-ui-react-components';
+ import { useTranslation } from "react-i18next";
+ import { useParams } from "react-router-dom";
+ import Axios from "axios";
+ import Urls from '../../../../../../libraries/src/services/atoms/urls';
+
+
+
+ const CitizenConsent = ({ showTermsPopup, setShowTermsPopup, otpVerifiedTimestamp }) => {
+
+ const [isModalOpen, setIsModalOpen] = useState(false);
+
+ const { t } = useTranslation();
+ const user = Digit.UserService.getUser();
+ const ownername = user?.info?.name;
+ const ownermobileNumber = user?.info.mobileNumber
+ const ownerEmail = user?.info?.emailId
+ const { id } = useParams();
+ const tenantId = Digit.ULBService.getCurrentTenantId();
+ const { data } = Digit.Hooks.obps.useBPADetailsPage(tenantId, { applicationNo: id });
+ let workflowDetails = Digit.Hooks.useWorkflowDetails({
+ tenantId: data?.applicationData?.tenantId,
+ id: id,
+ moduleCode: "OBPS",
+ config: {
+ enabled: !!data
+ }
+ });
+ const architectname = workflowDetails?.data?.timeline?.[0]?.assigner?.name
+ const mobileNumber = workflowDetails?.data?.timeline?.[0]?.assigner?.mobileNumber
+ const khasranumber = data?.applicationData?.additionalDetails?.khasraNumber;
+ const ulbname = data?.applicationData?.additionalDetails?.UlbName;
+ const district = data?.applicationData?.additionalDetails?.District;
+ const ward = data?.applicationData?.additionalDetails?.wardnumber;
+ const area = data?.applicationData?.additionalDetails?.area;
+ const applicationnumber = data?.applicationNo
+ const architectid = data?.applicationData?.additionalDetails?.architectid
+ const architecttype = data?.applicationData?.additionalDetails?.typeOfArchitect
+ const TimeStamp = otpVerifiedTimestamp;
+ const selfdeclarationform =
+ `
+ To:
+
+ Executive Officer,
+ ${ulbname}
+ ${district}
+
+ Dear Sir or Madam,
+
+ I/We, Shri/Smt/Kum. ${ownername} under signed owner of land bearing Kh. No. ${khasranumber} of ULB ${ulbname}
+ Area ${area} (Sq.mts.), ward number ${ward}, City ${district}
+
+ I/We hereby declare that the Architect name ${architectname} (${architecttype}) Architect ID - ${architectid} is
+ appointed by me/us and is authorized to make representation/application with regard to aforesaid
+ construction to any of the authorities.
+
+ I/We further declare that I am/We are aware of all the action taken or representation made by the
+ ${architecttype} authorized by me/us.
+
+ i) That I am/We are sole owner of the site.
+
+ ii) There is no dispute regarding the site and if any dispute arises then I shall be solely
+ responsible for the same.
+
+ iii) That construction of the building will be undertaken as per the approved building plans
+ and structural design given by the Structural Engineer.
+
+ That above stated facts are true and the requisite documents have been uploaded with this
+ E-Naksha plan and nothing has been concealed thereof.
+
+
+ Name of Owner - ${ownername}
+ Mobile Number - ${ownermobileNumber}
+ Application Number - ${applicationnumber}
+ Email Id - ${ownerEmail}
+ Signature - Verified By OTP at ${TimeStamp}
+ `;
+
+ const openModal = () => {
+ setIsModalOpen(true);
+ };
+
+ const closeModal = () => {
+ setShowTermsPopup(false);
+ };
+
+
+ const uploadSelfDeclaration = async () => {
+ try {
+ const doc = new jsPDF();
+ const leftMargin = 15;
+ const topMargin = 10;
+ const lineSpacing = 5;
+ const pageWidth = doc.internal.pageSize.getWidth();
+ const maxLineWidth = pageWidth - 2 * leftMargin;
+
+ let currentY = topMargin;
+
+ doc.setFont("Times-Roman");
+ doc.setFontSize(12);
+
+ // Split and write text into the PDF
+ const lines = selfdeclarationform.split("\n");
+ lines.forEach((line) => {
+ const wrappedLines = doc.splitTextToSize(line, maxLineWidth);
+ wrappedLines.forEach((wrappedLine) => {
+ if (currentY + lineSpacing > doc.internal.pageSize.getHeight() - topMargin) {
+ doc.addPage();
+ currentY = topMargin;
+ }
+ doc.text(leftMargin, currentY, wrappedLine);
+ currentY += lineSpacing;
+ });
+ });
+
+ // Convert the PDF to a Blob
+ const pdfBlob = doc.output("blob", "declaration.pdf");
+
+ // Prepare FormData for the upload
+ const formData = new FormData();
+ formData.append("file", pdfBlob, "declaration.pdf");
+ formData.append("tenantId", "pg");
+ formData.append("module", "BPA");
+
+
+ const response = await Axios({
+ method: "post",
+ url: `${Urls.FileStore}`,
+ data: formData,
+ headers: { "auth-token": Digit.UserService.getUser()?.access_token },
+ });
+
+ if (response?.data?.files?.length > 0) {
+ alert("File Uploaded Successfully");
+ sessionStorage.setItem("CitizenConsentdocFilestoreid",response?.data?.files[0]?.fileStoreId);
+ } else {
+ alert("File Upload Failed");
+ }
+ } catch (error) {
+ alert("Error Uploading PDF:", error); // Error handling
+ }
+};
+
+
+
+ const modalStyles = {
+ modal: {
+ width: "100%",
+ height: "100%",
+ top: "0",
+ position: "relative",
+ backgroundColor: 'rgba(0, 0, 0, 0.7)',
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+
+ },
+ modalOverlay: {
+ position: 'fixed',
+ top: '0',
+ left: '0',
+ width: '100%',
+ height: '100%',
+ backgroundColor: 'rgba(0, 0, 0, 0.7)'
+ },
+ modalContent: {
+ backgroundColor: '#FFFFFF',
+ padding: '2rem',
+ borderRadius: '0.5rem',
+ maxWidth: '800px',
+ margin: 'auto',
+ fontFamily: 'Roboto, serif',
+ overflowX: 'hidden',
+ textAlign: 'justify',
+ boxShadow: '0 4px 8px rgba(0, 0, 0, 0.2)',
+ maxHeight: '80vh',
+ overflowY: 'auto',
+ },
+ heading: {
+ textAlign: 'center',
+ fontWeight: 'bold',
+ marginBottom: '10px',
+
+ },
+ subheading: {
+ textAlign: 'center',
+ fontWeight: 'bold',
+ marginBottom: '20px',
+
+ },
+ };
+
+ return (
+
+
+
+
DECLARATION UNDER SELF-CERTIFICATION SCHEME
+
(By OWNER)
+
{selfdeclarationform}
+
+
+
+
+
+
+
+
+
+
+
+ );
+ };
+
+ export default CitizenConsent;
\ No newline at end of file
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/BpaApplicationDetail/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/BpaApplicationDetail/index.js
index 631ebd213e4..edb1e8a016a 100644
--- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/BpaApplicationDetail/index.js
+++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/BpaApplicationDetail/index.js
@@ -1,4 +1,4 @@
-import { CardHeader, Header, Toast, Card, StatusTable, Row, Loader, Menu, PDFSvg, SubmitBar, LinkButton, ActionBar, CheckBox, MultiLink, CardText, CardSubHeader } from "@upyog/digit-ui-react-components";
+import { CardHeader, TextInput, Header, Toast, Card, StatusTable, Row, Loader, Menu, PDFSvg, SubmitBar, LinkButton, ActionBar, CheckBox, MultiLink, CardText, CardSubHeader, CardLabel } from "@upyog/digit-ui-react-components";
import React, { Fragment, useEffect, useState } from "react";
import { useParams, useHistory } from "react-router-dom";
import { useQueryClient } from "react-query";
@@ -14,6 +14,7 @@ import cloneDeep from "lodash/cloneDeep";
import DocumentsPreview from "../../../../../templates/ApplicationDetails/components/DocumentsPreview";
import ScruntinyDetails from "../../../../../templates/ApplicationDetails/components/ScruntinyDetails";
import { Link } from "react-router-dom";
+import CitizenConsent from "./CitizenConsent";
const BpaApplicationDetail = () => {
const { id } = useParams();
@@ -36,12 +37,18 @@ const BpaApplicationDetail = () => {
sessionStorage.setItem("isEDCRDisable", JSON.stringify(true));
sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS", JSON.stringify(false));
+ const user = Digit.UserService.getUser();
+
+ const citizenmobilenumber = user?.info?.mobileNumber
+
+
const history = useHistory();
sessionStorage.setItem("bpaApplicationDetails", false);
let isFromSendBack = false;
const { data: stakeHolderDetails, isLoading: stakeHolderDetailsLoading } = Digit.Hooks.obps.useMDMS(stateCode, "StakeholderRegistraition", "TradeTypetoRoleMapping");
const { isLoading: bpaDocsLoading, data: bpaDocs } = Digit.Hooks.obps.useMDMS(stateCode, "BPA", ["DocTypeMapping"]);
const { data, isLoading } = Digit.Hooks.obps.useBPADetailsPage(tenantId, { applicationNo: id });
+ console.log("datata",data);
const { isMdmsLoading, data: mdmsData } = Digit.Hooks.obps.useMDMS(tenantId.split(".")[0], "BPA", ["RiskTypeComputation"]);
const mutation = Digit.Hooks.obps.useObpsAPI(data?.applicationData?.tenantId, false);
let workflowDetails = Digit.Hooks.useWorkflowDetails({
@@ -53,6 +60,101 @@ const BpaApplicationDetail = () => {
}
});
+ const [agree, setAgree] = useState(false);
+ const setdeclarationhandler = () => {
+ setAgree(!agree);
+ };
+
+ const [showTermsPopup, setShowTermsPopup] = useState(false);
+ const [showMobileInput, setShowMobileInput] = useState(false);
+ const [mobileNumber, setMobileNumber] = useState(citizenmobilenumber || "");
+ const [showOTPInput, setShowOTPInput] = useState(false);
+ const [otp, setOTP] = useState('');
+ const [isOTPVerified, setIsOTPVerified] = useState(false);
+ const [otpError, setOTPError] = useState("");
+ const [otpVerifiedTimestamp, setOTPVerifiedTimestamp] = useState(null);
+
+
+ const handleTermsLinkClick = () => {
+ if (isOTPVerified){
+ setShowTermsPopup(true);
+ }
+ else{
+ alert("Please verify yourself")
+ }
+
+ }
+
+ const checkLabels = () => {
+ return (
+
+ {t("I_AGREE_TO_BELOW_UNDERTAKING")}
+
+
+ );
+ };
+
+ const handleVerifyClick = () => {
+ setShowMobileInput(true);
+ };
+
+ const handleMobileNumberChange = (e) => {
+ setMobileNumber(e.target.value);
+ };
+
+ const handleGetOTPClick = async () => {
+ // Call the Digit.UserService.sendOtp API to send the OTP
+ try {
+ const response = await Digit.UserService.sendOtp({otp:{mobileNumber:mobileNumber, tenantId: user?.info?.tenantId, userType: user?.info?.type , type: "login"}});
+ if (response.isSuccessful) {
+ setShowOTPInput(true);
+ } else {
+ // Handle error case if OTP sending fails
+ console.error("Error sending OTP Response is false:", response.error);
+ }
+ } catch (error) {
+ console.error("Error sending OTP:", error);
+ }
+ };
+
+
+
+ const handleOTPChange = (e) => {
+ setOTP(e.target.value);
+ };
+
+ const requestData = {
+ username:mobileNumber,
+ password:otp,
+ tenantId: user?.info?.tenantId,
+ userType: user?.info?.type
+ };
+
+ const handleVerifyOTPClick = async () => {
+ // Call the API to verify the OTP
+ try {
+ const response = await Digit.UserService.authenticate(requestData);
+ if (response.ResponseInfo.status==="Access Token generated successfully") {
+ setIsOTPVerified(true);
+ setOTPError(t("BPA_OTP_VERIFIED"));
+ setOTPVerifiedTimestamp(new Date());
+ } else {
+ setIsOTPVerified(false);
+ setOTPError(t("BPA_WRONG_OTP"));
+ }
+ } catch (error) {
+ console.error("Error verifying OTP:", error);
+ setIsOTPVerified(false);
+ setOTPError(t("BPA_OTP_VERIFICATION_ERROR"));
+ }
+ };
+
+ const isValidMobileNumber = mobileNumber.length === 10 && /^[0-9]+$/.test(mobileNumber);
+
+
let businessService = [];
if(data && data?.applicationData?.businessService === "BPA_LOW")
@@ -87,6 +189,7 @@ const BpaApplicationDetail = () => {
}
return obj;
})
+
data.applicationDetails = [...newApplicationDetails];
}
}
@@ -201,15 +304,64 @@ const BpaApplicationDetail = () => {
else return false;
}
+ const Citizenconsentform = sessionStorage.getItem("CitizenConsentdocFilestoreid");
+ console.log("Citizenconsentform",Citizenconsentform);
+
+ // const submitAction = (workflow) => {
+ // setIsEnableLoader(true);
+ // mutation.mutate(
+ // { BPA: { ...data?.applicationData, workflow } },
+ // {
+ // onError: (error, variables) => {
+ // setIsEnableLoader(false);
+ // setShowModal(false);
+ // setShowToast({ key: "error", action: error?.response?.data?.Errors[0]?.message ? error?.response?.data?.Errors[0]?.message : error });
+ // setTimeout(closeToast, 5000);
+ // },
+ // onSuccess: (data, variables) => {
+ // setIsEnableLoader(false);
+ // history.replace(`/digit-ui/citizen/obps/response`, { data: data });
+ // setShowModal(false);
+ // setShowToast({ key: "success", action: selectedAction });
+ // setTimeout(closeToast, 5000);
+ // queryClient.invalidateQueries("BPA_DETAILS_PAGE");
+ // queryClient.invalidateQueries("workFlowDetails");
+ // },
+ // }
+ // );
+ // }
+
const submitAction = (workflow) => {
setIsEnableLoader(true);
+
+ // Create a new array with the existing documents and the new Citizenconsentform
+ const updatedDocuments = [
+ ...data?.applicationData?.documents,
+ {
+ documentType: "CITIZEN.UNDERTAKING",
+ fileStoreId: sessionStorage.getItem("CitizenConsentdocFilestoreid"),
+ fileStore: sessionStorage.getItem("CitizenConsentdocFilestoreid"),
+ },
+ ];
+
+ // Update the applicationData object with the new documents array
+ const updatedApplicationData = {
+ ...data?.applicationData,
+ documents: updatedDocuments,
+ };
+
mutation.mutate(
- { BPA: { ...data?.applicationData, workflow } },
+ { BPA: { ...updatedApplicationData, workflow } },
{
onError: (error, variables) => {
setIsEnableLoader(false);
setShowModal(false);
- setShowToast({ key: "error", action: error?.response?.data?.Errors[0]?.message ? error?.response?.data?.Errors[0]?.message : error });
+ setShowToast({
+ key: "error",
+ action: error?.response?.data?.Errors[0]?.message
+ ? error?.response?.data?.Errors[0]?.message
+ : error,
+ });
setTimeout(closeToast, 5000);
},
onSuccess: (data, variables) => {
@@ -223,7 +375,7 @@ const BpaApplicationDetail = () => {
},
}
);
- }
+ };
if (workflowDetails?.data?.nextActions?.length > 0 && data?.applicationData?.status == "CITIZEN_APPROVAL_INPROCESS") {
const userInfo = Digit.UserService.getUser();
@@ -406,7 +558,8 @@ const BpaApplicationDetail = () => {
if (results?.length > 0) {
data.applicationDetails = results;
}
-
+
+
return (
@@ -423,7 +576,12 @@ const BpaApplicationDetail = () => {
/>}
+
+
+
+
{data?.applicationDetails?.filter((ob) => Object.keys(ob).length > 0).map((detail, index, arr) => {
+
return (
@@ -482,6 +640,11 @@ const BpaApplicationDetail = () => {
)}
+
+
+
+
+
{/* to get FieldInspection values */}
{(detail?.isFieldInspection && data?.applicationData?.additionalDetails?.fieldinspection_pending?.length > 0) ? : null}
@@ -521,6 +684,8 @@ const BpaApplicationDetail = () => {
: null }
+
+
{/* to get Timeline values */}
{index === arr.length - 1 && (