export interface Account {
  id: string
  name: string
  display_code: string
  owner_id: string
  created_at: string
  updated_at: string
}

export interface Subscription {
  id: string
  account_id: string
  plan: 'free' | 'pro' | 'team'
  status: 'active' | 'past_due' | 'canceled' | 'trialing' | 'orphaned'
  current_period_start: string | null
  current_period_end: string | null
  created_at: string
  updated_at: string
}

export interface PlanLimits {
  plan: string
  max_trees: number | null
  max_sessions_per_month: number | null
  max_users: number | null
  custom_branding: boolean
  priority_support: boolean
  export_formats: string[]
}

export interface SubscriptionDetails {
  subscription: Subscription
  limits: PlanLimits
  usage: {
    tree_count: number
    session_count_this_month: number
    user_count: number
  }
}

export interface AccountInvite {
  id: string
  account_id: string
  email: string
  role: 'engineer' | 'viewer'
  code: string
  expires_at: string | null
  used_at: string | null
  created_at: string
}

export interface AccountMember {
  id: string
  email: string
  name: string
  account_role: string
  is_active: boolean
  created_at: string
  last_login: string | null
}
