"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class nftDisputeMessage extends sequelize_1.Model{static initModel(e){return nftDisputeMessage.init({id:{type:sequelize_1.DataTypes.UUID,defaultValue:sequelize_1.DataTypes.UUIDV4,primaryKey:!0,allowNull:!1},disputeId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{notNull:{msg:"disputeId: Dispute ID is required"},isUUID:{args:4,msg:"disputeId: Must be a valid UUID"}}},userId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{notNull:{msg:"userId: User ID is required"},isUUID:{args:4,msg:"userId: Must be a valid UUID"}}},message:{type:sequelize_1.DataTypes.TEXT,allowNull:!1,validate:{notEmpty:{msg:"message: Message cannot be empty"},len:{args:[1,1e4],msg:"message: Message must be between 1 and 10000 characters"}}},attachments:{type:sequelize_1.DataTypes.JSON,allowNull:!0,get(){const e=this.getDataValue("attachments");return e?JSON.parse(e):[]},set(e){this.setDataValue("attachments",e?JSON.stringify(e):null)}},isInternal:{type:sequelize_1.DataTypes.BOOLEAN,allowNull:!1,defaultValue:!1},isSystemMessage:{type:sequelize_1.DataTypes.BOOLEAN,allowNull:!1,defaultValue:!1}},{sequelize:e,modelName:"nftDisputeMessage",tableName:"nft_dispute_message",timestamps:!0,paranoid:!1,indexes:[{name:"idx_dispute_message_dispute",fields:["disputeId"]},{name:"idx_dispute_message_user",fields:["userId"]},{name:"idx_dispute_message_created",fields:["createdAt"]}]})}static associate(e){nftDisputeMessage.belongsTo(e.nftDispute,{as:"dispute",foreignKey:"disputeId"});nftDisputeMessage.belongsTo(e.user,{as:"user",foreignKey:"userId"})}}exports.default=nftDisputeMessage;