import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString, Matches } from 'class-validator';

export class ProvisionMqttCertDto {
  @ApiProperty({ example: 'mqtt.example.com', description: 'Hostname/CN for the broker server certificate' })
  @IsString()
  @IsNotEmpty()
  @Matches(/^[a-zA-Z0-9.-]{1,253}$/, {
    message: 'hostname must be 1-253 chars of letters, digits, dot, or dash',
  })
  hostname: string;
}
