import { Entity, Property, ManyToMany, Collection } from '@mikro-orm/core'; import { Food } from './food.entity'; import { BaseEntity } from '../../../common/entities/base.entity'; @Entity({ tableName: 'categories' }) export class Category extends BaseEntity { @Property() title!: string; @ManyToMany(() => Food, food => food.categories) foods = new Collection(this); @Property({ default: true }) isActive: boolean = true; @Property({ nullable: true }) restId?: string; @Property({ nullable: true }) avatarUrl?: string; }