add: create supplier

This commit is contained in:
ilham
2021-12-11 23:45:03 +07:00
parent d332935e85
commit 14a00988d9
18 changed files with 267 additions and 45 deletions

View File

@@ -11,6 +11,7 @@ import {
} from 'typeorm';
import { ProductSubCategories } from './product-sub-category.entity';
import { BaseModel } from '../../config/basemodel.entity';
import { Supplier } from '../../users/entities/supplier.entity';
@Entity()
export class Product extends BaseModel {
@@ -43,4 +44,14 @@ export class Product extends BaseModel {
},
)
sub_categories: ProductSubCategories;
@ManyToOne(
() => {
return Supplier;
},
(partner) => {
return partner.id;
},
)
supplier: Supplier;
}