import { BaseFilterDto } from 'src/core/modules/infrastructure/dto/base-filter.dto';
import { FilterPaymentMethodEntity } from '../../domain/entities/filter-payment-method.entity';
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';

export class FilterPaymentMethodDto
  extends BaseFilterDto
  implements FilterPaymentMethodEntity
{
  @ApiProperty({ type: ['string'], required: false })
  @Transform((body) => {
    return Array.isArray(body.value) ? body.value : [body.value];
  })
  types: string[];

  @ApiProperty({ type: ['string'], required: false })
  @Transform((body) => {
    return Array.isArray(body.value) ? body.value : [body.value];
  })
  issuers: string[];

  @ApiProperty({ type: ['string'], required: false })
  @Transform((body) => {
    return Array.isArray(body.value) ? body.value : [body.value];
  })
  account_numbers: string[];

  @ApiProperty({ type: ['string'], required: false })
  @Transform((body) => {
    return Array.isArray(body.value) ? body.value : [body.value];
  })
  account_names: string[];

  @ApiProperty({ type: ['string'], required: false })
  @Transform((body) => {
    return Array.isArray(body.value) ? body.value : [body.value];
  })
  notes: string[];
}
