'use strict' const { Model } = require('sequelize') module.exports = (sequelize, DataTypes) => { class PropertyAndLtv 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' }) // } } PropertyAndLtv.init( { losid: { type: DataTypes.STRING }, product : { type: DataTypes.STRING }, address_of_prop_to_be_mortgaged : { type: DataTypes.STRING }, property_type : { type: DataTypes.STRING }, property_usage : { type: DataTypes.STRING }, structure_type : { type: DataTypes.STRING }, slum_type : { type: DataTypes.STRING }, property_completion_stage : { type: DataTypes.STRING }, stage_of_construction : { type: DataTypes.STRING }, property_area : { type: DataTypes.STRING }, activity_in_property : { type: DataTypes.STRING }, mark_valuation_1 : { type: DataTypes.INTEGER }, mark_valuation_2 : { type: DataTypes.INTEGER }, third_val_not_req : { type: DataTypes.INTEGER }, variance_in_mv1_and_mv2 : { type: DataTypes.INTEGER }, // override : { type: DataTypes.STRING }, market_val_considered_for_ltv_calculation : { type: DataTypes.INTEGER }, ltv_on_loan_applied_for : { type: DataTypes.STRING }, max_ltv_norms_as_per_policy : { type: DataTypes.STRING }, ltv_norms : { type: DataTypes.STRING }, residual_life_of_property_for_1yr : { type: DataTypes.STRING }, residual_life_of_property_for_2yr : { type: DataTypes.STRING }, residual_life_of_property_considered_years : { type: DataTypes.STRING }, third_val_not_done : { type: DataTypes.INTEGER }, comp_of_loan_tenure_to_residual_life_of_property : { type: DataTypes.STRING }, norms_of_residual_age_of_property_years : { type: DataTypes.STRING }, carpet_area_of_property_to_be_mortgage_sqft : { type: DataTypes.STRING }, carpet_area_of_property_norms : { type: DataTypes.STRING }, ltv_norms_met_not_met : { type: DataTypes.STRING }, createdAt : { type: DataTypes.DATE }, createdby : { type: DataTypes.INTEGER }, updatedAt : { type: DataTypes.DATE }, updatedby : { type: DataTypes.INTEGER }, is_active : { type: DataTypes.INTEGER }, }, { sequelize, tableName: 'property_and_ltv_details', modelName: 'PropertyAndLtv', } ) PropertyAndLtv.associate = models => { PropertyAndLtv.hasMany(models.LoanDetail, { foreignKey: 'losid', sourceKey : 'losid' }); } return PropertyAndLtv }