using Predictalytics.Application.Interfaces;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;

namespace Predictalytics.Api.Endpoints;

public static class DashboardEndpoints
{
    public static void MapDashboardEndpoints(this IEndpointRouteBuilder routes)
    {
        routes.MapGet("/api/dashboard", async (IAnalyticsService svc, CancellationToken ct) =>
            Results.Ok(await svc.GetDashboardAsync(ct)))
            .WithTags("Dashboard");
    }
}
