fixing: get product

This commit is contained in:
ilham
2021-12-14 21:48:21 +07:00
parent ff60406af2
commit 6f1f82cc03
11 changed files with 198 additions and 36 deletions

View File

@@ -12,6 +12,7 @@ import {
import { ProductSubCategories } from './product-sub-category.entity';
import { BaseModel } from '../../config/basemodel.entity';
import { Supplier } from '../../users/entities/supplier.entity';
import { ProductHistoryPrice } from './product-history-price.entity';
@Entity()
export class Product extends BaseModel {
@@ -54,4 +55,16 @@ export class Product extends BaseModel {
},
)
supplier: Supplier;
@OneToMany(
() => {
return ProductHistoryPrice;
},
(php) => {
return php.product;
},
)
priceHistory: ProductHistoryPrice;
currentPrice: ProductHistoryPrice;
}