using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.Web.Services.Interfaces;

namespace WorkFlowCheck.Web.Pages.BaseStock.CheckPoints
{
    [Authorize]
    public class CheckPointsPageModel : PageModel
    {
        private readonly ILogger<IndexModel> _logger;
        private readonly IBaseStockService _baseStockService;
        public CheckPointsPageModel(ILogger<IndexModel> logger, IBaseStockService baseStockService)
        {
            _logger = logger;
            _baseStockService = baseStockService;
        }
        public void OnGet()
        {
        }
        public async Task<JsonResult> OnGetLoadCheckPoints()
        {
            var results = await _baseStockService.GetAllCheckPoints();
            return new JsonResult(new { data = results });
        }

    }
}
