Skip to content

Commit

Permalink
Added TL changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sriranjan-s authored and sriranjan-s committed Oct 25, 2024
1 parent 6aa1875 commit 3d9235e
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ Newdata = {RequestInfo:data?.RequestInfo, Transaction :{fileStoreId:data?.fileSt
: await Axios({ method, url: _url, data:Newdata, params, headers });

}
else if(url.includes("/requester-services-dx/eSign/filestoreId/v1/_search"))
{
Newdata = {RequestInfo:data?.RequestInfo, Transaction :{module:data?.module,consumerCode:data?.consumerCode}}

res = userDownload
? await Axios({ method, url: _url, data:Newdata, params, headers, responseType: "arraybuffer" })
: await Axios({ method, url: _url, data:Newdata, params, headers });
}
else{
res = userDownload
? await Axios({ method, url: _url, data, params, headers, responseType: "arraybuffer" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ digiLocker:{
uri:"/requester-services-dx/user/file"
},
eSign:{
pdfUrl:"/requester-services-dx/eSign/process"
pdfUrl:"/requester-services-dx/eSign/process",
fileStoreSearch:"/requester-services-dx/eSign/filestoreId/v1/_search"
},
engagement: {
document: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,17 @@ export const DigiLockerService = {
auth: true,
userService: true,
data:{ pdfUrl:data?.TokenReq?.pdfUrl,redirectUrl:"",fileStoreId:data?.TokenReq?.fileStoreId,module:data?.TokenReq?.module,tenantId:data?.TokenReq?.tenantId,consumerCode:data?.TokenReq?.consumerCode}
}),
fileStoreSearch:(data) =>
Request({
url: Urls.eSign.fileStoreSearch,
useCache: false,
method: "POST",
auth: true,
userService: true,
data:{module:data?.TokenReq?.module,consumerCode:data?.TokenReq?.consumerCode}
})

};


Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,49 @@ export const SuccessfulPayment = (props) => {
const generatePdfKeyForTL = "tlcertificate";

if (applicationDetails) {
let response = await Digit.PaymentService.generatePdf(state, { Licenses: applicationDetails?.Licenses }, generatePdfKeyForTL);
const fileStore = await Digit.PaymentService.printReciept(state, { fileStoreIds: response.filestoreIds[0] });
window.open(fileStore[response.filestoreIds[0]], "_blank");
console.log("applicationapplication",applicationDetails)
let res = await Digit.TLService.TLsearch({ tenantId: applicationDetails?.Licenses?.[0]?.tenantId, filters: { applicationNumber:applicationDetails?.Licenses?.[0]?.applicationNumber } });
let TokenReq = {
module:"TL",
"consumerCode": res?.Licenses?.[0]?.licenseNumber
}
const res1 = await Digit.DigiLockerService.fileStoreSearch({TokenReq})
console.log("res1res1res1",res1)
if(res1?.Transaction.length > 0 && res1?.Transaction?.[0]?.signedFilestoreId!==null)
{
const tenant = Digit.ULBService.getStateId()
const resneww = await Digit.UploadServices.Filefetch([res1?.Transaction?.[0]?.signedFilestoreId], tenant);
console.log("resneww11",resneww,resneww?.data?.fileStoreIds?.[0]?.url)
window.open(resneww?.data?.fileStoreIds?.[0]?.url, "_blank");
}
else{
const TLcertificatefile = await Digit.PaymentService.generatePdf(tenantId, { Licenses: res?.Licenses }, "tlcertificate");
const receiptFile = await Digit.PaymentService.printReciept(tenantId, { fileStoreIds: TLcertificatefile.filestoreIds[0] });
console.log("resres",res)
fetchDigiLockerDocuments(receiptFile[TLcertificatefile.filestoreIds[0]],TLcertificatefile.filestoreIds[0],res)
}


// let response = await Digit.PaymentService.generatePdf(state, { Licenses: applicationDetails?.Licenses }, generatePdfKeyForTL);
// const fileStore = await Digit.PaymentService.printReciept(state, { fileStoreIds: response.filestoreIds[0] });
// window.open(fileStore[response.filestoreIds[0]], "_blank");
}
};

const fetchDigiLockerDocuments = async (file,id,res) => {
console.log("res",res)

let TokenReq = {
pdfUrl:file,
tenantId: "pg.citya",
module:"TL",
redirectUrl:"",
"fileStoreId":id,
"consumerCode": res?.Licenses?.[0]?.licenseNumber
}
const res1 = await Digit.DigiLockerService.pdfUrl({TokenReq})
console.log("res1res1res1res1res1",res1)
window.location.href=res1
}
// const printpetCertificate = async () => {
// const tenantId = Digit.ULBService.getCurrentTenantId();
// const state = Digit.ULBService.getStateId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,36 @@ const TLApplicationDetails = () => {
};

const downloadTLcertificate = async () => {
const TLcertificatefile = await Digit.PaymentService.generatePdf(tenantId, { Licenses: application }, "tlcertificate");
console.log("applicationapplication",application)
let res = await Digit.TLService.TLsearch({ tenantId: application?.[0]?.tenantId, filters: { applicationNumber:application[0]?.applicationNumber } });
let TokenReq = {
module:"TL",
"consumerCode": res?.Licenses?.[0]?.licenseNumber
}
const res1 = await Digit.DigiLockerService.fileStoreSearch({TokenReq})
console.log("res1res1res1",res1)
if(res1?.Transaction.length > 0 && res1?.Transaction?.[0]?.signedFilestoreId!==null)
{
const tenant = Digit.ULBService.getStateId()
const resneww = await Digit.UploadServices.Filefetch([res1?.Transaction?.[0]?.signedFilestoreId], tenant);
console.log("resneww11",resneww,resneww?.data?.fileStoreIds?.[0]?.url)
window.open(resneww?.data?.fileStoreIds?.[0]?.url, "_blank");
}
else{
const TLcertificatefile = await Digit.PaymentService.generatePdf(tenantId, { Licenses: application }, "tlcertificate");
const receiptFile = await Digit.PaymentService.printReciept(tenantId, { fileStoreIds: TLcertificatefile.filestoreIds[0] });
window.open(receiptFile[TLcertificatefile.filestoreIds[0]], "_blank");
setShowOptions(false);
// const TLcertificatefile = await Digit.PaymentService.generatePdf(tenantId, { Licenses: res?.Licenses }, "tlcertificate");
// const receiptFile = await Digit.PaymentService.printReciept(tenantId, { fileStoreIds: TLcertificatefile.filestoreIds[0] });
// console.log("resres",res)
// fetchDigiLockerDocuments(receiptFile[TLcertificatefile.filestoreIds[0]],TLcertificatefile.filestoreIds[0],res)
}

// const TLcertificatefile = await Digit.PaymentService.generatePdf(tenantId, { Licenses: application }, "tlcertificate");
// const receiptFile = await Digit.PaymentService.printReciept(tenantId, { fileStoreIds: TLcertificatefile.filestoreIds[0] });
// window.open(receiptFile[TLcertificatefile.filestoreIds[0]], "_blank");
// setShowOptions(false);
};

let propertyAddress = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,27 @@ const ApplicationDetails = () => {
}
const printCertificate = async () => {
let res = await Digit.TLService.TLsearch({ tenantId: applicationDetails?.tenantId, filters: { applicationNumber:applicationDetails?.applicationData?.applicationNumber } });
const TLcertificatefile = await Digit.PaymentService.generatePdf(tenantId, { Licenses: res?.Licenses }, "tlcertificate");
const receiptFile = await Digit.PaymentService.printReciept(tenantId, { fileStoreIds: TLcertificatefile.filestoreIds[0] });
fetchDigiLockerDocuments(receiptFile[TLcertificatefile.filestoreIds[0]],TLcertificatefile.filestoreIds[0],res)
//window.open(receiptFile[TLcertificatefile.filestoreIds[0]], "_blank");
let TokenReq = {
module:"TL",
"consumerCode": res?.Licenses?.[0]?.licenseNumber
}
const res1 = await Digit.DigiLockerService.fileStoreSearch({TokenReq})
console.log("res1res1res1",res1)
if(res1?.Transaction.length > 0 && res1?.Transaction?.[0]?.signedFilestoreId!==null)
{
const tenant = Digit.ULBService.getStateId()
const resneww = await Digit.UploadServices.Filefetch([res1?.Transaction?.[0]?.signedFilestoreId], tenant);
console.log("resneww",resneww)
console.log("resneww11",resneww,resneww?.data?.fileStoreIds?.[0]?.url)
window.open(resneww?.data?.fileStoreIds?.[0]?.url, "_blank");
}
else{
const TLcertificatefile = await Digit.PaymentService.generatePdf(tenantId, { Licenses: res?.Licenses }, "tlcertificate");
const receiptFile = await Digit.PaymentService.printReciept(tenantId, { fileStoreIds: TLcertificatefile.filestoreIds[0] });
console.log("resres",res)
fetchDigiLockerDocuments(receiptFile[TLcertificatefile.filestoreIds[0]],TLcertificatefile.filestoreIds[0],res)
}

setIsDisplayDownloadMenu(false)
}
const [isDisplayDownloadMenu, setIsDisplayDownloadMenu] = useState(false);
Expand Down

0 comments on commit 3d9235e

Please sign in to comment.