feat: add Restaurant DTO with properties and a static fromEntity method for data conversion.
This commit is contained in:
@@ -6,6 +6,7 @@ export class RestaurantDto {
|
||||
slug: string;
|
||||
description?: string;
|
||||
logo?: string;
|
||||
banner?: string;
|
||||
template?: string;
|
||||
categories?: CategoryDto[];
|
||||
createdAt?: Date;
|
||||
@@ -17,6 +18,7 @@ export class RestaurantDto {
|
||||
slug: entity.slug,
|
||||
description: entity.description ?? undefined,
|
||||
logo: entity.logo ?? undefined,
|
||||
banner: entity.banner ?? undefined,
|
||||
template: entity.template ?? undefined,
|
||||
categories: entity.categories?.map(CategoryDto.fromEntity) ?? [],
|
||||
createdAt: entity.createdAt ? new Date(entity.createdAt) : undefined,
|
||||
|
||||
Reference in New Issue
Block a user