From f6903901274c1d88d8abe64d4109d56a72ff1ebf Mon Sep 17 00:00:00 2001 From: sriramv Date: Sat, 30 Apr 2022 13:28:34 +0530 Subject: [PATCH] GWM --- .../entity.applicant.controller.js | 53 ++++++++++++++- app/routes/routes.js | 64 +++++++++++++------ 2 files changed, 96 insertions(+), 21 deletions(-) diff --git a/app/controllers/entity.applicant.controller.js b/app/controllers/entity.applicant.controller.js index 741cac6..0c2fb41 100644 --- a/app/controllers/entity.applicant.controller.js +++ b/app/controllers/entity.applicant.controller.js @@ -674,7 +674,7 @@ exports.EnquiriesAndDisbursementsList = async (req, res) => -// Entity and Applicant Name List Api for banking module +// Entity and Applicant Name List Api for banking module (not for this module use) exports.EntityApplicantNameList = async (req, res) => { try @@ -689,6 +689,57 @@ exports.EntityApplicantNameList = async (req, res) => } //end of try catch }; + +//this api for SalesPd module (not for this module use) +exports.MainApplicantDetailsList = async (req, res) => +{ + try + { + ApplicantsDetails.findOne({raw: true , where:{losid : req.query.losid ,applicant_type : "Main Applicant" , is_active : 1}}).then(data => + { + + + if(data) + { + res.send({'status':200,'message':"success",'data':data}); + } + else { + res.send({'status':404,'message':"failed",'data':"No data"}); + } + + }) + .catch(err => { + res.send({'status':404, + message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" }); + }); + + } catch(err) { + res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" }); + } //end of try catch + +}; + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/routes/routes.js b/app/routes/routes.js index 2ddf9d6..277570a 100644 --- a/app/routes/routes.js +++ b/app/routes/routes.js @@ -20,6 +20,49 @@ module.exports = app => { */ router.get("/demo", Testcontroller.Welcome); +// entity_applicant_name list for banking module +/** +* @swagger +* /api/entityApplicantNameList: +* get: +* summary: Entity & Applicant Name List for Banking module(not for this module use) +* description: Get Entity Applicant Name List for losid +* parameters: +* - in: query +* name: losid +* schema: +* type: string +* required: true +* description: Loan ID +* example: MW112233 +* responses: +* 200: +* description: success +*/ +router.get("/entityApplicantNameList", Entitycontroller.EntityApplicantNameList); + + +// Main ApplicantDetails for SalesPd module +/** +* @swagger +* /api/MainApplicantDetailsList: +* get: +* summary: Main ApplicantDetails for SalesPd module(not for this module use) +* description: Get Main ApplicantDetails +* parameters: +* - in: query +* name: losid +* schema: +* type: string +* required: true +* description: Loan ID +* example: MW112233 +* responses: +* 200: +* description: success +*/ +router.get("/MainApplicantDetailsList", Entitycontroller.MainApplicantDetailsList); + // Loan Details List Api /** @@ -35,26 +78,7 @@ router.get("/demo", Testcontroller.Welcome); router.get("/landingPageApi", Entitycontroller.LoanNumberDetailsList); -// entity_applicant_name list for banking module -/** -* @swagger -* /api/entityApplicantNameList: -* get: -* summary: Entity & Applicant Name List -* description: Get Entity Applicant Name List for losid -* parameters: -* - in: query -* name: losid -* schema: -* type: string -* required: true -* description: Loan ID -* example: MW112233 -* responses: -* 200: -* description: success -*/ -router.get("/entityApplicantNameList", Entitycontroller.EntityApplicantNameList); + // Entity Details List Api /**