export interface TenantResponse {
  id: string;
  name: string;
  slug: string;
  tier: string;
  status: string;
  serverEndpoint: string | null;
  provisionError: string | null;
  createdAt: string;
  updatedAt: string;
}

export interface LicenseResponse {
  id: string;
  tenantId: string;
  tier: string;
  features: Record<string, boolean>;
  limits: Record<string, number>;
  issuedAt: string;
  expiresAt: string;
  token: string;
}

export interface MeResponse {
  userId: string;
  tenants: Array<{
    id: string;
    name: string;
    slug: string;
    logtoOrgId: string;
  }>;
}

// Vendor API types
export interface VendorTenantSummary {
  id: string;
  name: string;
  slug: string;
  tier: string;
  status: string;
  serverState: string;
  licenseExpiry: string | null;
  provisionError: string | null;
}

export interface VendorTenantDetail {
  tenant: TenantResponse;
  serverState: string;
  serverHealthy: boolean;
  serverStatus: string;
  license: LicenseResponse | null;
}

export interface CreateTenantRequest {
  name: string;
  slug: string;
  tier?: string;
  adminUsername?: string;
  adminPassword?: string;
}

// Tenant portal API types
export interface DashboardData {
  name: string;
  slug: string;
  tier: string;
  status: string;
  serverHealthy: boolean;
  serverStatus: string;
  serverEndpoint: string | null;
  licenseTier: string | null;
  licenseDaysRemaining: number;
  limits: Record<string, number>;
  features: Record<string, boolean>;
}

export interface TenantLicenseData {
  id: string;
  tier: string;
  features: Record<string, boolean>;
  limits: Record<string, number>;
  issuedAt: string;
  expiresAt: string;
  token: string;
  daysRemaining: number;
}

export interface TenantSettings {
  name: string;
  slug: string;
  tier: string;
  status: string;
  serverEndpoint: string | null;
  createdAt: string;
}
