import { ApiProperty } from '@nestjs/swagger';

export class SettlementHistoryItemDto {
  @ApiProperty({ description: '结算记录ID', example: '123' })
  id: string;

  @ApiProperty({ description: '结算USDT金额', example: 1000 })
  usdtAmount: number;

  @ApiProperty({ description: '结算算力', example: 0 })
  hashpowerAmount: number;

  @ApiProperty({ description: '结算币种', example: 'USDT' })
  settleCurrency: string;

  @ApiProperty({ description: '实际收到金额', example: 1000 })
  receivedAmount: number;

  @ApiProperty({ description: '兑换哈希', example: '0x...', nullable: true })
  swapTxHash: string | null;

  @ApiProperty({ description: '兑换汇率', example: 1.0, nullable: true })
  swapRate: number | null;

  @ApiProperty({ description: '状态', example: 'SUCCESS' })
  status: string;

  @ApiProperty({ description: '创建时间' })
  createdAt: Date;

  @ApiProperty({ description: '完成时间', nullable: true })
  completedAt: Date | null;

  @ApiProperty({ description: '涉及的奖励条目数量', example: 5 })
  rewardEntryCount: number;
}

export class SettlementHistoryPaginationDto {
  @ApiProperty({ description: '当前页', example: 1 })
  page: number;

  @ApiProperty({ description: '每页数量', example: 20 })
  pageSize: number;

  @ApiProperty({ description: '总数', example: 100 })
  total: number;
}

export class SettlementHistoryResponseDto {
  @ApiProperty({ description: '结算记录列表', type: [SettlementHistoryItemDto] })
  data: SettlementHistoryItemDto[];

  @ApiProperty({ description: '分页信息', type: SettlementHistoryPaginationDto })
  pagination: SettlementHistoryPaginationDto;
}
