/**
 * Shared TypeScript type definitions
 */

// API Types
export interface Resource {
  id: string
  name: string
  type: ResourceType
  status: ResourceStatus
  site: Site
  metadata?: Record<string, unknown>
  createdAt: string
  updatedAt: string
}

export interface Site {
  id: string
  name: string
  region: string
  status: SiteStatus
  resources?: Resource[]
  metadata?: Record<string, unknown>
  createdAt: string
  updatedAt: string
}

export interface User {
  id: string
  email: string
  name: string
  role: UserRole
  createdAt: string
  updatedAt: string
}

export type ResourceType = 'VM' | 'CONTAINER' | 'STORAGE' | 'NETWORK'
export type ResourceStatus = 'PENDING' | 'PROVISIONING' | 'RUNNING' | 'STOPPED' | 'ERROR' | 'DELETING'
export type SiteStatus = 'ACTIVE' | 'INACTIVE' | 'MAINTENANCE'
export type UserRole = 'ADMIN' | 'USER' | 'VIEWER'

// Form Types
export interface ResourceFormData {
  name: string
  type: ResourceType
  siteId: string
  metadata?: Record<string, unknown>
}

// API Response Types
export interface ApiResponse<T> {
  data?: T
  errors?: Array<{
    message: string
    code?: string
    path?: string[]
  }>
}

// Pagination Types
export interface PaginationParams {
  page?: number
  limit?: number
  offset?: number
}

export interface PaginatedResponse<T> {
  items: T[]
  total: number
  page: number
  limit: number
  hasMore: boolean
}

