export interface ServiceRequestStats {
  serviceId: number;
  serviceName: string;
  totalRequests: number;
  successCount: number;
  successRate: number;
  avgResponseTime: number;
}

export interface ServiceResponseTimeRank {
  serviceName: string;
  avgResponseTime: number;
  requestCount: number;
}

export interface HourlyServiceTrend {
  hour: number;
  serviceName: string;
  count: number;
}

export interface ServiceStatsResponse {
  serviceStats: ServiceRequestStats[];
  slowestServices: ServiceResponseTimeRank[];
  hourlyTrend: HourlyServiceTrend[];
}

export interface UserRequestRank {
  userId: number;
  userName: string;
  role: string;
  requestCount: number;
  successRate: number;
}

export interface UserRoleDistribution {
  role: string;
  userCount: number;
  requestCount: number;
}

export interface DailyActiveUsers {
  date: string;
  activeUsers: number;
}

export interface UserStatsResponse {
  totalUsers: number;
  usersWithActiveKey: number;
  totalActiveUsers: number;
  topUsers: UserRequestRank[];
  roleDistribution: UserRoleDistribution[];
  dailyActiveUsers: DailyActiveUsers[];
}

export interface ApiCallRank {
  serviceName: string;
  apiName: string;
  requestUrl: string;
  requestMethod: string;
  callCount: number;
  avgResponseTime: number;
  successRate: number;
}

export interface ApiErrorRank {
  serviceName: string;
  apiName: string;
  requestUrl: string;
  errorCount: number;
  totalCount: number;
  errorRate: number;
}

export interface ApiMethodDistribution {
  method: string;
  count: number;
}

export interface HttpStatusDistribution {
  statusCode: number;
  count: number;
}

export interface ApiStatsResponse {
  topApis: ApiCallRank[];
  topErrorApis: ApiErrorRank[];
  methodDistribution: ApiMethodDistribution[];
  statusCodeDistribution: HttpStatusDistribution[];
}

export interface TenantRequestStats {
  tenantId: number;
  tenantName: string;
  totalRequests: number;
  activeUsers: number;
  successRate: number;
  avgResponseTime: number;
}

export interface DailyTenantTrend {
  date: string;
  tenantName: string;
  count: number;
}

export interface TenantApiKeyStats {
  tenantName: string;
  totalKeys: number;
  activeKeys: number;
}

export interface TenantStatsResponse {
  tenantStats: TenantRequestStats[];
  dailyTrend: DailyTenantTrend[];
  apiKeyStats: TenantApiKeyStats[];
}

export interface UsageTrendItem {
  label: string;
  totalRequests: number;
  successCount: number;
  failureCount: number;
  successRate: number;
  avgResponseTime: number;
  activeUsers: number;
}

export interface UsageTrendResponse {
  period: string;
  items: UsageTrendItem[];
}
