import { ApiProperty } from '@nestjs/swagger';
import { RightType } from '../../../domain/value-objects/right-type.enum';
import { RewardStatus } from '../../../domain/value-objects/reward-status.enum';

export class RewardEntryDto {
  @ApiProperty({ description: '奖励流水ID', example: '1' })
  id: string;

  @ApiProperty({ description: '权益类型', enum: RightType, example: RightType.SHARE_RIGHT })
  rightType: RightType;

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

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

  @ApiProperty({ description: '奖励状态', enum: RewardStatus, example: RewardStatus.SETTLEABLE })
  rewardStatus: RewardStatus;

  @ApiProperty({ description: '创建时间', example: '2024-01-01T00:00:00.000Z' })
  createdAt: Date;

  @ApiProperty({ description: '过期时间', example: '2024-01-02T00:00:00.000Z', nullable: true })
  expireAt: Date | null;

  @ApiProperty({ description: '剩余过期时间(毫秒)', example: 86400000 })
  remainingTimeMs: number;

  @ApiProperty({ description: '领取时间', example: '2024-01-01T12:00:00.000Z', nullable: true })
  claimedAt: Date | null;

  @ApiProperty({ description: '结算时间', example: '2024-01-01T18:00:00.000Z', nullable: true })
  settledAt: Date | null;

  @ApiProperty({ description: '过期时间', example: null, nullable: true })
  expiredAt: Date | null;

  @ApiProperty({ description: '备注', example: '分享权益：来自用户123的认种' })
  memo: string;
}

export class RewardEntryListDto {
  @ApiProperty({ description: '奖励列表', type: [RewardEntryDto] })
  data: RewardEntryDto[];

  @ApiProperty({ description: '分页信息' })
  pagination: {
    page: number;
    pageSize: number;
    total: number;
  };
}
