import {
  IsString,
  IsOptional,
  IsUUID,
  IsEnum,
  IsNotEmpty,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { AlertStatus } from '../../../domain/entities/aml-alert.entity';
import { PaginationQueryDto } from './pagination.dto';

// ───────────── AML Alert DTOs ─────────────

export class ListAmlAlertsQueryDto extends PaginationQueryDto {
  @ApiPropertyOptional({ description: 'Filter by alert status', enum: AlertStatus })
  @IsOptional()
  @IsEnum(AlertStatus)
  status?: string;
}

export class UpdateAlertStatusDto {
  @ApiProperty({ description: 'New alert status', enum: AlertStatus })
  @IsNotEmpty()
  @IsEnum(AlertStatus)
  status: string;

  @ApiPropertyOptional({ description: 'Resolution notes' })
  @IsOptional()
  @IsString()
  resolution?: string;
}

// ───────────── OFAC Screening DTOs ─────────────

export class ScreenOfacDto {
  @ApiProperty({ description: 'User ID to screen' })
  @IsUUID()
  userId: string;

  @ApiProperty({ description: 'Name to screen against OFAC SDN list' })
  @IsString()
  @IsNotEmpty()
  name: string;
}

// ───────────── SAR Report DTOs ─────────────

export class CreateSarReportDto {
  @ApiProperty({ description: 'Related AML alert ID' })
  @IsUUID()
  alertId: string;

  @ApiProperty({ description: 'User ID associated with the report' })
  @IsUUID()
  userId: string;

  @ApiProperty({ description: 'Type of SAR report' })
  @IsString()
  @IsNotEmpty()
  reportType: string;

  @ApiProperty({ description: 'Narrative description of suspicious activity' })
  @IsString()
  @IsNotEmpty()
  narrative: string;
}
