feat: Implement menu item and category management with Redis caching for restaurant data.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { MenuItemDto } from "src/item/dto/menu-item.dto";
|
||||
import { RestaurantDto } from "src/restaurant/dto/restaurant.dto";
|
||||
|
||||
export class CategoryDto {
|
||||
id: string;
|
||||
@@ -6,6 +7,7 @@ export class CategoryDto {
|
||||
image: string;
|
||||
restaurantId: string;
|
||||
items?: MenuItemDto[];
|
||||
restaurant?: RestaurantDto;
|
||||
|
||||
static fromEntity(entity: any): CategoryDto {
|
||||
return {
|
||||
@@ -14,6 +16,7 @@ export class CategoryDto {
|
||||
image: entity.image,
|
||||
restaurantId: entity.restaurantId,
|
||||
items: entity.items?.map(MenuItemDto.fromEntity) ?? [],
|
||||
restaurant: entity.restaurant ? RestaurantDto.fromEntity(entity.restaurant) : undefined,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user