GWM
This commit is contained in:
parent
8b52729055
commit
f59a44fe1c
@ -30,7 +30,7 @@ const policyHelper = require('../services/policy.helper');
|
||||
|
||||
|
||||
// select PolicyParameterMaster data
|
||||
exports.ParameterMasterData = async (req, res) =>
|
||||
exports.PolicyMasterData = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -54,6 +54,59 @@ exports.ParameterMasterData = async (req, res) =>
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
exports.createPolicyMasterData = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
reqData = req.body;
|
||||
if(reqData.json == 1)
|
||||
{
|
||||
PolicyData = { }
|
||||
}else { PolicyData = reqData }
|
||||
|
||||
PolicyParameterMaster.create(PolicyData)
|
||||
.then(data => { res.send({'status':200,'message':"success",'data':data}); })
|
||||
.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.updatePolicyMasterData = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
reqData = req.body;
|
||||
id = reqData.id;
|
||||
delete reqData.id;
|
||||
if(reqData.json == 1)
|
||||
{
|
||||
PolicyData = { }
|
||||
}else { PolicyData = reqData }
|
||||
|
||||
PolicyParameterMaster.update(PolicyData,{ where: { id: id }})
|
||||
.then(data => { res.send({'status':200,'message':"success",'data':data}); })
|
||||
.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
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// select DoubleWhammy data
|
||||
exports.DoubleWhammyDataList = async (req, res) =>
|
||||
{
|
||||
@ -77,7 +130,31 @@ exports.ParameterMasterData = async (req, res) =>
|
||||
} //end of try catch
|
||||
|
||||
};
|
||||
|
||||
exports.createDoubleWhammy = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
DoubleWhammyData = req.body;
|
||||
for(const DoubleWhammyDataValue of DoubleWhammyData)
|
||||
{
|
||||
|
||||
await DoubleWhammy.create(DoubleWhammyDataValue)
|
||||
.then(async(data) =>{
|
||||
logMsg.info("create Success DoubleWhammy , id = "+id);
|
||||
|
||||
}).catch(err=>{ logMsg.info("create Failed DoubleWhammy , id = "+id); });
|
||||
|
||||
}
|
||||
setTimeout(() => {
|
||||
res.send({'status':200,'message':"success",'data':"No data"});
|
||||
}, 1500);
|
||||
|
||||
} catch(err) {
|
||||
res.send({'status':404,message: err.message || "Some error occurred while updating BankCredits." ,'data': "No data" });
|
||||
} //end of try catch
|
||||
|
||||
};
|
||||
exports.updateDoubleWhammy = async (req, res) =>
|
||||
{
|
||||
try
|
||||
@ -108,28 +185,49 @@ exports.ParameterMasterData = async (req, res) =>
|
||||
|
||||
|
||||
exports.DscrLeverageGridDataList = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Vanilla = await DscrLeverageGrid.findAll({raw:true,where:{program_id : 1}, include:[{ model: ProgramMaster,attributes:['program_name'] },{ model: BusinessActivityMaster,attributes:['business_activity_name'] }] });
|
||||
OtherThenVanilla = await DscrLeverageGrid.findAll({raw:true,where:{program_id : 8}, include:[{ model: ProgramMaster,attributes:['program_name'] },{ model: BusinessActivityMaster,attributes:['business_activity_name'] }] });
|
||||
|
||||
data = {Vanilla : Vanilla , OtherThenVanilla : OtherThenVanilla};
|
||||
|
||||
res.send({'status':200,'message':"success",'data':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.createDscrLeverageGrid = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
DscrLeverageGrid.findAll({raw:true, include:[{ model: ProgramMaster,attributes:['program_name'] },{ model: BusinessActivityMaster,attributes:['business_activity_name'] }] })
|
||||
.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 fetching entity applicant masterdata." ,'data': "No data" });
|
||||
});
|
||||
|
||||
DscrLeverageGridData = req.body;
|
||||
for(const DscrLeverageGridDataValue of DscrLeverageGridData)
|
||||
{
|
||||
|
||||
await DscrLeverageGrid.create(DscrLeverageGridDataValue)
|
||||
.then(async(data) =>{
|
||||
logMsg.info("create Success DoubleWhammy , id = "+id);
|
||||
|
||||
}).catch(err=>{ logMsg.info("create Failed DoubleWhammy , id = "+id); });
|
||||
|
||||
}
|
||||
setTimeout(() => {
|
||||
res.send({'status':200,'message':"success",'data':"No data"});
|
||||
}, 1500);
|
||||
|
||||
} catch(err) {
|
||||
res.send({'status':404,
|
||||
message: err.message || "Some error occurred while fetching entity applicant masterdata." ,'data': "No data"
|
||||
});
|
||||
res.send({'status':404,message: err.message || "Some error occurred while updating BankCredits." ,'data': "No data" });
|
||||
} //end of try catch
|
||||
|
||||
};
|
||||
|
||||
exports.updateDscrLeverageGrid = async (req, res) =>
|
||||
{
|
||||
try
|
||||
@ -159,28 +257,49 @@ exports.ParameterMasterData = async (req, res) =>
|
||||
|
||||
exports.LeverageUsedForEligCatDataList = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
LeverageUsedForEligCat.findAll({raw:true, include:[{ model: ProgramMaster,attributes:['program_name'] },{ model: BusinessActivityMaster,attributes:['business_activity_name'] }] })
|
||||
.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 fetching entity applicant masterdata." ,'data': "No data" });
|
||||
});
|
||||
try
|
||||
{
|
||||
|
||||
Vanilla = await LeverageUsedForEligCat.findAll({raw:true,where:{program_id : 1}, include:[{ model: ProgramMaster,attributes:['program_name'] },{ model: BusinessActivityMaster,attributes:['business_activity_name'] }] })
|
||||
OtherThenVanilla = await LeverageUsedForEligCat.findAll({raw:true,where:{program_id : 8}, include:[{ model: ProgramMaster,attributes:['program_name'] },{ model: BusinessActivityMaster,attributes:['business_activity_name'] }] })
|
||||
|
||||
data = {Vanilla : Vanilla , OtherThenVanilla : OtherThenVanilla};
|
||||
|
||||
res.send({'status':200,'message':"success",'data':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
|
||||
} 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.createLeverageUsedForEligCat = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
LeverageUsedForEligCatData = req.body;
|
||||
for(const LeverageUsedForEligCatValue of LeverageUsedForEligCatData)
|
||||
{
|
||||
|
||||
await LeverageUsedForEligCat.create(LeverageUsedForEligCatValue)
|
||||
.then(async(data) =>{
|
||||
logMsg.info("create Success DoubleWhammy , id = "+id);
|
||||
|
||||
}).catch(err=>{ logMsg.info("create Failed DoubleWhammy , id = "+id); });
|
||||
|
||||
}
|
||||
setTimeout(() => {
|
||||
res.send({'status':200,'message':"success",'data':"No data"});
|
||||
}, 1500);
|
||||
|
||||
} catch(err) {
|
||||
res.send({'status':404,message: err.message || "Some error occurred while updating BankCredits." ,'data': "No data" });
|
||||
} //end of try catch
|
||||
|
||||
};
|
||||
exports.updateLeverageUsedForEligCat = async (req, res) =>
|
||||
{
|
||||
try
|
||||
@ -236,7 +355,31 @@ exports.AdjustableTang = async (req, res) =>
|
||||
|
||||
|
||||
|
||||
|
||||
exports.createAdjustableTang = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
AdjustableTangDataArray = req.body;
|
||||
for(const AdjustableTangValue of AdjustableTangDataArray)
|
||||
{
|
||||
|
||||
await AdjustableTang.create(AdjustableTangValue)
|
||||
.then(async(data) =>{
|
||||
logMsg.info("create Success DoubleWhammy , id = "+id);
|
||||
|
||||
}).catch(err=>{ logMsg.info("create Failed DoubleWhammy , id = "+id); });
|
||||
|
||||
}
|
||||
setTimeout(() => {
|
||||
res.send({'status':200,'message':"success",'data':"No data"});
|
||||
}, 1500);
|
||||
|
||||
} catch(err) {
|
||||
res.send({'status':404,message: err.message || "Some error occurred while updating BankCredits." ,'data': "No data" });
|
||||
} //end of try catch
|
||||
|
||||
};
|
||||
exports.updateAdjustableTang = async (req, res) =>
|
||||
{
|
||||
try
|
||||
|
||||
@ -26,7 +26,7 @@ router.get("/MasterDataList", CreditPolicy.MasterDataList);
|
||||
// Parameter Master Data select api
|
||||
/**
|
||||
* @swagger
|
||||
* /api/ParameterMasterData:
|
||||
* /api/PolicyMasterData:
|
||||
* get:
|
||||
* summary: check Parameter MasterData Api
|
||||
* description: check Parameter MasterData Api
|
||||
@ -34,7 +34,7 @@ router.get("/MasterDataList", CreditPolicy.MasterDataList);
|
||||
* 200:
|
||||
* description: success
|
||||
*/
|
||||
router.get("/ParameterMasterData", CreditPolicy.ParameterMasterData);
|
||||
router.get("/PolicyMasterData", CreditPolicy.PolicyMasterData);
|
||||
|
||||
|
||||
// DoubleWhammy Data List
|
||||
@ -92,6 +92,203 @@ router.get("/AdjustableTang", CreditPolicy.AdjustableTang);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* createPolicyMasterData:
|
||||
* type: array
|
||||
* items:
|
||||
* type: object
|
||||
* properties:
|
||||
* section_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* parameter:
|
||||
* type: string
|
||||
* description:
|
||||
* example: test
|
||||
* rules:
|
||||
* type: json
|
||||
* description:
|
||||
* example: "{key : value } or value"
|
||||
* data:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 0
|
||||
* json:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* is_active:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* createdby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
*/
|
||||
/**
|
||||
* @swagger
|
||||
* /api/createPolicyMasterData:
|
||||
* post:
|
||||
* summary:
|
||||
* description:
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/definitions/createPolicyMasterData'
|
||||
* responses:
|
||||
* 200:
|
||||
* description: create success
|
||||
* 500:
|
||||
* description: failure in create
|
||||
*/
|
||||
router.post("/createPolicyMasterData", CreditPolicy.createPolicyMasterData);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* updatePolicyMasterData:
|
||||
* type: array
|
||||
* items:
|
||||
* type: object
|
||||
* properties:
|
||||
* id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 00
|
||||
* section_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* parameter:
|
||||
* type: string
|
||||
* description:
|
||||
* example: test
|
||||
* rules:
|
||||
* type: json
|
||||
* description:
|
||||
* example: "{key : value } or value"
|
||||
* data:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 0
|
||||
* json:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* is_active:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* updatedby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
*/
|
||||
/**
|
||||
* @swagger
|
||||
* /api/updatePolicyMasterData:
|
||||
* post:
|
||||
* summary:
|
||||
* description:
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/definitions/updatePolicyMasterData'
|
||||
* responses:
|
||||
* 200:
|
||||
* description: update success
|
||||
* 500:
|
||||
* description: failure in update
|
||||
*/
|
||||
router.post("/updatePolicyMasterData", CreditPolicy.updatePolicyMasterData);
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* createDoubleWhammy:
|
||||
* type: array
|
||||
* items:
|
||||
* type: object
|
||||
* properties:
|
||||
* program_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* check_type_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* property_type_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* property_usage:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Self Occupied
|
||||
* eligibility_factor_1:
|
||||
* type: string
|
||||
* description:
|
||||
* example: 125
|
||||
* eligibility_factor_2:
|
||||
* type: string
|
||||
* description:
|
||||
* example: 133
|
||||
* eligibility_factor_3:
|
||||
* type: string
|
||||
* description:
|
||||
* example: 143
|
||||
* eligibility_factor_4:
|
||||
* type: string
|
||||
* description:
|
||||
* example: 154
|
||||
* eligibility_factor_5:
|
||||
* type: string
|
||||
* description:
|
||||
* example: 167
|
||||
* result:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Applicable
|
||||
* is_active:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* createdby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
*/
|
||||
/**
|
||||
* @swagger
|
||||
* /api/createDoubleWhammy:
|
||||
* post:
|
||||
* summary:
|
||||
* description:
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/definitions/createDoubleWhammy'
|
||||
* responses:
|
||||
* 200:
|
||||
* description: update success
|
||||
* 500:
|
||||
* description: failure in update
|
||||
*/
|
||||
router.post("/createDoubleWhammy", CreditPolicy.createDoubleWhammy);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
@ -172,6 +369,66 @@ router.get("/AdjustableTang", CreditPolicy.AdjustableTang);
|
||||
*/
|
||||
router.post("/updateDoubleWhammy", CreditPolicy.updateDoubleWhammy);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* createDscrLeverageGrid:
|
||||
* type: array
|
||||
* items:
|
||||
* type: object
|
||||
* properties:
|
||||
* program_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* business_activity_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* leverage:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "<=3"
|
||||
* dscr_min:
|
||||
* type: string
|
||||
* description:
|
||||
* example: ">=0.95"
|
||||
* dscr_max:
|
||||
* type: string
|
||||
* description:
|
||||
* example: null
|
||||
* result:
|
||||
* type: string
|
||||
* description:
|
||||
* example: No Deviation
|
||||
* is_active:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* createdby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
*/
|
||||
/**
|
||||
* @swagger
|
||||
* /api/createDscrLeverageGrid:
|
||||
* post:
|
||||
* summary:
|
||||
* description:
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/definitions/createDscrLeverageGrid'
|
||||
* responses:
|
||||
* 200:
|
||||
* description: create success
|
||||
* 500:
|
||||
* description: failure in create
|
||||
*/
|
||||
router.post("/createDscrLeverageGrid", CreditPolicy.createDscrLeverageGrid);
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
@ -237,7 +494,53 @@ router.post("/updateDoubleWhammy", CreditPolicy.updateDoubleWhammy);
|
||||
*/
|
||||
router.post("/updateDscrLeverageGrid", CreditPolicy.updateDscrLeverageGrid);
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* createLeverageUsedForEligCat:
|
||||
* type: array
|
||||
* items:
|
||||
* type: object
|
||||
* properties:
|
||||
* program_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* business_activity_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* leverage_value:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 8
|
||||
* is_active:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* createdby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
*/
|
||||
/**
|
||||
* @swagger
|
||||
* /api/createLeverageUsedForEligCat:
|
||||
* post:
|
||||
* summary:
|
||||
* description:
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/definitions/createLeverageUsedForEligCat'
|
||||
* responses:
|
||||
* 200:
|
||||
* description: create success
|
||||
* 500:
|
||||
* description: failure in create
|
||||
*/
|
||||
router.post("/createLeverageUsedForEligCat", CreditPolicy.createLeverageUsedForEligCat);
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
@ -290,7 +593,81 @@ router.post("/updateDscrLeverageGrid", CreditPolicy.updateDscrLeverageGrid);
|
||||
*/
|
||||
router.post("/updateLeverageUsedForEligCat", CreditPolicy.updateLeverageUsedForEligCat);
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* createAdjustableTang:
|
||||
* type: array
|
||||
* items:
|
||||
* type: object
|
||||
* properties:
|
||||
* property_ownership_document_available:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "Yes"
|
||||
* type_of_property:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "Residential"
|
||||
* property_used_in_business:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "Yes"
|
||||
* property_free_loan_taken:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "No Loan on Property - Property Not on BS"
|
||||
* property_in_the_name_of_applicant:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "Yes"
|
||||
* loan_obligated_in_cet:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "Yes"
|
||||
* property_created_in_last_eight_yr:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "Yes"
|
||||
* value_to_be_considered:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "market_valuation_rs"
|
||||
* mv_to_be_added_to_atnw:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 100
|
||||
* final_value_considered:
|
||||
* type: string
|
||||
* description:
|
||||
* example: "(value_to_be_considered * mv_to_be_added_to_atnw )"
|
||||
* is_active:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* createdby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
*/
|
||||
/**
|
||||
* @swagger
|
||||
* /api/createAdjustableTang:
|
||||
* post:
|
||||
* summary:
|
||||
* description:
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/definitions/createAdjustableTang'
|
||||
* responses:
|
||||
* 200:
|
||||
* description: create success
|
||||
* 500:
|
||||
* description: failure in create
|
||||
*/
|
||||
router.post("/createAdjustableTang", CreditPolicy.createAdjustableTang);
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user