using Core.Interfaces;
using Domain.Entities;
using Microsoft.AspNetCore.Mvc;

namespace phronCare.API.Controllers.Stock
{
    [Route("api/[controller]")]
    [ApiController]
    public class LSMLookUpController : ControllerBase
    {
        private readonly ILSMLookUpDom _lookup;
        public LSMLookUpController(ILSMLookUpDom lookup) => _lookup = lookup;

        [HttpGet("productdivisions")]
        public Task<IEnumerable<ELookUpItem>> ProductDivisions([FromQuery] string q = "")
            => _lookup.ProductDivisionsListAsync(q);

        [HttpGet("units")]
        public Task<IEnumerable<ELookUpItem>> Units([FromQuery] string q = "")
            => _lookup.UnitsOfMeasureListAsync(q);
    }
}
