using Microsoft.AspNetCore.Mvc;
using Nexus.Api.Services;

namespace Nexus.Api.Controllers;

[ApiController]
[Route("api/v1/calendar")]
public class CalendarController(ICalendarService calendarService) : ControllerBase
{
    [HttpGet]
    public async Task<IResult> GetAll(CancellationToken ct)
        => Results.Ok(await calendarService.GetCronJobsAsync(ct));

    [HttpGet("upcoming")]
    public async Task<IResult> GetUpcoming(CancellationToken ct)
        => Results.Ok(await calendarService.GetUpcomingCronJobsAsync(ct));
}
