Skip to content

Commit

Permalink
Merge branch 'ft-friday-demo' of https://github.com/atlp-rwanda/e-com…
Browse files Browse the repository at this point in the history
…merce-crafters-bn into ft-friday-demo
  • Loading branch information
Prince-Kid committed May 22, 2024
2 parents a3a7194 + c2a396d commit da111dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/database/migrations/20240520101722-create-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ module.exports = {
profile:{
type: Sequelize.STRING
},
isVerfied:{
type: Sequelize.BOOLEAN,
defaultValue: false

},
createdAt: {
allowNull: false,
type: Sequelize.DATE
Expand Down
4 changes: 3 additions & 1 deletion src/database/models/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +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',
Expand All @@ -28,14 +29,15 @@ import { ftruncate } from "fs";
}
Product.init({
productId: {type:DataTypes.UUID,primaryKey: true,defaultValue: DataTypes.UUIDV4},
vendlorId: {type:DataTypes.STRING,primaryKey: true,defaultValue: DataTypes.UUIDV4},
vendorId: {type:DataTypes.STRING,primaryKey: true,defaultValue: DataTypes.UUIDV4},
name: {type:DataTypes.STRING,allowNull: false},
description: {type:DataTypes.STRING,allowNull: false},
image: {type:DataTypes.STRING,allowNull: false},
discount: {type:DataTypes.INTEGER,allowNull: false},
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,
Expand Down

0 comments on commit da111dc

Please sign in to comment.