"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class p2pOfferFlag extends sequelize_1.Model{static initModel(e){return p2pOfferFlag.init({id:{type:sequelize_1.DataTypes.UUID,defaultValue:sequelize_1.DataTypes.UUIDV4,primaryKey:!0,allowNull:!1},offerId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{isUUID:{args:4,msg:"offerId must be a valid UUID"}}},flaggedById:{type:sequelize_1.DataTypes.UUID,allowNull:!0,validate:{isUUID:{args:4,msg:"flaggedById must be a valid UUID"}}},isFlagged:{type:sequelize_1.DataTypes.BOOLEAN,allowNull:!1,defaultValue:!0},reason:{type:sequelize_1.DataTypes.TEXT,allowNull:!0},flaggedAt:{type:sequelize_1.DataTypes.DATE,allowNull:!1,defaultValue:sequelize_1.DataTypes.NOW}},{sequelize:e,modelName:"p2pOfferFlag",tableName:"p2p_offer_flags",timestamps:!0,paranoid:!0})}static associate(e){p2pOfferFlag.belongsTo(e.p2pOffer,{as:"offer",foreignKey:"offerId",onDelete:"CASCADE",onUpdate:"CASCADE"});p2pOfferFlag.belongsTo(e.user,{as:"flaggedBy",foreignKey:"flaggedById",onDelete:"SET NULL",onUpdate:"CASCADE"})}}exports.default=p2pOfferFlag;