"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class forexDuration extends sequelize_1.Model{static initModel(e){return forexDuration.init({id:{type:sequelize_1.DataTypes.UUID,defaultValue:sequelize_1.DataTypes.UUIDV4,primaryKey:!0,allowNull:!1},duration:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,validate:{isInt:{msg:"duration: Duration must be an integer"}}},timeframe:{type:sequelize_1.DataTypes.ENUM("HOUR","DAY","WEEK","MONTH"),allowNull:!1,validate:{isIn:{args:[["HOUR","DAY","WEEK","MONTH"]],msg:"timeframe: Timeframe must be one of HOUR, DAY, WEEK, MONTH"}}}},{sequelize:e,modelName:"forexDuration",tableName:"forex_duration",timestamps:!1,indexes:[{name:"PRIMARY",unique:!0,using:"BTREE",fields:[{name:"id"}]}]})}static associate(e){forexDuration.hasMany(e.forexInvestment,{as:"investments",foreignKey:"durationId",onDelete:"CASCADE",onUpdate:"CASCADE"});forexDuration.hasMany(e.forexPlanDuration,{as:"forexPlanDurations",foreignKey:"durationId",onDelete:"CASCADE",onUpdate:"CASCADE"});forexDuration.belongsToMany(e.forexPlan,{through:e.forexPlanDuration,as:"plans",foreignKey:"durationId",otherKey:"planId",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=forexDuration;