Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from egovernments/PDF_COLLECTION_DEPENDENCY_CH…
Browse files Browse the repository at this point in the history
…ANGES

RAIN-1955 Changes in search payment function dur to changes in collec…
  • Loading branch information
sathishp-eGov authored Jan 12, 2021
2 parents 82af22f + 2a5888e commit 20a54e0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions egov-pdf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All notable changes to this module will be documented in this file.

## 1.0.1 -2021-01-12
- Added changes due to collection service dependency

## 1.0.0 - 2020-06-16
- Added this service with support for following PDFs
- PT mutation cetificate
Expand Down
2 changes: 1 addition & 1 deletion egov-pdf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "egov-pdf",
"version": "1.0.0",
"version": "1.0.1",
"private": true,
"main": "index.js",
"scripts": {
Expand Down
6 changes: 4 additions & 2 deletions egov-pdf/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,21 @@ async function search_workflow(applicationNumber, tenantId, requestinfo) {
});
}

async function search_payment(consumerCodes, tenantId, requestinfo) {
async function search_payment(consumerCodes, tenantId, requestinfo, bussinessService) {
var params = {
tenantId: tenantId,
consumerCodes: consumerCodes,
};
var searchEndpoint = config.paths.payment_search;
searchEndpoint = searchEndpoint.replace(/\$module/g,bussinessService);
if (checkIfCitizen(requestinfo)) {
var mobileNumber = requestinfo.RequestInfo.userInfo.mobileNumber;
var userName = requestinfo.RequestInfo.userInfo.userName;
params["mobileNumber"] = mobileNumber || userName;
}
return await axios({
method: "post",
url: url.resolve(config.host.payments, config.paths.payment_search),
url: url.resolve(config.host.payments, searchEndpoint),
data: requestinfo,
params,
});
Expand Down
2 changes: 1 addition & 1 deletion egov-pdf/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = {
user_search: "/user/_search",
mdms_search: "/egov-mdms-service/v1/_search",
download_url: "/download/epass",
payment_search: "/collection-services/payments/_search",
payment_search: "/collection-services/payments/$module/_search",
bill_search: "/egov-searcher/bill-genie/billswithaddranduser/_get",
workflow_search: "/egov-workflow-v2/egov-wf/process/_search"
},
Expand Down
3 changes: 2 additions & 1 deletion egov-pdf/src/routes/payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ router.post(
asyncMiddleware(async function (req, res, next) {
var tenantId = req.query.tenantId;
var consumerCode = req.query.consumerCode;
var bussinessService = req.query.bussinessService;
var requestinfo = req.body;
if (requestinfo == undefined) {
return renderError(res, "requestinfo can not be null", 400);
Expand All @@ -31,7 +32,7 @@ router.post(
}
try {
try {
resProperty = await search_payment(consumerCode, tenantId, requestinfo);
resProperty = await search_payment(consumerCode, tenantId, requestinfo, bussinessService);
} catch (ex) {
console.log(ex.stack);
if (ex.response && ex.response.data) console.log(ex.response.data);
Expand Down
4 changes: 3 additions & 1 deletion egov-pdf/src/routes/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,14 @@ router.post(
properties.Properties.length > 0
) {
var propertyid = properties.Properties[0].propertyId;
var bussinessService = "PT";
var paymentresponse;
try {
paymentresponse = await search_payment(
propertyid,
tenantId,
requestinfo
requestinfo,
bussinessService
);
} catch (ex) {
console.log(ex.stack);
Expand Down
4 changes: 3 additions & 1 deletion egov-pdf/src/routes/tl.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ router.post(
tradelicenses.Licenses.length > 0
) {
var applicationNumber = tradelicenses.Licenses[0].applicationNumber;
var bussinessService = "TL";
var paymentresponse;
try {
paymentresponse = await search_payment(
applicationNumber,
tenantId,
requestinfo
requestinfo,
bussinessService
);
} catch (ex) {
console.log(ex.stack);
Expand Down

0 comments on commit 20a54e0

Please sign in to comment.