This commit is contained in:
2025-11-15 08:41:35 +03:30
parent 15c0c508b9
commit 0f1407c748
23 changed files with 714 additions and 177 deletions
@@ -0,0 +1,21 @@
import { Entity, Property, ManyToMany, Collection } from '@mikro-orm/core';
import { Foods } from './food.entity';
import { BaseEntity } from 'src/common/entities/base.entity';
@Entity({ tableName: 'categories' })
export class Category extends BaseEntity {
@Property({ nullable: true })
title?: string;
@ManyToMany(() => Foods, food => food.categories)
foods = new Collection<Foods>(this);
@Property({ default: true })
isActive: boolean = true;
@Property({ nullable: true })
restId?: string;
@Property({ nullable: true })
avatarUrl?: string;
}