"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class mailwizardCampaign extends sequelize_1.Model{static initModel(e){return mailwizardCampaign.init({id:{type:sequelize_1.DataTypes.UUID,defaultValue:sequelize_1.DataTypes.UUIDV4,primaryKey:!0,allowNull:!1},templateId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{isUUID:{args:4,msg:"templateId: Template ID must be a valid UUID"}}},name:{type:sequelize_1.DataTypes.STRING(191),allowNull:!1,validate:{notEmpty:{msg:"name: Name cannot be empty"}}},subject:{type:sequelize_1.DataTypes.STRING(191),allowNull:!1,validate:{notEmpty:{msg:"subject: Subject cannot be empty"}}},status:{type:sequelize_1.DataTypes.ENUM("PENDING","PAUSED","ACTIVE","STOPPED","COMPLETED","CANCELLED"),allowNull:!1,defaultValue:"PENDING",validate:{isIn:{args:[["PENDING","PAUSED","ACTIVE","STOPPED","COMPLETED","CANCELLED"]],msg:"status: Status must be one of PENDING, PAUSED, ACTIVE, STOPPED, COMPLETED, CANCELLED"}}},speed:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,defaultValue:1,validate:{isInt:{msg:"speed: Speed must be an integer"}}},targets:{type:sequelize_1.DataTypes.TEXT("long"),allowNull:!0}},{sequelize:e,modelName:"mailwizardCampaign",tableName:"mailwizard_campaign",timestamps:!0,paranoid:!0,indexes:[{name:"PRIMARY",unique:!0,using:"BTREE",fields:[{name:"id"}]},{name:"mailwizardCampaignTemplateIdForeign",using:"BTREE",fields:[{name:"templateId"}]}]})}static associate(e){mailwizardCampaign.belongsTo(e.mailwizardTemplate,{as:"template",foreignKey:"templateId",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=mailwizardCampaign;