/**
 * Multi-tenancy configuration types
 *
 * Config is stored in dedicated `config` columns (NOT nested in metadata):
 * - organizations.config: Org-level config (no feature toggles -- all features available by default)
 * - org_memberships.config: Reserved for non-access membership configuration
 * - users.config: User-global config
 */

import type { ThemePresetName } from './theme-presets'

/**
 * User-global config (stored in users.config)
 * Theme and onboarding are user-specific, NOT org-specific
 */
export interface UserConfig {
  theme?: {
    preset?: ThemePresetName
    colorScheme?: 'light' | 'dark' | 'auto'
  }
  onboarding?: {
    completed?: boolean
    completedAt?: string // ISO date
    role?: string
    primaryUseCase?: string[]
    experienceLevel?: string
    /** Onboarding guide system state (set by checklist/tour system) */
    guides?: {
      completedIds?: string[] // e.g. ["explore-dashboard", "view-workflow"]
      dismissed?: boolean // user manually dismissed checklist
      completedAt?: string // ISO date — all guides finished
    }
  }
}

/**
 * OrgMetadata - Contains WorkOS sync data only
 * Note: This is kept separate from config for clarity
 */
export interface OrgMetadata {
  domains?: {
    verified: string[]
    pending: string[]
    all: string[]
  }
  workos_created_at?: string
  workos_updated_at?: string
}
