modelfile:GWM
This commit is contained in:
parent
7ce849a76f
commit
c9ddd223c3
28
app/controllers/entity.applicant.controller.js
Normal file
28
app/controllers/entity.applicant.controller.js
Normal file
@ -0,0 +1,28 @@
|
||||
const { sequelize,EntityApplicantMaster} = require('../models')
|
||||
const { logMsg } = require('../services/logger.js');
|
||||
|
||||
|
||||
|
||||
exports.createEntityDetails = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
await EntityApplicantMaster.create(req.body)
|
||||
.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 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
|
||||
|
||||
};
|
||||
|
||||
28
app/controllers/master.controller.js
Normal file
28
app/controllers/master.controller.js
Normal file
@ -0,0 +1,28 @@
|
||||
const { sequelize,EntityApplicantMaster} = require('../models')
|
||||
const { logMsg } = require('../services/logger.js');
|
||||
|
||||
exports.MasterData = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
await EntityApplicantMaster.findAll({where :{is_active : 1} })
|
||||
.then(data =>
|
||||
{
|
||||
res.send({'status':200,'message':"success",'EntityApplicantMasterData':data});
|
||||
logMsg.info("Master Data List api call Success");
|
||||
})
|
||||
.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
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
41
app/models/ApplicantsDetails.js
Normal file
41
app/models/ApplicantsDetails.js
Normal file
@ -0,0 +1,41 @@
|
||||
'use strict'
|
||||
const { Model } = require('sequelize')
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
class ApplicantsDetails extends Model {
|
||||
/**
|
||||
* Helper method for defining associations.
|
||||
* This method is not a part of Sequelize lifecycle.
|
||||
* The `models/index` file will call this method automatically.
|
||||
*/
|
||||
// define association here
|
||||
// static associate({ Financials }) {
|
||||
// this.hasMany(Financials, { foreignKey: 'entity_id', as: 'financialsData' })
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
ApplicantsDetails.init(
|
||||
{
|
||||
entity_details_id: { type: DataTypes.INTEGER },
|
||||
name: { type: DataTypes.STRING },
|
||||
entity_type: { type: DataTypes.STRING },
|
||||
designation: { type: DataTypes.STRING },
|
||||
ownership_share_in_the_entity: { type: DataTypes.STRING },
|
||||
designatapplicant_typeion: { type: DataTypes.STRING },
|
||||
key_promoter: { type: DataTypes.INTEGER },
|
||||
bureau_name: { type: DataTypes.STRING },
|
||||
bureau_score: { type: DataTypes.STRING },
|
||||
heir_in_business_and_on_loan_struct: { type: DataTypes.STRING },
|
||||
nri: { type: DataTypes.STRING },
|
||||
createdby: { type: DataTypes.INTEGER },
|
||||
updatedby: { type: DataTypes.INTEGER },
|
||||
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
tableName: 'applicants',
|
||||
modelName: 'ApplicantsDetails',
|
||||
}
|
||||
)
|
||||
return ApplicantsDetails
|
||||
}
|
||||
41
app/models/ApplicantsRelationship.js
Normal file
41
app/models/ApplicantsRelationship.js
Normal file
@ -0,0 +1,41 @@
|
||||
'use strict'
|
||||
const { Model } = require('sequelize')
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
class ApplicantsRelationship extends Model {
|
||||
/**
|
||||
* Helper method for defining associations.
|
||||
* This method is not a part of Sequelize lifecycle.
|
||||
* The `models/index` file will call this method automatically.
|
||||
*/
|
||||
// define association here
|
||||
// static associate({ Financials }) {
|
||||
// this.hasMany(Financials, { foreignKey: 'entity_id', as: 'financialsData' })
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
ApplicantsRelationship.init(
|
||||
{
|
||||
applicant_id: { type: DataTypes.INTEGER },
|
||||
name_of_the_individual: { type: DataTypes.STRING },
|
||||
related_to: { type: DataTypes.STRING },
|
||||
relationship: { type: DataTypes.STRING },
|
||||
is_main_person_running_the_business: { type: DataTypes.INTEGER },
|
||||
no_of_years_in_this_entity: { type: DataTypes.INTEGER },
|
||||
no_of_years_in_same_line_of_buss: { type: DataTypes.INTEGER },
|
||||
dob: { type: DataTypes.DataTypes },
|
||||
age: { type: DataTypes.INTEGER },
|
||||
gender: { type: DataTypes.STRING },
|
||||
remarks: { type: DataTypes.STRING },
|
||||
createdby: { type: DataTypes.INTEGER },
|
||||
updatedby: { type: DataTypes.INTEGER },
|
||||
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
tableName: 'applicants_relationship',
|
||||
modelName: 'ApplicantsRelationship',
|
||||
}
|
||||
)
|
||||
return ApplicantsRelationship
|
||||
}
|
||||
32
app/models/EntityApplicantMaster.js
Normal file
32
app/models/EntityApplicantMaster.js
Normal file
@ -0,0 +1,32 @@
|
||||
'use strict'
|
||||
const { Model } = require('sequelize')
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
class EntityApplicantMaster extends Model {
|
||||
/**
|
||||
* Helper method for defining associations.
|
||||
* This method is not a part of Sequelize lifecycle.
|
||||
* The `models/index` file will call this method automatically.
|
||||
*/
|
||||
// define association here
|
||||
// static associate({ Financials }) {
|
||||
// this.hasMany(Financials, { foreignKey: 'entity_id', as: 'financialsData' })
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
EntityApplicantMaster.init(
|
||||
{
|
||||
master_name: { type: DataTypes.STRING },
|
||||
value: { type: DataTypes.STRING },
|
||||
sub_value: { type: DataTypes.STRING },
|
||||
is_active: { type: DataTypes.INTEGER }
|
||||
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
tableName: 'entity_applicant_master',
|
||||
modelName: 'EntityApplicantMaster',
|
||||
}
|
||||
)
|
||||
return EntityApplicantMaster
|
||||
}
|
||||
65
app/models/EntityDetails.js
Normal file
65
app/models/EntityDetails.js
Normal file
@ -0,0 +1,65 @@
|
||||
'use strict'
|
||||
const { Model } = require('sequelize')
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
class EntityDetails extends Model {
|
||||
/**
|
||||
* Helper method for defining associations.
|
||||
* This method is not a part of Sequelize lifecycle.
|
||||
* The `models/index` file will call this method automatically.
|
||||
*/
|
||||
// define association here
|
||||
// static associate({ Financials }) {
|
||||
// this.hasMany(Financials, { foreignKey: 'entity_id', as: 'financialsData' })
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
EntityDetails.init(
|
||||
{
|
||||
loan_no_id: { type: DataTypes.INTEGER },
|
||||
snep_sep: { type: DataTypes.STRING },
|
||||
cat_of_sep: { type: DataTypes.STRING },
|
||||
sub_cat_of_sep: { type: DataTypes.STRING },
|
||||
entity_name: { type: DataTypes.STRING },
|
||||
bureau_score: { type: DataTypes.STRING },
|
||||
bureau_name: { type: DataTypes.STRING },
|
||||
entity_type: { type: DataTypes.STRING },
|
||||
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 },
|
||||
registered_address_state: { type: DataTypes.STRING },
|
||||
registered_address_city: { type: DataTypes.STRING },
|
||||
registered_address_pin: { type: DataTypes.INTEGER },
|
||||
registered_address_registered_address_ownership_statuspin: { type: DataTypes.STRING },
|
||||
operating_address_of_business: { type: DataTypes.STRING },
|
||||
operating_address_ownership_status: { type: DataTypes.STRING },
|
||||
operating_address_city_category: { type: DataTypes.STRING },
|
||||
operating_address_state: { type: DataTypes.STRING },
|
||||
operating_address_city: { type: DataTypes.STRING },
|
||||
operating_address_pin: { type: DataTypes.INTEGER },
|
||||
operating_address_of_business_type: { type: DataTypes.STRING },
|
||||
type_of_bussiness_activity: { type: DataTypes.STRING },
|
||||
no_of_yr_at_opaob: { type: DataTypes.INTEGER },
|
||||
area_in_which_at_opaob_is_located: { type: DataTypes.STRING },
|
||||
workplace_type: { type: DataTypes.STRING },
|
||||
others: { type: DataTypes.STRING },
|
||||
external_rating: { type: DataTypes.STRING },
|
||||
industry: { type: DataTypes.STRING },
|
||||
other_industry: { type: DataTypes.STRING },
|
||||
profile: { type: DataTypes.STRING },
|
||||
any_changes_in_dirship_parship_in_lst_6mns: { type: DataTypes.STRING },
|
||||
is_the_change_related_to_key_promoter: { type: DataTypes.STRING },
|
||||
remark_on_change__in_directorship: { type: DataTypes.STRING },
|
||||
createdby: { type: DataTypes.INTEGER },
|
||||
updatedby: { type: DataTypes.INTEGER },
|
||||
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
tableName: 'entity_details',
|
||||
modelName: 'EntityDetails',
|
||||
}
|
||||
)
|
||||
return EntityDetails
|
||||
}
|
||||
39
app/models/ResidenceAddressDetails.js
Normal file
39
app/models/ResidenceAddressDetails.js
Normal file
@ -0,0 +1,39 @@
|
||||
'use strict'
|
||||
const { Model } = require('sequelize')
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
class ResidenceAddressDetails extends Model {
|
||||
/**
|
||||
* Helper method for defining associations.
|
||||
* This method is not a part of Sequelize lifecycle.
|
||||
* The `models/index` file will call this method automatically.
|
||||
*/
|
||||
// define association here
|
||||
// static associate({ Financials }) {
|
||||
// this.hasMany(Financials, { foreignKey: 'entity_id', as: 'financialsData' })
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
ResidenceAddressDetails.init(
|
||||
{
|
||||
entity_details_id: { type: DataTypes.INTEGER },
|
||||
name_of_the_individual: { type: DataTypes.STRING },
|
||||
residence_address: { type: DataTypes.STRING },
|
||||
residence_geo_limit_compliance: { type: DataTypes.STRING },
|
||||
residence_location_area: { type: DataTypes.STRING },
|
||||
ownership_status: { type: DataTypes.STRING },
|
||||
residence_stay_period_in_years: { type: DataTypes.INTEGER },
|
||||
residence_stay_period_in_bracket: { type: DataTypes.INTEGER },
|
||||
remarks: { type: DataTypes.STRING },
|
||||
createdby: { type: DataTypes.INTEGER },
|
||||
updatedby: { type: DataTypes.INTEGER },
|
||||
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
tableName: 'residence_address_details',
|
||||
modelName: 'ResidenceAddressDetails',
|
||||
}
|
||||
)
|
||||
return ResidenceAddressDetails
|
||||
}
|
||||
@ -1,14 +1,13 @@
|
||||
module.exports = app => {
|
||||
const request = require("request");
|
||||
const cors=require('cors');
|
||||
const Mycontroller = require("../controllers/test.controller.js");
|
||||
const Testcontroller = require("../controllers/test.controller.js");
|
||||
const Entitycontroller = require("../controllers/entity.applicant.controller.js");
|
||||
const Mastercontroller = require("../controllers/entity.applicant.controller.js");
|
||||
const { logMsg } = require('../services/logger.js');
|
||||
var router = require("express").Router();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/demo:
|
||||
@ -19,7 +18,76 @@ module.exports = app => {
|
||||
* 200:
|
||||
* description: success
|
||||
*/
|
||||
router.get("/demo", Mycontroller.Welcome);
|
||||
router.get("/demo", Testcontroller.Welcome);
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
* createEntityDetails:
|
||||
* type: object
|
||||
* properties:
|
||||
* loan_no_id:
|
||||
* type: string
|
||||
* description: losid
|
||||
* example: MW12233
|
||||
* entityid:
|
||||
* type: integer
|
||||
* description: entityid
|
||||
* example: 1
|
||||
* fy:
|
||||
* type: integer
|
||||
* description: financial Year
|
||||
* example: 2022
|
||||
* st_type:
|
||||
* type: integer
|
||||
* description: statement type
|
||||
* example: 2
|
||||
* additional_year_type:
|
||||
* type: integer
|
||||
* description: additional year type
|
||||
* example: 2
|
||||
*/
|
||||
/**
|
||||
* @swagger
|
||||
* /api/createEntityDetails:
|
||||
* post:
|
||||
* summary: create entity details
|
||||
* description: create a new entity
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* $ref: '#/definitions/createEntityDetails'
|
||||
* responses:
|
||||
* 200:
|
||||
* description: New entity details inserted
|
||||
* 500:
|
||||
* description: failure in inserting entity details Year
|
||||
*/
|
||||
router.post("/createEntityDetails", Entitycontroller.createEntityDetails);
|
||||
|
||||
|
||||
|
||||
|
||||
// Master data Api's
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/MasterData:
|
||||
* get:
|
||||
* summary: Dropdown master data Api
|
||||
* description: All master data for dropdown value
|
||||
* responses:
|
||||
* 200:
|
||||
* description: success
|
||||
*/
|
||||
router.get("/MasterData", Mastercontroller.MasterData);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user