import { BaseEntity, Column, CreateDateColumn, Entity, OneToMany, PrimaryColumn, Relation, } from 'typeorm'; import { BranchMenuEntity } from './branch-menu.entity.js'; import { MenuItemType } from '../common/enums/MenuItemType.enum.js'; @Entity('menu_items') export class MenuItemEntity extends BaseEntity { @PrimaryColumn() id: string; @Column() item_name: string; @Column({ nullable: true }) image_url: string; @Column({ type: 'enum', enum: MenuItemType, default: 'khac' }) item_type: MenuItemType; @Column() description: string; @Column() price: number; @OneToMany(() => BranchMenuEntity, (a) => a.menu_item) branch_menus: Relation[]; @CreateDateColumn() create_at: Date; }