This commit is contained in:
2026-01-17 13:16:43 +03:30
parent 2ddf892793
commit 1c45abcede
11 changed files with 161 additions and 43 deletions
@@ -1,4 +1,4 @@
import { Entity, Enum, Index, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
import { Entity, Enum, Index, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { Order } from './order.entity';
import { Product } from 'src/modules/product/entities/product.entity';
@@ -10,13 +10,16 @@ import { OrderItemStatus } from '../interface/order.interface';
export class OrderItem extends BaseEntity {
@PrimaryKey({ type: 'bigint', autoincrement: true })
id: bigint
@ManyToOne(() => Order)
order!: Order;
@ManyToOne(() => Product)
product!: Product;
@Property({ type: 'json' })
attributesValues: string[]
@Property({ type: 'int' })
quantity!: number;