Cleaned code
This commit is contained in:
@@ -19,7 +19,8 @@ public class AddProductoToQuotationEndpoint(
|
||||
|
||||
public override async Task HandleAsync(AddQuotationProductDto req, CancellationToken ct)
|
||||
{
|
||||
QuotationProduct? productQuotation = await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(req.ProductId, req.QuotationId), ct);
|
||||
QuotationProduct? productQuotation =
|
||||
await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(req.ProductId, req.QuotationId), ct);
|
||||
|
||||
if (productQuotation is not null)
|
||||
{
|
||||
@@ -28,7 +29,7 @@ public class AddProductoToQuotationEndpoint(
|
||||
}
|
||||
|
||||
QuotationProduct quotationProduct = mapper.Map<QuotationProduct>(req);
|
||||
|
||||
|
||||
await quotationProductsRepository.AddAsync(quotationProduct, ct);
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class CreateQuotationEndpoint(
|
||||
Product? product = await productsRepository.SingleOrDefaultAsync(new GetProductByIdSpec(line.ProductId), ct);
|
||||
QuotationProduct? quotationProduct =
|
||||
await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(line.ProductId, quotation.Id), ct);
|
||||
|
||||
|
||||
if (product is null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace PyroFetes.Endpoints.Quotations;
|
||||
|
||||
public class GetQuotationPdfEndpoint(
|
||||
QuotationsRepository quotationRepository,
|
||||
IQuotationPdfService quotationPdfService,
|
||||
IQuotationPdfService quotationPdfService,
|
||||
SettingsRepository settingsRepository)
|
||||
: Endpoint<GetQuotationPdfDto, byte[]>
|
||||
{
|
||||
@@ -32,7 +32,7 @@ public class GetQuotationPdfEndpoint(
|
||||
}
|
||||
|
||||
Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct);
|
||||
|
||||
|
||||
byte[] bytes = quotationPdfService.Generate(quotation, quotation.QuotationProducts!, setting!);
|
||||
|
||||
await Send.BytesAsync(
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PatchQuotationConditionsSaleEndpoint(
|
||||
}
|
||||
|
||||
mapper.Map(req, quotation);
|
||||
|
||||
|
||||
await quotationsRepository.SaveChangesAsync(ct);
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PatchQuotationMessageEndpoint(
|
||||
}
|
||||
|
||||
mapper.Map(req, quotation);
|
||||
|
||||
|
||||
await quotationsRepository.SaveChangesAsync(ct);
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PatchQuotationProductQuantityEndpoint(
|
||||
}
|
||||
|
||||
mapper.Map(req, quotationProduct);
|
||||
|
||||
|
||||
await quotationProductsRepository.SaveChangesAsync(ct);
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class UpdateQuotationEndpoint(
|
||||
}
|
||||
|
||||
mapper.Map(req, quotation);
|
||||
|
||||
|
||||
await quotationsRepository.SaveChangesAsync(ct);
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user