From 4246a24519f50a31b969b15351cca415f7c890c0 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Sat, 15 Nov 2025 10:38:22 +0330 Subject: [PATCH] bug --- src/modules/foods/dto/create-category.dto.ts | 2 +- .../restaurants/dto/create-restaurant.dto.ts | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/modules/foods/dto/create-category.dto.ts b/src/modules/foods/dto/create-category.dto.ts index 8336446..56ab77c 100644 --- a/src/modules/foods/dto/create-category.dto.ts +++ b/src/modules/foods/dto/create-category.dto.ts @@ -4,7 +4,7 @@ import { Type } from 'class-transformer'; export class CreateCategoryDto { @IsString() - @ApiPropertyOptional({ example: 'Beverages' }) + @ApiPropertyOptional({ example: 'ایرانی' }) title!: string; @IsOptional() diff --git a/src/modules/restaurants/dto/create-restaurant.dto.ts b/src/modules/restaurants/dto/create-restaurant.dto.ts index 2cf8b56..5d9b799 100644 --- a/src/modules/restaurants/dto/create-restaurant.dto.ts +++ b/src/modules/restaurants/dto/create-restaurant.dto.ts @@ -2,95 +2,95 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { IsString, IsOptional, IsNumber, IsBoolean, IsArray, IsUrl } from 'class-validator'; export class CreateRestaurantDto { - @ApiProperty({ example: 'Cafe Morteza' }) + @ApiProperty({ example: 'کافه ژیوان', description: 'نام رستوران' }) @IsString() name!: string; - @ApiProperty({ example: 'cafe-morteza' }) + @ApiProperty({ example: 'cafe-zhivan', description: 'شناسه (slug) رستوران، لاتین و بدون فاصله' }) @IsString() slug!: string; - @ApiPropertyOptional({ example: 'https://example.com/logo.png' }) + @ApiPropertyOptional({ example: 'https://example.com/logo.png', description: 'آدرس تصویر لوگو' }) @IsOptional() @IsUrl() logo?: string; - @ApiPropertyOptional({ example: 'Tehran, Valiasr St. No. 123' }) + @ApiPropertyOptional({ example: 'تهران، خیابان ولیعصر پلاک ۱۲۳', description: 'آدرس کامل' }) @IsOptional() @IsString() address?: string; - @ApiPropertyOptional({ example: '#ff6600' }) + @ApiPropertyOptional({ example: '#ff6600', description: 'رنگ قالب/منو (hex)' }) @IsOptional() @IsString() menuColor?: string; - @ApiPropertyOptional({ example: 35.6892 }) + @ApiPropertyOptional({ example: 35.6892, description: 'عرض جغرافیایی (latitude)' }) @IsOptional() @IsNumber() latitude?: number; - @ApiPropertyOptional({ example: 51.389 }) + @ApiPropertyOptional({ example: 51.389, description: 'طول جغرافیایی (longitude)' }) @IsOptional() @IsNumber() longitude?: number; - @ApiPropertyOptional({ example: 5000, description: 'Service area in meters' }) + @ApiPropertyOptional({ example: 5000, description: 'حوزه سرویس‌دهی به متر' }) @IsOptional() @IsNumber() serviceArea?: number; - @ApiPropertyOptional({ example: 2020 }) + @ApiPropertyOptional({ example: 2020, description: 'سال تأسیس' }) @IsOptional() @IsNumber() establishedYear?: number; - @ApiPropertyOptional({ example: '+989123456789' }) + @ApiPropertyOptional({ example: '+989123456789', description: 'شماره تماس' }) @IsOptional() @IsString() phoneNumber?: string; - @ApiPropertyOptional({ example: 'https://instagram.com/cafemorteza' }) + @ApiPropertyOptional({ example: 'https://instagram.com/cafemorteza', description: 'آدرس اینستاگرام' }) @IsOptional() @IsUrl() instagram?: string; - @ApiPropertyOptional({ example: 'https://t.me/cafemorteza' }) + @ApiPropertyOptional({ example: 'https://t.me/cafemorteza', description: 'آدرس تلگرام' }) @IsOptional() @IsUrl() telegram?: string; - @ApiPropertyOptional({ example: 'https://wa.me/989123456789' }) + @ApiPropertyOptional({ example: 'https://wa.me/989123456789', description: 'لینک واتس‌اپ' }) @IsOptional() @IsUrl() whatsapp?: string; - @ApiPropertyOptional({ example: 'Cozy place with best coffee in town.' }) + @ApiPropertyOptional({ example: 'محل دنج با بهترین قهوه شهر.', description: 'توضیحات درباره رستوران' }) @IsOptional() @IsString() description?: string; - @ApiPropertyOptional({ example: 'Best Cafe in Tehran' }) + @ApiPropertyOptional({ example: 'بهترین کافه تهران', description: 'عنوان برای SEO' }) @IsOptional() @IsString() seoTitle?: string; - @ApiPropertyOptional({ example: 'Cafe Morteza serves high-quality coffee.' }) + @ApiPropertyOptional({ example: 'کافه مرتضی ارائه‌دهنده قهوه با کیفیت بالا.', description: 'توضیحات برای SEO' }) @IsOptional() @IsString() seoDescription?: string; - @ApiPropertyOptional({ example: ['coffee', 'breakfast', 'cafe'] }) + @ApiPropertyOptional({ example: ['قهوه', 'صبحانه', 'کافه'], description: 'لیست تگ‌های مرتبط' }) @IsOptional() @IsArray() tagNames?: string[]; - @ApiPropertyOptional({ example: true }) + @ApiPropertyOptional({ example: true, description: 'آیا رستوران اکنون باز است؟' }) @IsOptional() @IsBoolean() isOpenNow?: boolean; - @ApiPropertyOptional({ example: 0.09 }) + @ApiPropertyOptional({ example: 0.09, description: 'نرخ مالیات (مثلاً 0.09 برای 9%)' }) @IsOptional() @IsNumber() vat?: number;