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

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

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

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

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

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

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

  @ApiProperty({ type: Number, required: false })
  couner_no: number;

  @ApiProperty({ type: String, required: false })
  payment_type: string;

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

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

  @ApiProperty({ type: String, required: false })
  transaction_type: string;

  @ApiProperty({ type: String, required: false })
  payment_via: string;

  @ApiProperty({ type: String, required: false })
  payment_bank: string;
}
