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
@@ -9,4 +9,13 @@ export class Category extends BaseEntity {
@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;
}
+6 -9
View File
@@ -1,5 +1,5 @@
import { Collection, Entity, ManyToMany, Property } from '@mikro-orm/core';
import { Category } from './category';
import { Category } from './category.entity';
import { BaseEntity } from 'src/common/entities/base.entity';
@Entity({ tableName: 'foods' })
@@ -8,16 +8,10 @@ export class Foods extends BaseEntity {
categories = new Collection<Category>(this);
@Property({ nullable: true })
titleFa?: string;
@Property({ nullable: true })
titleEn?: string;
title?: string;
@Property({ type: 'text', nullable: true })
contentFa?: string;
@Property({ type: 'text', nullable: true })
contentEn?: string;
content?: string;
@Property({ type: 'decimal', precision: 10, scale: 2, nullable: true })
price?: number;
@@ -25,6 +19,9 @@ export class Foods extends BaseEntity {
@Property({ type: 'int', nullable: true })
points?: number;
@Property({ type: 'int', nullable: true })
order?: number;
@Property({ type: 'int', nullable: true })
prepareTime?: number; // in minutes