using Demo.Domain.Models;
using Demo.Domain.UseCase;
using Microsoft.AspNetCore.Mvc;

namespace presence_api.Controllers;
[ApiController]
[Route("api/[controller]")]

public class PresenceController: ControllerBase{
    private readonly PresenceUseCase _presenceUseCase;

    public PresenceController(PresenceUseCase presenceUseCase)
    {
    _presenceUseCase = presenceUseCase;
    }

    //get

    //post

    [HttpPost("generate")]
    public ActionResult<bool> GeneratePresence([FromBody] PresencePost request)
    {
        if (request == null){
            return BadRequest("buba");
        }
        var isGenerated = _presenceUseCase.GeneratePresence(request.firstLesson, request.lastLesson, request.groupID, request.date);
        return Ok(isGenerated);
    }

    //delete

    //update
}