ppob-backend/src/product/entities/product-history-price.entity.ts
2022-05-13 00:39:08 +07:00

41 lines
845 B
TypeScript

import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Product } from './product.entity';
import { BaseModel } from '../../config/basemodel.entity';
import { productType } from '../../helper/enum-list';
import { Partner } from '../../users/entities/partner.entity';
@Entity()
export class ProductHistoryPrice extends BaseModel {
@PrimaryGeneratedColumn('uuid')
id: string;
@ManyToOne(() => Product, (product) => product.id)
product: Product;
@ManyToOne(() => Partner, (partner) => partner.id)
partner: Partner;
@Column()
price: number;
@Column()
mark_up_price: number;
@Column({ type: 'date' })
startDate: Date;
@Column({
type: 'date',
nullable: true,
})
endDate: Date;
@Column('text')
type: productType;
@Column({
default: 0,
})
admin_price: number;
}