import { IsOptional, IsString, IsInt, IsEnum, Min, Max } from 'class-validator';
import { Type } from 'class-transformer';
import { ApiPropertyOptional } from '@nestjs/swagger';

export enum SyncDirection {
  INBOUND = 'inbound',
  OUTBOUND = 'outbound',
}

export class FindSyncLogsDto {
  @ApiPropertyOptional({ description: 'Cursor for pagination' })
  @IsString()
  @IsOptional()
  cursor?: string;

  @ApiPropertyOptional({ description: 'Items per page (1-100)', default: 20 })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @Max(100)
  @IsOptional()
  limit?: number = 20;

  @ApiPropertyOptional({ description: 'Filter by sync direction', enum: SyncDirection })
  @IsEnum(SyncDirection)
  @IsOptional()
  direction?: SyncDirection;

  @ApiPropertyOptional({ description: 'Filter by entity type', example: 'clients' })
  @IsString()
  @IsOptional()
  entityType?: string;
}
