import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
import { RoleType, AuthorizationStatus } from '@/domain/enums'

export class AuthorizationResponse {
  @ApiProperty({ description: '授权ID' })
  authorizationId: string

  @ApiProperty({ description: '用户ID' })
  userId: string

  @ApiProperty({ description: '角色类型', enum: RoleType })
  roleType: RoleType

  @ApiProperty({ description: '区域代码' })
  regionCode: string

  @ApiProperty({ description: '区域名称' })
  regionName: string

  @ApiProperty({ description: '授权状态', enum: AuthorizationStatus })
  status: AuthorizationStatus

  @ApiProperty({ description: '显示标题' })
  displayTitle: string

  @ApiProperty({ description: '权益是否激活' })
  benefitActive: boolean

  @ApiProperty({ description: '当前考核月份索引' })
  currentMonthIndex: number

  @ApiProperty({ description: '本地占比要求' })
  requireLocalPercentage: number

  @ApiProperty({ description: '是否豁免占比考核' })
  exemptFromPercentageCheck: boolean

  @ApiProperty({ description: '初始考核目标（社区100，市500，省3000）' })
  initialTargetTreeCount: number

  @ApiProperty({ description: '当前团队认种数量' })
  currentTreeCount: number

  @ApiProperty({ description: '月度考核目标' })
  monthlyTargetTreeCount: number

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

  @ApiProperty({ description: '更新时间' })
  updatedAt: Date
}

export class ApplyAuthorizationResponse {
  @ApiProperty({ description: '授权ID' })
  authorizationId: string

  @ApiProperty({ description: '授权状态' })
  status: string

  @ApiProperty({ description: '权益是否激活' })
  benefitActive: boolean

  @ApiPropertyOptional({ description: '显示标题' })
  displayTitle?: string

  @ApiProperty({ description: '消息提示' })
  message: string

  @ApiProperty({ description: '当前认种数量' })
  currentTreeCount: number

  @ApiProperty({ description: '所需认种数量' })
  requiredTreeCount: number
}

export class StickmanRankingResponse {
  @ApiProperty({ description: '唯一标识（授权ID）' })
  id: string

  @ApiProperty({ description: '用户ID' })
  userId: string

  @ApiProperty({ description: '授权ID' })
  authorizationId: string

  @ApiProperty({ description: '角色类型', enum: RoleType })
  roleType: RoleType

  @ApiProperty({ description: '区域代码' })
  regionCode: string

  @ApiProperty({ description: '昵称' })
  nickname: string

  @ApiPropertyOptional({ description: '头像URL' })
  avatarUrl?: string

  @ApiProperty({ description: '完成数量（累计完成）' })
  completedCount: number

  @ApiProperty({ description: '本月可结算收益（USDT）' })
  monthlyEarnings: number

  @ApiProperty({ description: '是否是当前用户' })
  isCurrentUser: boolean

  @ApiProperty({ description: '排名' })
  ranking: number

  @ApiProperty({ description: '是否第一名' })
  isFirstPlace: boolean

  @ApiProperty({ description: '累计完成数量' })
  cumulativeCompleted: number

  @ApiProperty({ description: '累计目标数量' })
  cumulativeTarget: number

  @ApiProperty({ description: '最终目标数量' })
  finalTarget: number

  @ApiProperty({ description: '进度百分比' })
  progressPercentage: number

  @ApiProperty({ description: '超越比例' })
  exceedRatio: number

  @ApiProperty({ description: '本月USDT收益' })
  monthlyRewardUsdt: number

  @ApiProperty({ description: '本月RWAD收益' })
  monthlyRewardRwad: number
}
