"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class mlmUnilevelNode extends sequelize_1.Model{static initModel(e){return mlmUnilevelNode.init({id:{type:sequelize_1.DataTypes.UUID,defaultValue:sequelize_1.DataTypes.UUIDV4,primaryKey:!0,allowNull:!1},referralId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{isUUID:{args:4,msg:"referralId: Referral ID must be a valid UUID"}}},parentId:{type:sequelize_1.DataTypes.UUID,allowNull:!0,validate:{isUUID:{args:4,msg:"parentId: Parent ID must be a valid UUID"}}}},{sequelize:e,modelName:"mlmUnilevelNode",tableName:"mlm_unilevel_node",timestamps:!1,indexes:[{name:"PRIMARY",unique:!0,using:"BTREE",fields:[{name:"id"}]},{name:"mlmUnilevelNodeReferralIdKey",unique:!0,using:"BTREE",fields:[{name:"referralId"}]},{name:"mlmUnilevelNodeParentIdFkey",using:"BTREE",fields:[{name:"parentId"}]}]})}static associate(e){mlmUnilevelNode.belongsTo(e.mlmUnilevelNode,{as:"parent",foreignKey:"parentId",onDelete:"CASCADE",onUpdate:"CASCADE"});mlmUnilevelNode.hasMany(e.mlmUnilevelNode,{as:"unilevelNodes",foreignKey:"parentId",onDelete:"CASCADE",onUpdate:"CASCADE"});mlmUnilevelNode.belongsTo(e.mlmReferral,{as:"referral",foreignKey:"referralId",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=mlmUnilevelNode;