Artteiv's picture
feat: add menu item and module and migrations
d9eec61
raw
history blame
721 Bytes
import {
BaseEntity,
Column,
Entity,
ManyToOne,
OneToMany,
PrimaryColumn,
Relation,
} from 'typeorm';
import { BranchMenuEntity } from './branch-menu.entity.js';
@Entity('menu_items')
export class MenuItemEntity extends BaseEntity {
@PrimaryColumn()
id: string;
@Column()
item_name: string;
@Column({ nullable: true })
image_url: string;
@Column({ nullable: true })
item_group_id: string;
@Column()
description: string;
@Column()
price: number;
@OneToMany(() => BranchMenuEntity, (a) => a.menu_item)
branch_menus: Relation<BranchMenuEntity>[];
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
create_at: Date;
}