"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class binaryAiEngineCohort extends sequelize_1.Model{static initModel(e){return binaryAiEngineCohort.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"}}},cohortName:{type:sequelize_1.DataTypes.STRING(100),allowNull:!1,validate:{notEmpty:{msg:"cohortName: Cohort name must not be empty"}}},cohortType:{type:sequelize_1.DataTypes.ENUM("SIGNUP_DATE","DEPOSIT_AMOUNT","TRADE_FREQUENCY","CUSTOM"),allowNull:!1},startDate:{type:sequelize_1.DataTypes.DATE,allowNull:!0},endDate:{type:sequelize_1.DataTypes.DATE,allowNull:!0},minValue:{type:sequelize_1.DataTypes.DECIMAL(18,8),allowNull:!0,get(){const e=this.getDataValue("minValue");return null!==e?parseFloat(e):null}},maxValue:{type:sequelize_1.DataTypes.DECIMAL(18,8),allowNull:!0,get(){const e=this.getDataValue("maxValue");return null!==e?parseFloat(e):null}},customCriteria:{type:sequelize_1.DataTypes.JSON,allowNull:!0},userCount:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:0},totalOrders:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:0},totalWins:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:0},avgWinRate:{type:sequelize_1.DataTypes.DECIMAL(5,4),allowNull:!1,defaultValue:0,get(){const e=this.getDataValue("avgWinRate");return null!==e?parseFloat(e):0}},totalProfit:{type:sequelize_1.DataTypes.DECIMAL(18,8),allowNull:!1,defaultValue:0,get(){const e=this.getDataValue("totalProfit");return null!==e?parseFloat(e):0}},lastCalculatedAt:{type:sequelize_1.DataTypes.DATE,allowNull:!0}},{sequelize:e,modelName:"binaryAiEngineCohort",tableName:"binary_ai_engine_cohort",timestamps:!0,indexes:[{fields:["engineId"]},{fields:["cohortType"]},{fields:["cohortName"]}]})}static associate(e){binaryAiEngineCohort.belongsTo(e.binaryAiEngine,{foreignKey:"engineId",as:"engine",onDelete:"CASCADE"})}}exports.default=binaryAiEngineCohort;