using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;

namespace ASTRAIN.Api.Endpoints;

/// <summary>
/// Provides health check endpoints.
/// </summary>
internal static class HealthEndpoints
{
    /// <summary>
    /// Registers health check routes under the provided route group.
    /// </summary>
    /// <param name="group">The API route group.</param>
    /// <returns>The same route group for chaining.</returns>
    public static RouteGroupBuilder MapHealthEndpoints(this RouteGroupBuilder group)
    {
        group.MapGet("/health", () => Results.Ok(new { status = "ok" }))
            .WithSummary("Health check")
            .WithDescription("Returns a simple payload used for liveness checks.");

        return group;
    }
}
