This commit is contained in:
2025-11-10 23:23:44 +03:30
parent 6a25bf9116
commit 4c274c3118
7 changed files with 257 additions and 0 deletions
@@ -0,0 +1,97 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsString, IsOptional, IsNumber, IsBoolean, IsArray, IsUrl } from 'class-validator';
export class CreateRestaurantDto {
@ApiProperty({ example: 'Cafe Morteza' })
@IsString()
name!: string;
@ApiProperty({ example: 'cafe-morteza' })
@IsString()
slug!: string;
@ApiPropertyOptional({ example: 'https://example.com/logo.png' })
@IsOptional()
@IsUrl()
logo?: string;
@ApiPropertyOptional({ example: 'Tehran, Valiasr St. No. 123' })
@IsOptional()
@IsString()
address?: string;
@ApiPropertyOptional({ example: '#ff6600' })
@IsOptional()
@IsString()
menuColor?: string;
@ApiPropertyOptional({ example: 35.6892 })
@IsOptional()
@IsNumber()
latitude?: number;
@ApiPropertyOptional({ example: 51.389 })
@IsOptional()
@IsNumber()
longitude?: number;
@ApiPropertyOptional({ example: 5000, description: 'Service area in meters' })
@IsOptional()
@IsNumber()
serviceArea?: number;
@ApiPropertyOptional({ example: 2020 })
@IsOptional()
@IsNumber()
establishedYear?: number;
@ApiPropertyOptional({ example: '+989123456789' })
@IsOptional()
@IsString()
phoneNumber?: string;
@ApiPropertyOptional({ example: 'https://instagram.com/cafemorteza' })
@IsOptional()
@IsUrl()
instagram?: string;
@ApiPropertyOptional({ example: 'https://t.me/cafemorteza' })
@IsOptional()
@IsUrl()
telegram?: string;
@ApiPropertyOptional({ example: 'https://wa.me/989123456789' })
@IsOptional()
@IsUrl()
whatsapp?: string;
@ApiPropertyOptional({ example: 'Cozy place with best coffee in town.' })
@IsOptional()
@IsString()
description?: string;
@ApiPropertyOptional({ example: 'Best Cafe in Tehran' })
@IsOptional()
@IsString()
seoTitle?: string;
@ApiPropertyOptional({ example: 'Cafe Morteza serves high-quality coffee.' })
@IsOptional()
@IsString()
seoDescription?: string;
@ApiPropertyOptional({ example: ['coffee', 'breakfast', 'cafe'] })
@IsOptional()
@IsArray()
tagNames?: string[];
@ApiPropertyOptional({ example: true })
@IsOptional()
@IsBoolean()
isOpenNow?: boolean;
@ApiPropertyOptional({ example: 0.09 })
@IsOptional()
@IsNumber()
vat?: number;
}