Merge branch 'master' of bitbucket.org:venbainformationtechnology/smc_cet_mainapp_backend
This commit is contained in:
commit
c17bb283e6
@ -1,4 +1,4 @@
|
||||
const { sequelize , LoanDetail , EntityDetails , ApplicantsDetails , ApplicantsRelationship , ResidenceAddressDetails , PropertyOwnershipIncomeConsidered , DueDiligenceCheck , TradeReferences} = require('../models')
|
||||
const { sequelize , LoanDetail , EntityDetails , ApplicantsDetails , ApplicantsRelationship , ResidenceAddressDetails , PropertyOwnershipIncomeConsidered , DueDiligenceCheck , TradeReferences , CheckTypeMaster} = require('../models')
|
||||
const { logMsg } = require('../services/logger.js');
|
||||
|
||||
|
||||
@ -9,10 +9,29 @@ exports.createEntityDetails = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
EntityDetails.create(req.body).then(data =>
|
||||
EntityDetails.create(req.body).then(async(data) =>
|
||||
{
|
||||
res.send({'status':200,'message':"success",'data':data});
|
||||
logMsg.info("Master Data List api call Success");
|
||||
CheckTypeMaster.findAll({raw: true , where : {is_active : 1}}).then(async(CheckTypeMasterData) =>
|
||||
{
|
||||
entityid = data.dataValues.id;
|
||||
DueDiligenceCheckData = [];
|
||||
for (const value of CheckTypeMasterData)
|
||||
{
|
||||
check_type_obj = {entity_id:entityid , check_type_id:value.id , check_type:value.value};
|
||||
DueDiligenceCheckData.push(check_type_obj);
|
||||
}
|
||||
setTimeout(() => {
|
||||
DueDiligenceCheck.bulkCreate(DueDiligenceCheckData)
|
||||
.then(DueDiligenceCheckData =>{ logMsg.info("DueDiligenceCheck Data Creation Success for EntityId= "+entityid); })
|
||||
.catch(err =>{ logMsg.info("DueDiligenceCheck Data Creation Failed for EntityId= "+entityid+" Error= "+err); });
|
||||
}, 500);
|
||||
})
|
||||
.catch(err => { logMsg.info("DueDiligenceCheckType Data Fetching Failed for EntityId= "+entityid+" Error= "+err); });
|
||||
setTimeout(() => {
|
||||
res.send({'status':200,'message':"success",'data':data});
|
||||
}, 1000);
|
||||
|
||||
logMsg.info("Entity created successfully");
|
||||
})
|
||||
.catch(err => {
|
||||
res.send({'status':404,
|
||||
@ -517,3 +536,18 @@ exports.TradeReferencesList = async (req, res) =>
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
// test api
|
||||
exports.test = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
} catch(err) {
|
||||
res.send({'status':404,message: err.message || "Some error occurred while inserting statements." ,'data': "No data" });
|
||||
} //end of try catch
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -7,7 +7,9 @@ module.exports = (sequelize, DataTypes) => {
|
||||
CheckTypeMaster.init(
|
||||
{
|
||||
value: { type: DataTypes.STRING },
|
||||
is_active: { type: DataTypes.INTEGER }
|
||||
createdby: { type: DataTypes.INTEGER },
|
||||
updatedby: { type: DataTypes.INTEGER },
|
||||
is_active: {type : DataTypes.INTEGER}
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
|
||||
@ -19,6 +19,7 @@ module.exports = app => {
|
||||
* description: success
|
||||
*/
|
||||
router.get("/demo", Testcontroller.Welcome);
|
||||
router.get("/test", Entitycontroller.test);
|
||||
|
||||
|
||||
// Loan Details List Api
|
||||
@ -534,6 +535,211 @@ router.post("/updateEntityDetails", Entitycontroller.updateEntityDetails);
|
||||
|
||||
|
||||
// Create new Applicant and it's child Details (Relationship, Address, Property ownership)
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* createApplicantDetails:
|
||||
* type: object
|
||||
* properties:
|
||||
* loan_no_id:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* name:
|
||||
* type: string
|
||||
* description:
|
||||
* example: kumar
|
||||
* entity_type:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Individual
|
||||
* designation:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Proprietor
|
||||
* ownership_share_in_the_entity:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 1
|
||||
* applicant_type:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Guarantor
|
||||
* key_promoter:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Yes
|
||||
* bureau_name:
|
||||
* type: string
|
||||
* description:
|
||||
* example: CRIF High Mark
|
||||
* bureau_score:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: NULL
|
||||
* heir_in_business_and_on_loan_struct:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Yes
|
||||
* nri:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: Yes
|
||||
* createdby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 003
|
||||
* applicant_relationship:
|
||||
* type: application/json
|
||||
* description:
|
||||
* example:
|
||||
* schema:
|
||||
* $ref: '#/definitions/applicant_relationship'
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* applicant_relationship:
|
||||
* type: object
|
||||
* properties:
|
||||
* name_of_the_individual:
|
||||
* type: string
|
||||
* description:
|
||||
* example: kumar
|
||||
* related_to:
|
||||
* type: string
|
||||
* description:
|
||||
* example: gowtham
|
||||
* relationship:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Brother
|
||||
* is_main_person_running_the_business:
|
||||
* type: string
|
||||
* description: No
|
||||
* example: kumar
|
||||
* no_of_years_in_this_entity:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 3
|
||||
* no_of_years_in_same_line_of_buss:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 5
|
||||
* dob:
|
||||
* type: date
|
||||
* description:
|
||||
* example: 1996-06-04
|
||||
* age:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 25
|
||||
* gender:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Male
|
||||
* remarks:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Nothing
|
||||
* createdby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 003
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* residence_address:
|
||||
* type: object
|
||||
* properties:
|
||||
* name_of_the_individual:
|
||||
* type: string
|
||||
* description:
|
||||
* example: kumar
|
||||
* residence_address:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Chennai
|
||||
* residence_geo_limit_compliance:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Within Geo-Limits
|
||||
* residence_location_area:
|
||||
* type: string
|
||||
* description: No
|
||||
* example: Positive Area
|
||||
* ownership_status:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Owned
|
||||
* residence_stay_period_in_years:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 5
|
||||
* residence_stay_period_in_bracket:
|
||||
* type: date
|
||||
* description:
|
||||
* example: '> = 1 Yr'
|
||||
* remarks:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Nothing
|
||||
* createdby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 003
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* property_ownership_income_considered:
|
||||
* type: object
|
||||
* properties:
|
||||
* name_of_the_loan_applicants:
|
||||
* type: string
|
||||
* description:
|
||||
* example: kumar
|
||||
* applicant_type:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Guarantor
|
||||
* income_considered:
|
||||
* type: string
|
||||
* description:
|
||||
* example: Yes
|
||||
* property_owner:
|
||||
* type: string
|
||||
* description: Yes
|
||||
* createdby:
|
||||
* type: integer
|
||||
* description:
|
||||
* example: 003
|
||||
*/
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/createApplicantDetails:
|
||||
* post:
|
||||
* summary: create ApplicantDetails Details
|
||||
* description: create Applicants Details and relationship/residenceAddress and property_ownership_income_considered
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/definitions/createApplicantDetails'
|
||||
* responses:
|
||||
* 200:
|
||||
* description: New ApplicantDetails created
|
||||
* 500:
|
||||
* description: failure in creating ApplicantDetails
|
||||
*/
|
||||
router.post("/createApplicantDetails", Entitycontroller.createApplicantDetails);
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user