41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
JavaScript
'use strict'
|
|
const { Model } = require('sequelize')
|
|
module.exports = (sequelize, DataTypes) => {
|
|
class Entities 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' })
|
|
}
|
|
|
|
|
|
}
|
|
Entities.init(
|
|
{
|
|
losid: { type: DataTypes.STRING },
|
|
process_instance_id: {type: DataTypes.STRING},
|
|
pan: { type: DataTypes.STRING },
|
|
cin: { type: DataTypes.STRING },
|
|
bizname: { type: DataTypes.STRING },
|
|
entity_type: { type: DataTypes.STRING },
|
|
activity_group: { type: DataTypes.STRING },
|
|
biz_act_desc: { type: DataTypes.STRING },
|
|
probe42_data_status : {type : DataTypes.INTEGER},
|
|
is_verified : {type : DataTypes.INTEGER},
|
|
createdby: { type: DataTypes.INTEGER },
|
|
updatedby: { type: DataTypes.INTEGER },
|
|
|
|
},
|
|
{
|
|
sequelize,
|
|
tableName: 'entities',
|
|
modelName: 'Entities',
|
|
}
|
|
)
|
|
return Entities
|
|
}
|