import type { SupabaseUserProfile } from '../../supabase'

/**
 * Test user fixtures using actual Supabase types
 * All timestamps use ISO 8601 format matching Supabase defaults
 */
export const TEST_USERS: Record<string, SupabaseUserProfile> = {
  admin: {
    id: '00000000-0000-0000-0000-000000000001',
    workos_user_id: 'user_admin_test',
    email: 'admin@test.com',
    first_name: 'Admin',
    last_name: 'User',
    display_name: 'Admin User',
    is_platform_admin: true,
    is_active: true,
    profile_picture_url: null,
    last_login_at: null,
    last_visited_org: null,
    config: {},
    created_at: '2025-01-01T00:00:00Z',
    updated_at: '2025-01-01T00:00:00Z'
  },
  regularUser: {
    id: '00000000-0000-0000-0000-000000000002',
    workos_user_id: 'user_regular_test',
    email: 'user@test.com',
    first_name: 'Regular',
    last_name: 'User',
    display_name: 'Regular User',
    is_platform_admin: false,
    is_active: true,
    profile_picture_url: null,
    last_login_at: null,
    last_visited_org: null,
    config: {},
    created_at: '2025-01-01T00:00:00Z',
    updated_at: '2025-01-01T00:00:00Z'
  },
  inactiveUser: {
    id: '00000000-0000-0000-0000-000000000003',
    workos_user_id: 'user_inactive_test',
    email: 'inactive@test.com',
    first_name: 'Inactive',
    last_name: 'User',
    display_name: 'Inactive User',
    is_platform_admin: false,
    is_active: false,
    profile_picture_url: null,
    last_login_at: null,
    last_visited_org: null,
    config: {},
    created_at: '2025-01-01T00:00:00Z',
    updated_at: '2025-01-01T00:00:00Z'
  }
}

/**
 * Helper to create custom user fixture
 */
export function createTestUser(overrides: Partial<SupabaseUserProfile>): SupabaseUserProfile {
  return {
    id: '00000000-0000-0000-0000-999999999999',
    workos_user_id: 'user_custom_test',
    email: 'custom@test.com',
    first_name: 'Custom',
    last_name: 'User',
    display_name: 'Custom User',
    is_platform_admin: false,
    is_active: true,
    profile_picture_url: null,
    last_login_at: null,
    last_visited_org: null,
    config: {},
    created_at: '2025-01-01T00:00:00Z',
    updated_at: '2025-01-01T00:00:00Z',
    ...overrides
  }
}
