2026-06-12 20:37:33 +03:30
|
|
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
|
import {
|
|
|
|
|
IsBoolean,
|
|
|
|
|
IsInt,
|
|
|
|
|
IsLatitude,
|
|
|
|
|
IsLongitude,
|
|
|
|
|
IsOptional,
|
|
|
|
|
IsString,
|
|
|
|
|
IsUUID,
|
|
|
|
|
Matches,
|
|
|
|
|
Max,
|
|
|
|
|
MaxLength,
|
|
|
|
|
Min,
|
|
|
|
|
} from 'class-validator';
|
2026-05-12 16:17:39 +03:30
|
|
|
|
2026-06-12 20:37:33 +03:30
|
|
|
export class UpdateBusinessDto {
|
|
|
|
|
@ApiPropertyOptional({ example: 'Shine Carwash' })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(150)
|
|
|
|
|
title?: string;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ example: 'shine-carwash' })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
@Matches(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, {
|
|
|
|
|
message: 'slug must be lowercase words separated by hyphens',
|
|
|
|
|
})
|
|
|
|
|
slug?: string;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ format: 'uuid' })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsUUID()
|
|
|
|
|
categoryId?: string;
|
2026-05-12 16:17:39 +03:30
|
|
|
|
2026-06-11 12:19:28 +03:30
|
|
|
@ApiPropertyOptional({ example: 'تمیزی که میدرخشد', nullable: true })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(150)
|
2026-06-12 20:37:33 +03:30
|
|
|
subtitle?: string | null;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ example: 'Premium carwash service', nullable: true })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(500)
|
|
|
|
|
description?: string | null;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ example: '09123456789', nullable: true })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(20)
|
|
|
|
|
contactPhone?: string | null;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ example: 'Main street', nullable: true })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(500)
|
|
|
|
|
address?: string | null;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ example: 35.6892, nullable: true })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsLatitude()
|
|
|
|
|
latitude?: number | null;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ example: 51.389, nullable: true })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsLongitude()
|
|
|
|
|
longitude?: number | null;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ format: 'uuid', nullable: true })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsUUID()
|
|
|
|
|
ownerId?: string | null;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ example: true })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsBoolean()
|
|
|
|
|
isActive?: boolean;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({
|
|
|
|
|
example: false,
|
|
|
|
|
description: 'When true, services are priced per owner-defined class (e.g. car size)',
|
|
|
|
|
})
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsBoolean()
|
|
|
|
|
serviceClassesEnabled?: boolean;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({
|
|
|
|
|
example: 1,
|
|
|
|
|
description: 'How many customers can be served at the same time',
|
|
|
|
|
minimum: 1,
|
|
|
|
|
maximum: 20,
|
|
|
|
|
})
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsInt()
|
|
|
|
|
@Min(1)
|
|
|
|
|
@Max(20)
|
|
|
|
|
concurrentCapacity?: number;
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({
|
|
|
|
|
example: 30,
|
|
|
|
|
description: 'Minutes between available booking slot start times',
|
|
|
|
|
minimum: 5,
|
|
|
|
|
maximum: 120,
|
|
|
|
|
})
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsInt()
|
|
|
|
|
@Min(5)
|
|
|
|
|
@Max(120)
|
|
|
|
|
slotStepMinutes?: number;
|
|
|
|
|
}
|