Spaces:
Sleeping
Sleeping
File size: 890 Bytes
d9eec61 f97bd0c d9eec61 f97bd0c d9eec61 f97bd0c d9eec61 85a7484 d9eec61 f97bd0c d9eec61 f97bd0c d9eec61 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
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<BranchEntity>;
@ManyToOne(() => MenuItemEntity, (a) => a.branch_menus)
@JoinColumn({ name: 'menu_id' })
menu_item: Relation<MenuItemEntity>;
}
|