This commit is contained in:
2025-11-16 10:37:03 +03:30
parent ad4b2e2c89
commit fae765e05a
8 changed files with 45 additions and 30 deletions
+5 -1
View File
@@ -1,9 +1,13 @@
import { Collection, Entity, ManyToMany, Property } from '@mikro-orm/core';
import { Collection, Entity, ManyToMany, OneToOne, Property } from '@mikro-orm/core';
import { Category } from './category.entity';
import { BaseEntity } from '../../../common/entities/base.entity';
import { Restaurant } from 'src/modules/restaurants/entities/restaurant.entity';
@Entity({ tableName: 'foods' })
export class Food extends BaseEntity {
@OneToOne(() => Restaurant)
restaurant: Restaurant;
@ManyToMany(() => Category)
categories = new Collection<Category>(this);