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

80 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-05-12 16:17:39 +03:30
import { ApiPropertyOptional } from '@nestjs/swagger';
import {
IsBoolean,
IsLatitude,
IsLongitude,
IsOptional,
IsString,
IsUUID,
Matches,
MaxLength,
} 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-05-07 21:22:50 +03:30
}