diff --git a/src/cart/entities/cart.entity.ts b/src/cart/entities/cart.entity.ts index 5d96d83..1a8e400 100644 --- a/src/cart/entities/cart.entity.ts +++ b/src/cart/entities/cart.entity.ts @@ -8,14 +8,14 @@ export class Cart extends Model { @Column userId: number; - @BelongsTo(() => User, { onDelete: 'CASCADE' }) + @BelongsTo(() => User, { onDelete: "CASCADE" }) user: User; @ForeignKey(() => Product) @Column productId: number; - @BelongsTo(() => Product, { onDelete: 'CASCADE' }) + @BelongsTo(() => Product, { onDelete: "CASCADE" }) product: Product; @Column({ @@ -23,4 +23,10 @@ export class Cart extends Model { allowNull: false, }) quantity: number; + + @Column({ + type: DataType.DECIMAL(10, 2), + allowNull: false, + }) + productPrice: number; }