/**
 * OAuth types for authentication and profile responses.
 */

export interface OAuthTokens {
  accessToken: string
  refreshToken?: string
  expiresAt?: number
  scopes?: string[]
}

export type SubscriptionType = 'free' | 'pro' | 'max' | 'team' | 'enterprise' | (string & {})

export type RateLimitTier = string

export type BillingType = string

export interface OAuthProfileResponse {
  account: {
    uuid: string
    email: string
    display_name?: string
    created_at?: string
  }
  organization: {
    uuid: string
    organization_type?: string
    rate_limit_tier?: RateLimitTier
    has_extra_usage_enabled?: boolean
    billing_type?: BillingType
    subscription_created_at?: string
  }
}

export interface ReferrerRewardInfo {
  type?: string
  amount?: number
  currency?: string
  description?: string
}

export interface ReferralRedemptionsResponse {
  redemptions: Array<{
    id: string
    redeemed_at: string
    status: string
  }>
  limit: number
  campaign: string
}

export interface ReferralEligibilityResponse {
  eligible: boolean
  referral_code?: string
  referral_code_details?: {
    campaign?: string
  }
  referrer_reward?: ReferrerRewardInfo
}
