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 {
|
export class CategoryDto {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
image: string;
|
||||||
restaurantId: string;
|
restaurantId: string;
|
||||||
items?: MenuItemDto[];
|
items?: MenuItemDto[];
|
||||||
|
|
||||||
@@ -10,6 +11,7 @@ export class CategoryDto {
|
|||||||
return {
|
return {
|
||||||
id: entity.id,
|
id: entity.id,
|
||||||
name: entity.name,
|
name: entity.name,
|
||||||
|
image: entity.image,
|
||||||
restaurantId: entity.restaurantId,
|
restaurantId: entity.restaurantId,
|
||||||
items: entity.items?.map(MenuItemDto.fromEntity) ?? [],
|
items: entity.items?.map(MenuItemDto.fromEntity) ?? [],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user