import { BaseEntity, Column, CreateDateColumn, Entity, ManyToOne, OneToMany, PrimaryColumn, PrimaryGeneratedColumn, Relation, } from 'typeorm'; import { UserEntity } from './user.entity.js'; import { BranchMenuEntity } from './branch-menu.entity.js'; @Entity('branches') export class BranchEntity extends BaseEntity { @PrimaryColumn() id: string; @Column() name: string; @Column() location: string; @Column() phone_number: string; @ManyToOne(() => UserEntity, (user) => user.branches) owner: Relation; @OneToMany(() => BranchMenuEntity, (a) => a.branch) menu_items: Relation[]; @CreateDateColumn() create_at: Date; }