diff --git a/src/database/models/product.ts b/src/database/models/product.ts index a768b16..2ec4196 100644 --- a/src/database/models/product.ts +++ b/src/database/models/product.ts @@ -13,7 +13,7 @@ import { ftruncate } from "fs"; public price!: string public quantity!: number public category!: string - public isVerfied?: boolean + static associate(models: any) { Product.hasMany(models.Wishlist,{ foreignKey: 'productId', @@ -37,7 +37,7 @@ import { ftruncate } from "fs"; price: {type:DataTypes.INTEGER,allowNull: false}, quantity: {type:DataTypes.INTEGER,allowNull: true}, category: {type:DataTypes.STRING,allowNull: true}, - isVerfied: {type:DataTypes.BOOLEAN,defaultValue: false} + }, { sequelize: connectSequelize, diff --git a/src/database/models/user.ts b/src/database/models/user.ts index fd4c346..57a2ac5 100644 --- a/src/database/models/user.ts +++ b/src/database/models/user.ts @@ -12,6 +12,7 @@ import connectSequelize from "../config/db.config"; public cartId?: string public role!: string public profile?: string + public isVerfied?: boolean static associate(models: any) { User.hasMany(models.Rating,{ @@ -37,7 +38,8 @@ import connectSequelize from "../config/db.config"; wishlistId: {type:DataTypes.STRING}, cartId: {type:DataTypes.STRING}, role: {type:DataTypes.STRING,defaultValue:'buyer'}, - profile: {type:DataTypes.STRING,defaultValue: "https://thumbs.dreamstime.com/b/default-avatar-profile-vector-user-profile-default-avatar-profile-vector-user-profile-profile-179376714.jpg"}, + profile: {type:DataTypes.STRING,defaultValue: "https://thumbs.dreamstime.com/b/default-avatar-profile-vector-user-profile-default-avatar-profile-vector-user-profile-profile-179376714.jpg"}, + isVerfied: {type:DataTypes.BOOLEAN,defaultValue: false} }, { sequelize: connectSequelize, modelName: 'User',