using System; using System.Web.Http; using LCU.API.Internal.CoreSoapApiWrapper.CoreSoapUtilities; using LCU.API.Internal.CoreSoapApiWrapper.Services; using LCU.API.Internal.CoreSoapApiWrapper.Models.Requests; namespace LCU.API.Internal.CoreSoapApiWrapper.Controllers { [RoutePrefix("api/core/Tax")] public class TaxController : ApiController { private readonly ITaxService _taxService; public TaxController(ITaxService taxService) { _taxService = taxService; } [Route("{taxId:long}/GetTaxIdData")] public IHttpActionResult GetTaxIdData(long taxId) { try { if (taxId == 0) { return BadRequest("A taxId must be provided, and cannot be 0."); } var response = _taxService.GetTaxIdData(taxId); return Ok(response); } catch (Exception ex) { return BadRequest(ex.Message); } } } }