54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
'use strict'
|
|
const { Model } = require('sequelize')
|
|
module.exports = (sequelize, DataTypes) => {
|
|
class DoubleWhammy extends Model {
|
|
|
|
}
|
|
DoubleWhammy.init(
|
|
{
|
|
program_id : { type: DataTypes.INTEGER },
|
|
check_type_id : { type: DataTypes.INTEGER },
|
|
property_type_id : { type: DataTypes.INTEGER },
|
|
property_usage : { type: DataTypes.STRING },
|
|
eligibility_factor_1 : { type: DataTypes.STRING },
|
|
eligibility_factor_2 : { type: DataTypes.STRING },
|
|
eligibility_factor_3 : { type: DataTypes.STRING },
|
|
eligibility_factor_4 : { type: DataTypes.STRING },
|
|
eligibility_factor_5 : { type: DataTypes.STRING },
|
|
result : { type: DataTypes.STRING },
|
|
is_active : { type: DataTypes.INTEGER },
|
|
createdby : { type: DataTypes.INTEGER },
|
|
updatedby : { type: DataTypes.INTEGER },
|
|
createdAt : { type: DataTypes.DATE },
|
|
updatedAt : { type: DataTypes.DATE },
|
|
|
|
},
|
|
{
|
|
sequelize,
|
|
tableName: 'double_whammy',
|
|
modelName: 'DoubleWhammy',
|
|
}
|
|
)
|
|
|
|
|
|
|
|
DoubleWhammy.associate = models => {
|
|
DoubleWhammy.hasMany(models.ProgramMaster, {
|
|
foreignKey: 'id',
|
|
sourceKey : 'program_id'
|
|
});
|
|
DoubleWhammy.hasMany(models.CheckTypeMaster, {
|
|
foreignKey: 'id',
|
|
sourceKey : 'check_type_id'
|
|
});
|
|
DoubleWhammy.hasMany(models.PropertyTypeMaster, {
|
|
foreignKey: 'id',
|
|
sourceKey : 'property_type_id'
|
|
});
|
|
|
|
}
|
|
|
|
|
|
return DoubleWhammy
|
|
}
|