import { BaseEntity, Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn, Relation, } from 'typeorm'; import { BranchEntity } from './branch.entity.js'; import { MenuItemEntity } from './menu-item.entity.js'; @Entity('branch_menu') export class BranchMenuEntity extends BaseEntity { @PrimaryGeneratedColumn('uuid') id: string; @Column() branch_id: string; @Column() menu_id: string; @Column({ nullable: true }) description: string; @Column({ default: true }) is_open: boolean; @Column({ default: 0 }) sold_count: number; @ManyToOne(() => BranchEntity, (a) => a.menu_items) @JoinColumn({ name: 'branch_id' }) branch: Relation; @ManyToOne(() => MenuItemEntity, (a) => a.branch_menus) @JoinColumn({ name: 'menu_id' }) menu_item: Relation; }