This commit is contained in:
2026-02-19 11:20:15 +03:30
parent d32367f37d
commit c05e9187df
18 changed files with 1811 additions and 2 deletions
@@ -1,7 +1,8 @@
import { Entity, ManyToOne, OptionalProps, Property } from '@mikro-orm/core';
import { Collection, Entity, ManyToOne, OptionalProps, Property,OneToMany } from '@mikro-orm/core';
import { Product } from 'src/modules/product/entities/product.entity';
import { BaseEntity } from 'src/common/entities/base.entity';
import { Invoice } from './invoice.entity';
import { Order } from 'src/modules/order/entities/order.entity';
@Entity({ tableName: 'invoice_items' })
@@ -14,11 +15,14 @@ export class InvoiceItem extends BaseEntity {
@ManyToOne(() => Product)
product!: Product;
@OneToMany(() => Order, order => order.invoiceItem)
orders = new Collection<Order>(this);
@Property({ type: 'int' })
quantity!: number;
@Property({ type: 'int'})
@Property({ type: 'int' })
unitPrice: number;
@Property({