feat: Add CategoryDto with properties and a static fromEntity conversion method.
This commit is contained in:
@@ -3,6 +3,7 @@ import { MenuItemDto } from "src/item/dto/menu-item.dto";
|
||||
export class CategoryDto {
|
||||
id: string;
|
||||
name: string;
|
||||
image: string;
|
||||
restaurantId: string;
|
||||
items?: MenuItemDto[];
|
||||
|
||||
@@ -10,6 +11,7 @@ export class CategoryDto {
|
||||
return {
|
||||
id: entity.id,
|
||||
name: entity.name,
|
||||
image: entity.image,
|
||||
restaurantId: entity.restaurantId,
|
||||
items: entity.items?.map(MenuItemDto.fromEntity) ?? [],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user