/**
 * Internal User types - normalized from WorkOS API
 */

export interface User {
  id: string
  email: string
  firstName: string | null
  lastName: string | null
  emailVerified: boolean
  profilePictureUrl: string | null
  lastSignInAt?: Date
  externalId: string | null
  metadata: Record<string, unknown>
  createdAt: Date
  updatedAt: Date
}

export interface UserSummary {
  totalUsers: number
  verifiedUsers: number
  unverifiedUsers: number
  recentSignIns: number
}

/**
 * Request/Response types for internal API
 */

export interface CreateUserRequest {
  email: string
  password?: string
  firstName?: string
  lastName?: string
  emailVerified?: boolean
  externalId?: string
  metadata?: Record<string, unknown>
}

export interface UpdateUserRequest {
  firstName?: string
  lastName?: string
  email?: string
  emailVerified?: boolean
  password?: string
  externalId?: string
  metadata?: Record<string, unknown>
}

export interface ListUsersParams {
  email?: string
  organizationId?: string
  limit?: number
  before?: string
  after?: string
  order?: 'asc' | 'desc'
}

export interface ListUsersResponse {
  data: User[]
  listMetadata: {
    before?: string
    after?: string
  }
}
