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

export class SuperAdminLoginDto {
  @ApiProperty({ example: 'admin@oudelaa.com' })
  @IsEmail()
  email!: string;

  @ApiProperty({ example: 'SuperAdminStrongPass123!' })
  @IsString()
  @Length(8, 128)
  password!: string;

  @ApiPropertyOptional({ description: 'TOTP code; required when SUPERADMIN_TOTP_SECRET is set' })
  @IsOptional()
  @IsString()
  @Matches(/^\d{6}$/)
  otpCode?: string;
}
