diff --git a/app/controllers/credit.policy.controller.js b/app/controllers/credit.policy.controller.js index 50b4994..01d01fe 100644 --- a/app/controllers/credit.policy.controller.js +++ b/app/controllers/credit.policy.controller.js @@ -27,6 +27,166 @@ const policyHelper = require('../services/policy.helper'); }; + exports.createProgramData = async (req, res) => + { + try + { + + + ProgramMaster.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 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.updateProgramData = async (req, res) => +{ + try + { + reqData = req.body; + id = reqData.id; + delete reqData.id; + + ProgramMaster.update(reqData,{ 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 + +}; + + + + +exports.createCheckTypeData = async (req, res) => +{ + try + { + + + CheckTypeMaster.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 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.updateCheckTypeData = async (req, res) => +{ + try + { + reqData = req.body; + id = reqData.id; + delete reqData.id; + + CheckTypeMaster.update(reqData,{ 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 + +}; + + + +exports.createPropertyTypeData = async (req, res) => +{ + try + { + + + PropertyTypeMaster.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 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.updatePropertyTypeData = async (req, res) => +{ + try + { + reqData = req.body; + id = reqData.id; + delete reqData.id; + + PropertyTypeMaster.update(reqData,{ 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 + +}; + + + +exports.createBusinessActivityData = async (req, res) => +{ + try + { + + + BusinessActivityMaster.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 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.updateBusinessActivityData = async (req, res) => +{ + try + { + reqData = req.body; + id = reqData.id; + delete reqData.id; + + BusinessActivityMaster.update(reqData,{ 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 PolicyParameterMaster data diff --git a/app/routes/routes.js b/app/routes/routes.js index 76f9ec5..167d034 100644 --- a/app/routes/routes.js +++ b/app/routes/routes.js @@ -23,6 +23,336 @@ module.exports = app => { router.get("/MasterDataList", CreditPolicy.MasterDataList); +/** +* @swagger +* definitions: +* createProgramData: +* type: object +* properties: +* program_name: +* type: string +* description: +* example: test +* is_active: +* type: integer +* description: +* example: 1 +* createdby: +* type: integer +* description: +* example: 1 +*/ +/** +* @swagger +* /api/createProgramData: +* post: +* summary: +* description: +* requestBody: +* content: +* application/json: +* schema: +* $ref: '#/definitions/createProgramData' +* responses: +* 200: +* description: create success +* 500: +* description: failure in create +*/ +router.post("/createProgramData", CreditPolicy.createProgramData); + +/** +* @swagger +* definitions: +* updateProgramData: +* type: object +* properties: +* id: +* type: integer +* description: +* example: 1 +* program_name: +* type: string +* description: +* example: test +* is_active: +* type: integer +* description: +* example: 1 +* updatedby: +* type: integer +* description: +* example: 1 +*/ +/** +* @swagger +* /api/updateProgramData: +* post: +* summary: +* description: +* requestBody: +* content: +* application/json: +* schema: +* $ref: '#/definitions/updateProgramData' +* responses: +* 200: +* description: update success +* 500: +* description: failure in update +*/ +router.post("/updateProgramData", CreditPolicy.updateProgramData); + + + + +/** +* @swagger +* definitions: +* createCheckTypeData: +* type: object +* properties: +* check_type: +* type: string +* description: +* example: test +* is_active: +* type: integer +* description: +* example: 1 +* createdby: +* type: integer +* description: +* example: 1 +*/ +/** +* @swagger +* /api/createCheckTypeData: +* post: +* summary: +* description: +* requestBody: +* content: +* application/json: +* schema: +* $ref: '#/definitions/createCheckTypeData' +* responses: +* 200: +* description: create success +* 500: +* description: failure in create +*/ +router.post("/createCheckTypeData", CreditPolicy.createCheckTypeData); + +/** +* @swagger +* definitions: +* updateCheckTypeData: +* type: object +* properties: +* id: +* type: integer +* description: +* example: 1 +* check_type: +* type: string +* description: +* example: test +* is_active: +* type: integer +* description: +* example: 1 +* updatedby: +* type: integer +* description: +* example: 1 +*/ +/** +* @swagger +* /api/updateCheckTypeData: +* post: +* summary: +* description: +* requestBody: +* content: +* application/json: +* schema: +* $ref: '#/definitions/updateCheckTypeData' +* responses: +* 200: +* description: update success +* 500: +* description: failure in update +*/ +router.post("/updateCheckTypeData", CreditPolicy.updateCheckTypeData); + + + +/** +* @swagger +* definitions: +* createPropertyTypeData: +* type: object +* properties: +* property_type: +* type: string +* description: +* example: test +* is_active: +* type: integer +* description: +* example: 1 +* createdby: +* type: integer +* description: +* example: 1 +*/ +/** +* @swagger +* /api/createPropertyTypeData: +* post: +* summary: +* description: +* requestBody: +* content: +* application/json: +* schema: +* $ref: '#/definitions/createPropertyTypeData' +* responses: +* 200: +* description: create success +* 500: +* description: failure in create +*/ +router.post("/createPropertyTypeData", CreditPolicy.createPropertyTypeData); + +/** +* @swagger +* definitions: +* updatePropertyTypeData: +* type: object +* properties: +* id: +* type: integer +* description: +* example: 1 +* property_type: +* type: string +* description: +* example: test +* is_active: +* type: integer +* description: +* example: 1 +* updatedby: +* type: integer +* description: +* example: 1 +*/ +/** +* @swagger +* /api/updatePropertyTypeData: +* post: +* summary: +* description: +* requestBody: +* content: +* application/json: +* schema: +* $ref: '#/definitions/updatePropertyTypeData' +* responses: +* 200: +* description: update success +* 500: +* description: failure in update +*/ +router.post("/updatePropertyTypeData", CreditPolicy.updatePropertyTypeData); + + + + +/** +* @swagger +* definitions: +* createBusinessActivityData: +* type: object +* properties: +* business_activity_name: +* type: string +* description: +* example: test +* is_active: +* type: integer +* description: +* example: 1 +* createdby: +* type: integer +* description: +* example: 1 +*/ +/** +* @swagger +* /api/createBusinessActivityData: +* post: +* summary: +* description: +* requestBody: +* content: +* application/json: +* schema: +* $ref: '#/definitions/createBusinessActivityData' +* responses: +* 200: +* description: create success +* 500: +* description: failure in create +*/ +router.post("/createBusinessActivityData", CreditPolicy.createBusinessActivityData); + +/** +* @swagger +* definitions: +* updateBusinessActivityData: +* type: object +* properties: +* id: +* type: integer +* description: +* example: 1 +* business_activity_name: +* type: string +* description: +* example: test +* is_active: +* type: integer +* description: +* example: 1 +* updatedby: +* type: integer +* description: +* example: 1 +*/ +/** +* @swagger +* /api/updateBusinessActivityData: +* post: +* summary: +* description: +* requestBody: +* content: +* application/json: +* schema: +* $ref: '#/definitions/updateBusinessActivityData' +* responses: +* 200: +* description: update success +* 500: +* description: failure in update +*/ +router.post("/updateBusinessActivityData", CreditPolicy.updateBusinessActivityData); + + + // Parameter Master Data select api /** * @swagger @@ -92,6 +422,10 @@ router.get("/AdjustableTang", CreditPolicy.AdjustableTang); + + + + /** * @swagger * definitions: