Trần Viết Sơn
feat: all thing about order
3367e34
raw
history blame contribute delete
771 Bytes
import {
BaseEntity,
Column,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
Relation,
} from 'typeorm';
import { BranchMenuEntity } from './branch-menu.entity.js';
import { OrderEntity } from './order.entity.js';
@Entity('order_items')
export class OrderItemEntity extends BaseEntity {
@PrimaryGeneratedColumn()
id: number;
@Column()
order_id: number;
@ManyToOne(() => OrderEntity, (a) => a.order_items)
@JoinColumn({ name: 'order_id' })
order: Relation<OrderEntity>;
@Column()
branch_menu_id: string;
@ManyToOne(() => BranchMenuEntity)
@JoinColumn({ name: 'branch_menu_id' })
branch_menu: Relation<BranchMenuEntity>;
@Column()
quantity: number;
@Column()
price: number;
}