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;
|
slug: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
logo?: string;
|
logo?: string;
|
||||||
|
banner?: string;
|
||||||
template?: string;
|
template?: string;
|
||||||
categories?: CategoryDto[];
|
categories?: CategoryDto[];
|
||||||
createdAt?: Date;
|
createdAt?: Date;
|
||||||
@@ -17,6 +18,7 @@ export class RestaurantDto {
|
|||||||
slug: entity.slug,
|
slug: entity.slug,
|
||||||
description: entity.description ?? undefined,
|
description: entity.description ?? undefined,
|
||||||
logo: entity.logo ?? undefined,
|
logo: entity.logo ?? undefined,
|
||||||
|
banner: entity.banner ?? undefined,
|
||||||
template: entity.template ?? undefined,
|
template: entity.template ?? undefined,
|
||||||
categories: entity.categories?.map(CategoryDto.fromEntity) ?? [],
|
categories: entity.categories?.map(CategoryDto.fromEntity) ?? [],
|
||||||
createdAt: entity.createdAt ? new Date(entity.createdAt) : undefined,
|
createdAt: entity.createdAt ? new Date(entity.createdAt) : undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user