add: create supplier
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user