"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class walletPnl extends sequelize_1.Model{static initModel(e){return walletPnl.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:{isUUID:{args:4,msg:"userId: User ID must be a valid UUID"}},comment:"ID of the user whose P&L is tracked"},balances:{type:sequelize_1.DataTypes.JSON,allowNull:!0,get(){const e=this.getDataValue("balances");return e?JSON.parse(e):null},comment:"Profit and loss balances for different wallet types (FIAT, SPOT, ECO)"}},{sequelize:e,modelName:"walletPnl",tableName:"wallet_pnl",timestamps:!0})}static associate(e){walletPnl.belongsTo(e.user,{as:"user",foreignKey:"userId",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=walletPnl;