package dev.lions.unionflow.server.resource;

import jakarta.annotation.security.PermitAll;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import java.time.LocalDateTime;
import java.util.Map;
import org.eclipse.microprofile.openapi.annotations.Operation;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;

/** Resource de santé pour UnionFlow Server */
@Path("/api/status")
@Produces(MediaType.APPLICATION_JSON)
@ApplicationScoped
@PermitAll
@Tag(name = "Status", description = "API de statut du serveur")
public class HealthResource {

  @GET
  @Operation(summary = "Vérifier le statut du serveur")
  public Response getStatus() {
    return Response.ok(
            Map.of(
                "status", "UP",
                "service", "UnionFlow Server",
                "version", "1.0.0",
                "timestamp", LocalDateTime.now().toString(),
                "message", "Serveur opérationnel"))
        .build();
  }
}
