"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class binaryAiEngineABTest extends sequelize_1.Model{static initModel(e){return binaryAiEngineABTest.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"}}},testName:{type:sequelize_1.DataTypes.STRING(100),allowNull:!1,validate:{notEmpty:{msg:"testName: Test name must not be empty"}}},status:{type:sequelize_1.DataTypes.ENUM("DRAFT","RUNNING","COMPLETED","CANCELLED"),allowNull:!1,defaultValue:"DRAFT"},startedAt:{type:sequelize_1.DataTypes.DATE,allowNull:!0},endedAt:{type:sequelize_1.DataTypes.DATE,allowNull:!0},controlConfig:{type:sequelize_1.DataTypes.JSON,allowNull:!1},variantConfig:{type:sequelize_1.DataTypes.JSON,allowNull:!1},trafficSplit:{type:sequelize_1.DataTypes.DECIMAL(3,2),allowNull:!1,defaultValue:.5,validate:{min:{args:[.1],msg:"trafficSplit: Must be at least 0.1 (10%)"},max:{args:[.9],msg:"trafficSplit: Must be at most 0.9 (90%)"}},get(){const e=this.getDataValue("trafficSplit");return null!==e?parseFloat(e):.5}},controlOrders:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:0},controlWins:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:0},controlProfit:{type:sequelize_1.DataTypes.DECIMAL(18,8),allowNull:!1,defaultValue:0,get(){const e=this.getDataValue("controlProfit");return null!==e?parseFloat(e):0}},variantOrders:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:0},variantWins:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:0},variantProfit:{type:sequelize_1.DataTypes.DECIMAL(18,8),allowNull:!1,defaultValue:0,get(){const e=this.getDataValue("variantProfit");return null!==e?parseFloat(e):0}},winningVariant:{type:sequelize_1.DataTypes.ENUM("CONTROL","VARIANT","TIE","INCONCLUSIVE"),allowNull:!0},confidenceLevel:{type:sequelize_1.DataTypes.DECIMAL(5,4),allowNull:!0,get(){const e=this.getDataValue("confidenceLevel");return null!==e?parseFloat(e):null}}},{sequelize:e,modelName:"binaryAiEngineABTest",tableName:"binary_ai_engine_ab_test",timestamps:!0,indexes:[{fields:["engineId"]},{fields:["status"]},{fields:["startedAt"]}]})}static associate(e){binaryAiEngineABTest.belongsTo(e.binaryAiEngine,{foreignKey:"engineId",as:"engine",onDelete:"CASCADE"})}}exports.default=binaryAiEngineABTest;