"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class stakingExternalPoolPerformance extends sequelize_1.Model{static initModel(e){return stakingExternalPoolPerformance.init({id:{type:sequelize_1.DataTypes.UUID,defaultValue:sequelize_1.DataTypes.UUIDV4,primaryKey:!0,allowNull:!1},poolId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{notNull:{msg:"poolId: Pool ID cannot be null"},isUUID:{args:4,msg:"poolId: Must be a valid UUID"}}},date:{type:sequelize_1.DataTypes.DATE,allowNull:!1,validate:{isDate:{msg:"date: Must be a valid date",args:!0},isNotFuture(e){if(new Date(e)>new Date)throw new Error("date: Cannot be in the future")}}},apr:{type:sequelize_1.DataTypes.FLOAT,allowNull:!1,validate:{isFloat:{msg:"apr: Must be a valid number"},min:{args:[0],msg:"apr: Cannot be negative"}}},totalStaked:{type:sequelize_1.DataTypes.FLOAT,allowNull:!1,validate:{isFloat:{msg:"totalStaked: Must be a valid number"},min:{args:[0],msg:"totalStaked: Cannot be negative"}}},profit:{type:sequelize_1.DataTypes.FLOAT,allowNull:!1,validate:{isFloat:{msg:"profit: Must be a valid number"}}},notes:{type:sequelize_1.DataTypes.TEXT,allowNull:!1,validate:{notEmpty:{msg:"notes: Notes must not be empty"}}}},{sequelize:e,modelName:"stakingExternalPoolPerformance",tableName:"staking_external_pool_performances",paranoid:!0,timestamps:!0,indexes:[{name:"PRIMARY",unique:!0,fields:[{name:"id"}]},{name:"staking_external_pool_performances_pool_idx",fields:[{name:"poolId"}]},{name:"staking_external_pool_performances_date_idx",fields:[{name:"date"}]}]})}static associate(e){stakingExternalPoolPerformance.belongsTo(e.stakingPool,{foreignKey:"poolId",as:"pool",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=stakingExternalPoolPerformance;