/// API 端点常量
///
/// 注意: 这些路径不包含 /api/v1 前缀，因为 AppConfig.apiBaseUrl 已经包含了
/// 例如 baseUrl = 'https://rwaapi.szaiai.com/api/v1'
class ApiEndpoints {
  ApiEndpoints._();

  // Base URL - 生产环境 (仅供参考，实际使用 AppConfig)
  static const String baseUrl = 'https://rwaapi.szaiai.com';
  // Base URL - 开发环境
  static const String baseUrlDev = 'https://rwaapi-dev.szaiai.com';

  // Auth (-> Identity Service)
  static const String auth = '/auth';
  static const String login = '$auth/login';
  static const String register = '$auth/register';
  static const String refreshToken = '$auth/refresh';
  static const String logout = '$auth/logout';

  // User (-> Identity Service)
  static const String user = '/user';
  static const String autoCreate = '$user/auto-create';
  static const String userWallet = '$user/wallet';  // 获取钱包状态
  static const String me = '/me';  // 获取当前用户完整信息
  static const String profile = '$user/profile';
  static const String updateProfile = '$user/profile/update';
  static const String updateAvatar = '$user/avatar';

  // Wallet (-> Wallet Service)
  static const String wallet = '/wallet';
  static const String createWallet = '$wallet/create';
  static const String importWallet = '$wallet/import';
  static const String balance = '$wallet/balance';

  // Mining (-> Reward Service)
  static const String mining = '/mining';
  static const String miningStatus = '$mining/status';
  static const String startMining = '$mining/start';
  static const String stopMining = '$mining/stop';
  static const String claimReward = '$mining/claim';
  static const String hashPower = '$mining/hash-power';

  // Ranking (-> Leaderboard Service)
  static const String ranking = '/ranking';
  static const String dailyRanking = '$ranking/daily';
  static const String weeklyRanking = '$ranking/weekly';
  static const String monthlyRanking = '$ranking/monthly';

  // Trading (-> Wallet Service)
  static const String trading = '/trading';
  static const String exchange = '$trading/exchange';
  static const String settlement = '$trading/settlement';
  static const String transactions = '$trading/transactions';

  // Deposit (-> Wallet Service)
  static const String deposit = '/deposit';
  static const String depositAddress = '$deposit/address';
  static const String confirmDeposit = '$deposit/confirm';
  static const String depositRecords = '$deposit/records';

  // Planting (-> Planting Service)
  static const String planting = '/planting';
  static const String plantingPrice = '$planting/price';
  static const String submitPlanting = '$planting/submit';
  static const String provinces = '$planting/provinces';
  static const String cities = '$planting/cities';

  // Community & Referral (-> Referral Service)
  static const String community = '/community';
  static const String referral = '/referral';
  static const String referralMe = '$referral/me';  // 获取当前用户推荐信息
  static const String referralDirects = '$referral/me/direct-referrals';  // 获取直推列表
  static const String referralList = '$community/referrals';
  static const String earnings = '$community/earnings';
  static const String claimEarnings = '$community/claim';
  static const String generateReferralLink = '$referral/generate-link';

  // Authorization (-> Authorization Service)
  static const String authorizations = '/authorizations';
  static const String myAuthorizations = '$authorizations/my';  // 获取我的授权列表
  static const String myCommunityHierarchy = '$authorizations/my/community-hierarchy';  // 获取社区层级
  static const String stickmanRanking = '$authorizations/ranking/stickman';  // 火柴人排名
  static const String selfApplyStatus = '$authorizations/self-apply/status';  // 获取自助申请状态
  static const String selfApply = '$authorizations/self-apply';  // 自助申请授权

  // Telemetry (-> Reporting Service)
  static const String telemetry = '/telemetry';
  static const String telemetrySession = '$telemetry/session';
  static const String telemetryHeartbeat = '$telemetry/heartbeat';
  static const String telemetryEvents = '$telemetry/events';

  // System Config (-> Admin Service)
  static const String systemConfig = '/system-config';
  static const String displaySettings = '$systemConfig/display/settings';

  // Pending Actions (-> Identity Service)
  static const String pendingActions = '/user/pending-actions';
  static const String pendingActionsComplete = '/user/pending-actions'; // POST /:id/complete

  // [2026-03-02] 团队预种统计 (-> Referral Service)
  static const String teamPrePlanting = '$referral/me/team-pre-planting';
  static const String teamPrePlantingMembers = '$referral/me/team-pre-planting/members';

  // [2026-02-17] 预种计划 (-> Planting Service / PrePlantingModule)
  // 1887 USDT/份预种，累计 10 份自动合成 1 棵树
  // 所有端点与现有 /planting/* 完全独立
  static const String prePlanting = '/pre-planting';
  static const String prePlantingConfig = '$prePlanting/config';           // 开关配置
  static const String prePlantingEligibility = '$prePlanting/eligibility'; // 购买资格检查
  static const String prePlantingPosition = '$prePlanting/position';       // 持仓信息
  static const String prePlantingOrders = '$prePlanting/orders';           // 订单 CRUD
  static const String prePlantingMerges = '$prePlanting/merges';           // 合并记录
}
