using FastEndpoints; using PyroFetes.DTO.PurchaseOrder.Response; using PyroFetes.Repositories; using PyroFetes.Specifications.PurchaseOrders; namespace PyroFetes.Endpoints.PurchaseOrders; public class GetAllPurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrdersRepository) : EndpointWithoutRequest> { public override void Configure() { Get("/purchaseOrders"); Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) { await Send.OkAsync(await purchaseOrdersRepository.ProjectToListAsync(new GetAllPurchaseOrderSpec(), ct), ct); } }