Add endpoint to display all customers, and updated dto to create quotation and purchase order

This commit is contained in:
2026-05-27 12:32:27 +01:00
parent 897b036fc5
commit cac880e35f
7 changed files with 38 additions and 0 deletions
@@ -0,0 +1,19 @@
using FastEndpoints;
using PyroFetes.DTO.Customer.Response;
using PyroFetes.Repositories;
namespace PyroFetes.Endpoints.Customers;
public class GetAllCustomersEndpoint(CustomersRepository customersRepository, AutoMapper.IMapper mapper) : EndpointWithoutRequest<List<GetCustomerDto>>
{
public override void Configure()
{
Get("/customers");
AllowAnonymous();
}
public override async Task HandleAsync(CancellationToken ct)
{
await Send.OkAsync(await customersRepository.ProjectToListAsync<GetCustomerDto>(ct), ct);
}
}