import { ApiProperty } from '@nestjs/swagger'

/**
 * 手续费类型
 */
export enum FeeType {
  FIXED = 'FIXED',           // 固定金额
  PERCENTAGE = 'PERCENTAGE', // 百分比
}

/**
 * 提取手续费配置响应 DTO
 */
export class WithdrawalFeeConfigResponseDTO {
  @ApiProperty({ description: '费率类型', enum: FeeType, example: FeeType.FIXED })
  feeType: FeeType

  @ApiProperty({ description: '费率值 (固定金额或百分比)', example: 2 })
  feeValue: number

  @ApiProperty({ description: '最小手续费 (百分比模式)', example: 0 })
  minFee: number

  @ApiProperty({ description: '最大手续费 (百分比模式，0表示不限)', example: 0 })
  maxFee: number

  @ApiProperty({ description: '备注', example: '默认手续费配置', required: false })
  memo?: string
}

/**
 * 计算手续费请求 DTO
 */
export class CalculateFeeRequestDTO {
  @ApiProperty({ description: '提取金额', example: 1000 })
  amount: number
}

/**
 * 计算手续费响应 DTO
 */
export class CalculateFeeResponseDTO {
  @ApiProperty({ description: '提取金额', example: 1000 })
  amount: number

  @ApiProperty({ description: '手续费', example: 2 })
  fee: number

  @ApiProperty({ description: '发送方总支出 (金额 + 手续费)', example: 1002 })
  totalRequired: number

  @ApiProperty({ description: '接收方收到金额', example: 1000 })
  receiverGets: number

  @ApiProperty({ description: '费率类型', enum: FeeType })
  feeType: FeeType

  @ApiProperty({ description: '费率值', example: 2 })
  feeValue: number
}
