This commit is contained in:
2025-11-15 10:38:22 +03:30
parent 3cbab81e0f
commit 4246a24519
2 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import { Type } from 'class-transformer';
export class CreateCategoryDto { export class CreateCategoryDto {
@IsString() @IsString()
@ApiPropertyOptional({ example: 'Beverages' }) @ApiPropertyOptional({ example: 'ایرانی' })
title!: string; title!: string;
@IsOptional() @IsOptional()
@@ -2,95 +2,95 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsString, IsOptional, IsNumber, IsBoolean, IsArray, IsUrl } from 'class-validator'; import { IsString, IsOptional, IsNumber, IsBoolean, IsArray, IsUrl } from 'class-validator';
export class CreateRestaurantDto { export class CreateRestaurantDto {
@ApiProperty({ example: 'Cafe Morteza' }) @ApiProperty({ example: 'کافه ژیوان', description: 'نام رستوران' })
@IsString() @IsString()
name!: string; name!: string;
@ApiProperty({ example: 'cafe-morteza' }) @ApiProperty({ example: 'cafe-zhivan', description: 'شناسه (slug) رستوران، لاتین و بدون فاصله' })
@IsString() @IsString()
slug!: string; slug!: string;
@ApiPropertyOptional({ example: 'https://example.com/logo.png' }) @ApiPropertyOptional({ example: 'https://example.com/logo.png', description: 'آدرس تصویر لوگو' })
@IsOptional() @IsOptional()
@IsUrl() @IsUrl()
logo?: string; logo?: string;
@ApiPropertyOptional({ example: 'Tehran, Valiasr St. No. 123' }) @ApiPropertyOptional({ example: 'تهران، خیابان ولیعصر پلاک ۱۲۳', description: 'آدرس کامل' })
@IsOptional() @IsOptional()
@IsString() @IsString()
address?: string; address?: string;
@ApiPropertyOptional({ example: '#ff6600' }) @ApiPropertyOptional({ example: '#ff6600', description: 'رنگ قالب/منو (hex)' })
@IsOptional() @IsOptional()
@IsString() @IsString()
menuColor?: string; menuColor?: string;
@ApiPropertyOptional({ example: 35.6892 }) @ApiPropertyOptional({ example: 35.6892, description: 'عرض جغرافیایی (latitude)' })
@IsOptional() @IsOptional()
@IsNumber() @IsNumber()
latitude?: number; latitude?: number;
@ApiPropertyOptional({ example: 51.389 }) @ApiPropertyOptional({ example: 51.389, description: 'طول جغرافیایی (longitude)' })
@IsOptional() @IsOptional()
@IsNumber() @IsNumber()
longitude?: number; longitude?: number;
@ApiPropertyOptional({ example: 5000, description: 'Service area in meters' }) @ApiPropertyOptional({ example: 5000, description: 'حوزه سرویس‌دهی به متر' })
@IsOptional() @IsOptional()
@IsNumber() @IsNumber()
serviceArea?: number; serviceArea?: number;
@ApiPropertyOptional({ example: 2020 }) @ApiPropertyOptional({ example: 2020, description: 'سال تأسیس' })
@IsOptional() @IsOptional()
@IsNumber() @IsNumber()
establishedYear?: number; establishedYear?: number;
@ApiPropertyOptional({ example: '+989123456789' }) @ApiPropertyOptional({ example: '+989123456789', description: 'شماره تماس' })
@IsOptional() @IsOptional()
@IsString() @IsString()
phoneNumber?: string; phoneNumber?: string;
@ApiPropertyOptional({ example: 'https://instagram.com/cafemorteza' }) @ApiPropertyOptional({ example: 'https://instagram.com/cafemorteza', description: 'آدرس اینستاگرام' })
@IsOptional() @IsOptional()
@IsUrl() @IsUrl()
instagram?: string; instagram?: string;
@ApiPropertyOptional({ example: 'https://t.me/cafemorteza' }) @ApiPropertyOptional({ example: 'https://t.me/cafemorteza', description: 'آدرس تلگرام' })
@IsOptional() @IsOptional()
@IsUrl() @IsUrl()
telegram?: string; telegram?: string;
@ApiPropertyOptional({ example: 'https://wa.me/989123456789' }) @ApiPropertyOptional({ example: 'https://wa.me/989123456789', description: 'لینک واتس‌اپ' })
@IsOptional() @IsOptional()
@IsUrl() @IsUrl()
whatsapp?: string; whatsapp?: string;
@ApiPropertyOptional({ example: 'Cozy place with best coffee in town.' }) @ApiPropertyOptional({ example: 'محل دنج با بهترین قهوه شهر.', description: 'توضیحات درباره رستوران' })
@IsOptional() @IsOptional()
@IsString() @IsString()
description?: string; description?: string;
@ApiPropertyOptional({ example: 'Best Cafe in Tehran' }) @ApiPropertyOptional({ example: 'بهترین کافه تهران', description: 'عنوان برای SEO' })
@IsOptional() @IsOptional()
@IsString() @IsString()
seoTitle?: string; seoTitle?: string;
@ApiPropertyOptional({ example: 'Cafe Morteza serves high-quality coffee.' }) @ApiPropertyOptional({ example: 'کافه مرتضی ارائه‌دهنده قهوه با کیفیت بالا.', description: 'توضیحات برای SEO' })
@IsOptional() @IsOptional()
@IsString() @IsString()
seoDescription?: string; seoDescription?: string;
@ApiPropertyOptional({ example: ['coffee', 'breakfast', 'cafe'] }) @ApiPropertyOptional({ example: ['قهوه', 'صبحانه', 'کافه'], description: 'لیست تگ‌های مرتبط' })
@IsOptional() @IsOptional()
@IsArray() @IsArray()
tagNames?: string[]; tagNames?: string[];
@ApiPropertyOptional({ example: true }) @ApiPropertyOptional({ example: true, description: 'آیا رستوران اکنون باز است؟' })
@IsOptional() @IsOptional()
@IsBoolean() @IsBoolean()
isOpenNow?: boolean; isOpenNow?: boolean;
@ApiPropertyOptional({ example: 0.09 }) @ApiPropertyOptional({ example: 0.09, description: 'نرخ مالیات (مثلاً 0.09 برای 9%)' })
@IsOptional() @IsOptional()
@IsNumber() @IsNumber()
vat?: number; vat?: number;