feat: add Restaurant DTO and remove prisma generate from the build script

This commit is contained in:
2025-12-02 11:37:44 +03:00
parent ba38ce2865
commit 018d9ad41d
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
"private": true, "private": true,
"license": "UNLICENSED", "license": "UNLICENSED",
"scripts": { "scripts": {
"build": "prisma generate && nest build", "build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start", "start": "nest start",
"start:dev": "nest start --watch", "start:dev": "nest start --watch",
+2
View File
@@ -6,6 +6,7 @@ export class RestaurantDto {
slug: string; slug: string;
description?: string; description?: string;
logo?: string; logo?: string;
template?: string;
categories?: CategoryDto[]; categories?: CategoryDto[];
createdAt?: Date; createdAt?: Date;
@@ -16,6 +17,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,
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,
}; };