package dev.lions.user.manager.dto.sync;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

import java.io.Serializable;

/**
 * DTO représentant le statut de santé de Keycloak
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "Statut de santé de Keycloak")
public class HealthStatusDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "Timestamp du check de santé (millisecondes)", example = "1699545600000")
    private long timestamp;

    @Schema(description = "Indique si Keycloak est accessible", example = "true")
    private boolean keycloakAccessible;

    @Schema(description = "Version de Keycloak", example = "23.0.3")
    private String keycloakVersion;

    @Schema(description = "Indique si les realms sont accessibles", example = "true")
    private boolean realmsAccessible;

    @Schema(description = "Nombre de realms disponibles", example = "5")
    private int realmsCount;

    @Schema(description = "Indique si Keycloak est globalement en bonne santé", example = "true")
    private boolean overallHealthy;

    @Schema(description = "Message d'erreur si le check a échoué")
    private String errorMessage;
}

