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

export class UpdateDomainDto {
  @ApiProperty({
    description: 'Subdomain (alphanumeric and hyphens only)',
    example: 'myserver',
    required: false,
  })
  @IsString()
  @IsOptional()
  @Matches(/^[a-z0-9-]+$/, {
    message: 'Subdomain can only contain lowercase letters, numbers, and hyphens',
  })
  subdomain?: string;

  @ApiProperty({
    description: 'Custom domain',
    example: 'play.myserver.com',
    required: false,
  })
  @IsString()
  @IsOptional()
  custom_domain?: string;
}
