import { IsOptional, IsString, IsIn, IsNumber, MaxLength, Min } from 'class-validator';

export class CreateDonationDto {
  @IsOptional()
  @IsString()
  @MaxLength(40)
  name?: string;

  @IsOptional()
  @IsString()
  @MaxLength(280)
  message?: string;

  @IsOptional()
  @IsIn(['ALIPAY', 'WECHAT'])
  channel?: 'ALIPAY' | 'WECHAT';

  @IsOptional()
  @IsNumber({ allowNaN: false, allowInfinity: false })
  @Min(0)
  amount?: number;
}
