"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class faqSearch extends sequelize_1.Model{static initModel(e){return faqSearch.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 cannot be null"}}},query:{type:sequelize_1.DataTypes.TEXT,allowNull:!1,validate:{notEmpty:{msg:"query: Search query must not be empty"}}},resultCount:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:0,validate:{isInt:{msg:"resultCount: Must be an integer"},min:{args:[0],msg:"resultCount: Cannot be negative"}}},category:{type:sequelize_1.DataTypes.STRING(191),allowNull:!0}},{sequelize:e,modelName:"faqSearch",tableName:"faq_searches",paranoid:!0,timestamps:!0,indexes:[{name:"PRIMARY",unique:!0,fields:[{name:"id"}]},{name:"faq_searches_query_idx",fields:[{name:"query",length:255}]}]})}static associate(e){this.belongsTo(e.user,{foreignKey:"userId",as:"user",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=faqSearch;