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

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

        [HttpGet("customers")]
        public Task<IEnumerable<ELookUpItem>> Customers([FromQuery] string q)
            => _lookup.CustomersListAsync(q);
        [HttpGet("institutions")]
        public Task<IEnumerable<ELookUpItem>> Institutions([FromQuery] string q)
            => _lookup.InstitutionsListAsync(q);
        [HttpGet("patients")]
        public Task<IEnumerable<ELookUpItem>> Patients([FromQuery] string q)
            => _lookup.PatientsListAsync(q);
        [HttpGet("people")]
        public Task<IEnumerable<ELookUpItem>> People([FromQuery] string q)
            => _lookup.PeopleListAsync(q);
        [HttpGet("professionals")]
        public Task<IEnumerable<ELookUpItem>> Professionals([FromQuery] string q)
            => _lookup.ProfessionalsListAsync(q);
        [HttpGet("bussinessunits")]
        public Task<IEnumerable<ELookUpItem>> BussinessUnits([FromQuery] string q)
            => _lookup.BussinessUnitsListAsync(q);
        
        [HttpGet("products")]
        public Task<IEnumerable<EProductLookupItem>> Products([FromQuery] string q)
            => _lookup.ProductsListAsync(q);

        [HttpGet("paymentterms")]
        public Task<IEnumerable<ELookUpItem>> PaymentTerms()
            => _lookup.PaymentTermsListAsync(""); // o sin parámetro si lo hacés opcional

        [HttpGet("approvedquotes")]
        public Task<IEnumerable<ELookUpItem>> ApprovedQuotes([FromQuery] string q)
            => _lookup.ApprovedQuotesListAsync(q);
    }
}
