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

export class CreatePaymentMethodDto {

  @ApiProperty({ description: 'Payment method', enum: PaymentMethodEnum })
  @IsEnum(PaymentMethodEnum)
  method!: PaymentMethodEnum;

  @ApiProperty({ description: 'Payment gateway', enum: PaymentGatewayEnum, required: false })
  @IsOptional()
  @IsEnum(PaymentGatewayEnum)
  gateway?: PaymentGatewayEnum | null;

  @ApiProperty({ description: 'Payment method description', required: false })
  @IsOptional()
  @IsString()
  description?: string;

  @ApiProperty({ description: 'Is payment method enabled', required: false, default: true })
  @IsOptional()
  @IsBoolean()
  enabled?: boolean;

  @ApiProperty({ description: 'Display order', required: false, default: 0 })
  @IsOptional()
  @IsNumber()
  order?: number;

  @ApiProperty({ description: 'Merchant ID', required: false })
  @IsOptional()
  @IsString()
  merchantId?: string;
}
