"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class copyTradingFollower extends sequelize_1.Model{static initModel(e){return copyTradingFollower.init({id:{type:sequelize_1.DataTypes.UUID,defaultValue:sequelize_1.DataTypes.UUIDV4,primaryKey:!0,allowNull:!1},userId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{notNull:{msg:"userId: User ID is required"}}},leaderId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{notNull:{msg:"leaderId: Leader ID is required"}}},copyMode:{type:sequelize_1.DataTypes.ENUM("PROPORTIONAL","FIXED_AMOUNT","FIXED_RATIO"),allowNull:!1,defaultValue:"PROPORTIONAL"},fixedAmount:{type:sequelize_1.DataTypes.FLOAT,allowNull:!0},fixedRatio:{type:sequelize_1.DataTypes.FLOAT,allowNull:!0},maxDailyLoss:{type:sequelize_1.DataTypes.FLOAT,allowNull:!0},maxPositionSize:{type:sequelize_1.DataTypes.FLOAT,allowNull:!0},stopLossPercent:{type:sequelize_1.DataTypes.FLOAT,allowNull:!0},takeProfitPercent:{type:sequelize_1.DataTypes.FLOAT,allowNull:!0},status:{type:sequelize_1.DataTypes.ENUM("ACTIVE","PAUSED","STOPPED"),allowNull:!1,defaultValue:"ACTIVE"},createdAt:{type:sequelize_1.DataTypes.DATE,allowNull:!1,defaultValue:sequelize_1.DataTypes.NOW},updatedAt:{type:sequelize_1.DataTypes.DATE,allowNull:!1,defaultValue:sequelize_1.DataTypes.NOW},deletedAt:{type:sequelize_1.DataTypes.DATE,allowNull:!0}},{sequelize:e,modelName:"copyTradingFollower",tableName:"copy_trading_followers",timestamps:!0,paranoid:!0,indexes:[{name:"PRIMARY",unique:!0,fields:[{name:"id"}]},{name:"copy_trading_followers_user_leader_idx",unique:!0,fields:[{name:"userId"},{name:"leaderId"}]},{name:"copy_trading_followers_user_id_idx",fields:[{name:"userId"}]},{name:"copy_trading_followers_leader_id_idx",fields:[{name:"leaderId"}]},{name:"copy_trading_followers_status_idx",fields:[{name:"status"}]}]})}static associate(e){copyTradingFollower.belongsTo(e.user,{foreignKey:"userId",as:"user",onDelete:"CASCADE",onUpdate:"CASCADE"});copyTradingFollower.belongsTo(e.copyTradingLeader,{foreignKey:"leaderId",as:"leader",onDelete:"CASCADE",onUpdate:"CASCADE"});copyTradingFollower.hasMany(e.copyTradingTrade,{foreignKey:"followerId",as:"trades",onDelete:"CASCADE",onUpdate:"CASCADE"});copyTradingFollower.hasMany(e.copyTradingTransaction,{foreignKey:"followerId",as:"transactions",onDelete:"CASCADE",onUpdate:"CASCADE"});copyTradingFollower.hasMany(e.copyTradingFollowerAllocation,{foreignKey:"followerId",as:"allocations",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=copyTradingFollower;