36 lines
788 B
TypeScript
36 lines
788 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;
|
|
}
|