Compare commits

...

10 Commits

Author SHA1 Message Date
sriramv
11abe74a92 GWm 2023-10-20 16:26:15 +05:30
sriramv
0a2b851299 non-indidual:GWM 2023-10-20 14:56:21 +05:30
sriramv
a89f31dea1 GWM:new_key added in applicant table 2023-10-11 12:29:18 +05:30
sriramv
3510041eeb modelFile:GWM 2023-09-27 10:41:27 +05:30
sriramv
98d4df2e8d propertyAndLtv Delete api :GWM 2023-08-17 16:39:44 +05:30
sriramv
2e8f5fbb6d propertyAndLtv Delete api :GWM 2023-08-17 16:22:13 +05:30
sriramv
1d86263f94 entity_name:GWM 2023-08-16 11:41:22 +05:30
bitbucket
65c4651913 susee 2023-08-11 11:51:44 +05:30
sriramv
5175982cbf vvvw 2023-08-11 11:13:15 +05:30
sriramv
eb6dd5dff7 vvvw 2023-08-11 11:05:03 +05:30
8 changed files with 5071 additions and 37 deletions

View File

@ -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
exports.createLoanDetail = async (req, res) =>

View File

@ -16,10 +16,10 @@ exports.mainLandingPage = async (req, res) =>
if(req.query.is_loan_api_call == 0)
{
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: [
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data =>
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
] }] }).then(data =>
{
if(data.length > 0)
{
@ -59,11 +59,11 @@ exports.mainLandingPage = async (req, res) =>
//Module Wise Completion Status Data Creation Helper Call
ModuleWiseStatusHelper.moduleCompletionStatusDataCreationHelper(loanDetailData.loginNo);
// Final Response
LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1},
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
include: [{ model: EntityDetails , // Set the alias for the relationship
attributes: [
[sequelize.col('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"}); } })
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
] }] }).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
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_formation_date : moment(new Date(value.doi)).format("YYYY-MM-DD"),
pan_no : value.panNo,
entity_type : value.kycType.trim()
entity_type : null
}
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
pan_no : value.panNo,
entity_type : value.kycType.trim(),
applicant_type : 'Main Applicant'
applicant_type : 'Main Applicant',
is_data_from_los : 1
}
lstApplicantKYCDetailDataArray.push(lstApplicantKYCDetailObj);
}
@ -178,11 +179,11 @@ exports.mainLandingPage = async (req, res) =>
else
{
logMsg.info("Los api call Failed " +req.query.losid);
LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1},
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
include: [{ model: EntityDetails , // Set the alias for the relationship
attributes: [
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data =>
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
] }] }).then(data =>
{
if(data.length > 0)
{
@ -202,11 +203,11 @@ exports.mainLandingPage = async (req, res) =>
{
logMsg.info("Data already inserted " +req.query.losid);
// Final Response
LoanDetail.findAll({raw: true , where : {losid :req.query.losid , is_active : 1},
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
include: [{ model: EntityDetails , // Set the alias for the relationship
attributes: [
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
] , where: { 'applicant_type' : 'Main Applicant'} }] }).then(data =>
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
] }] }).then(data =>
{
if(data.length > 0)
{

View File

@ -29,6 +29,7 @@ module.exports = (sequelize, DataTypes) => {
bureau_score: { type: DataTypes.STRING },
heir_in_business_and_on_loan_struct: { type: DataTypes.STRING },
nri: { type: DataTypes.STRING },
is_data_from_los : { type: DataTypes.INTEGER },
is_active : { type: DataTypes.INTEGER },
createdby: { type: DataTypes.INTEGER },
updatedby: { type: DataTypes.INTEGER },

View File

@ -27,7 +27,7 @@ module.exports = (sequelize, DataTypes) => {
bureau_score: { type: DataTypes.STRING },
bureau_name: { 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 },
total_no_of_members: { type: DataTypes.INTEGER },
registered_address_of_business: { type: DataTypes.STRING },

View File

@ -44,6 +44,10 @@ module.exports = (sequelize, DataTypes) => {
foreignKey: 'loan_no_id',
sourceKey : 'id'
});
LoanDetail.hasMany(models.EntityDetails, {
foreignKey: 'loan_no_id',
sourceKey : 'id'
});
}
return LoanDetail
}

View File

@ -44,6 +44,7 @@ module.exports = (sequelize, DataTypes) => {
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_norms : { type: DataTypes.STRING },
ltv_norms_met_not_met : { type: DataTypes.STRING },
createdAt : { type: DataTypes.DATE },
createdby : { type: DataTypes.INTEGER },
updatedAt : { type: DataTypes.DATE },

View File

@ -2064,6 +2064,8 @@ router.post("/updatePropertyAndLtv", Entitycontroller.updatePropertyAndLtv);
*/
router.get("/PropertyAndLtvList", Entitycontroller.PropertyAndLtvList);
router.get("/deletePropertyAndLtv", Entitycontroller.deletePropertyAndLtv);

5038
package-lock.json generated

File diff suppressed because it is too large Load Diff