package com.cameleer.server.app.dto;

import io.swagger.v3.oas.annotations.media.Schema;

import java.util.List;

@Schema(description = "Unified catalog entry combining app records with live agent data")
public record CatalogApp(
        @Schema(description = "Application slug (universal identifier)") String slug,
        @Schema(description = "Display name") String displayName,
        @Schema(description = "True if a managed App record exists in the database") boolean managed,
        @Schema(description = "Environment slug") String environmentSlug,
        @Schema(description = "Composite health: deployment status + agent health") String health,
        @Schema(description = "Human-readable tooltip explaining the health state") String healthTooltip,
        @Schema(description = "Number of connected agents") int agentCount,
        @Schema(description = "Live routes from agents") List<RouteSummary> routes,
        @Schema(description = "Connected agent summaries") List<AgentSummary> agents,
        @Schema(description = "Total exchange count from ClickHouse") long exchangeCount,
        @Schema(description = "Active deployment info, null if no deployment") DeploymentSummary deployment
) {
    public record DeploymentSummary(
            String status,
            String replicas,
            int version
    ) {}
}
