65 lines
1.2 KiB
TypeScript
65 lines
1.2 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import {
|
|
IsLatitude,
|
|
IsLongitude,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
Matches,
|
|
MaxLength,
|
|
} from 'class-validator';
|
|
|
|
export class CreateBusinessRegistrationDto {
|
|
@ApiProperty({ example: 'کارواش محمد' })
|
|
@IsString()
|
|
@MaxLength(150)
|
|
title!: string;
|
|
|
|
@ApiProperty({ format: 'uuid' })
|
|
@IsUUID()
|
|
categoryId!: string;
|
|
|
|
@ApiPropertyOptional({ example: 'mohammad-carwash' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(120)
|
|
@Matches(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, {
|
|
message: 'slug must be lowercase words separated by hyphens',
|
|
})
|
|
slug?: string;
|
|
|
|
@ApiPropertyOptional({ example: 'تمیزی که میدرخشد' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(150)
|
|
subtitle?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(500)
|
|
description?: string;
|
|
|
|
@ApiPropertyOptional({ example: '09121234567' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(20)
|
|
contactPhone?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(500)
|
|
address?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsLatitude()
|
|
latitude?: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsLongitude()
|
|
longitude?: number;
|
|
}
|