Files
serverMontime/src/modules/businesses/dto/update-business.dto.ts
T

107 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-05-12 16:17:39 +03:30
import { ApiPropertyOptional } from '@nestjs/swagger';
import {
IsBoolean,
2026-06-01 13:26:25 +03:30
IsInt,
2026-05-12 16:17:39 +03:30
IsLatitude,
IsLongitude,
IsOptional,
IsString,
IsUUID,
Matches,
2026-06-01 13:26:25 +03:30
Max,
2026-05-12 16:17:39 +03:30
MaxLength,
2026-06-01 13:26:25 +03:30
Min,
2026-05-12 16:17:39 +03:30
} from 'class-validator';
2026-05-07 21:22:50 +03:30
export class UpdateBusinessDto {
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: 'Shine Carwash' })
@IsOptional()
@IsString()
@MaxLength(150)
2026-05-07 21:22:50 +03:30
title?: string;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: 'shine-carwash' })
@IsOptional()
@IsString()
@MaxLength(120)
@Matches(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, {
message: 'slug must be lowercase words separated by hyphens',
})
2026-05-07 21:22:50 +03:30
slug?: string;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ format: 'uuid' })
@IsOptional()
@IsUUID()
2026-05-07 21:22:50 +03:30
categoryId?: string;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: 'Premium carwash service', nullable: true })
@IsOptional()
@IsString()
@MaxLength(500)
2026-05-07 21:22:50 +03:30
description?: string | null;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: '09123456789', nullable: true })
@IsOptional()
@IsString()
@MaxLength(20)
2026-05-07 21:22:50 +03:30
contactPhone?: string | null;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: 'Main street', nullable: true })
@IsOptional()
@IsString()
@MaxLength(500)
2026-05-07 21:22:50 +03:30
address?: string | null;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: 35.6892, nullable: true })
@IsOptional()
@IsLatitude()
2026-05-07 21:22:50 +03:30
latitude?: number | null;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: 51.389, nullable: true })
@IsOptional()
@IsLongitude()
2026-05-07 21:22:50 +03:30
longitude?: number | null;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ format: 'uuid', nullable: true })
@IsOptional()
@IsUUID()
2026-05-07 21:22:50 +03:30
ownerId?: string | null;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: true })
@IsOptional()
@IsBoolean()
2026-05-07 21:22:50 +03:30
isActive?: boolean;
2026-05-31 21:36:19 +03:30
@ApiPropertyOptional({
example: false,
description: 'When true, services are priced per owner-defined class (e.g. car size)',
})
@IsOptional()
@IsBoolean()
serviceClassesEnabled?: boolean;
2026-06-01 13:26:25 +03:30
@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;
2026-06-02 11:35:54 +03:30
@ApiPropertyOptional({
example: 30,
description: 'Minutes between available booking slot start times',
minimum: 5,
maximum: 120,
})
@IsOptional()
@IsInt()
@Min(5)
@Max(120)
slotStepMinutes?: number;
2026-05-07 21:22:50 +03:30
}