category
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user