"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize"),init_1=require("../init");class twoFactor extends sequelize_1.Model{static initModel(e){return twoFactor.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"},isUUID:{args:4,msg:"userId: User ID must be a valid UUID"}}},secret:{type:sequelize_1.DataTypes.STRING(255),allowNull:!1,validate:{notEmpty:{msg:"secret: Secret cannot be empty"}}},type:{type:sequelize_1.DataTypes.ENUM("EMAIL","SMS","APP"),allowNull:!1,validate:{isIn:{args:[["EMAIL","SMS","APP"]],msg:"type: Type must be one of ['EMAIL', 'SMS', 'APP']"}}},enabled:{type:sequelize_1.DataTypes.BOOLEAN,allowNull:!1,defaultValue:!1},recoveryCodes:{type:sequelize_1.DataTypes.TEXT("long"),allowNull:!0}},{sequelize:e,modelName:"twoFactor",tableName:"two_factor",timestamps:!0,paranoid:!0,indexes:[{name:"PRIMARY",unique:!0,using:"BTREE",fields:[{name:"id"}]},{name:"twoFactorUserIdKey",unique:!0,using:"BTREE",fields:[{name:"userId"}]},{name:"twoFactorUserIdForeign",using:"BTREE",fields:[{name:"userId"}]}],hooks:{...(0,init_1.createUserCacheHooks)()}})}static associate(e){twoFactor.belongsTo(e.user,{as:"user",foreignKey:"userId",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=twoFactor;