import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsEnum, IsBoolean, IsOptional, IsNumber } from 'class-validator';

export class PaymentMethodDTO {
  @ApiProperty()
  @IsString()
  id: string = '';

  @ApiProperty({ enum: ['card', 'bank', 'sepa'] })
  @IsEnum(['card', 'bank', 'sepa'])
  type: 'card' | 'bank' | 'sepa' = 'card';

  @ApiProperty()
  @IsString()
  last4: string = '';

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  brand?: string;

  @ApiProperty()
  @IsBoolean()
  isDefault: boolean = false;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsNumber()
  expiryMonth?: number;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsNumber()
  expiryYear?: number;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  bankName?: string;
}