import { PipeTransform, Injectable, BadRequestException } from '@nestjs/common';

@Injectable()
export class FileValidationPipe implements PipeTransform {
  transform(value: any) {
    const size = value.size;
    if (size > 1000000) {
      throw new BadRequestException('File is too large');
    }
    return value;
  }
}
