GWM
This commit is contained in:
parent
1639ea2a7d
commit
cf5a0021ea
@ -1,4 +1,5 @@
|
|||||||
const { sequelize,Test , AdjustableTang , PolicyParameterMaster , Authorization ,DoubleWhammy,DscrLeverageGrid,LeverageUsedForEligCat,ProgramMaster,CheckTypeMaster,PropertyTypeMaster,BusinessActivityMaster} = require('../models')
|
const { sequelize, AdjustableTang , PolicyParameterMaster , Authorization ,DoubleWhammy,DscrLeverageGrid,LeverageUsedForEligCat,ProgramMaster,CheckTypeMaster,PropertyTypeMaster,BusinessActivityMaster} = require('../models')
|
||||||
|
const {BankingNorms,BankingNorms2,CreditBureauNorms,DeviationNorms,DeviationNorms2,DeviationNorms3,DeviationNorms4,DeviationNorms5,DeviationNorms6,DeviationNorms7,FinancialsNorms,LoanEligibilityNorms,LoanEligibilityNorms2,LoanEligibilityNorms3,LoanEligibilityNorms4,PropertyNorms,PropertyNorms2,TurnoverTrendNorms } = require('../models')
|
||||||
const { logMsg } = require('../services/logger.js');
|
const { logMsg } = require('../services/logger.js');
|
||||||
const policyHelper = require('../services/policy.helper');
|
const policyHelper = require('../services/policy.helper');
|
||||||
|
|
||||||
@ -194,7 +195,7 @@ exports.PolicyMasterData = async (req, res) =>
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
sequelize.query('SELECT section_master.section , policy_parameter_master.parameter , policy_parameter_master.rules , policy_parameter_master.master_key , policy_parameter_master.data , policy_parameter_master.json FROM policy_parameter_master JOIN section_master ON policy_parameter_master.section_id = section_master.id and section_master.is_active = 1 where policy_parameter_master.is_active = 1 ')
|
sequelize.query('SELECT section_master.section , policy_parameter_master.parameter , policy_parameter_master.rules , policy_parameter_master.master_key , policy_parameter_master.data , policy_parameter_master.json , policy_parameter_master.table_name FROM policy_parameter_master JOIN section_master ON policy_parameter_master.section_id = section_master.id and section_master.is_active = 1 where policy_parameter_master.is_active = 1 ')
|
||||||
.then(data =>
|
.then(data =>
|
||||||
{
|
{
|
||||||
res.send({'status':200,'message':"success",'data':data});
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
@ -264,7 +265,142 @@ exports.updatePolicyMasterData = async (req, res) =>
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// select PolicyMasterChildTableData data
|
||||||
|
exports.PolicyMasterChildTableData = async (req, res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Query = 'SELECT * FROM '+req.query.table_name+' where policy_parameter_master_id ='+req.query.master_key;
|
||||||
|
console.log(Query);
|
||||||
|
sequelize.query(Query)
|
||||||
|
.then(data =>
|
||||||
|
{
|
||||||
|
res.send({'status':200,'message':"success",'data':data[0]});
|
||||||
|
logMsg.info("Master Data List api call Success");
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while fetching entity applicant masterdata." ,'data': "No data" });
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch(err) {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while fetching entity applicant masterdata." ,'data': "No data"
|
||||||
|
});
|
||||||
|
} //end of try catch
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
exports.createPolicyMasterChildData = async (req, res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
modelArray = {banking_norms:BankingNorms ,
|
||||||
|
banking_norms2:BankingNorms,
|
||||||
|
creditBureau_norms:CreditBureauNorms,
|
||||||
|
deviation_norms:DeviationNorms,
|
||||||
|
deviation_norms2:DeviationNorms2,
|
||||||
|
deviation_norms3:DeviationNorms3,
|
||||||
|
deviation_norms4:DeviationNorms4,
|
||||||
|
deviation_norms5:DeviationNorms5,
|
||||||
|
deviation_norms6:DeviationNorms6,
|
||||||
|
deviation_norms7:DeviationNorms7,
|
||||||
|
financials_norms:FinancialsNorms,
|
||||||
|
loanEligibility_norms:LoanEligibilityNorms,
|
||||||
|
loanEligibility_norms2:LoanEligibilityNorms2,
|
||||||
|
loanEligibility_norms3LoanEligibilityNorms3,
|
||||||
|
loanEligibility_norms4:LoanEligibilityNorms4,
|
||||||
|
property_norms:PropertyNorms,
|
||||||
|
property_norms2:PropertyNorms2,
|
||||||
|
turnoverTrend_norms:TurnoverTrendNorms }
|
||||||
|
modelName = req.query.table_name;
|
||||||
|
|
||||||
|
setTimeout(async() => {
|
||||||
|
model = modelArray[modelName] ;
|
||||||
|
model.create(req.body)
|
||||||
|
.then(data=>{ res.send({'status':200,'message':"success",'data':"No data"}); })
|
||||||
|
.catch(err=>{ res.send({'status':404,'message':"failed",'data':"No data"}); });
|
||||||
|
}, 1500);
|
||||||
|
|
||||||
|
// req.body.forEach((result, index, array) => {
|
||||||
|
// let Queryvalues = '';
|
||||||
|
// let Querycolumn = '';
|
||||||
|
// Object.keys(result).forEach((key , index , array ) => {
|
||||||
|
// //construct column name
|
||||||
|
// if(index == 0) { Querycolumn = "('"+key+"',"; }
|
||||||
|
// else if (array.length == index + 1 ) { Querycolumn += "'"+key+"')"; }
|
||||||
|
// else { Querycolumn += "'"+key+"',"; }
|
||||||
|
|
||||||
|
// //construct column value
|
||||||
|
// if(index == 0) { if (typeof result[key] === 'string' ) { Queryvalues += "('"+result[key]+"',"; } else { Queryvalues += "("+result[key]+","; } }
|
||||||
|
// else if (array.length == index + 1 ) { if (typeof result[key] === 'string' ) { Queryvalues += "'"+result[key]+"'),"; } else { Queryvalues += result[key]+"),"; } }
|
||||||
|
// else { if (typeof result[key] === 'string' ) { Queryvalues += "'"+result[key]+"',"; } else { Queryvalues += result[key]+","; } }
|
||||||
|
|
||||||
|
// //track ending of object loop.
|
||||||
|
// if(array.length == index+1)
|
||||||
|
// {
|
||||||
|
// Queryvalues = Queryvalues.slice(0, -1);
|
||||||
|
// Query = 'INSERT INTO '+req.query.table_name+' '+Querycolumn+' VALUES'+Queryvalues;
|
||||||
|
// // insert data here
|
||||||
|
// sequelize.query(Query).then(data => { logMsg.info("Insert Success"); }).catch(err => { logMsg.info("Insert Failed"); });
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
|
||||||
|
} catch(err) {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while fetching entity applicant masterdata." ,'data': "No data"
|
||||||
|
});
|
||||||
|
} //end of try catch
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
exports.updatePolicyMasterChildData = async (req, res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
modelArray = {banking_norms:BankingNorms ,
|
||||||
|
banking_norms2:BankingNorms,
|
||||||
|
creditBureau_norms:CreditBureauNorms,
|
||||||
|
deviation_norms:DeviationNorms,
|
||||||
|
deviation_norms2:DeviationNorms2,
|
||||||
|
deviation_norms3:DeviationNorms3,
|
||||||
|
deviation_norms4:DeviationNorms4,
|
||||||
|
deviation_norms5:DeviationNorms5,
|
||||||
|
deviation_norms6:DeviationNorms6,
|
||||||
|
deviation_norms7:DeviationNorms7,
|
||||||
|
financials_norms:FinancialsNorms,
|
||||||
|
loanEligibility_norms:LoanEligibilityNorms,
|
||||||
|
loanEligibility_norms2:LoanEligibilityNorms2,
|
||||||
|
loanEligibility_norms3LoanEligibilityNorms3,
|
||||||
|
loanEligibility_norms4:LoanEligibilityNorms4,
|
||||||
|
property_norms:PropertyNorms,
|
||||||
|
property_norms2:PropertyNorms2,
|
||||||
|
turnoverTrend_norms:TurnoverTrendNorms }
|
||||||
|
modelName = req.query.table_name;
|
||||||
|
|
||||||
|
setTimeout(async() => {
|
||||||
|
model = modelArray[modelName] ;
|
||||||
|
id = req.body.id;
|
||||||
|
delete req.body.id;
|
||||||
|
model.update(req.body,{ where: { id: id }})
|
||||||
|
.then(data=>{ res.send({'status':200,'message':"success",'data':"No data"}); })
|
||||||
|
.catch(err=>{ res.send({'status':404,'message':"failed",'data':"No data"}); });
|
||||||
|
}, 1500);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} catch(err) {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while fetching entity applicant masterdata." ,'data': "No data"
|
||||||
|
});
|
||||||
|
} //end of try catch
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// select DoubleWhammy data
|
// select DoubleWhammy data
|
||||||
@ -342,33 +478,7 @@ exports.updatePolicyMasterData = async (req, res) =>
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
[{
|
|
||||||
program:"Vanilla",
|
|
||||||
|
|
||||||
child:[
|
|
||||||
|
|
||||||
[{"business_activity_name":"Retail Trader","leverage": "<=1","data":[]},
|
|
||||||
{"business_activity_name":"Retail Trader","leverage": "<=2","data":[]},
|
|
||||||
{"business_activity_name":"Retail Trader","leverage": "<=3","data":[]},
|
|
||||||
{"business_activity_name":"Retail Trader","leverage": "<=4","data":[]}] ,
|
|
||||||
|
|
||||||
[{"business_activity_name":"Wholesale Trader","leverage": "<=1","data":[]},
|
|
||||||
{"business_activity_name":"Wholesale Trader","leverage": "<=2","data":[]},
|
|
||||||
{"business_activity_name":"Wholesale Trader","leverage": "<=3","data":[]},
|
|
||||||
{"business_activity_name":"Wholesale Trader","leverage": "<=4","data":[]}] ,
|
|
||||||
|
|
||||||
[{"business_activity_name":"Manufacturer","leverage": "<=1","data":[]},
|
|
||||||
{"business_activity_name":"Manufacturer","leverage": "<=2","data":[]},
|
|
||||||
{"business_activity_name":"Manufacturer","leverage": "<=3","data":[]},
|
|
||||||
{"business_activity_name":"Manufacturer","leverage": "<=4","data":[]}] ,
|
|
||||||
|
|
||||||
[{"business_activity_name":"Service Provider","leverage": "<=1","data":[]},
|
|
||||||
{"business_activity_name":"Service Provider","leverage": "<=2","data":[]},
|
|
||||||
{"business_activity_name":"Service Provider","leverage": "<=3","data":[]},
|
|
||||||
{"business_activity_name":"Service Provider","leverage": "<=4","data":[]}] ,
|
|
||||||
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
|
|
||||||
exports.DscrLeverageGridDataList = async (req, res) =>
|
exports.DscrLeverageGridDataList = async (req, res) =>
|
||||||
{
|
{
|
||||||
|
|||||||
28
app/models/BankingNorms.js
Normal file
28
app/models/BankingNorms.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class BankingNorms extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
BankingNorms.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Normal : { type: DataTypes.STRING },
|
||||||
|
'RCM/ZCM_>' : { type: DataTypes.STRING },
|
||||||
|
'RCM/ZCM_<=' : { type: DataTypes.STRING },
|
||||||
|
'NCM_>' : { type: DataTypes.STRING },
|
||||||
|
'NCM_<=' : { type: DataTypes.STRING },
|
||||||
|
'CC_>' : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER },
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'banking_norms',
|
||||||
|
modelName: 'BankingNorms',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return BankingNorms
|
||||||
|
}
|
||||||
29
app/models/BankingNorms2.js
Normal file
29
app/models/BankingNorms2.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class BankingNorms2 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
BankingNorms2.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Normal : { type: DataTypes.STRING },
|
||||||
|
'CM/Sr.CM' : { type: DataTypes.STRING },
|
||||||
|
'RCM/ZCM' : { type: DataTypes.STRING },
|
||||||
|
NCM : { type: DataTypes.STRING },
|
||||||
|
CC : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'banking_norms2',
|
||||||
|
modelName: 'BankingNorms2',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return BankingNorms2
|
||||||
|
}
|
||||||
31
app/models/CreditBureauNorms.js
Normal file
31
app/models/CreditBureauNorms.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class CreditBureauNorms extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
CreditBureauNorms.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Vanilla : { type: DataTypes.STRING },
|
||||||
|
Banking : { type: DataTypes.STRING },
|
||||||
|
Industry_Margin : { type: DataTypes.STRING },
|
||||||
|
GST_Returns : { type: DataTypes.STRING },
|
||||||
|
Banking_V2 : { type: DataTypes.STRING },
|
||||||
|
GPR : { type: DataTypes.STRING },
|
||||||
|
Approval_Level : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'credit_bureau_norms',
|
||||||
|
modelName: 'CreditBureauNorms',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return CreditBureauNorms
|
||||||
|
}
|
||||||
33
app/models/DeviationNorms.js
Normal file
33
app/models/DeviationNorms.js
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class DeviationNorms extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
DeviationNorms.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Program : { type: DataTypes.STRING },
|
||||||
|
Non_Individual_Entity : { type: DataTypes.STRING },
|
||||||
|
Individual_Key_Promoters : { type: DataTypes.STRING },
|
||||||
|
'Non_Individual_Entity_(Overall vintage)' : { type: DataTypes.STRING },
|
||||||
|
'RCM/ZCM_>=' : { type: DataTypes.STRING },
|
||||||
|
'RCM/ZCM_<' : { type: DataTypes.STRING },
|
||||||
|
'NCM_<' : { type: DataTypes.STRING },
|
||||||
|
RCU_of_Business_Set_up : { type: DataTypes.STRING },
|
||||||
|
Business_Stability_at_same_place : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'deviation_norms',
|
||||||
|
modelName: 'DeviationNorms',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return DeviationNorms
|
||||||
|
}
|
||||||
26
app/models/DeviationNorms2.js
Normal file
26
app/models/DeviationNorms2.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class DeviationNorms2 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
DeviationNorms2.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Loan_Amount : { type: DataTypes.STRING },
|
||||||
|
No_of_years_of_Financials : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'deviation_norms2',
|
||||||
|
modelName: 'DeviationNorms2',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return DeviationNorms2
|
||||||
|
}
|
||||||
39
app/models/DeviationNorms3.js
Normal file
39
app/models/DeviationNorms3.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class DeviationNorms3 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
DeviationNorms3.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
All : { type: DataTypes.STRING },
|
||||||
|
Individual : { type: DataTypes.STRING },
|
||||||
|
Proprietorship_Firm : { type: DataTypes.STRING },
|
||||||
|
Unregistered_Partnership_Firm : { type: DataTypes.STRING },
|
||||||
|
Registered_Partnership : { type: DataTypes.STRING },
|
||||||
|
Private_Ltd_Co : { type: DataTypes.STRING },
|
||||||
|
PLC_Closely_Held : { type: DataTypes.STRING },
|
||||||
|
PLC_Widely_Held : { type: DataTypes.STRING },
|
||||||
|
Limited_Liability_Partnership : { type: DataTypes.STRING },
|
||||||
|
HUF : { type: DataTypes.STRING },
|
||||||
|
Society : { type: DataTypes.STRING },
|
||||||
|
Trust : { type: DataTypes.STRING },
|
||||||
|
AOP : { type: DataTypes.STRING },
|
||||||
|
BOI : { type: DataTypes.STRING },
|
||||||
|
AJP : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'deviation_norms3',
|
||||||
|
modelName: 'DeviationNorms3',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return DeviationNorms3
|
||||||
|
}
|
||||||
27
app/models/DeviationNorms4.js
Normal file
27
app/models/DeviationNorms4.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class DeviationNorms4 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
DeviationNorms4.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Standard : { type: DataTypes.STRING },
|
||||||
|
Allowed_for_deviation : { type: DataTypes.STRING },
|
||||||
|
Allowed_for_deviation_for_Property_Owner : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'deviation_norms4',
|
||||||
|
modelName: 'DeviationNorms4',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return DeviationNorms4
|
||||||
|
}
|
||||||
29
app/models/DeviationNorms5.js
Normal file
29
app/models/DeviationNorms5.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class DeviationNorms5 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
DeviationNorms5.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Program : { type: DataTypes.STRING },
|
||||||
|
Manufacturer : { type: DataTypes.STRING },
|
||||||
|
Wholesale_Trader : { type: DataTypes.STRING },
|
||||||
|
Retail_Trader : { type: DataTypes.STRING },
|
||||||
|
Service_Provider : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'deviation_norms5',
|
||||||
|
modelName: 'DeviationNorms5',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return DeviationNorms5
|
||||||
|
}
|
||||||
26
app/models/DeviationNorms6.js
Normal file
26
app/models/DeviationNorms6.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class DeviationNorms6 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
DeviationNorms6.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Min : { type: DataTypes.INTEGER },
|
||||||
|
No_of_Guarantor_Required : { type: DataTypes.INTEGER },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'deviation_norms6',
|
||||||
|
modelName: 'DeviationNorms6',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return DeviationNorms6
|
||||||
|
}
|
||||||
28
app/models/DeviationNorms7.js
Normal file
28
app/models/DeviationNorms7.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class DeviationNorms7 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
DeviationNorms7.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
'Max_<=' : { type: DataTypes.INTEGER },
|
||||||
|
'RCM/ZCM_<=' : { type: DataTypes.INTEGER },
|
||||||
|
'NCM_<=': { type: DataTypes.INTEGER },
|
||||||
|
'CC_>' : { type: DataTypes.INTEGER },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'deviation_norms7',
|
||||||
|
modelName: 'DeviationNorms7',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return DeviationNorms7
|
||||||
|
}
|
||||||
30
app/models/FinancialsNorms.js
Normal file
30
app/models/FinancialsNorms.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class FinancialsNorms extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
FinancialsNorms.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Vanilla_From : { type: DataTypes.STRING },
|
||||||
|
Vanilla_To : { type: DataTypes.STRING },
|
||||||
|
Industry_Margin_From : { type: DataTypes.STRING },
|
||||||
|
Industry_Margin_To : { type: DataTypes.STRING },
|
||||||
|
GPR_From : { type: DataTypes.STRING },
|
||||||
|
GPR_To : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'financials_norms',
|
||||||
|
modelName: 'FinancialsNorms',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return FinancialsNorms
|
||||||
|
}
|
||||||
27
app/models/LoanEligibilityNorms.js
Normal file
27
app/models/LoanEligibilityNorms.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class LoanEligibilityNorms extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
LoanEligibilityNorms.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Program : { type: DataTypes.STRING },
|
||||||
|
DSCR : { type: DataTypes.STRING },
|
||||||
|
DW : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'loan_eligibility_norms',
|
||||||
|
modelName: 'LoanEligibilityNorms',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return LoanEligibilityNorms
|
||||||
|
}
|
||||||
28
app/models/LoanEligibilityNorms2.js
Normal file
28
app/models/LoanEligibilityNorms2.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class LoanEligibilityNorms2 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
LoanEligibilityNorms2.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
'Vintage_(Yrs)' : { type: DataTypes.STRING },
|
||||||
|
'Doctors_(%)' : { type: DataTypes.STRING },
|
||||||
|
'Other_SEP_(%)' : { type: DataTypes.STRING },
|
||||||
|
'Vintage_(Yrs)_for_Bracket_calculation' : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'loan_eligibility_norms2',
|
||||||
|
modelName: 'LoanEligibilityNorms2',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return LoanEligibilityNorms2
|
||||||
|
}
|
||||||
26
app/models/LoanEligibilityNorms3.js
Normal file
26
app/models/LoanEligibilityNorms3.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class LoanEligibilityNorms3 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
LoanEligibilityNorms3.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Program : { type: DataTypes.STRING },
|
||||||
|
Percentage : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'loan_eligibility_norms3',
|
||||||
|
modelName: 'LoanEligibilityNorms3',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return LoanEligibilityNorms3
|
||||||
|
}
|
||||||
29
app/models/LoanEligibilityNorms4.js
Normal file
29
app/models/LoanEligibilityNorms4.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class LoanEligibilityNorms4 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
LoanEligibilityNorms4.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Program : { type: DataTypes.STRING },
|
||||||
|
Max : { type: DataTypes.INTEGER },
|
||||||
|
Min : { type: DataTypes.INTEGER },
|
||||||
|
Min_Loan_Eligibility : { type: DataTypes.INTEGER },
|
||||||
|
Max_with_deviation : { type: DataTypes.INTEGER },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'loan_eligibility_norms4',
|
||||||
|
modelName: 'LoanEligibilityNorms4',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return LoanEligibilityNorms4
|
||||||
|
}
|
||||||
@ -13,6 +13,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
master_key : { type: DataTypes.INTEGER },
|
master_key : { type: DataTypes.INTEGER },
|
||||||
data : { type: DataTypes.INTEGER },
|
data : { type: DataTypes.INTEGER },
|
||||||
json : { type: DataTypes.INTEGER },
|
json : { type: DataTypes.INTEGER },
|
||||||
|
table_name : { type: DataTypes.STRING },
|
||||||
is_active : { type: DataTypes.INTEGER },
|
is_active : { type: DataTypes.INTEGER },
|
||||||
createdAt : { type: DataTypes.DATE },
|
createdAt : { type: DataTypes.DATE },
|
||||||
updatedAt : { type: DataTypes.DATE },
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
|||||||
26
app/models/PropertyNorms.js
Normal file
26
app/models/PropertyNorms.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class PropertyNorms extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
PropertyNorms.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
'Max_Variance_in_2_Valuations_10%' : { type: DataTypes.INTEGER },
|
||||||
|
'Max_Variance_in_2_Valuations_>10%' : { type: DataTypes.INTEGER },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'property_norms',
|
||||||
|
modelName: 'PropertyNorms',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return PropertyNorms
|
||||||
|
}
|
||||||
29
app/models/PropertyNorms2.js
Normal file
29
app/models/PropertyNorms2.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class PropertyNorms2 extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
PropertyNorms2.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Property_Type : { type: DataTypes.STRING },
|
||||||
|
Self_Occupied : { type: DataTypes.STRING },
|
||||||
|
Rented : { type: DataTypes.STRING },
|
||||||
|
Vacant : { type: DataTypes.STRING },
|
||||||
|
Mixed_Use : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'property_norms2',
|
||||||
|
modelName: 'PropertyNorms2',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return PropertyNorms2
|
||||||
|
}
|
||||||
29
app/models/TurnoverTrendNorms.js
Normal file
29
app/models/TurnoverTrendNorms.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class TurnoverTrendNorms extends Model {
|
||||||
|
|
||||||
|
}
|
||||||
|
TurnoverTrendNorms.init(
|
||||||
|
{
|
||||||
|
policy_parameter_master_id : { type: DataTypes.INTEGER },
|
||||||
|
Program : { type: DataTypes.STRING },
|
||||||
|
'RCM/ZCM_<' : { type: DataTypes.STRING },
|
||||||
|
'NCM_<' : { type: DataTypes.STRING },
|
||||||
|
'CC_<' : { type: DataTypes.STRING },
|
||||||
|
'Dip_in_TO_in _2_consecutive_years' : { type: DataTypes.STRING },
|
||||||
|
is_active : { type: DataTypes.INTEGER },
|
||||||
|
createdAt : { type: DataTypes.DATE },
|
||||||
|
updatedAt : { type: DataTypes.DATE },
|
||||||
|
createdby : { type: DataTypes.INTEGER },
|
||||||
|
updatedby : { type: DataTypes.INTEGER }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'turnover_trend_norms',
|
||||||
|
modelName: 'TurnoverTrendNorms',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return TurnoverTrendNorms
|
||||||
|
}
|
||||||
@ -352,6 +352,70 @@ router.post("/createBusinessActivityData", CreditPolicy.createBusinessActivityDa
|
|||||||
router.post("/updateBusinessActivityData", CreditPolicy.updateBusinessActivityData);
|
router.post("/updateBusinessActivityData", CreditPolicy.updateBusinessActivityData);
|
||||||
|
|
||||||
|
|
||||||
|
// Parameter Master Child Table Data select api
|
||||||
|
/**
|
||||||
|
* @swagger
|
||||||
|
* /api/PolicyMasterChildTableData:
|
||||||
|
* get:
|
||||||
|
* summary:
|
||||||
|
* description:
|
||||||
|
* parameters:
|
||||||
|
* - in: query
|
||||||
|
* name: table_name
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* required: true
|
||||||
|
* example: financials_norms
|
||||||
|
* - in: query
|
||||||
|
* name: master_key
|
||||||
|
* schema:
|
||||||
|
* type: integer
|
||||||
|
* required: true
|
||||||
|
* example: 10
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: success
|
||||||
|
*/
|
||||||
|
router.get("/PolicyMasterChildTableData", CreditPolicy.PolicyMasterChildTableData);
|
||||||
|
//create Policy Master Child Data
|
||||||
|
/**
|
||||||
|
* @swagger
|
||||||
|
* /api/createPolicyMasterChildData:
|
||||||
|
* post:
|
||||||
|
* summary: (post method ) need to attach creation object as body
|
||||||
|
* description:
|
||||||
|
* parameters:
|
||||||
|
* - in: query
|
||||||
|
* name: table_name
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* required: true
|
||||||
|
* example: financials_norms
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: success
|
||||||
|
*/
|
||||||
|
router.post("/createPolicyMasterChildData", CreditPolicy.createPolicyMasterChildData);
|
||||||
|
//update Policy Master Child Data
|
||||||
|
/**
|
||||||
|
* @swagger
|
||||||
|
* /api/updatePolicyMasterChildData:
|
||||||
|
* post:
|
||||||
|
* summary: (post method ) need to attach updation object as body
|
||||||
|
* description:
|
||||||
|
* parameters:
|
||||||
|
* - in: query
|
||||||
|
* name: table_name
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* required: true
|
||||||
|
* example: financials_norms
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: success
|
||||||
|
*/
|
||||||
|
router.post("/updatePolicyMasterChildData", CreditPolicy.updatePolicyMasterChildData);
|
||||||
|
|
||||||
|
|
||||||
// Parameter Master Data select api
|
// Parameter Master Data select api
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user