"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class notification extends sequelize_1.Model{static initModel(e){return notification.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: Must be a valid UUID"}}},relatedId:{type:sequelize_1.DataTypes.UUID,allowNull:!0},title:{type:sequelize_1.DataTypes.STRING(255),allowNull:!1,validate:{notEmpty:{msg:"title: Notification title must not be empty"}}},type:{type:sequelize_1.DataTypes.STRING(50),allowNull:!1,validate:{notEmpty:{msg:"type: Notification type must not be empty"}}},message:{type:sequelize_1.DataTypes.STRING(255),allowNull:!1,validate:{notEmpty:{msg:"message: Notification message must not be empty"}}},details:{type:sequelize_1.DataTypes.TEXT,allowNull:!0},link:{type:sequelize_1.DataTypes.STRING(255),allowNull:!0},actions:{type:sequelize_1.DataTypes.JSON,allowNull:!0},read:{type:sequelize_1.DataTypes.BOOLEAN,allowNull:!1,defaultValue:!1},idempotencyKey:{type:sequelize_1.DataTypes.STRING(255),allowNull:!0,field:"idempotency_key"},channels:{type:sequelize_1.DataTypes.JSON,allowNull:!0},priority:{type:sequelize_1.DataTypes.ENUM("LOW","NORMAL","HIGH","URGENT"),allowNull:!0,defaultValue:"NORMAL"}},{sequelize:e,modelName:"notification",tableName:"notification",timestamps:!0,paranoid:!0,indexes:[{name:"PRIMARY",unique:!0,fields:[{name:"id"}]},{name:"userId_index",fields:[{name:"userId"}]},{name:"type_index",fields:[{name:"type"}]},{name:"idempotency_key_index",fields:[{name:"idempotency_key"}]}],hooks:{beforeValidate:e=>{e.type&&(e.type=e.type.toLowerCase())}}})}static associate(e){notification.belongsTo(e.user,{as:"user",foreignKey:"userId",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=notification;