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

namespace phronCare.API.Controllers.Sales
{
    [Route("api/[controller]")]
    [ApiController]
    public class TaxTypeController : ControllerBase
    {
        private readonly ITaxTypeDom _taxTypeDom;
        public TaxTypeController(ITaxTypeDom taxTypeDom)
        {
            _taxTypeDom = taxTypeDom ?? throw new ArgumentNullException(nameof(taxTypeDom));
        }
        [HttpGet("GetAll")]
        public async Task<IActionResult> GetAll()
        {
            try
            {
                var result = await _taxTypeDom.GetAllActiveAsync();
                return Ok(result);
            }
            catch (Exception ex)
            {
                return BadRequest(ex.Message);
            }
        }
    }
}
