master_api:GWM
This commit is contained in:
parent
18f47e3473
commit
30f04af079
@ -1,4 +1,4 @@
|
|||||||
const { sequelize,EntityApplicantMaster} = require('../models')
|
const { sequelize , EntityDetails , ApplicantsDetails , ApplicantsRelationship , ResidenceAddressDetails , PropertyOwnershipIncomeConsidered} = require('../models')
|
||||||
const { logMsg } = require('../services/logger.js');
|
const { logMsg } = require('../services/logger.js');
|
||||||
|
|
||||||
|
|
||||||
@ -7,10 +7,9 @@ exports.createEntityDetails = async (req, res) =>
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await EntityApplicantMaster.create(req.body)
|
EntityDetails.create(req.body).then(data =>
|
||||||
.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");
|
logMsg.info("Master Data List api call Success");
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.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
|
||||||
|
|
||||||
|
};
|
||||||
@ -1,14 +1,17 @@
|
|||||||
const { sequelize,EntityApplicantMaster} = require('../models')
|
const { sequelize,EntityApplicantMaster,StateMaster,CityMaster,PinMaster,ChecktypeCheckresultRelationMaster
|
||||||
|
,DueDiligenceCheck,CheckResultMaster} = require('../models')
|
||||||
const { logMsg } = require('../services/logger.js');
|
const { logMsg } = require('../services/logger.js');
|
||||||
|
|
||||||
exports.MasterData = async (req, res) =>
|
|
||||||
|
// select entityMaster data
|
||||||
|
exports.EntityApplicantMasterData = async (req, res) =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await EntityApplicantMaster.findAll({where :{is_active : 1} })
|
await EntityApplicantMaster.findAll({where :{is_active : 1} })
|
||||||
.then(data =>
|
.then(data =>
|
||||||
{
|
{
|
||||||
res.send({'status':200,'message':"success",'EntityApplicantMasterData':data});
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
logMsg.info("Master Data List api call Success");
|
logMsg.info("Master Data List api call Success");
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@ -24,5 +27,116 @@ exports.MasterData = async (req, res) =>
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 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
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
@ -16,13 +16,13 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
}
|
}
|
||||||
ApplicantsDetails.init(
|
ApplicantsDetails.init(
|
||||||
{
|
{
|
||||||
entity_details_id: { type: DataTypes.INTEGER },
|
loan_no_id: { type: DataTypes.INTEGER },
|
||||||
name: { type: DataTypes.STRING },
|
name: { type: DataTypes.STRING },
|
||||||
entity_type: { type: DataTypes.STRING },
|
entity_type: { type: DataTypes.STRING },
|
||||||
designation: { type: DataTypes.STRING },
|
designation: { type: DataTypes.STRING },
|
||||||
ownership_share_in_the_entity: { type: DataTypes.STRING },
|
ownership_share_in_the_entity: { type: DataTypes.INTEGER },
|
||||||
designatapplicant_typeion: { type: DataTypes.STRING },
|
applicant_type: { type: DataTypes.STRING },
|
||||||
key_promoter: { type: DataTypes.INTEGER },
|
key_promoter: { type: DataTypes.STRING },
|
||||||
bureau_name: { type: DataTypes.STRING },
|
bureau_name: { type: DataTypes.STRING },
|
||||||
bureau_score: { type: DataTypes.STRING },
|
bureau_score: { type: DataTypes.STRING },
|
||||||
heir_in_business_and_on_loan_struct: { type: DataTypes.STRING },
|
heir_in_business_and_on_loan_struct: { type: DataTypes.STRING },
|
||||||
|
|||||||
@ -2,38 +2,30 @@
|
|||||||
const { Model } = require('sequelize')
|
const { Model } = require('sequelize')
|
||||||
module.exports = (sequelize, DataTypes) => {
|
module.exports = (sequelize, DataTypes) => {
|
||||||
class ApplicantsRelationship extends Model {
|
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(
|
ApplicantsRelationship.init(
|
||||||
{
|
{
|
||||||
|
loan_no_id: { type: DataTypes.INTEGER },
|
||||||
applicant_id: { type: DataTypes.INTEGER },
|
applicant_id: { type: DataTypes.INTEGER },
|
||||||
name_of_the_individual: { type: DataTypes.STRING },
|
name_of_the_individual: { type: DataTypes.STRING },
|
||||||
related_to: { type: DataTypes.STRING },
|
related_to: { type: DataTypes.STRING },
|
||||||
relationship: { 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_this_entity: { type: DataTypes.INTEGER },
|
||||||
no_of_years_in_same_line_of_buss: { 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 },
|
age: { type: DataTypes.INTEGER },
|
||||||
gender: { type: DataTypes.STRING },
|
gender: { type: DataTypes.STRING },
|
||||||
remarks: { type: DataTypes.STRING },
|
remarks: { type: DataTypes.STRING },
|
||||||
createdby: { type: DataTypes.INTEGER },
|
createdBy: { type: DataTypes.INTEGER },
|
||||||
updatedby: { type: DataTypes.INTEGER },
|
updatedBy: { type: DataTypes.INTEGER },
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sequelize,
|
sequelize,
|
||||||
tableName: 'applicants_relationship',
|
tableName: 'applicants_relationships',
|
||||||
modelName: 'ApplicantsRelationship',
|
modelName: 'ApplicantsRelationship',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
22
app/models/CheckResultMaster.js
Normal file
22
app/models/CheckResultMaster.js
Normal file
@ -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
|
||||||
|
}
|
||||||
22
app/models/ChecktypeCheckresultRelationMaster.js
Normal file
22
app/models/ChecktypeCheckresultRelationMaster.js
Normal file
@ -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
|
||||||
|
}
|
||||||
22
app/models/CityMaster.js
Normal file
22
app/models/CityMaster.js
Normal file
@ -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
|
||||||
|
}
|
||||||
|
|
||||||
21
app/models/DueDiligenceCheck.js
Normal file
21
app/models/DueDiligenceCheck.js
Normal file
@ -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
|
||||||
|
}
|
||||||
@ -31,7 +31,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
registered_address_state: { type: DataTypes.STRING },
|
registered_address_state: { type: DataTypes.STRING },
|
||||||
registered_address_city: { type: DataTypes.STRING },
|
registered_address_city: { type: DataTypes.STRING },
|
||||||
registered_address_pin: { type: DataTypes.INTEGER },
|
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_of_business: { type: DataTypes.STRING },
|
||||||
operating_address_ownership_status: { type: DataTypes.STRING },
|
operating_address_ownership_status: { type: DataTypes.STRING },
|
||||||
operating_address_city_category: { type: DataTypes.STRING },
|
operating_address_city_category: { type: DataTypes.STRING },
|
||||||
|
|||||||
35
app/models/LoanDetail.js
Normal file
35
app/models/LoanDetail.js
Normal file
@ -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
|
||||||
|
}
|
||||||
20
app/models/PinMaster.js
Normal file
20
app/models/PinMaster.js
Normal file
@ -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
|
||||||
|
}
|
||||||
28
app/models/PropertyOwnershipIncomeConsidered.js
Normal file
28
app/models/PropertyOwnershipIncomeConsidered.js
Normal file
@ -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
|
||||||
|
}
|
||||||
@ -16,14 +16,15 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
}
|
}
|
||||||
ResidenceAddressDetails.init(
|
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 },
|
name_of_the_individual: { type: DataTypes.STRING },
|
||||||
residence_address: { type: DataTypes.STRING },
|
residence_address: { type: DataTypes.STRING },
|
||||||
residence_geo_limit_compliance: { type: DataTypes.STRING },
|
residence_geo_limit_compliance: { type: DataTypes.STRING },
|
||||||
residence_location_area: { type: DataTypes.STRING },
|
residence_location_area: { type: DataTypes.STRING },
|
||||||
ownership_status: { type: DataTypes.STRING },
|
ownership_status: { type: DataTypes.STRING },
|
||||||
residence_stay_period_in_years: { type: DataTypes.INTEGER },
|
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 },
|
remarks: { type: DataTypes.STRING },
|
||||||
createdby: { type: DataTypes.INTEGER },
|
createdby: { type: DataTypes.INTEGER },
|
||||||
updatedby: { type: DataTypes.INTEGER },
|
updatedby: { type: DataTypes.INTEGER },
|
||||||
|
|||||||
20
app/models/StateMaster.js
Normal file
20
app/models/StateMaster.js
Normal file
@ -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
|
||||||
|
}
|
||||||
|
|
||||||
@ -7,7 +7,7 @@ module.exports = app => {
|
|||||||
const { logMsg } = require('../services/logger.js');
|
const { logMsg } = require('../services/logger.js');
|
||||||
var router = require("express").Router();
|
var router = require("express").Router();
|
||||||
|
|
||||||
|
// demo welcome Api //
|
||||||
/**
|
/**
|
||||||
* @swagger
|
* @swagger
|
||||||
* /api/demo:
|
* /api/demo:
|
||||||
@ -19,6 +19,113 @@ module.exports = app => {
|
|||||||
* description: success
|
* description: success
|
||||||
*/
|
*/
|
||||||
router.get("/demo", Testcontroller.Welcome);
|
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
|
* @swagger
|
||||||
* definitions:
|
* definitions:
|
||||||
@ -65,15 +172,20 @@ router.get("/demo", Testcontroller.Welcome);
|
|||||||
*/
|
*/
|
||||||
router.post("/createEntityDetails", Entitycontroller.createEntityDetails);
|
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
|
// Master data Api's
|
||||||
|
|
||||||
|
// EntityApplicantMaster data select api
|
||||||
/**
|
/**
|
||||||
* @swagger
|
* @swagger
|
||||||
* /api/MasterData:
|
* /api/dropdownMasterData:
|
||||||
* get:
|
* get:
|
||||||
* summary: Dropdown master data Api
|
* summary: Dropdown master data Api
|
||||||
* description: All master data for dropdown value
|
* description: All master data for dropdown value
|
||||||
@ -81,10 +193,137 @@ router.post("/createEntityDetails", Entitycontroller.createEntityDetails);
|
|||||||
* 200:
|
* 200:
|
||||||
* description: success
|
* 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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user