This commit is contained in:
2025-12-18 12:39:25 +03:30
parent ec56e03907
commit 60c0bfb8d2
6 changed files with 108 additions and 11 deletions
@@ -5,6 +5,7 @@ import { Restaurant } from '../../../modules/restaurants/entities/restaurant.ent
import { Review } from 'src/modules/review/entities/review.entity';
import { Inventory } from 'src/modules/inventory/entities/inventory.entity';
import { MealType } from '../interface/food.interface';
import { Favorite } from './favorite.entity';
@Entity({ tableName: 'foods' })
@Index({ properties: ['restaurant', 'isActive'] })
@@ -26,6 +27,9 @@ export class Food extends BaseEntity {
})
inventory?: Inventory;
@OneToMany(() => Favorite, favorite => favorite.food)
favorites = new Collection<Favorite>(this);
@Property({ nullable: true })
title?: string;