93f2f1bd3b
Major refactor replacing Sale/Order with ShopPO → Invoice → LoadingSheet flow. Removed legacy Sale/Order models and features; introduced ShopPO, ShopPOItem, Invoice, LoadingSheetOrder, and SysConfig models. Updated related entities, enums, repositories, and controllers. Added new migrations for schema changes and system config. Overhauled business logic and DI registrations. Updated documentation with migration plan.
29 lines
808 B
C#
29 lines
808 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Distribution.Features.ShopPO;
|
|
|
|
[ApiController]
|
|
[Route("api/shop-pos")]
|
|
public class ShopPOController(ShopPOService service) : ControllerBase
|
|
{
|
|
[HttpGet]
|
|
public async Task<IActionResult> GetAll(
|
|
[FromQuery] Guid? agentId,
|
|
[FromQuery] Guid? routeId,
|
|
[FromQuery] Guid? shopId,
|
|
[FromQuery] bool? confirmed,
|
|
[FromQuery] int page = 1,
|
|
[FromQuery] int pageSize = 20)
|
|
{
|
|
var result = await service.GetAllAsync(agentId, routeId, shopId, confirmed, page, pageSize);
|
|
return Ok(result);
|
|
}
|
|
|
|
[HttpGet("{id:guid}")]
|
|
public async Task<IActionResult> GetById(Guid id)
|
|
{
|
|
var result = await service.GetByIdAsync(id);
|
|
return result is null ? NotFound() : Ok(result);
|
|
}
|
|
}
|