food
This commit is contained in:
@@ -1 +1,76 @@
|
||||
export class Food {}
|
||||
import { Collection, Entity, ManyToMany, Property } from '@mikro-orm/core';
|
||||
import { Category } from './category';
|
||||
import { BaseEntity } from 'src/common/entities/base.entity';
|
||||
|
||||
@Entity({ tableName: 'foods' })
|
||||
export class Foods extends BaseEntity {
|
||||
@ManyToMany(() => Category)
|
||||
categories = new Collection<Category>(this);
|
||||
|
||||
@Property({ nullable: true })
|
||||
titleFa?: string;
|
||||
|
||||
@Property({ nullable: true })
|
||||
titleEn?: string;
|
||||
|
||||
@Property({ type: 'text', nullable: true })
|
||||
contentFa?: string;
|
||||
|
||||
@Property({ type: 'text', nullable: true })
|
||||
contentEn?: string;
|
||||
|
||||
@Property({ type: 'decimal', precision: 10, scale: 2, nullable: true })
|
||||
price?: number;
|
||||
|
||||
@Property({ type: 'int', nullable: true })
|
||||
points?: number;
|
||||
|
||||
@Property({ type: 'int', nullable: true })
|
||||
prepareTime?: number; // in minutes
|
||||
|
||||
@Property({ type: 'boolean', default: false })
|
||||
sat: boolean = false;
|
||||
|
||||
@Property({ type: 'boolean', default: false })
|
||||
sun: boolean = false;
|
||||
|
||||
@Property({ type: 'boolean', default: false })
|
||||
mon: boolean = false;
|
||||
|
||||
@Property({ type: 'boolean', default: false })
|
||||
breakfast: boolean = false;
|
||||
|
||||
@Property({ type: 'boolean', default: false })
|
||||
noon: boolean = false;
|
||||
|
||||
@Property({ type: 'boolean', default: false })
|
||||
dinner: boolean = false;
|
||||
|
||||
@Property({ type: 'boolean', default: false })
|
||||
isPickup: boolean = false;
|
||||
|
||||
@Property({ type: 'int', default: 0 })
|
||||
stock: number = 0;
|
||||
|
||||
@Property({ type: 'int', default: 0 })
|
||||
stockDefault: number = 0;
|
||||
|
||||
@Property({ type: 'boolean', default: true })
|
||||
isActive: boolean = true;
|
||||
|
||||
// you can store image URLs as JSON array
|
||||
@Property({ type: 'json', nullable: true })
|
||||
images?: string[];
|
||||
|
||||
@Property({ type: 'boolean', default: false })
|
||||
inPlaceServe: boolean = false;
|
||||
|
||||
@Property({ type: 'boolean', default: false })
|
||||
pickupServe: boolean = false;
|
||||
|
||||
@Property({ type: 'float', default: 0 })
|
||||
rate: number = 0;
|
||||
|
||||
@Property({ type: 'float', default: 0 })
|
||||
discount: number = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user