feat: add Restaurant DTO with properties and a static fromEntity method for data conversion.

This commit is contained in:
SamiGetu
2025-12-05 10:31:07 +03:00
parent 08404eb145
commit 5dc5cd87a8
+2
View File
@@ -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,