/**
 * Tenant Type Definitions
 * Defines the structure of tenant objects used throughout the application
 */

export interface Tenant {
  id: string
  name: string
  domain: string | null
  billingAccountId: string
  status: 'ACTIVE' | 'SUSPENDED' | 'DELETED' | 'PENDING_ACTIVATION'
  tier: 'FREE' | 'STANDARD' | 'ENTERPRISE' | 'SOVEREIGN'
  quotaLimits: TenantQuotas
  metadata: Record<string, unknown>
  createdAt: Date
  updatedAt: Date
}

export interface TenantQuotas {
  compute?: {
    vcpu?: number
    memory?: number
    instances?: number
  }
  storage?: {
    total?: number
    perInstance?: number
  }
  network?: {
    bandwidth?: number
    egress?: number
  }
  custom?: Record<string, unknown>
}

export interface TenantQuotaUsage {
  compute: {
    vcpu: number
    memory: number
    instances: number
  }
  storage: {
    total: number
    perInstance: number
  }
  network: {
    bandwidth: number
    egress: number
  }
}

export interface TenantQuotaMetrics {
  compute: {
    used: TenantQuotaUsage['compute']
    limit: TenantQuotas['compute']
    percentage: {
      instances: number
      vcpu: number
      memory: number
    }
  }
  storage: {
    used: TenantQuotaUsage['storage']
    limit: TenantQuotas['storage']
    percentage: {
      total: number
    }
  }
  network: {
    used: TenantQuotaUsage['network']
    limit: TenantQuotas['network']
    percentage: {
      bandwidth: number
    }
  }
}

