Files
pyrofetes-backend/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs
T
2026-05-28 15:36:33 +02:00

20 lines
628 B
C#

using FastEndpoints;
using PyroFetes.DTO.Quotation.Response;
using PyroFetes.Repositories;
using PyroFetes.Specifications.Quotations;
namespace PyroFetes.Endpoints.Quotations;
public class GetAllQuotationEndpoint(QuotationsRepository quotationsRepository) : EndpointWithoutRequest<List<GetQuotationDto>>
{
public override void Configure()
{
Get("/quotations");
Roles("Admin","Employe");
}
public override async Task HandleAsync(CancellationToken ct)
{
await Send.OkAsync(await quotationsRepository.ProjectToListAsync<GetQuotationDto>(new GetAllQuotationSpec(), ct), ct);
}
}