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

export class CreateSipAccountDto {
  @ApiProperty({
    description: 'SIP username for registration',
    example: 'trainer_001',
  })
  @IsString()
  @IsNotEmpty()
  sipUsername: string;

  @ApiProperty({
    description: 'SIP password for registration',
    example: 'securepass123',
  })
  @IsString()
  @IsNotEmpty()
  sipPassword: string;

  @ApiPropertyOptional({
    description: 'Display name for the SIP caller',
    example: 'Ivan Petrov',
  })
  @IsString()
  @IsOptional()
  displayName?: string;
}

export class UpdateSipAccountDto {
  @ApiPropertyOptional({
    description: 'SIP username for registration',
    example: 'trainer_001',
  })
  @IsString()
  @IsOptional()
  sipUsername?: string;

  @ApiPropertyOptional({
    description: 'SIP password for registration',
    example: 'securepass123',
  })
  @IsString()
  @IsOptional()
  sipPassword?: string;

  @ApiPropertyOptional({
    description: 'Display name for the SIP caller',
    example: 'Ivan Petrov',
  })
  @IsString()
  @IsOptional()
  displayName?: string;

  @ApiPropertyOptional({
    description: 'Whether the SIP account is active',
  })
  @IsBoolean()
  @IsOptional()
  isActive?: boolean;
}

export class UpdateOwnSipAccountDto {
  @ApiPropertyOptional({
    description: 'Display name for the SIP caller',
    example: 'Ivan Petrov',
  })
  @IsString()
  @IsOptional()
  displayName?: string;
}
