import { IsEmail, IsNotEmpty, IsString, Matches, MinLength, IsEnum, IsOptional, IsUUID } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

/**
 * Connect Account DTO
 * DTO لربط حساب
 */
export class ConnectAccountDto {
  @ApiProperty({ example: 'My Ad Account', description: 'Friendly name for the account | اسم مألوف للحساب' })
  @IsString()
  @MinLength(3)
  name: string;

  @ApiProperty({ example: 'meta', enum: ['meta', 'tiktok', 'google'] })
  @IsEnum(['meta', 'tiktok', 'google'])
  platform: string;

  @ApiProperty({ example: 'act_123456789', description: 'Meta Ad Account ID | معرف حساب ميتا' })
  @IsOptional()
  @IsString()
  @Matches(/^act_\d+$/, { message: 'Meta Ad Account ID must start with "act_"' })
  adAccountId?: string;

  @ApiProperty({ example: 'EAAYf4cd...', description: 'Access Token | توكن الوصول' })
  @IsString()
  @MinLength(20)
  accessToken: string;

  @ApiProperty({ example: 'test-user-uuid', description: 'User UUID | معرف المستخدم' })
  @IsUUID()
  userId: string;
}
