This commit is contained in:
2025-11-25 15:49:08 +03:30
parent 6f76b36a09
commit e6fb28b87e
4 changed files with 58 additions and 49 deletions
@@ -1,6 +1,7 @@
import { Entity, Property, Collection, OneToMany } from '@mikro-orm/core';
import { Entity, Property, Collection, OneToMany, ManyToOne } from '@mikro-orm/core';
import { Food } from './food.entity';
import { BaseEntity } from '../../../common/entities/base.entity';
import { Restaurant } from 'src/modules/restaurants/entities/restaurant.entity';
@Entity({ tableName: 'categories' })
export class Category extends BaseEntity {
@@ -13,8 +14,8 @@ export class Category extends BaseEntity {
@Property({ default: true })
isActive: boolean = true;
@Property({ nullable: true })
restId?: string;
@ManyToOne(() => Restaurant)
restaurant!: Restaurant;
@Property({ nullable: true })
avatarUrl?: string;