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

export class CreateBankCardDto {
  @ApiProperty({ description: '卡片名称' })
  @IsString()
  cardName: string;

  @ApiProperty({ description: '开户银行' })
  @IsString()
  bankName: string;

  @ApiProperty({ description: '银行账号' })
  @IsString()
  bankAccount: string;

  @ApiProperty({ description: '账户名称' })
  @IsString()
  accountName: string;

  @ApiPropertyOptional({ description: '是否默认' })
  @IsBoolean()
  @IsOptional()
  isDefault?: boolean;

  @ApiPropertyOptional({ description: '备注' })
  @IsString()
  @IsOptional()
  remark?: string;
}

export class UpdateBankCardDto {
  @ApiPropertyOptional({ description: '卡片名称' })
  @IsString()
  @IsOptional()
  cardName?: string;

  @ApiPropertyOptional({ description: '开户银行' })
  @IsString()
  @IsOptional()
  bankName?: string;

  @ApiPropertyOptional({ description: '银行账号' })
  @IsString()
  @IsOptional()
  bankAccount?: string;

  @ApiPropertyOptional({ description: '账户名称' })
  @IsString()
  @IsOptional()
  accountName?: string;

  @ApiPropertyOptional({ description: '是否默认' })
  @IsBoolean()
  @IsOptional()
  isDefault?: boolean;

  @ApiPropertyOptional({ description: '备注' })
  @IsString()
  @IsOptional()
  remark?: string;
}
