This commit is contained in:
2025-12-16 12:03:18 +03:30
parent 5a00874a4e
commit e6d8bbbda5
2 changed files with 12 additions and 18 deletions
+7 -18
View File
@@ -4,6 +4,7 @@ import { BaseEntity } from '../../../common/entities/base.entity';
import { Restaurant } from '../../../modules/restaurants/entities/restaurant.entity'; import { Restaurant } from '../../../modules/restaurants/entities/restaurant.entity';
import { Review } from 'src/modules/review/entities/review.entity'; import { Review } from 'src/modules/review/entities/review.entity';
import { Inventory } from 'src/modules/inventory/entities/inventory.entity'; import { Inventory } from 'src/modules/inventory/entities/inventory.entity';
import { MealType } from '../interface/food.interface';
@Entity({ tableName: 'foods' }) @Entity({ tableName: 'foods' })
@Index({ properties: ['restaurant', 'isActive'] }) @Index({ properties: ['restaurant', 'isActive'] })
@@ -43,23 +44,11 @@ export class Food extends BaseEntity {
@Property({ type: 'int', nullable: true }) @Property({ type: 'int', nullable: true })
prepareTime?: number; // in minutes prepareTime?: number; // in minutes
@Property({ type: 'boolean', default: false }) @Property({ type: 'jsonb', default: [] })
sat: boolean = false; weekDays: number[] = [0, 1, 2, 3, 4, 5, 6];
@Property({ type: 'boolean', default: false }) @Property({ type: 'jsonb', default: [] })
sun: boolean = false; mealTypes: MealType[] = [];
@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: true }) @Property({ type: 'boolean', default: true })
isActive: boolean = true; isActive: boolean = true;
@@ -73,8 +62,8 @@ export class Food extends BaseEntity {
@Property({ type: 'boolean', default: false }) @Property({ type: 'boolean', default: false })
pickupServe: boolean = false; pickupServe: boolean = false;
@Property({ type: 'float', default: 0 }) @Property({ type: 'float', default: null })
rate?: number = 0; score?: number | null = null;
@Property({ type: 'float', default: 0 }) @Property({ type: 'float', default: 0 })
discount: number = 0; discount: number = 0;
@@ -0,0 +1,5 @@
export enum MealType {
BREAKFAST = 'breakfast',
LUNCH = 'lunch',
DINNER = 'dinner',
}