Compare commits
10 Commits
99bd0f7fca
...
11abe74a92
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11abe74a92 | ||
|
|
0a2b851299 | ||
|
|
a89f31dea1 | ||
|
|
3510041eeb | ||
|
|
98d4df2e8d | ||
|
|
2e8f5fbb6d | ||
|
|
1d86263f94 | ||
|
|
65c4651913 | ||
|
|
5175982cbf | ||
|
|
eb6dd5dff7 |
@ -932,7 +932,28 @@ exports.PropertyAndLtvList = async (req, res) =>
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//delete Property & LTV Details Api
|
||||||
|
exports.deletePropertyAndLtv = async (req, res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
PropertyAndLtv.update({is_active:0},{ where: { id: req.query.id }})
|
||||||
|
.then(data =>
|
||||||
|
{
|
||||||
|
res.send({'status':200,'message':"success",'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
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//create LoanDetail Api
|
//create LoanDetail Api
|
||||||
exports.createLoanDetail = async (req, res) =>
|
exports.createLoanDetail = async (req, res) =>
|
||||||
|
|||||||
@ -16,10 +16,10 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
if(req.query.is_loan_api_call == 0)
|
if(req.query.is_loan_api_call == 0)
|
||||||
{
|
{
|
||||||
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
||||||
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
|
include: [{ model: EntityDetails , // Set the alias for the relationship
|
||||||
attributes: [
|
attributes: [
|
||||||
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
|
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
|
||||||
] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data =>
|
] }] }).then(data =>
|
||||||
{
|
{
|
||||||
if(data.length > 0)
|
if(data.length > 0)
|
||||||
{
|
{
|
||||||
@ -59,11 +59,11 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
//Module Wise Completion Status Data Creation Helper Call
|
//Module Wise Completion Status Data Creation Helper Call
|
||||||
ModuleWiseStatusHelper.moduleCompletionStatusDataCreationHelper(loanDetailData.loginNo);
|
ModuleWiseStatusHelper.moduleCompletionStatusDataCreationHelper(loanDetailData.loginNo);
|
||||||
// Final Response
|
// Final Response
|
||||||
LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1},
|
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
||||||
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
|
include: [{ model: EntityDetails , // Set the alias for the relationship
|
||||||
attributes: [
|
attributes: [
|
||||||
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
|
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
|
||||||
] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data => { if(data.length > 0) { res.send({'status':200,'message':"success",'data':data}); } else { res.send({'status':404,'message':"failed",'data':"No data"}); } })
|
] }] }).then(data => { if(data.length > 0) { res.send({'status':200,'message':"success",'data':data}); } else { res.send({'status':404,'message':"failed",'data':"No data"}); } })
|
||||||
|
|
||||||
// Entity detail promise
|
// Entity detail promise
|
||||||
var EntityKYCDetailDataInsert = new Promise(async(resolve, reject) =>
|
var EntityKYCDetailDataInsert = new Promise(async(resolve, reject) =>
|
||||||
@ -79,7 +79,7 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
entity_name : [value.firstName, value.middleName, value.lastName ].filter(Boolean).join(" "),
|
entity_name : [value.firstName, value.middleName, value.lastName ].filter(Boolean).join(" "),
|
||||||
entity_formation_date : moment(new Date(value.doi)).format("YYYY-MM-DD"),
|
entity_formation_date : moment(new Date(value.doi)).format("YYYY-MM-DD"),
|
||||||
pan_no : value.panNo,
|
pan_no : value.panNo,
|
||||||
entity_type : value.kycType.trim()
|
entity_type : null
|
||||||
}
|
}
|
||||||
ResData.lstApplicantAddress.forEach(async(address_value,index) =>
|
ResData.lstApplicantAddress.forEach(async(address_value,index) =>
|
||||||
{
|
{
|
||||||
@ -150,7 +150,8 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
name : [value.firstName, value.middleName, value.lastName ].filter(Boolean).join(" "), // concat and ignore null
|
name : [value.firstName, value.middleName, value.lastName ].filter(Boolean).join(" "), // concat and ignore null
|
||||||
pan_no : value.panNo,
|
pan_no : value.panNo,
|
||||||
entity_type : value.kycType.trim(),
|
entity_type : value.kycType.trim(),
|
||||||
applicant_type : 'Main Applicant'
|
applicant_type : 'Main Applicant',
|
||||||
|
is_data_from_los : 1
|
||||||
}
|
}
|
||||||
lstApplicantKYCDetailDataArray.push(lstApplicantKYCDetailObj);
|
lstApplicantKYCDetailDataArray.push(lstApplicantKYCDetailObj);
|
||||||
}
|
}
|
||||||
@ -178,11 +179,11 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
logMsg.info("Los api call Failed " +req.query.losid);
|
logMsg.info("Los api call Failed " +req.query.losid);
|
||||||
LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1},
|
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
||||||
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
|
include: [{ model: EntityDetails , // Set the alias for the relationship
|
||||||
attributes: [
|
attributes: [
|
||||||
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
|
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
|
||||||
] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data =>
|
] }] }).then(data =>
|
||||||
{
|
{
|
||||||
if(data.length > 0)
|
if(data.length > 0)
|
||||||
{
|
{
|
||||||
@ -202,11 +203,11 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
{
|
{
|
||||||
logMsg.info("Data already inserted " +req.query.losid);
|
logMsg.info("Data already inserted " +req.query.losid);
|
||||||
// Final Response
|
// Final Response
|
||||||
LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1},
|
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
||||||
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
|
include: [{ model: EntityDetails , // Set the alias for the relationship
|
||||||
attributes: [
|
attributes: [
|
||||||
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
|
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
|
||||||
] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data =>
|
] }] }).then(data =>
|
||||||
{
|
{
|
||||||
if(data.length > 0)
|
if(data.length > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,6 +29,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
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 },
|
||||||
nri: { type: DataTypes.STRING },
|
nri: { type: DataTypes.STRING },
|
||||||
|
is_data_from_los : { type: DataTypes.INTEGER },
|
||||||
is_active : { type: DataTypes.INTEGER },
|
is_active : { type: DataTypes.INTEGER },
|
||||||
createdby: { type: DataTypes.INTEGER },
|
createdby: { type: DataTypes.INTEGER },
|
||||||
updatedby: { type: DataTypes.INTEGER },
|
updatedby: { type: DataTypes.INTEGER },
|
||||||
|
|||||||
@ -27,7 +27,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
bureau_score: { type: DataTypes.STRING },
|
bureau_score: { type: DataTypes.STRING },
|
||||||
bureau_name: { type: DataTypes.STRING },
|
bureau_name: { type: DataTypes.STRING },
|
||||||
entity_type: { type: DataTypes.STRING },
|
entity_type: { type: DataTypes.STRING },
|
||||||
entity_formation_date: { type: DataTypes.DATEONLY },
|
entity_formation_date: { type: DataTypes.DATE },
|
||||||
entity_vintage_years: { type: DataTypes.STRING },
|
entity_vintage_years: { type: DataTypes.STRING },
|
||||||
total_no_of_members: { type: DataTypes.INTEGER },
|
total_no_of_members: { type: DataTypes.INTEGER },
|
||||||
registered_address_of_business: { type: DataTypes.STRING },
|
registered_address_of_business: { type: DataTypes.STRING },
|
||||||
|
|||||||
@ -44,6 +44,10 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
foreignKey: 'loan_no_id',
|
foreignKey: 'loan_no_id',
|
||||||
sourceKey : 'id'
|
sourceKey : 'id'
|
||||||
});
|
});
|
||||||
|
LoanDetail.hasMany(models.EntityDetails, {
|
||||||
|
foreignKey: 'loan_no_id',
|
||||||
|
sourceKey : 'id'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return LoanDetail
|
return LoanDetail
|
||||||
}
|
}
|
||||||
@ -44,6 +44,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
norms_of_residual_age_of_property_years : { type: DataTypes.STRING },
|
norms_of_residual_age_of_property_years : { type: DataTypes.STRING },
|
||||||
carpet_area_of_property_to_be_mortgage_sqft : { type: DataTypes.STRING },
|
carpet_area_of_property_to_be_mortgage_sqft : { type: DataTypes.STRING },
|
||||||
carpet_area_of_property_norms : { type: DataTypes.STRING },
|
carpet_area_of_property_norms : { type: DataTypes.STRING },
|
||||||
|
ltv_norms_met_not_met : { type: DataTypes.STRING },
|
||||||
createdAt : { type: DataTypes.DATE },
|
createdAt : { type: DataTypes.DATE },
|
||||||
createdby : { type: DataTypes.INTEGER },
|
createdby : { type: DataTypes.INTEGER },
|
||||||
updatedAt : { type: DataTypes.DATE },
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
|||||||
@ -2064,6 +2064,8 @@ router.post("/updatePropertyAndLtv", Entitycontroller.updatePropertyAndLtv);
|
|||||||
*/
|
*/
|
||||||
router.get("/PropertyAndLtvList", Entitycontroller.PropertyAndLtvList);
|
router.get("/PropertyAndLtvList", Entitycontroller.PropertyAndLtvList);
|
||||||
|
|
||||||
|
router.get("/deletePropertyAndLtv", Entitycontroller.deletePropertyAndLtv);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
5038
package-lock.json
generated
5038
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user