using Biskilog_Accounting.Shared.CustomModels; using Biskilog_Accounting.Shared.Interfaces; using Biskilog_Accounting.Shared.POSModels; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace Biskilog_Accounting.Server.Controllers { [Route("api/[controller]")] [ApiController] public class ProductsController : ControllerBase { private readonly IProduct m_productService; public ProductsController(IProduct a_productService) { m_productService = a_productService; } /// /// Endpoint to return all units of measure for products /// [Authorize] [HttpGet, Route("units")] public IEnumerable GetUnits() { return m_productService.GetUnitofmeasures(); } /// /// Endpoint to return all products /// [Authorize] [HttpGet, Route("fetch")] public IEnumerable GetProducts() { return m_productService.GetProducts(); } /// /// Endpoint to return all product categories /// [Authorize] [HttpGet, Route("categories")] public IEnumerable GetCategories() { return m_productService.GetCategories(); } /// /// Endpoint to return all product brands /// [Authorize] [HttpGet, Route("brands")] public IEnumerable GetBrands() { return m_productService.GetBrands(); } } }