Artteiv's picture
feat: add menu item and module and migrations
d9eec61
raw
history blame
714 Bytes
import {
BaseEntity,
Column,
Entity,
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()
description: string;
@Column()
is_open: boolean;
@ManyToOne(() => BranchEntity, (a) => a.menu_items)
branch: Relation<BranchEntity>;
@ManyToOne(() => MenuItemEntity, (a) => a.branch_menus)
menu_item: Relation<MenuItemEntity>;
}