"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class binaryAiEngineUserCooldown extends sequelize_1.Model{static initModel(e){return binaryAiEngineUserCooldown.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"}}},userId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{notEmpty:{msg:"userId: User ID must not be empty"},isUUID:{args:4,msg:"userId: Must be a valid UUID"}}},reason:{type:sequelize_1.DataTypes.ENUM("BIG_WIN","STREAK","MANUAL"),allowNull:!1,defaultValue:"BIG_WIN"},triggerOrderId:{type:sequelize_1.DataTypes.UUID,allowNull:!0},triggerAmount:{type:sequelize_1.DataTypes.DECIMAL(18,8),allowNull:!0,get(){const e=this.getDataValue("triggerAmount");return null!==e?parseFloat(e):null}},winRateReduction:{type:sequelize_1.DataTypes.DECIMAL(5,4),allowNull:!1,validate:{min:{args:[0],msg:"winRateReduction: Must be at least 0"},max:{args:[.5],msg:"winRateReduction: Must be at most 0.50 (50%)"}},get(){const e=this.getDataValue("winRateReduction");return null!==e?parseFloat(e):0}},startsAt:{type:sequelize_1.DataTypes.DATE,allowNull:!1},expiresAt:{type:sequelize_1.DataTypes.DATE,allowNull:!1},isActive:{type:sequelize_1.DataTypes.BOOLEAN,allowNull:!1,defaultValue:!0}},{sequelize:e,modelName:"binaryAiEngineUserCooldown",tableName:"binary_ai_engine_user_cooldown",timestamps:!0,indexes:[{fields:["engineId","userId"]},{fields:["expiresAt"]},{fields:["isActive"]},{fields:["userId"]}]})}static associate(e){binaryAiEngineUserCooldown.belongsTo(e.binaryAiEngine,{foreignKey:"engineId",as:"engine",onDelete:"CASCADE"});e.user&&binaryAiEngineUserCooldown.belongsTo(e.user,{foreignKey:"userId",as:"user"})}}exports.default=binaryAiEngineUserCooldown;