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

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

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

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

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

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

  @ApiProperty({ type: Date, required: false })
  refund_date_from: Date;

  @ApiProperty({ type: Date, required: false })
  refund_date_to: Date;

  @ApiProperty({ type: Date, required: false })
  request_date_from: Date;

  @ApiProperty({ type: Date, required: false })
  request_date_to: Date;

  @ApiProperty({ type: Date, required: false })
  settlement_date_from: Date;

  @ApiProperty({ type: Date, required: false })
  settlement_date_to: Date;
}
