43 lines
719 B
TypeScript
43 lines
719 B
TypeScript
import {
|
|
Entity,
|
|
Column,
|
|
PrimaryGeneratedColumn,
|
|
UpdateDateColumn,
|
|
DeleteDateColumn,
|
|
VersionColumn,
|
|
CreateDateColumn,
|
|
OneToMany,
|
|
ManyToOne,
|
|
} from 'typeorm';
|
|
import { ProductSubCategories } from './product-sub-category.entity';
|
|
import { BaseModel } from '../../config/basemodel.entity';
|
|
|
|
@Entity()
|
|
export class Product extends BaseModel{
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column()
|
|
name: string;
|
|
|
|
@Column()
|
|
code: string;
|
|
|
|
@Column()
|
|
status: string;
|
|
|
|
@Column()
|
|
price: number;
|
|
|
|
@Column({
|
|
nullable:true
|
|
})
|
|
basePrice: number;
|
|
|
|
@ManyToOne(
|
|
() => ProductSubCategories,
|
|
(subCategories) => subCategories.category,
|
|
)
|
|
subCategories: ProductSubCategories;
|
|
}
|