import { RoleType, AuthorizationStatus } from '@/domain/enums'

export interface AuthorizationDTO {
  authorizationId: string
  userId: string
  roleType: RoleType
  regionCode: string
  regionName: string
  status: AuthorizationStatus
  displayTitle: string
  benefitActive: boolean
  currentMonthIndex: number
  requireLocalPercentage: number
  exemptFromPercentageCheck: boolean
  // 考核进度字段
  initialTargetTreeCount: number  // 初始考核目标（社区100，市500，省3000）
  currentTreeCount: number        // 当前团队认种数量
  monthlyTargetTreeCount: number  // 月度考核目标（社区固定10）
  createdAt: Date
  updatedAt: Date
}

export interface StickmanRankingDTO {
  id: string  // 授权ID，用于前端唯一标识
  userId: string
  accountSequence: string  // 用户账户序列号，用于查看详情
  authorizationId: string
  roleType: RoleType
  regionCode: string
  nickname: string  // 用户昵称
  avatarUrl?: string  // 头像URL
  completedCount: number  // 完成数量（累计完成）
  monthlyEarnings: number  // 本月可结算收益（USDT）
  isCurrentUser: boolean  // 是否是当前请求用户
  ranking: number
  isFirstPlace: boolean
  cumulativeCompleted: number
  cumulativeTarget: number
  finalTarget: number
  progressPercentage: number
  exceedRatio: number
  monthlyRewardUsdt: number
  monthlyRewardRwad: number
}

export interface MonthlyAssessmentDTO {
  assessmentId: string
  authorizationId: string
  userId: string
  roleType: RoleType
  regionCode: string
  assessmentMonth: string
  monthIndex: number
  monthlyTarget: number
  cumulativeTarget: number
  monthlyCompleted: number
  cumulativeCompleted: number
  localPercentage: number
  localPercentagePass: boolean
  exceedRatio: number
  result: string
  rankingInRegion: number | null
  isFirstPlace: boolean
  isBypassed: boolean
}
