26 lines
945 B
C#
26 lines
945 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using SytelineSaAppEfDataModel.Dtos;
|
|
using SytelineSaAppEfDataModel.Services;
|
|
|
|
namespace FaKrosnoApi.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("api/[controller]")]
|
|
public class WzHeaderController(IWzHeaderService service, IMaterialTransactionService materialTransactionService) : Controller
|
|
{
|
|
[HttpGet]
|
|
public async Task<ActionResult<IEnumerable<WzHeaderDto>>> GetAll()
|
|
{
|
|
IEnumerable<WzHeaderDto> wzHeaders = await service.GetAll();
|
|
return Ok(wzHeaders);
|
|
}
|
|
|
|
[HttpGet("by-customer-number")]
|
|
public async Task<ActionResult<IEnumerable<MaterialTransactionDto>>> GetByCustomerNumber(
|
|
[FromQuery] string customerNumber, [FromQuery] int customerSequence)
|
|
{
|
|
IEnumerable<MaterialTransactionDto> materialTransactions =
|
|
await materialTransactionService.GetByCustomerNumber(customerNumber, customerSequence);
|
|
return Ok(materialTransactions);
|
|
}
|
|
} |