package dev.lions.unionflow.client.api.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.List;

/**
 * Miroir local du DTO {@code ReadinessReport} backend (P1-NEW-15).
 *
 * @since 2026-04-25 (Sprint 8)
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public record PispiReadinessDto(
    String globalStatus,            // READY, DEGRADED, BLOCKED
    String baseUrl,
    List<CheckResultDto> checks,
    List<String> blockingIssues,
    List<String> warnings
) {
  @JsonIgnoreProperties(ignoreUnknown = true)
  public record CheckResultDto(
      String name,
      String status,                // PASS, FAIL
      String severity,              // BLOCKING, WARNING
      String message
  ) {}

  public boolean estReady() { return "READY".equals(globalStatus); }
  public boolean estBlocked() { return "BLOCKED".equals(globalStatus); }
}
