Skip to content

Commit

Permalink
RAIN-2765 Firenoc map issue (#828)
Browse files Browse the repository at this point in the history
* RAIN-2765 Added applicant category column

* RAIN-2765 corrected mapping for owner category

* RAIN-2765 debugging user reponnse

* RAIN-2765 updated search query

* RAIN-2765 debugging user reponnse

* RAIN-2765 Updated row mapper

* RAIN-2765 Removed unnecessary console logs
  • Loading branch information
rohit-eGov authored Jun 2, 2021
1 parent 33e8ff1 commit 8e742e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE eg_fn_owner ADD applicantcategory character varying(64);
2 changes: 1 addition & 1 deletion municipal-services/firenoc-services/src/api/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const searchApiResponse = async (request, next = {}) => {
}
// console.log(queryObj);
let text =
"SELECT FN.uuid as FID,FN.tenantid,FN.fireNOCNumber,FN.provisionfirenocnumber,FN.oldfirenocnumber,FN.dateofapplied,FN.createdBy,FN.createdTime,FN.lastModifiedBy,FN.lastModifiedTime,FD.uuid as firenocdetailsid,FD.action,FD.applicationnumber,FD.fireNOCType,FD.applicationdate,FD.financialYear,FD.firestationid,FD.issuedDate,FD.validFrom,FD.validTo,FD.action,FD.status,FD.channel,FD.propertyid,FD.noofbuildings,FD.additionaldetail,FBA.uuid as puuid,FBA.doorno as pdoorno,FBA.latitude as platitude,FBA.longitude as plongitude,FBA.buildingName as pbuildingname,FBA.addressnumber as paddressnumber,FBA.pincode as ppincode,FBA.locality as plocality,FBA.city as pcity,FBA.street as pstreet,FB.uuid as buildingid ,FB.name as buildingname,FB.usagetype,FO.uuid as ownerid,FO.ownertype,FO.useruuid,FO.relationship,FUOM.uuid as uomuuid,FUOM.code,FUOM.value,FUOM.activeuom,FBD.uuid as documentuuid,FUOM.active,FBD.documentType,FBD.filestoreid,FBD.documentuid,FBD.createdby as documentCreatedBy,FBD.lastmodifiedby as documentLastModifiedBy,FBD.createdtime as documentCreatedTime,FBD.lastmodifiedtime as documentLastModifiedTime FROM eg_fn_firenoc FN JOIN eg_fn_firenocdetail FD ON (FN.uuid = FD.firenocuuid) JOIN eg_fn_address FBA ON (FD.uuid = FBA.firenocdetailsuuid) JOIN eg_fn_owner FO ON (FD.uuid = FO.firenocdetailsuuid) JOIN eg_fn_buidlings FB ON (FD.uuid = FB.firenocdetailsuuid) JOIN eg_fn_buildinguoms FUOM ON (FB.uuid = FUOM.buildinguuid) LEFT OUTER JOIN eg_fn_buildingdocuments FBD on(FB.uuid = FBD.buildinguuid)";
"SELECT FN.uuid as FID,FN.tenantid,FN.fireNOCNumber,FN.provisionfirenocnumber,FN.oldfirenocnumber,FN.dateofapplied,FN.createdBy,FN.createdTime,FN.lastModifiedBy,FN.lastModifiedTime,FD.uuid as firenocdetailsid,FD.action,FD.applicationnumber,FD.fireNOCType,FD.applicationdate,FD.financialYear,FD.firestationid,FD.issuedDate,FD.validFrom,FD.validTo,FD.action,FD.status,FD.channel,FD.propertyid,FD.noofbuildings,FD.additionaldetail,FBA.uuid as puuid,FBA.doorno as pdoorno,FBA.latitude as platitude,FBA.longitude as plongitude,FBA.buildingName as pbuildingname,FBA.addressnumber as paddressnumber,FBA.pincode as ppincode,FBA.locality as plocality,FBA.city as pcity,FBA.street as pstreet,FB.uuid as buildingid ,FB.name as buildingname,FB.usagetype,FO.uuid as ownerid,FO.ownertype,FO.applicantcategory,FO.useruuid,FO.relationship,FUOM.uuid as uomuuid,FUOM.code,FUOM.value,FUOM.activeuom,FBD.uuid as documentuuid,FUOM.active,FBD.documentType,FBD.filestoreid,FBD.documentuid,FBD.createdby as documentCreatedBy,FBD.lastmodifiedby as documentLastModifiedBy,FBD.createdtime as documentCreatedTime,FBD.lastmodifiedtime as documentLastModifiedTime FROM eg_fn_firenoc FN JOIN eg_fn_firenocdetail FD ON (FN.uuid = FD.firenocuuid) JOIN eg_fn_address FBA ON (FD.uuid = FBA.firenocdetailsuuid) JOIN eg_fn_owner FO ON (FD.uuid = FO.firenocdetailsuuid) JOIN eg_fn_buidlings FB ON (FD.uuid = FB.firenocdetailsuuid) JOIN eg_fn_buildinguoms FUOM ON (FB.uuid = FUOM.buildinguuid) LEFT OUTER JOIN eg_fn_buildingdocuments FBD on(FB.uuid = FBD.buildinguuid)";
// FBD.active=true AND FO.active=true AND FUOM.active=true AND";
//if citizen
const roles = get(request.body, "RequestInfo.userInfo.roles");
Expand Down
5 changes: 3 additions & 2 deletions municipal-services/firenoc-services/src/utils/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,23 @@ const fireNocOwnersRowMapper = async (row, mapper = []) => {
userName: row.username,
useruuid: row.useruuid,
active: row.active,
ownerType: row.ownertype,
ownerType: row.applicantcategory,
relationship: row.relationship,
tenantId: row.tenantId,
fatherOrHusbandName: ""
};

if (ownerIndex != -1) {
mapper[ownerIndex] = {
...ownerObject,
...mapper[ownerIndex]
};
mapper[ownerIndex].ownerType = row.applicantcategory;
} else {
let user = {};
if (row.useruuid) {
user = await searchUser(requestInfo, row.useruuid);
}
// console.info("user",user);
user = {
...ownerObject,
...user
Expand Down

0 comments on commit 8e742e1

Please sign in to comment.