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; @Column() branch_menu_id: string; @ManyToOne(() => BranchMenuEntity) @JoinColumn({ name: 'branch_menu_id' }) branch_menu: Relation; @Column() quantity: number; @Column() price: number; }