From 08404eb145fee601484cc30446c9b9c7ab79e58b Mon Sep 17 00:00:00 2001 From: danijemmo Date: Wed, 3 Dec 2025 19:16:18 +0300 Subject: [PATCH] feat: add banner field to the restaurant model. --- prisma/migrations/20251203161418_banner/migration.sql | 2 ++ prisma/schema.prisma | 1 + src/restaurant/dto/create-restaurant.dto.ts | 4 ++++ src/restaurant/restaurant.service.ts | 1 + 4 files changed, 8 insertions(+) create mode 100644 prisma/migrations/20251203161418_banner/migration.sql diff --git a/prisma/migrations/20251203161418_banner/migration.sql b/prisma/migrations/20251203161418_banner/migration.sql new file mode 100644 index 0000000..80c2acd --- /dev/null +++ b/prisma/migrations/20251203161418_banner/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Restaurant" ADD COLUMN "banner" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 53717b9..8173e9b 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -84,6 +84,7 @@ model Restaurant { slug String @unique // used as /domain.com/slug description String? logo String? // image URL + banner String? ownerId String owner User @relation(fields: [ownerId], references: [id]) diff --git a/src/restaurant/dto/create-restaurant.dto.ts b/src/restaurant/dto/create-restaurant.dto.ts index 9ce6f54..bad04c3 100644 --- a/src/restaurant/dto/create-restaurant.dto.ts +++ b/src/restaurant/dto/create-restaurant.dto.ts @@ -17,6 +17,10 @@ export class CreateRestaurantDto { @IsString() logo?: string; + @IsOptional() + @IsString() + banner?: string; + @IsOptional() template?: string; } diff --git a/src/restaurant/restaurant.service.ts b/src/restaurant/restaurant.service.ts index cffaa7c..1f94cba 100644 --- a/src/restaurant/restaurant.service.ts +++ b/src/restaurant/restaurant.service.ts @@ -29,6 +29,7 @@ export class RestaurantService { slug: dto.slug, description: dto.description, logo: dto.logo, + banner: dto.banner, ownerId, template: dto.template ?? null, },