import { BaseEntity, Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, Relation, } from 'typeorm'; import { UserEntity } from './user.entity.js'; import { BranchMenuEntity } from './branch-menu.entity.js'; @Entity('branches') export class BranchEntity extends BaseEntity { @PrimaryGeneratedColumn('uuid') 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[]; @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }) create_at: Date; }