/**
 * API related constants
 */

export const API_VERSION = 'v1';

export const API_PATHS = {
  // User API
  AUTH: {
    ANONYMOUS: '/auth/anonymous',
    VERIFY_PHONE: '/auth/verify-phone',
    SEND_CODE: '/auth/send-code',
    LOGIN: '/auth/login',
    REFRESH: '/auth/refresh',
    LOGOUT: '/auth/logout',
  },

  // Conversation API
  CONVERSATIONS: {
    BASE: '/conversations',
    BY_ID: (id: string) => `/conversations/${id}`,
    MESSAGES: (id: string) => `/conversations/${id}/messages`,
  },

  // Payment API
  PAYMENTS: {
    BASE: '/payments',
    CREATE_ORDER: '/payments/orders',
    ORDER_STATUS: (id: string) => `/payments/orders/${id}/status`,
    ALIPAY_NOTIFY: '/payments/alipay/notify',
    WECHAT_NOTIFY: '/payments/wechat/notify',
  },

  // Admin API
  ADMIN: {
    AUTH: {
      LOGIN: '/admin/auth/login',
      REFRESH: '/admin/auth/refresh',
      LOGOUT: '/admin/auth/logout',
    },
    KNOWLEDGE: {
      BASE: '/admin/knowledge',
      BY_ID: (id: string) => `/admin/knowledge/${id}`,
      UPLOAD: '/admin/knowledge/upload',
      SEARCH: '/admin/knowledge/search',
    },
    EVOLUTION: {
      CHAT: '/admin/evolution/chat',
      EXPERIENCES: '/admin/evolution/experiences',
      APPLY: '/admin/evolution/apply',
      LOGS: '/admin/evolution/logs',
    },
    CONFIGS: {
      BASE: '/admin/configs',
      BY_KEY: (key: string) => `/admin/configs/${key}`,
    },
    ANALYTICS: {
      DASHBOARD: '/admin/analytics/dashboard',
      CONVERSATIONS: '/admin/analytics/conversations',
      PAYMENTS: '/admin/analytics/payments',
      USERS: '/admin/analytics/users',
    },
    USERS: {
      BASE: '/admin/users',
      BY_ID: (id: string) => `/admin/users/${id}`,
    },
    ADMINS: {
      BASE: '/admin/admins',
      BY_ID: (id: string) => `/admin/admins/${id}`,
    },
  },
} as const;

// WebSocket paths
export const WS_PATHS = {
  CONVERSATION: '/ws/conversation',
  ADMIN_EVOLUTION: '/ws/admin/evolution',
} as const;

// HTTP Headers
export const HEADERS = {
  AUTHORIZATION: 'Authorization',
  FINGERPRINT: 'X-Fingerprint',
  REQUEST_ID: 'X-Request-ID',
  USER_AGENT: 'User-Agent',
} as const;

// Pagination defaults
export const PAGINATION = {
  DEFAULT_PAGE: 1,
  DEFAULT_PAGE_SIZE: 20,
  MAX_PAGE_SIZE: 100,
} as const;
