"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class binaryAiEngineUserTier extends sequelize_1.Model{static initModel(e){return binaryAiEngineUserTier.init({id:{type:sequelize_1.DataTypes.UUID,defaultValue:sequelize_1.DataTypes.UUIDV4,primaryKey:!0,allowNull:!1},engineId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{notEmpty:{msg:"engineId: Engine ID must not be empty"},isUUID:{args:4,msg:"engineId: Must be a valid UUID"}}},tierName:{type:sequelize_1.DataTypes.STRING(20),allowNull:!1,validate:{notEmpty:{msg:"tierName: Tier name must not be empty"}}},tierOrder:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:0},minVolume:{type:sequelize_1.DataTypes.DECIMAL(18,8),allowNull:!1,defaultValue:0,get(){const e=this.getDataValue("minVolume");return null!==e?parseFloat(e):0}},minDeposit:{type:sequelize_1.DataTypes.DECIMAL(18,8),allowNull:!1,defaultValue:0,get(){const e=this.getDataValue("minDeposit");return null!==e?parseFloat(e):0}},winRateBonus:{type:sequelize_1.DataTypes.DECIMAL(5,4),allowNull:!1,defaultValue:0,validate:{min:{args:[0],msg:"winRateBonus: Must be at least 0"},max:{args:[.2],msg:"winRateBonus: Must be at most 0.20 (20%)"}},get(){const e=this.getDataValue("winRateBonus");return null!==e?parseFloat(e):0}},description:{type:sequelize_1.DataTypes.STRING(255),allowNull:!0},isActive:{type:sequelize_1.DataTypes.BOOLEAN,allowNull:!1,defaultValue:!0}},{sequelize:e,modelName:"binaryAiEngineUserTier",tableName:"binary_ai_engine_user_tier",timestamps:!0,indexes:[{fields:["engineId","tierName"],unique:!0},{fields:["tierOrder"]},{fields:["engineId"]}]})}static associate(e){binaryAiEngineUserTier.belongsTo(e.binaryAiEngine,{foreignKey:"engineId",as:"engine",onDelete:"CASCADE"})}}exports.default=binaryAiEngineUserTier;