"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class ecommerceUserDiscount extends sequelize_1.Model{static initModel(e){return ecommerceUserDiscount.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"}}},discountId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{notNull:{msg:"discountId: Discount ID cannot be null"},isUUID:{args:4,msg:"discountId: Discount ID must be a valid UUID"}}},status:{type:sequelize_1.DataTypes.BOOLEAN,allowNull:!1,defaultValue:!0,validate:{isBoolean:{msg:"status: Status must be a boolean value"}}}},{sequelize:e,modelName:"ecommerceUserDiscount",tableName:"ecommerce_user_discount",timestamps:!1,indexes:[{name:"PRIMARY",unique:!0,using:"BTREE",fields:[{name:"id"}]},{name:"ecommerceUserDiscountUserIdDiscountIdUnique",unique:!0,using:"BTREE",fields:[{name:"userId"},{name:"discountId"}]},{name:"ecommerceUserDiscountDiscountIdFkey",using:"BTREE",fields:[{name:"discountId"}]}]})}static associate(e){ecommerceUserDiscount.belongsTo(e.ecommerceDiscount,{as:"discount",foreignKey:"discountId",onDelete:"CASCADE",onUpdate:"CASCADE"});ecommerceUserDiscount.belongsTo(e.user,{as:"user",foreignKey:"userId",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=ecommerceUserDiscount;