New source control repo for Biskilog POS - secure hub to store & manage source code. Streamlines dev process, tracks changes, & improves collaboration. Ensures reliable software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.6 KiB

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;
}
/// <summary>
/// Endpoint to return all units of measure for products
/// </summary>
[Authorize]
[HttpGet, Route("units")]
public IEnumerable<Unitofmeasure> GetUnits()
{
return m_productService.GetUnitofmeasures();
}
/// <summary>
/// Endpoint to return all products
/// </summary>
[Authorize]
[HttpGet, Route("fetch")]
public IEnumerable<ProductItem> GetProducts()
{
return m_productService.GetProducts();
}
/// <summary>
/// Endpoint to return all product categories
/// </summary>
[Authorize]
[HttpGet, Route("categories")]
public IEnumerable<Tblcategory> GetCategories()
{
return m_productService.GetCategories();
}
/// <summary>
/// Endpoint to return all product brands
/// </summary>
[Authorize]
[HttpGet, Route("brands")]
public IEnumerable<Tblbrand> GetBrands()
{
return m_productService.GetBrands();
}
}
}