From 30f04af0796d299146b3261b45db10953a3cb851 Mon Sep 17 00:00:00 2001 From: sriramv Date: Tue, 1 Mar 2022 10:49:26 +0530 Subject: [PATCH] master_api:GWM --- .../entity.applicant.controller.js | 159 ++++++++++- app/controllers/master.controller.js | 170 ++++++++++-- app/models/ApplicantsDetails.js | 8 +- app/models/ApplicantsRelationship.js | 22 +- app/models/CheckResultMaster.js | 22 ++ .../ChecktypeCheckresultRelationMaster.js | 22 ++ app/models/CityMaster.js | 22 ++ app/models/DueDiligenceCheck.js | 21 ++ app/models/EntityDetails.js | 2 +- app/models/LoanDetail.js | 35 +++ app/models/PinMaster.js | 20 ++ .../PropertyOwnershipIncomeConsidered.js | 28 ++ app/models/ResidenceAddressDetails.js | 5 +- app/models/StateMaster.js | 20 ++ app/routes/routes.js | 247 +++++++++++++++++- 15 files changed, 745 insertions(+), 58 deletions(-) create mode 100644 app/models/CheckResultMaster.js create mode 100644 app/models/ChecktypeCheckresultRelationMaster.js create mode 100644 app/models/CityMaster.js create mode 100644 app/models/DueDiligenceCheck.js create mode 100644 app/models/LoanDetail.js create mode 100644 app/models/PinMaster.js create mode 100644 app/models/PropertyOwnershipIncomeConsidered.js create mode 100644 app/models/StateMaster.js diff --git a/app/controllers/entity.applicant.controller.js b/app/controllers/entity.applicant.controller.js index d0409f6..b6bdfd8 100644 --- a/app/controllers/entity.applicant.controller.js +++ b/app/controllers/entity.applicant.controller.js @@ -1,4 +1,4 @@ -const { sequelize,EntityApplicantMaster} = require('../models') +const { sequelize , EntityDetails , ApplicantsDetails , ApplicantsRelationship , ResidenceAddressDetails , PropertyOwnershipIncomeConsidered} = require('../models') const { logMsg } = require('../services/logger.js'); @@ -7,10 +7,9 @@ exports.createEntityDetails = async (req, res) => { try { - await EntityApplicantMaster.create(req.body) - .then(data => + EntityDetails.create(req.body).then(data => { - res.send({'status':200,'message':"success",'Data':data}); + res.send({'status':200,'message':"success",'data':data}); logMsg.info("Master Data List api call Success"); }) .catch(err => { @@ -24,3 +23,155 @@ exports.createEntityDetails = async (req, res) => }; + +exports.createApplicantDetails = async (req, res) => +{ + try + { + ApplicantsRelationshipData = req.body.applicant_relationship; + ResidenceAddressDetailsData = req.body.residence_address; + PropertyOwnershipIncomeConsideredData = req.body.property_ownership_income_considered; + delete req.body.applicant_relationship + delete req.body.residence_address + delete req.body.property_ownership_income_considered ; + + await ApplicantsDetails.create(req.body).then(async (data) => + { + if(req.body.entity_type == "Individual") + { + + ApplicantsRelationshipData = Object.assign(ApplicantsRelationshipData, {applicant_id: data.dataValues.id}); + await ApplicantsRelationship.create(ApplicantsRelationshipData) + .then(data=>{logMsg.info("ApplicantsRelationship inserted");}).catch(err=>{logMsg.info("ApplicantsRelationship Failed , Msg :" +err);}); + + + ResidenceAddressDetailsData = Object.assign(ResidenceAddressDetailsData, {applicant_id: data.dataValues.id}); + await ResidenceAddressDetails.create(ResidenceAddressDetailsData) + .then(data=>{logMsg.info("ResidenceAddressDetails inserted");}).catch(err=>{logMsg.info("ResidenceAddressDetails Failed , Msg :" +err);}); + + + PropertyOwnershipIncomeConsideredData = Object.assign(PropertyOwnershipIncomeConsideredData, {applicant_id: data.dataValues.id}); + await PropertyOwnershipIncomeConsidered.create(PropertyOwnershipIncomeConsideredData) + .then(data=>{logMsg.info("PropertyOwnershipIncomeConsidered inserted");}).catch(err=>{logMsg.info("PropertyOwnershipIncomeConsidered Failed , Msg :" +err);}); + } + else { + PropertyOwnershipIncomeConsideredData = Object.assign(PropertyOwnershipIncomeConsideredData, {applicant_id: data.dataValues.id}); + await PropertyOwnershipIncomeConsidered.create(PropertyOwnershipIncomeConsideredData) + .then(data=>{logMsg.info("PropertyOwnershipIncomeConsidered inserted");}).catch(err=>{logMsg.info("PropertyOwnershipIncomeConsidered Failed , Msg :" +err);}); + } + + // send response here + res.send({'status':200,'message':"success",'data':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 + +}; + + +exports.EntityDetailsList = async (req, res) => +{ + try + { + EntityDetails.findAll({where:{loan_no_id : req.query.loan_no_id}}).then(data => + { + res.send({'status':200,'message':"success",'data':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 + +}; + +exports.ApplicantDetailsList = async (req, res) => +{ + try + { + ApplicantsDetails.findAll({where:{loan_no_id : req.query.loan_no_id}}).then(data => + { + res.send({'status':200,'message':"success",'data':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 + +}; + +exports.ApplicantRelationshipList = async (req, res) => +{ + try + { + ApplicantsRelationship.findAll({where:{loan_no_id : req.query.loan_no_id }}).then(data => + { + res.send({'status':200,'message':"success",'data':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 + +}; + +exports.ResidenceAddressDetailsList = async (req, res) => +{ + try + { + ResidenceAddressDetails.findAll({where:{loan_no_id : req.query.loan_no_id }}).then(data => + { + res.send({'status':200,'message':"success",'data':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 + +}; + +exports.PropertyOwnershipList = async (req, res) => +{ + try + { + PropertyOwnershipIncomeConsidered.findAll({where:{loan_no_id : req.query.loan_no_id }}).then(data => + { + res.send({'status':200,'message':"success",'data':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 + +}; \ No newline at end of file diff --git a/app/controllers/master.controller.js b/app/controllers/master.controller.js index 8008623..5fe277e 100644 --- a/app/controllers/master.controller.js +++ b/app/controllers/master.controller.js @@ -1,28 +1,142 @@ -const { sequelize,EntityApplicantMaster} = require('../models') -const { logMsg } = require('../services/logger.js'); - -exports.MasterData = async (req, res) => -{ - try - { - await EntityApplicantMaster.findAll({where :{is_active : 1} }) - .then(data => - { - res.send({'status':200,'message':"success",'EntityApplicantMasterData':data}); - logMsg.info("Master Data List api call Success"); - }) - .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 - -}; - - - +const { sequelize,EntityApplicantMaster,StateMaster,CityMaster,PinMaster,ChecktypeCheckresultRelationMaster + ,DueDiligenceCheck,CheckResultMaster} = require('../models') + const { logMsg } = require('../services/logger.js'); + + + // select entityMaster data + exports.EntityApplicantMasterData = async (req, res) => + { + try + { + await EntityApplicantMaster.findAll({where :{is_active : 1} }) + .then(data => + { + res.send({'status':200,'message':"success",'data':data}); + logMsg.info("Master Data List api call Success"); + }) + .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 + + }; + + // create entity master data + exports.CreateEntityApplicantMasterData = async (req, res) => + { + + try + { + await EntityApplicantMaster.create(req.body) + .then(data => + { + res.send({'status':200,'message':"success",'data':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 + + }; + + + // select state master data + exports.StateMasterData = async (req, res) => + { + try + { + await StateMaster.findAll() + .then(data => + { + res.send({'status':200,'message':"success",'data':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 + + }; + + // select city master data + exports.CityMasterData = async (req, res) => + { + try + { + await CityMaster.findAll({ where : { "state_id" : req.query.state_id }}) + .then(data => + { + res.send({'status':200,'message':"success",'data':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 + + }; + + // select pin master data + exports.PinMasterData = async (req, res) => + { + try + { + await PinMaster.findAll({ where : { "state_id" : req.query.state_id }}) + .then(data => + { + res.send({'status':200,'message':"success",'data':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 + + }; + + exports.CheckResultMaster = async (req, res) => + { + try + { + const storeData = await sequelize.query('SELECT checktype_checkresult_relation_master.check_type_id , checktype_checkresult_relation_master.check_result_id, due_diligence_checks.check_type AS check_type, check_result_master.value AS check_result FROM checktype_checkresult_relation_master JOIN due_diligence_checks ON checktype_checkresult_relation_master.check_type_id = due_diligence_checks.id JOIN check_result_master ON checktype_checkresult_relation_master.check_result_id = check_result_master.id') + res.send({'status':200,'message':"success",'data':storeData}); + } catch(err) { + res.send({'status':404, + message: err.message || "Some error occurred while inserting statements." ,'data': "No data" + }); + } //end of try catch + + + }; + \ No newline at end of file diff --git a/app/models/ApplicantsDetails.js b/app/models/ApplicantsDetails.js index 839027f..21bf83d 100644 --- a/app/models/ApplicantsDetails.js +++ b/app/models/ApplicantsDetails.js @@ -16,13 +16,13 @@ module.exports = (sequelize, DataTypes) => { } ApplicantsDetails.init( { - entity_details_id: { type: DataTypes.INTEGER }, + loan_no_id: { type: DataTypes.INTEGER }, name: { type: DataTypes.STRING }, entity_type: { type: DataTypes.STRING }, designation: { type: DataTypes.STRING }, - ownership_share_in_the_entity: { type: DataTypes.STRING }, - designatapplicant_typeion: { type: DataTypes.STRING }, - key_promoter: { type: DataTypes.INTEGER }, + ownership_share_in_the_entity: { type: DataTypes.INTEGER }, + applicant_type: { type: DataTypes.STRING }, + key_promoter: { type: DataTypes.STRING }, bureau_name: { type: DataTypes.STRING }, bureau_score: { type: DataTypes.STRING }, heir_in_business_and_on_loan_struct: { type: DataTypes.STRING }, diff --git a/app/models/ApplicantsRelationship.js b/app/models/ApplicantsRelationship.js index 2a8cfd4..97cbfea 100644 --- a/app/models/ApplicantsRelationship.js +++ b/app/models/ApplicantsRelationship.js @@ -2,38 +2,30 @@ const { Model } = require('sequelize') module.exports = (sequelize, DataTypes) => { class ApplicantsRelationship extends Model { - /** - * Helper method for defining associations. - * This method is not a part of Sequelize lifecycle. - * The `models/index` file will call this method automatically. - */ - // define association here - // static associate({ Financials }) { - // this.hasMany(Financials, { foreignKey: 'entity_id', as: 'financialsData' }) - // } - + } ApplicantsRelationship.init( { + loan_no_id: { type: DataTypes.INTEGER }, applicant_id: { type: DataTypes.INTEGER }, name_of_the_individual: { type: DataTypes.STRING }, related_to: { type: DataTypes.STRING }, relationship: { type: DataTypes.STRING }, - is_main_person_running_the_business: { type: DataTypes.INTEGER }, + is_main_person_running_the_business: { type: DataTypes.STRING }, no_of_years_in_this_entity: { type: DataTypes.INTEGER }, no_of_years_in_same_line_of_buss: { type: DataTypes.INTEGER }, - dob: { type: DataTypes.INTEGER }, + dob: { type: DataTypes.DATEONLY }, age: { type: DataTypes.INTEGER }, gender: { type: DataTypes.STRING }, remarks: { type: DataTypes.STRING }, - createdby: { type: DataTypes.INTEGER }, - updatedby: { type: DataTypes.INTEGER }, + createdBy: { type: DataTypes.INTEGER }, + updatedBy: { type: DataTypes.INTEGER }, }, { sequelize, - tableName: 'applicants_relationship', + tableName: 'applicants_relationships', modelName: 'ApplicantsRelationship', } ) diff --git a/app/models/CheckResultMaster.js b/app/models/CheckResultMaster.js new file mode 100644 index 0000000..c366316 --- /dev/null +++ b/app/models/CheckResultMaster.js @@ -0,0 +1,22 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class CheckResultMaster extends Model { + + } + CheckResultMaster.init( + { + value: { type: DataTypes.STRING } + }, + { + sequelize, + tableName: 'check_result_master', + modelName: 'CheckResultMaster', + } + ) + + + + + return CheckResultMaster +} \ No newline at end of file diff --git a/app/models/ChecktypeCheckresultRelationMaster.js b/app/models/ChecktypeCheckresultRelationMaster.js new file mode 100644 index 0000000..64cd05a --- /dev/null +++ b/app/models/ChecktypeCheckresultRelationMaster.js @@ -0,0 +1,22 @@ +'use strict' +const { Model } = require('sequelize') + +module.exports = (sequelize, DataTypes) => { + class ChecktypeCheckresultRelationMaster extends Model { + + } + ChecktypeCheckresultRelationMaster.init( + { + check_type_id: { type: DataTypes.INTEGER }, + check_result_id: { type: DataTypes.INTEGER } + }, + { + sequelize, + tableName: 'checktype_checkresult_relation_master', + modelName: 'ChecktypeCheckresultRelationMaster', + } + ) + + + return ChecktypeCheckresultRelationMaster +} \ No newline at end of file diff --git a/app/models/CityMaster.js b/app/models/CityMaster.js new file mode 100644 index 0000000..257cdfc --- /dev/null +++ b/app/models/CityMaster.js @@ -0,0 +1,22 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class CityMaster extends Model { + + } + CityMaster.init( + { + state_id: { type: DataTypes.INTEGER }, + city: { type: DataTypes.STRING } + + }, + { + sequelize, + tableName: 'city_master', + modelName: 'CityMaster', + } + ) + + return CityMaster +} + diff --git a/app/models/DueDiligenceCheck.js b/app/models/DueDiligenceCheck.js new file mode 100644 index 0000000..2916898 --- /dev/null +++ b/app/models/DueDiligenceCheck.js @@ -0,0 +1,21 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class DueDiligenceCheck extends Model { + + } + DueDiligenceCheck.init( + { + check_type: { type: DataTypes.STRING }, + check_result: { type: DataTypes.STRING }, + remarks: { type: DataTypes.STRING } + }, + { + sequelize, + tableName: 'due_diligence_checks', + modelName: 'DueDiligenceCheck', + } + ) + + return DueDiligenceCheck +} \ No newline at end of file diff --git a/app/models/EntityDetails.js b/app/models/EntityDetails.js index 93ade5b..ecfc27b 100644 --- a/app/models/EntityDetails.js +++ b/app/models/EntityDetails.js @@ -31,7 +31,7 @@ module.exports = (sequelize, DataTypes) => { registered_address_state: { type: DataTypes.STRING }, registered_address_city: { type: DataTypes.STRING }, registered_address_pin: { type: DataTypes.INTEGER }, - registered_address_registered_address_ownership_statuspin: { type: DataTypes.STRING }, + registered_address_ownership_status: { type: DataTypes.STRING }, operating_address_of_business: { type: DataTypes.STRING }, operating_address_ownership_status: { type: DataTypes.STRING }, operating_address_city_category: { type: DataTypes.STRING }, diff --git a/app/models/LoanDetail.js b/app/models/LoanDetail.js new file mode 100644 index 0000000..b24dafb --- /dev/null +++ b/app/models/LoanDetail.js @@ -0,0 +1,35 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class LoanDetail extends Model { + + } + LoanDetail.init( + { + loan_no: { type: DataTypes.INTEGER }, + date_of_login: { type: DataTypes.INTEGER }, + sourcing_channel_type: { type: DataTypes.INTEGER }, + sourcing_channel_name: { type: DataTypes.INTEGER }, + proposal: { type: DataTypes.INTEGER }, + sanction_date_of_earlier_exposure: { type: DataTypes.INTEGER }, + sanction_amount_of_earlier_exposure: { type: DataTypes.INTEGER }, + current_outstnd_bal_of_earlier_exposure: { type: DataTypes.INTEGER }, + emi_of_earlier_exposure: { type: DataTypes.INTEGER }, + additional_loan_amnt_applied_for: { type: DataTypes.INTEGER }, + insurance_premium_amnt_being_funded: { type: DataTypes.INTEGER }, + insurance_premium_loan_applied_for: { type: DataTypes.INTEGER }, + additional_loan_amnt_applied_for_and_insu_premium: { type: DataTypes.INTEGER }, + load_tenure_applied_for_months: { type: DataTypes.INTEGER }, + rate_of_interest_per_annum: { type: DataTypes.INTEGER }, + emi_per_lac_of_loan: { type: DataTypes.INTEGER }, + purpose_of_loan: { type: DataTypes.INTEGER }, + emi_of_loan_applied_for: { type: DataTypes.INTEGER } + }, + { + sequelize, + tableName: 'load_details', + modelName: 'LoanDetail', + } + ) + return LoanDetail +} \ No newline at end of file diff --git a/app/models/PinMaster.js b/app/models/PinMaster.js new file mode 100644 index 0000000..f2afb29 --- /dev/null +++ b/app/models/PinMaster.js @@ -0,0 +1,20 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class PinMaster extends Model { + + } + PinMaster.init( + { + state_id: { type: DataTypes.STRING }, + pin: { type: DataTypes.INTEGER } + + }, + { + sequelize, + tableName: 'pin_master', + modelName: 'PinMaster', + } + ) + return PinMaster +} diff --git a/app/models/PropertyOwnershipIncomeConsidered.js b/app/models/PropertyOwnershipIncomeConsidered.js new file mode 100644 index 0000000..fb8e418 --- /dev/null +++ b/app/models/PropertyOwnershipIncomeConsidered.js @@ -0,0 +1,28 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class PropertyOwnershipIncomeConsidered extends Model { + + } + PropertyOwnershipIncomeConsidered.init( + { + loan_no_id: { type: DataTypes.INTEGER }, + applicant_id: { type: DataTypes.INTEGER }, + name_of_the_loan_applicants: { type: DataTypes.STRING }, + applicant_type: { type: DataTypes.STRING }, + income_considered: { type: DataTypes.STRING }, + property_owner: { type: DataTypes.STRING }, + createdby: { type: DataTypes.INTEGER }, + updatedby: { type: DataTypes.INTEGER }, + }, + { + sequelize, + tableName: 'property_ownership_income_considered', + modelName: 'PropertyOwnershipIncomeConsidered', + } + ) + + + + return PropertyOwnershipIncomeConsidered +} diff --git a/app/models/ResidenceAddressDetails.js b/app/models/ResidenceAddressDetails.js index b47b8be..f6e48c6 100644 --- a/app/models/ResidenceAddressDetails.js +++ b/app/models/ResidenceAddressDetails.js @@ -16,14 +16,15 @@ module.exports = (sequelize, DataTypes) => { } ResidenceAddressDetails.init( { - entity_details_id: { type: DataTypes.INTEGER }, + loan_no_id: { type: DataTypes.INTEGER }, + applicant_id: { type: DataTypes.INTEGER }, name_of_the_individual: { type: DataTypes.STRING }, residence_address: { type: DataTypes.STRING }, residence_geo_limit_compliance: { type: DataTypes.STRING }, residence_location_area: { type: DataTypes.STRING }, ownership_status: { type: DataTypes.STRING }, residence_stay_period_in_years: { type: DataTypes.INTEGER }, - residence_stay_period_in_bracket: { type: DataTypes.INTEGER }, + residence_stay_period_in_bracket: { type: DataTypes.STRING }, remarks: { type: DataTypes.STRING }, createdby: { type: DataTypes.INTEGER }, updatedby: { type: DataTypes.INTEGER }, diff --git a/app/models/StateMaster.js b/app/models/StateMaster.js new file mode 100644 index 0000000..07dcdf4 --- /dev/null +++ b/app/models/StateMaster.js @@ -0,0 +1,20 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class StateMaster extends Model { + + } + StateMaster.init( + { + state: { type: DataTypes.STRING } + + }, + { + sequelize, + tableName: 'state_master', + modelName: 'StateMaster', + } + ) + return StateMaster +} + diff --git a/app/routes/routes.js b/app/routes/routes.js index bc75c78..c2db03b 100644 --- a/app/routes/routes.js +++ b/app/routes/routes.js @@ -7,7 +7,7 @@ module.exports = app => { const { logMsg } = require('../services/logger.js'); var router = require("express").Router(); - +// demo welcome Api // /** * @swagger * /api/demo: @@ -19,6 +19,113 @@ module.exports = app => { * description: success */ router.get("/demo", Testcontroller.Welcome); + +// Entity Details List Api // +/** +* @swagger +* /api/entityDetailsList: +* get: +* summary: Entity Details List +* description: Get Entity List by sending Los id (Primary key) +* parameters: +* - in: query +* name: loan_no_id +* schema: +* type: integer +* required: true +* description: id of the Loan Details (primart key of Los_id) +* example: 1 +* responses: +* 200: +* description: success +*/ +router.get("/entityDetailsList", Entitycontroller.EntityDetailsList); + +// Applicant Details List Api // +/** +* @swagger +* /api/applicantDetailsList: +* get: +* summary: Applicants Details List +* description: Get Applicant List by sending Los id (Primery key) +* parameters: +* - in: query +* name: loan_no_id +* schema: +* type: integer +* required: true +* description: id of the Loan Details (primart key of Los_id) +* example: 1 +* responses: +* 200: +* description: success +*/ +router.get("/applicantDetailsList", Entitycontroller.ApplicantDetailsList); + +// Applicants relationship List Api // +/** +* @swagger +* /api/applicantRelationshipList: +* get: +* summary: Applicant Relationship List +* description: Get Applicant Relationship List by sending Los id(Primery key) +* parameters: +* - in: query +* name: loan_no_id +* schema: +* type: integer +* required: true +* description: id of the Loan Details (primart key of Los_id) +* example: 1 +* responses: +* 200: +* description: success +*/ +router.get("/applicantRelationshipList", Entitycontroller.ApplicantRelationshipList); + +// Residence Address Details List Api // +/** +* @swagger +* /api/residenceAddressDetailsList: +* get: +* summary: Residence Addres sDetails List +* description: Get Residence Address Details List by sending Los id(Primery key) +* parameters: +* - in: query +* name: loan_no_id +* schema: +* type: integer +* required: true +* description: id of the Loan Details (primart key of Los_id) +* example: 1 +* responses: +* 200: +* description: success +*/ +router.get("/residenceAddressDetailsList", Entitycontroller.ResidenceAddressDetailsList); + +// Property Ownership Income Considered Details List Api // +/** +* @swagger +* /api/propertyOwnershipList: +* get: +* summary: Property Ownership Income Considered List +* description: Get Property Ownership Income Considered List by sending Los id(Primery key) +* parameters: +* - in: query +* name: loan_no_id +* schema: +* type: integer +* required: true +* description: id of the Loan Details (primart key of Los_id) +* example: 1 +* responses: +* 200: +* description: success +*/ +router.get("/propertyOwnershipList", Entitycontroller.PropertyOwnershipList); + +// Create new Entity Details // /** * @swagger * definitions: @@ -65,15 +172,20 @@ router.get("/demo", Testcontroller.Welcome); */ router.post("/createEntityDetails", Entitycontroller.createEntityDetails); +// Create new Applicant and it's child Details (Relationship, Address, Property ownership) // +router.post("/createApplicantDetails", Entitycontroller.createApplicantDetails); + + + // Master data Api's - +// EntityApplicantMaster data select api /** * @swagger -* /api/MasterData: +* /api/dropdownMasterData: * get: * summary: Dropdown master data Api * description: All master data for dropdown value @@ -81,10 +193,137 @@ router.post("/createEntityDetails", Entitycontroller.createEntityDetails); * 200: * description: success */ -router.get("/MasterData", Mastercontroller.MasterData); +router.get("/entityApplicantMasterData", Mastercontroller.EntityApplicantMasterData); //line 7 +// create EntityApplicantMasterData api +/** +* @swagger +* definitions: +* createEntityApplicantMasterData: +* type: object +* properties: +* master_name: +* type: string +* description: masterName +* example: abcd +* value: +* type: string +* description: masterValue +* example: ABCD +* sub_value: +* type: string +* description: subValue +* example: Negative +* is_active: +* type: integer +* description: isactive +* example: 1 +*/ +/** +* @swagger +* /api/createEntityApplicantMasterData: +* post: +* summary: create entity applicant details +* description: create a new entity applicant +* requestBody: +* content: +* application/json: +* schema: +* $ref: '#/definitions/createEntityApplicantMasterData' +* responses: +* 200: +* description: New entity applicant details inserted +* 500: +* description: failure in inserting entity applicant details +*/ +router.post("/createEntityApplicantMasterData", Mastercontroller.CreateEntityApplicantMasterData); // line 31 + + + +// StateMasterData select api + +/** +* @swagger +* /api/stateMasterData: +* get: +* summary: Dropdown state master data Api +* description: All master data for dropdown value +* responses: +* 200: +* description: success +*/ +router.get("/stateMasterData", Mastercontroller.StateMasterData); // line 82 + + + + +// CityMasterData select api + +/** +* @swagger +* /api/cityMasterData: +* get: +* summary: Dropdown city master data Api +* description: All master data for dropdown value +* parameters: +* - in: query +* name: state_id +* schema: +* type: integer +* required: true +* description: id of the stateMaster (primart key of state value) +* example: 1 +* responses: +* 200: +* description: success +*/ +router.get("/cityMasterData", Mastercontroller.CityMasterData); // line 106 + + + + +// PinMasterData select api + +/** +* @swagger +* /api/pinMasterData: +* get: +* summary: Dropdown pin master data Api +* description: pin code master data for dropdown value +* parameters: +* - in: query +* name: state_id +* schema: +* type: integer +* required: true +* description: id of the stateMaster (primart key of state value) +* example: 1 +* responses: +* 200: +* description: success +*/ +router.get("/pinMasterData", Mastercontroller.PinMasterData); // line 130 + + + + +// CheckResultMaster select api + +/** +* @swagger +* /api/checkResultMasterData: +* get: +* summary: Due Diligence Check master data Api +* description: Due Diligence Check master data for dropdown value +* responses: +* 200: +* description: success +*/ +router.get("/checkResultMasterData", Mastercontroller.CheckResultMaster); + +