using Microsoft.AspNetCore.Authorization;

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MTWorkHR.Application.Filters;
using MTWorkHR.Application.Models;
using MTWorkHR.Application.Services;
using MTWorkHR.Application.Services.Interfaces;

namespace MTWorkHR.API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    [AppAuthorize]
    public class HRController : ControllerBase
    {
        private readonly IContractService _ContractService;

        public HRController(IContractService UserContractService, IFileService fileService)
        {
            _ContractService = UserContractService;
        }
        [HttpGet("GetAll")]
        [ProducesResponseType(StatusCodes.Status200OK)]

        public async Task<ActionResult<List<ContractAllHRDto>>> GetAll([FromQuery] ContractPagingInputDto pagingInput)
        {
            return Ok(await _ContractService.GetAllForHr(pagingInput));
        }

        [HttpGet("GetByIdHRDetails")]
        [ProducesResponseType(StatusCodes.Status200OK)]
        public async Task<ActionResult<ContractHRDto>> GetByIdHRDetails([FromQuery] long contractId)
        {
            return Ok(await _ContractService.GetByIdHRDetails(contractId));
        }

    }
}
