From 1434a5d77a820fa729c6a8b208e2e4e6ce72a970 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 24 May 2026 17:24:44 +0100 Subject: [PATCH] Cleaned code --- .../DTO/Deliverer/Response/GetDelivererDto.cs | 2 +- .../Request/UpdateDeliveryNoteDto.cs | 2 +- .../Response/GetDeliveryNoteDto.cs | 6 ++--- PyroFetes/DTO/Price/Response/GetPriceDto.cs | 4 +-- .../DTO/Product/Request/UpdateProductDto.cs | 2 +- .../DTO/Product/Response/GetProductDto.cs | 2 +- .../Response/GetProductDeliveryDto.cs | 4 +-- .../Request/CreatePurchaseOrderDto.cs | 2 +- .../Request/CreatePurchaseProductDto.cs | 2 +- .../PatchPurchaseProductQuantityDto.cs | 2 +- .../Response/GetPurchaseProductDto.cs | 4 +-- .../Quotation/Request/GetQuotationPdfDto.cs | 2 +- .../Response/GetQuotationProductDto.cs | 4 +-- .../CreateDeliveryNoteEndpoint.cs | 2 +- .../GetAllDeliveryNoteEndpoint.cs | 2 +- .../GetDeliveryNotePdfEndpoint.cs | 3 ++- .../PatchProductMinimalStockEndpoint.cs | 2 +- .../PurchaseOrders/CreatePurchaseOrder.cs | 4 +-- .../GetPurchaseOrderPdfEndpoint.cs | 6 ++--- .../PatchPurchaseProductQuantityEndpoint.cs | 2 +- .../AddProductoToQuotationEndpoint.cs | 5 ++-- .../Quotations/CreateQuotationEndpoint.cs | 2 +- .../Quotations/GetQuotationPdfEndpoint.cs | 4 +-- .../PatchQuotationConditionsSaleEndpoint.cs | 2 +- .../PatchQuotationMessageEndpoint.cs | 2 +- .../PatchQuotationProductQuantityEndpoint.cs | 2 +- .../Quotations/UpdateQuotationEndpoint.cs | 2 +- .../Settings/CreateSettingEndpoint.cs | 2 +- ...PatchSettingElectronicSignatureEndpoint.cs | 4 +-- .../Settings/PatchSettingLogoEndpoint.cs | 4 +-- .../Suppliers/AddProductToSupplierEndpoint.cs | 4 +-- .../Endpoints/Suppliers/PatchPriceEndpoint.cs | 2 +- .../Users/PatchUserPasswordEndpoint.cs | 2 +- .../PatchWareHouseProductQuantityEndpoint.cs | 4 +-- .../MappingProfiles/DtoToEntityMappings.cs | 14 +++++------ .../MappingProfiles/EntityToDtoMappings.cs | 4 +-- PyroFetes/Models/Availability.cs | 2 +- PyroFetes/Models/Brand.cs | 6 ++--- PyroFetes/Models/City.cs | 6 ++--- PyroFetes/Models/Classification.cs | 6 ++--- PyroFetes/Models/Color.cs | 6 ++--- PyroFetes/Models/Communication.cs | 4 +-- PyroFetes/Models/Contact.cs | 4 +-- PyroFetes/Models/ContactServiceProvider.cs | 2 +- PyroFetes/Models/Customer.cs | 6 ++--- PyroFetes/Models/CustomerType.cs | 4 +-- PyroFetes/Models/Deliverer.cs | 2 +- PyroFetes/Models/DeliveryNote.cs | 2 +- PyroFetes/Models/Effect.cs | 6 ++--- PyroFetes/Models/ExperienceLevel.cs | 2 +- PyroFetes/Models/HistoryOfApproval.cs | 4 +-- PyroFetes/Models/Material.cs | 18 ++++++------- PyroFetes/Models/MaterialWarehouse.cs | 2 +- PyroFetes/Models/Movement.cs | 22 ++++++++-------- PyroFetes/Models/Price.cs | 2 +- PyroFetes/Models/Product.cs | 10 +++----- PyroFetes/Models/ProductCategory.cs | 6 ++--- PyroFetes/Models/ProductColor.cs | 2 +- PyroFetes/Models/ProductDelivery.cs | 2 +- PyroFetes/Models/ProductEffect.cs | 1 - PyroFetes/Models/ProductTimecode.cs | 4 +-- PyroFetes/Models/ProviderType.cs | 4 +-- PyroFetes/Models/PurchaseOrder.cs | 2 +- PyroFetes/Models/Quotation.cs | 4 +-- PyroFetes/Models/QuotationProduct.cs | 4 +-- PyroFetes/Models/ServiceProvider.cs | 6 ++--- PyroFetes/Models/Show.cs | 6 ++--- PyroFetes/Models/ShowMaterial.cs | 1 - PyroFetes/Models/ShowServiceProvider.cs | 3 +-- PyroFetes/Models/Sound.cs | 4 +-- PyroFetes/Models/SoundCategory.cs | 2 +- PyroFetes/Models/SoundTimecode.cs | 2 +- PyroFetes/Models/Staff.cs | 2 +- PyroFetes/Models/Supplier.cs | 4 +-- PyroFetes/Models/Truck.cs | 2 +- PyroFetes/Models/Warehouse.cs | 20 +++++++-------- PyroFetes/Models/WarehouseProduct.cs | 2 +- PyroFetes/Program.cs | 5 +--- PyroFetes/PyroFetesDbContext.cs | 6 ++--- .../Repositories/DeliverersRepository.cs | 2 +- .../QuotationProductsRepository.cs | 2 +- .../Services/Pdf/DeliveryNotePdfService.cs | 21 +++++++--------- .../Services/Pdf/PurchaseOrderPdfService.cs | 25 ++++++++----------- PyroFetes/Services/Pdf/QuotationPdfService.cs | 23 ++++++++--------- .../GetPurchaseOrderByIdWithProductsSpec.cs | 4 +-- ...roductByProductIdAndPurchaseOrderIdSpec.cs | 2 +- .../Specifications/Users/GetUserByNameSpec.cs | 2 +- .../GetProductTotalQuantitySpec.cs | 1 - 88 files changed, 197 insertions(+), 213 deletions(-) diff --git a/PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs b/PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs index ee221963..ba638b83 100644 --- a/PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs +++ b/PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs @@ -6,6 +6,6 @@ public class GetDelivererDto { public int Id { get; set; } public string? Transporter { get; set; } - + public List? DeliveryNotes { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs b/PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs index b4746ff4..95856e48 100644 --- a/PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs +++ b/PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs @@ -7,6 +7,6 @@ public class UpdateDeliveryNoteDto public DateOnly EstimateDeliveryDate { get; set; } public DateOnly ExpeditionDate { get; set; } public DateOnly? RealDeliveryDate { get; set; } - + public int DelivererId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs b/PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs index 3683ed3b..63651431 100644 --- a/PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs +++ b/PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs @@ -9,9 +9,9 @@ public class GetDeliveryNoteDto public DateOnly EstimateDeliveryDate { get; set; } public DateOnly ExpeditionDate { get; set; } public DateOnly? RealDeliveryDate { get; set; } - + public int DelivererId { get; set; } public string? DelivererTransporter { get; set; } - - public List? Products { get; set; } + + public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/Price/Response/GetPriceDto.cs b/PyroFetes/DTO/Price/Response/GetPriceDto.cs index 6657f2fb..8ad649c6 100644 --- a/PyroFetes/DTO/Price/Response/GetPriceDto.cs +++ b/PyroFetes/DTO/Price/Response/GetPriceDto.cs @@ -3,11 +3,11 @@ public class GetPriceDto { public decimal SellingPrice { get; set; } - + public int ProductId { get; set; } public string? ProductReference { get; set; } public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} + public decimal ProductDuration { get; set; } public int ProductCaliber { get; set; } public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } diff --git a/PyroFetes/DTO/Product/Request/UpdateProductDto.cs b/PyroFetes/DTO/Product/Request/UpdateProductDto.cs index db70e9c8..9a95a034 100644 --- a/PyroFetes/DTO/Product/Request/UpdateProductDto.cs +++ b/PyroFetes/DTO/Product/Request/UpdateProductDto.cs @@ -5,7 +5,7 @@ public class UpdateProductDto public int Id { get; set; } public string? References { get; set; } public string? Name { get; set; } - public decimal Duration {get; set;} + public decimal Duration { get; set; } public int Caliber { get; set; } public string? ApprovalNumber { get; set; } public decimal Weight { get; set; } diff --git a/PyroFetes/DTO/Product/Response/GetProductDto.cs b/PyroFetes/DTO/Product/Response/GetProductDto.cs index c1f85f03..145f245f 100644 --- a/PyroFetes/DTO/Product/Response/GetProductDto.cs +++ b/PyroFetes/DTO/Product/Response/GetProductDto.cs @@ -5,7 +5,7 @@ public class GetProductDto public int Id { get; set; } public string? References { get; set; } public string? Name { get; set; } - public decimal Duration {get; set;} + public decimal Duration { get; set; } public int Caliber { get; set; } public string? ApprovalNumber { get; set; } public decimal Weight { get; set; } diff --git a/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs b/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs index 92c78cfc..58c47aea 100644 --- a/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs +++ b/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs @@ -5,7 +5,7 @@ public class GetProductDeliveryDto public int ProductId { get; set; } public string? ProductReference { get; set; } public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} + public decimal ProductDuration { get; set; } public int ProductCaliber { get; set; } public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } @@ -13,6 +13,6 @@ public class GetProductDeliveryDto public string? ProductImage { get; set; } public string? ProductLink { get; set; } public int ProductMinimalQuantity { get; set; } - + public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs b/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs index e7da0dcc..12e3c20f 100644 --- a/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs +++ b/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs @@ -6,4 +6,4 @@ public class CreatePurchaseOrderDto { public string? PurchaseConditions { get; set; } public List? Products { get; set; } -} +} \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs index f23dfb0b..007ab5ff 100644 --- a/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs @@ -2,7 +2,7 @@ namespace PyroFetes.DTO.PurchaseProduct.Request; public class CreatePurchaseProductDto { - public int Quantity { get; set; } + public int Quantity { get; set; } public int ProductId { get; set; } public int PurchaseOrderId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Request/PatchPurchaseProductQuantityDto.cs b/PyroFetes/DTO/PurchaseProduct/Request/PatchPurchaseProductQuantityDto.cs index 8bd94996..c19ef2fb 100644 --- a/PyroFetes/DTO/PurchaseProduct/Request/PatchPurchaseProductQuantityDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Request/PatchPurchaseProductQuantityDto.cs @@ -4,5 +4,5 @@ public class PatchPurchaseProductQuantityDto { public int ProductId { get; set; } public int PurchaseOrderId { get; set; } - public int Quantity { get; set; } + public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs index e3233952..3a61081a 100644 --- a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs @@ -5,7 +5,7 @@ public class GetPurchaseProductDto public int ProductId { get; set; } public string? ProductReference { get; set; } public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} + public decimal ProductDuration { get; set; } public int ProductCaliber { get; set; } public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } @@ -14,6 +14,6 @@ public class GetPurchaseProductDto public string? ProductLink { get; set; } public int ProductMinimalQuantity { get; set; } public decimal ProductPrice { get; set; } - + public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs b/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs index 0c74cd7e..fb37fa86 100644 --- a/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs +++ b/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs @@ -2,5 +2,5 @@ public class GetQuotationPdfDto { - public int Id { get; set; } + public int Id { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs index 087e844e..06f8ef5b 100644 --- a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs @@ -3,11 +3,11 @@ namespace PyroFetes.DTO.QuotationProduct.Response; public class GetQuotationProductDto { public int Quantity { get; set; } - + public int ProductId { get; set; } public string? ProductReference { get; set; } public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} + public decimal ProductDuration { get; set; } public int ProductCaliber { get; set; } public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } diff --git a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs index 3266034c..2e622279 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs @@ -51,7 +51,7 @@ public class CreateDeliveryNoteEndpoint( DeliveryNote = newDeliveryNote, Quantity = productQuantity.Value, Product = product, - ProductId = product.Id, + ProductId = product.Id, DeliveryNoteId = newDeliveryNote.Id }; diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs index 56c19c63..4fbadbec 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs @@ -15,6 +15,6 @@ public class GetAllDeliveryNoteEndpoint(DeliveryNotesRepository deliveryNotesRep public override async Task HandleAsync(CancellationToken ct) { - await Send.OkAsync(await deliveryNotesRepository.ProjectToListAsync(new GetAllDeliveryNoteSpec() ,ct), ct); + await Send.OkAsync(await deliveryNotesRepository.ProjectToListAsync(new GetAllDeliveryNoteSpec(), ct), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs index 19b47d1e..aaaaa7ff 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs @@ -8,7 +8,8 @@ using PyroFetes.Specifications.DeliveryNotes; namespace PyroFetes.Endpoints.DeliveryNotes; -public class GetDeliveryNotePdfEndpoint(DeliveryNotesRepository deliveryNotesRepository, IDeliveryNotePdfService deliveryNotePdfService, SettingsRepository settingsRepository) : Endpoint +public class GetDeliveryNotePdfEndpoint(DeliveryNotesRepository deliveryNotesRepository, IDeliveryNotePdfService deliveryNotePdfService, SettingsRepository settingsRepository) + : Endpoint { public override void Configure() { diff --git a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs index 40ebeba8..dc2229f9 100644 --- a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs +++ b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs @@ -25,7 +25,7 @@ public class PatchProductMinimalStockEndpoint(ProductsRepository productsReposit } mapper.Map(req, product); - + await productsRepository.UpdateAsync(product, ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs index b30ec5d9..0e5406c7 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -34,8 +34,8 @@ public class CreatePurchaseOrder( await Send.NotFoundAsync(ct); return; } - - PurchaseProduct? purchaseProduct = + + PurchaseProduct? purchaseProduct = await purchaseProductsRepository.SingleOrDefaultAsync(new GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(line.ProductId, purchaseOrder.Id), ct); if (purchaseProduct is not null) diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs index 05c1f86a..23851635 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs @@ -10,7 +10,7 @@ namespace PyroFetes.Endpoints.PurchaseOrders; public class GetPurchaseOrderPdfEndpoint( PurchaseOrdersRepository purchaseOrdersRepository, - IPurchaseOrderPdfService purchaseOrderPdfService, + IPurchaseOrderPdfService purchaseOrderPdfService, SettingsRepository settingsRepository) : Endpoint { @@ -24,7 +24,7 @@ public class GetPurchaseOrderPdfEndpoint( public override async Task HandleAsync(GetPurchaseOrderPdfDto req, CancellationToken ct) { PurchaseOrder? purchaseOrder = await purchaseOrdersRepository.SingleOrDefaultAsync(new GetPurchaseOrderByIdWithProductsSpec(req.Id), ct); - + if (purchaseOrder is null) { await Send.NotFoundAsync(ct); @@ -32,7 +32,7 @@ public class GetPurchaseOrderPdfEndpoint( } Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); - + byte[] bytes = purchaseOrderPdfService.Generate(purchaseOrder, purchaseOrder.PurchaseProducts!, setting!); await Send.BytesAsync( diff --git a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs index 1453e0a8..fe32641a 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs @@ -28,7 +28,7 @@ public class PatchPurchaseProductQuantityEndpoint(PurchaseProductsRepository pur } mapper.Map(req, purchaseProduct); - + await purchaseProductsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs index 9d71325b..8a6c9f4f 100644 --- a/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs @@ -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(req); - + await quotationProductsRepository.AddAsync(quotationProduct, ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs index c8ba9553..1ec4e1f1 100644 --- a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs @@ -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); diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs index 0c754504..434ddcf9 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs @@ -10,7 +10,7 @@ namespace PyroFetes.Endpoints.Quotations; public class GetQuotationPdfEndpoint( QuotationsRepository quotationRepository, - IQuotationPdfService quotationPdfService, + IQuotationPdfService quotationPdfService, SettingsRepository settingsRepository) : Endpoint { @@ -32,7 +32,7 @@ public class GetQuotationPdfEndpoint( } Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); - + byte[] bytes = quotationPdfService.Generate(quotation, quotation.QuotationProducts!, setting!); await Send.BytesAsync( diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs index c0a80a89..203913fb 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs @@ -28,7 +28,7 @@ public class PatchQuotationConditionsSaleEndpoint( } mapper.Map(req, quotation); - + await quotationsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs index 8de48b48..066f8318 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs @@ -28,7 +28,7 @@ public class PatchQuotationMessageEndpoint( } mapper.Map(req, quotation); - + await quotationsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs index ad036271..f7cc2335 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs @@ -28,7 +28,7 @@ public class PatchQuotationProductQuantityEndpoint( } mapper.Map(req, quotationProduct); - + await quotationProductsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs index b383c719..703c69cd 100644 --- a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs @@ -28,7 +28,7 @@ public class UpdateQuotationEndpoint( } mapper.Map(req, quotation); - + await quotationsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs index a1a12cae..dda0bd19 100644 --- a/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs @@ -22,7 +22,7 @@ public class CreateSettingEndpoint(SettingsRepository settingsRepository) : Endp if (req.ElectronicSignature != null) await req.ElectronicSignature.CopyToAsync(memoryStream, ct); byte[] signatureBytes = memoryStream.ToArray(); - + Setting setting = new() { ElectronicSignature = Convert.ToBase64String(signatureBytes), diff --git a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs index 2aa7d4e1..5588935f 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs @@ -28,9 +28,9 @@ public class PatchSettingElectronicSignatureEndpoint(SettingsRepository settings using MemoryStream memoryStream = new(); if (req.ElectronicSignature != null) await req.ElectronicSignature.CopyToAsync(memoryStream, ct); byte[] signatureBytes = memoryStream.ToArray(); - + setting.ElectronicSignature = Convert.ToBase64String(signatureBytes); - + await settingsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs index e35bb204..84de0166 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs @@ -28,9 +28,9 @@ public class PatchSettingLogoEndpoint(SettingsRepository settingsRepository) : E using MemoryStream memoryStream = new(); if (req.Logo != null) await req.Logo.CopyToAsync(memoryStream, ct); byte[] logoBytes = memoryStream.ToArray(); - + setting.Logo = Convert.ToBase64String(logoBytes); - + await settingsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs index 6a342526..657ee98c 100644 --- a/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs @@ -11,7 +11,7 @@ namespace PyroFetes.Endpoints.Suppliers; public class AddProductToSupplierEndpoint( SuppliersRepository suppliersRepository, ProductsRepository productsRepository, - PricesRepository pricesRepository, + PricesRepository pricesRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() @@ -36,7 +36,7 @@ public class AddProductToSupplierEndpoint( await Send.StringAsync("Le fournisseur a déjà un prix pour ce produit.", 400, cancellation: ct); return; } - + await pricesRepository.AddAsync(mapper.Map(req), ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs index b6ab7ac4..38002f90 100644 --- a/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs @@ -27,7 +27,7 @@ public class PatchPriceEndpoint( } mapper.Map(req, price); - + await pricesRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs index d56153d7..760ce32f 100644 --- a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs +++ b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs @@ -7,7 +7,7 @@ using PyroFetes.Specifications.Users; namespace PyroFetes.Endpoints.Users; -public class PatchUserPasswordEndpoint(UsersRepository usersRepository,AutoMapper.IMapper mapper) : Endpoint +public class PatchUserPasswordEndpoint(UsersRepository usersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { diff --git a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs index ff41e56c..e346e9bb 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs @@ -17,7 +17,7 @@ public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository w public override async Task HandleAsync(PatchWareHouseProductQuantityDto req, CancellationToken ct) { - WarehouseProduct? wareHouseProduct = await warehouseProductsRepository.FirstOrDefaultAsync(new GetWarehouseProductByProductIdSpec(req.ProductId, req.WareHouseId) , ct); + WarehouseProduct? wareHouseProduct = await warehouseProductsRepository.FirstOrDefaultAsync(new GetWarehouseProductByProductIdSpec(req.ProductId, req.WareHouseId), ct); if (wareHouseProduct is null) { @@ -27,7 +27,7 @@ public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository w wareHouseProduct.Quantity = req.Quantity; await warehouseProductsRepository.SaveChangesAsync(ct); - + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs index d79b9667..152d0c3e 100644 --- a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs +++ b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs @@ -38,16 +38,16 @@ public class DtoToEntityMappings : Profile .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - + CreateMap(); - CreateMap() + CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - + CreateMap(); CreateMap() .ForMember(dest => dest.ProductId, opt => opt.Ignore()) .ForMember(dest => dest.PurchaseOrderId, opt => opt.Ignore()); - + CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() @@ -58,19 +58,19 @@ public class DtoToEntityMappings : Profile CreateMap() .ForMember(dest => dest.ProductId, opt => opt.Ignore()) .ForMember(dest => dest.QuotationId, opt => opt.Ignore()); - + CreateMap(); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - + CreateMap(); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - + CreateMap(); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index 5604064b..b312e96a 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -28,10 +28,10 @@ public class EntityToDtoMappings : Profile .ForMember(dest => dest.Products, opt => opt.MapFrom(src => src.ProductDeliveries)); CreateMap(); - + CreateMap() .ForMember(dest => dest.References, opt => opt.MapFrom(src => src.Reference)); - + CreateMap(); CreateMap() diff --git a/PyroFetes/Models/Availability.cs b/PyroFetes/Models/Availability.cs index 47b0f1c6..9fb6043e 100644 --- a/PyroFetes/Models/Availability.cs +++ b/PyroFetes/Models/Availability.cs @@ -9,6 +9,6 @@ public class Availability [Required] public DateOnly DeliveryDate { get; set; } [Required] public DateOnly ExpirationDate { get; set; } [Required] public DateOnly RenewallDate { get; set; } - + public List? StaffAvailabilities { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Brand.cs b/PyroFetes/Models/Brand.cs index 49016ca0..8d4050c9 100644 --- a/PyroFetes/Models/Brand.cs +++ b/PyroFetes/Models/Brand.cs @@ -4,9 +4,9 @@ namespace PyroFetes.Models; public class Brand { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Name { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Name { get; set; } + [Required] public int ProductId { get; set; } [Required] public Product? Product { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/City.cs b/PyroFetes/Models/City.cs index 04dc24e4..caeb6831 100644 --- a/PyroFetes/Models/City.cs +++ b/PyroFetes/Models/City.cs @@ -4,9 +4,9 @@ namespace PyroFetes.Models; public class City { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Name { get; set; } + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Name { get; set; } [Required] public int ZipCode { get; set; } - + public List? Shows { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Classification.cs b/PyroFetes/Models/Classification.cs index bd3685bf..c58c3442 100644 --- a/PyroFetes/Models/Classification.cs +++ b/PyroFetes/Models/Classification.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class Classification { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Label { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Label { get; set; } + public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Color.cs b/PyroFetes/Models/Color.cs index acfe8301..6ab01d71 100644 --- a/PyroFetes/Models/Color.cs +++ b/PyroFetes/Models/Color.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class Color { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Label { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Label { get; set; } + public List? ProductColors { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Communication.cs b/PyroFetes/Models/Communication.cs index a3dd0d21..14831009 100644 --- a/PyroFetes/Models/Communication.cs +++ b/PyroFetes/Models/Communication.cs @@ -4,11 +4,11 @@ namespace PyroFetes.Models; public class Communication { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Calling { get; set; } [Required, MaxLength(100)] public string? Email { get; set; } [Required, MaxLength(300)] public string? Meeting { get; set; } - + [Required] public int ContactId { get; set; } public Contact? Contact { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Contact.cs b/PyroFetes/Models/Contact.cs index e1573ad7..e693559a 100644 --- a/PyroFetes/Models/Contact.cs +++ b/PyroFetes/Models/Contact.cs @@ -13,10 +13,10 @@ public class Contact [Required] public int ZipCode { get; set; } [Required, MaxLength(100)] public string? City { get; set; } [Required, MaxLength(100)] public string? Role { get; set; } - + public Customer? Customer { get; set; } [Required] public int CustomerId { get; set; } - + public List? Communications { get; set; } public List? StaffContacts { get; set; } public List? ContactServiceProviders { get; set; } diff --git a/PyroFetes/Models/ContactServiceProvider.cs b/PyroFetes/Models/ContactServiceProvider.cs index cc9cd1be..f936ba6c 100644 --- a/PyroFetes/Models/ContactServiceProvider.cs +++ b/PyroFetes/Models/ContactServiceProvider.cs @@ -8,7 +8,7 @@ public class ContactServiceProvider { [Required] public int ContactId { get; set; } [Required] public int ServiceProviderId { get; set; } - + public Contact? Contact { get; set; } public ServiceProvider? ServiceProvider { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Customer.cs b/PyroFetes/Models/Customer.cs index da6dbba7..03a10923 100644 --- a/PyroFetes/Models/Customer.cs +++ b/PyroFetes/Models/Customer.cs @@ -6,11 +6,11 @@ public class Customer { [Key] public int Id { get; set; } [Required, MaxLength(200)] public string? Note { get; set; } - + //Relations [Required] public int CustomerTypeId { get; set; } public CustomerType? CustomerType { get; set; } - + public List? Contacts { get; set; } public List? Quotations { get; set; } -} +} \ No newline at end of file diff --git a/PyroFetes/Models/CustomerType.cs b/PyroFetes/Models/CustomerType.cs index 197ad099..2f6aec94 100644 --- a/PyroFetes/Models/CustomerType.cs +++ b/PyroFetes/Models/CustomerType.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class CustomerType { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Label { get; set; } - + public List? Customers { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Deliverer.cs b/PyroFetes/Models/Deliverer.cs index 34e708c0..3ba10e80 100644 --- a/PyroFetes/Models/Deliverer.cs +++ b/PyroFetes/Models/Deliverer.cs @@ -6,6 +6,6 @@ public class Deliverer { [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Transporter { get; set; } - + public List? DeliveryNotes { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/DeliveryNote.cs b/PyroFetes/Models/DeliveryNote.cs index e94792fd..9cf8e53b 100644 --- a/PyroFetes/Models/DeliveryNote.cs +++ b/PyroFetes/Models/DeliveryNote.cs @@ -10,7 +10,7 @@ public class DeliveryNote [Required] public DateOnly EstimateDeliveryDate { get; set; } [Required] public DateOnly ExpeditionDate { get; set; } public DateOnly? RealDeliveryDate { get; set; } - + public Deliverer? Deliverer { get; set; } public List? ProductDeliveries { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Effect.cs b/PyroFetes/Models/Effect.cs index 0dcb87cb..4f509224 100644 --- a/PyroFetes/Models/Effect.cs +++ b/PyroFetes/Models/Effect.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class Effect { - [Key] public int Id { get; set; } - [Required, MaxLength(200)] public string? Label { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(200)] public string? Label { get; set; } + public List? ProductEffects { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ExperienceLevel.cs b/PyroFetes/Models/ExperienceLevel.cs index 923f7575..a1014b86 100644 --- a/PyroFetes/Models/ExperienceLevel.cs +++ b/PyroFetes/Models/ExperienceLevel.cs @@ -6,7 +6,7 @@ public class ExperienceLevel { [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Label { get; set; } - + public Staff? Staff { get; set; } [Required] public int StaffId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/HistoryOfApproval.cs b/PyroFetes/Models/HistoryOfApproval.cs index c8fd073e..039a63e1 100644 --- a/PyroFetes/Models/HistoryOfApproval.cs +++ b/PyroFetes/Models/HistoryOfApproval.cs @@ -4,9 +4,9 @@ namespace PyroFetes.Models; public class HistoryOfApproval { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required] public DateOnly DeliveryDate { get; set; } [Required] public DateOnly ExpirationDate { get; set; } - + public List? StaffHistoryOfApprovals { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Material.cs b/PyroFetes/Models/Material.cs index 224e5d57..b8330900 100644 --- a/PyroFetes/Models/Material.cs +++ b/PyroFetes/Models/Material.cs @@ -4,13 +4,13 @@ namespace PyroFetes.Models; public class Material { - [Key] public int Id {get; set;} - [Required, MaxLength(100)] public string? Name {get; set;} - [Required] public int Quantity {get; set;} - - [Required] public int WarehouseId {get; set;} - public Warehouse? Warehouse {get; set;} - - public List? ShowMaterials {get; set;} - public List? MaterialWarehouses {get; set;} + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Name { get; set; } + [Required] public int Quantity { get; set; } + + [Required] public int WarehouseId { get; set; } + public Warehouse? Warehouse { get; set; } + + public List? ShowMaterials { get; set; } + public List? MaterialWarehouses { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/MaterialWarehouse.cs b/PyroFetes/Models/MaterialWarehouse.cs index 4f49ba90..983188e4 100644 --- a/PyroFetes/Models/MaterialWarehouse.cs +++ b/PyroFetes/Models/MaterialWarehouse.cs @@ -8,7 +8,7 @@ public class MaterialWarehouse { [Required] public int MaterialId { get; set; } [Required] public int WarehouseId { get; set; } - + public Material? Material { get; set; } public Warehouse? Warehouse { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Movement.cs b/PyroFetes/Models/Movement.cs index fe26f187..f5a39f04 100644 --- a/PyroFetes/Models/Movement.cs +++ b/PyroFetes/Models/Movement.cs @@ -4,16 +4,16 @@ namespace PyroFetes.Models; public class Movement { - [Key] public int Id { get; set; } - [Required] public DateTime Date { get; set; } - [Required] public DateTime Start {get; set;} - [Required] public DateTime Arrival {get; set;} - [Required] public int Quantity {get; set;} - + [Key] public int Id { get; set; } + [Required] public DateTime Date { get; set; } + [Required] public DateTime Start { get; set; } + [Required] public DateTime Arrival { get; set; } + [Required] public int Quantity { get; set; } + public List? Products { get; set; } - - public int? SourceWarehouseId {get; set;} - public Warehouse? SourceWarehouse {get; set;} - public int? DestinationWarehouseId {get; set;} - public Warehouse? DestinationWarehouse {get; set;} + + public int? SourceWarehouseId { get; set; } + public Warehouse? SourceWarehouse { get; set; } + public int? DestinationWarehouseId { get; set; } + public Warehouse? DestinationWarehouse { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Price.cs b/PyroFetes/Models/Price.cs index 2ee597ea..0facca47 100644 --- a/PyroFetes/Models/Price.cs +++ b/PyroFetes/Models/Price.cs @@ -10,7 +10,7 @@ public class Price [Required] public int ProductId { get; set; } [Required] public int SupplierId { get; set; } [Required] public decimal SellingPrice { get; set; } - + public Product? Product { get; set; } public Supplier? Supplier { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Product.cs b/PyroFetes/Models/Product.cs index 88f52e47..b53cb038 100644 --- a/PyroFetes/Models/Product.cs +++ b/PyroFetes/Models/Product.cs @@ -7,7 +7,7 @@ namespace PyroFetes.Models [Key] public int Id { get; set; } [Required, MaxLength(20)] public string? Reference { get; set; } [Required, MaxLength(100)] public string? Name { get; set; } - [Required] public decimal Duration {get; set;} + [Required] public decimal Duration { get; set; } [Required] public int Caliber { get; set; } [Required, MaxLength(100)] public string? ApprovalNumber { get; set; } [Required] public decimal Weight { get; set; } @@ -22,9 +22,9 @@ namespace PyroFetes.Models [Required] public int ProductCategoryId { get; set; } public ProductCategory? ProductCategory { get; set; } - - [Required] public int MovementId {get; set;} - public Movement? Movement {get; set;} + + [Required] public int MovementId { get; set; } + public Movement? Movement { get; set; } public List? ProductDeliveries { get; set; } public List? Brands { get; set; } @@ -35,7 +35,5 @@ namespace PyroFetes.Models public List? QuotationProducts { get; set; } public List? WarehouseProducts { get; set; } public List? ProductTimecodes { get; set; } - - } } \ No newline at end of file diff --git a/PyroFetes/Models/ProductCategory.cs b/PyroFetes/Models/ProductCategory.cs index 79bd67f8..d809d026 100644 --- a/PyroFetes/Models/ProductCategory.cs +++ b/PyroFetes/Models/ProductCategory.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class ProductCategory { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Label { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Label { get; set; } + public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ProductColor.cs b/PyroFetes/Models/ProductColor.cs index f93d9642..14291d8f 100644 --- a/PyroFetes/Models/ProductColor.cs +++ b/PyroFetes/Models/ProductColor.cs @@ -8,7 +8,7 @@ public class ProductColor { public Product? Product { get; set; } [Required] public int ProductId { get; set; } - + public Color? Color { get; set; } [Required] public int ColorId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ProductDelivery.cs b/PyroFetes/Models/ProductDelivery.cs index bfbae683..03d7c364 100644 --- a/PyroFetes/Models/ProductDelivery.cs +++ b/PyroFetes/Models/ProductDelivery.cs @@ -9,7 +9,7 @@ public class ProductDelivery [Required] public int ProductId { get; set; } [Required] public int DeliveryNoteId { get; set; } [Required] public int Quantity { get; set; } - + public Product? Product { get; set; } public DeliveryNote? DeliveryNote { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ProductEffect.cs b/PyroFetes/Models/ProductEffect.cs index 3f269d64..d81e9526 100644 --- a/PyroFetes/Models/ProductEffect.cs +++ b/PyroFetes/Models/ProductEffect.cs @@ -11,5 +11,4 @@ public class ProductEffect public Effect? Effect { get; set; } [Required] public int EffectId { get; set; } - } \ No newline at end of file diff --git a/PyroFetes/Models/ProductTimecode.cs b/PyroFetes/Models/ProductTimecode.cs index a4ad8260..b9979af9 100644 --- a/PyroFetes/Models/ProductTimecode.cs +++ b/PyroFetes/Models/ProductTimecode.cs @@ -8,10 +8,10 @@ public class ProductTimecode { public Product? Product { get; set; } [Required] public int ProductId { get; set; } - + public Show? Show { get; set; } [Required] public int ShowId { get; set; } - + [Required] public decimal Start { get; set; } [Required] public decimal End { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ProviderType.cs b/PyroFetes/Models/ProviderType.cs index 0871b8aa..0fb7821c 100644 --- a/PyroFetes/Models/ProviderType.cs +++ b/PyroFetes/Models/ProviderType.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class ProviderType { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Label { get; set; } - + public List? ServiceProviders { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/PurchaseOrder.cs b/PyroFetes/Models/PurchaseOrder.cs index 94a2ab64..0f544190 100644 --- a/PyroFetes/Models/PurchaseOrder.cs +++ b/PyroFetes/Models/PurchaseOrder.cs @@ -6,7 +6,7 @@ public class PurchaseOrder { [Key] public int Id { get; set; } [Required, MaxLength(300)] public string? PurchaseConditions { get; set; } - + [Required] public int SupplierId { get; set; } public Supplier? Supplier { get; set; } public List? PurchaseProducts { get; set; } diff --git a/PyroFetes/Models/Quotation.cs b/PyroFetes/Models/Quotation.cs index 569c2714..a732b8f9 100644 --- a/PyroFetes/Models/Quotation.cs +++ b/PyroFetes/Models/Quotation.cs @@ -7,9 +7,9 @@ public class Quotation [Key] public int Id { get; set; } [Required, MaxLength(200)] public string? Message { get; set; } [Required, MaxLength(300)] public string? ConditionsSale { get; set; } - + [Required] public int CustomerId { get; set; } public Customer? Customer { get; set; } - + public List? QuotationProducts { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/QuotationProduct.cs b/PyroFetes/Models/QuotationProduct.cs index 8e2f3bb9..db88e637 100644 --- a/PyroFetes/Models/QuotationProduct.cs +++ b/PyroFetes/Models/QuotationProduct.cs @@ -8,8 +8,8 @@ public class QuotationProduct { [Required] public int ProductId { get; set; } [Required] public int QuotationId { get; set; } - [Required] public int Quantity { get; set; } - + [Required] public int Quantity { get; set; } + public Product? Product { get; set; } public Quotation? Quotation { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ServiceProvider.cs b/PyroFetes/Models/ServiceProvider.cs index b91e0d7f..64e62724 100644 --- a/PyroFetes/Models/ServiceProvider.cs +++ b/PyroFetes/Models/ServiceProvider.cs @@ -4,13 +4,13 @@ namespace PyroFetes.Models; public class ServiceProvider { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required] public decimal Price { get; set; } - + //Relations [Required] public int ProviderTypeId { get; set; } public ProviderType? ProviderType { get; set; } - + public List? Contracts { get; set; } public List? ContactServiceProviders { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Show.cs b/PyroFetes/Models/Show.cs index bc425ddd..33ae7135 100644 --- a/PyroFetes/Models/Show.cs +++ b/PyroFetes/Models/Show.cs @@ -9,13 +9,13 @@ public class Show [Required, MaxLength(120)] public string? Place { get; set; } [MaxLength(500)] public string? Description { get; set; } public DateOnly? Date { get; set; } - + // Link (path/URL/file name) to the pyrotechnic implementation plan [Required, MaxLength(500)] public string? PyrotechnicImplementationPlan { get; set; } - + [Required] public int CityId { get; set; } public City? City { get; set; } - + public List? ShowStaffs { get; set; } public List? ShowTrucks { get; set; } public List? SoundTimecodes { get; set; } diff --git a/PyroFetes/Models/ShowMaterial.cs b/PyroFetes/Models/ShowMaterial.cs index 81cc82a3..b28de282 100644 --- a/PyroFetes/Models/ShowMaterial.cs +++ b/PyroFetes/Models/ShowMaterial.cs @@ -11,5 +11,4 @@ public class ShowMaterial public Material? Material { get; set; } [Required] public int MaterialId { get; set; } - } \ No newline at end of file diff --git a/PyroFetes/Models/ShowServiceProvider.cs b/PyroFetes/Models/ShowServiceProvider.cs index 351c9fcd..3580426e 100644 --- a/PyroFetes/Models/ShowServiceProvider.cs +++ b/PyroFetes/Models/ShowServiceProvider.cs @@ -4,6 +4,5 @@ namespace PyroFetes.Models; public class ShowServiceProvider { - [Key] public int Id { get; set; } - + [Key] public int Id { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Sound.cs b/PyroFetes/Models/Sound.cs index 3ddee3e6..71e16c25 100644 --- a/PyroFetes/Models/Sound.cs +++ b/PyroFetes/Models/Sound.cs @@ -12,9 +12,9 @@ public class Sound [Required, MaxLength(40)] public string? Kind { get; set; } [Required, MaxLength(40)] public string? Format { get; set; } public DateTime? CreationDate { get; set; } - + [Required] public int SoundCategoryId { get; set; } public SoundCategory? SoundCategory { get; set; } - + public List? SoundTimecodes { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/SoundCategory.cs b/PyroFetes/Models/SoundCategory.cs index 52caeafa..b73b8cce 100644 --- a/PyroFetes/Models/SoundCategory.cs +++ b/PyroFetes/Models/SoundCategory.cs @@ -6,6 +6,6 @@ public class SoundCategory { [Key] public int Id { get; set; } [Required, MaxLength(100)] public string Name { get; set; } = null!; - + public List? Sounds { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/SoundTimecode.cs b/PyroFetes/Models/SoundTimecode.cs index 3411e0c1..8ab47c32 100644 --- a/PyroFetes/Models/SoundTimecode.cs +++ b/PyroFetes/Models/SoundTimecode.cs @@ -10,7 +10,7 @@ public class SoundTimecode public Show? Show { get; set; } [Required] public int SoundId { get; set; } public Sound? Sound { get; set; } - + [Required] public decimal Start { get; set; } [Required] public decimal End { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Staff.cs b/PyroFetes/Models/Staff.cs index a95c4553..b50df53c 100644 --- a/PyroFetes/Models/Staff.cs +++ b/PyroFetes/Models/Staff.cs @@ -11,7 +11,7 @@ public class Staff [Required, MaxLength(120)] public string? Email { get; set; } [Required, MaxLength(100)] public string? F4T2NumberApproval { get; set; } [Required] public DateOnly F4T2ExpirationDate { get; set; } - + public List? ShowStaffs { get; set; } public List? ExperienceLevels { get; set; } public List? StaffAvailabilities { get; set; } diff --git a/PyroFetes/Models/Supplier.cs b/PyroFetes/Models/Supplier.cs index 539b1b45..18c66943 100644 --- a/PyroFetes/Models/Supplier.cs +++ b/PyroFetes/Models/Supplier.cs @@ -9,9 +9,9 @@ public class Supplier [Required, MaxLength(100)] public string? Email { get; set; } [Required, MaxLength(30)] public string? Phone { get; set; } [Required, MaxLength(100)] public string? Address { get; set; } - [Required,Length(5,5)] public string? ZipCode { get; set; } + [Required, Length(5, 5)] public string? ZipCode { get; set; } [Required, MaxLength(100)] public string? City { get; set; } [Required] public int DeliveryDelay { get; set; } - + public List? Prices { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Truck.cs b/PyroFetes/Models/Truck.cs index 91794a9d..8a11b077 100644 --- a/PyroFetes/Models/Truck.cs +++ b/PyroFetes/Models/Truck.cs @@ -9,6 +9,6 @@ public class Truck [Required] public double? MaxExplosiveCapacity { get; set; } [Required, MaxLength(80)] public string? Sizes { get; set; } [Required, MaxLength(40)] public string? Status { get; set; } - + public List? ShowTrucks { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Warehouse.cs b/PyroFetes/Models/Warehouse.cs index d1e64206..0de0a12a 100644 --- a/PyroFetes/Models/Warehouse.cs +++ b/PyroFetes/Models/Warehouse.cs @@ -4,19 +4,19 @@ namespace PyroFetes.Models; public class Warehouse { - [Key] public int Id {get; set;} - [Required, MaxLength(100)] public string? Name {get; set;} - [Required] public int MaxWeight {get; set;} - [Required] public int Current {get; set;} - [Required] public int MinWeight {get; set;} + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Name { get; set; } + [Required] public int MaxWeight { get; set; } + [Required] public int Current { get; set; } + [Required] public int MinWeight { get; set; } [Required, MaxLength(100)] public string? Address { get; set; } - [Required, Length(5,5)] public string? ZipCode { get; set; } + [Required, Length(5, 5)] public string? ZipCode { get; set; } [Required, MaxLength(100)] public string? City { get; set; } - + public List? WarehouseProducts { get; set; } - - public List? MaterialWarehouses {get; set;} - + + public List? MaterialWarehouses { get; set; } + public List? MovementsSource { get; set; } public List? MovementsDestination { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/WarehouseProduct.cs b/PyroFetes/Models/WarehouseProduct.cs index fe89d364..cabc07cd 100644 --- a/PyroFetes/Models/WarehouseProduct.cs +++ b/PyroFetes/Models/WarehouseProduct.cs @@ -10,6 +10,6 @@ public class WarehouseProduct public Product? Product { get; set; } [Required] public int WarehouseId { get; set; } public Warehouse? Warehouse { get; set; } - + [Required] public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index b0564138..ac758925 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -20,10 +20,7 @@ builder.Services .AddAuthenticationJwtBearer(s => s.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong") .AddAuthorization() .AddFastEndpoints() - .SwaggerDocument(options => - { - options.ShortSchemaNames = true; - }) + .SwaggerDocument(options => { options.ShortSchemaNames = true; }) .AddCors(options => { options.AddDefaultPolicy(policyBuilder => diff --git a/PyroFetes/PyroFetesDbContext.cs b/PyroFetes/PyroFetesDbContext.cs index 7d8c9007..9a278ace 100644 --- a/PyroFetes/PyroFetesDbContext.cs +++ b/PyroFetes/PyroFetesDbContext.cs @@ -71,7 +71,7 @@ public class PyroFetesDbContext : DbContext optionsBuilder.UseSqlServer(connectionString); } - + // Models customization protected override void OnModelCreating(ModelBuilder modelBuilder) { @@ -80,13 +80,13 @@ public class PyroFetesDbContext : DbContext .WithMany(w => w.MovementsSource) .HasForeignKey(m => m.SourceWarehouseId) .OnDelete(DeleteBehavior.Restrict); - + modelBuilder.Entity() .HasOne(m => m.DestinationWarehouse) .WithMany(w => w.MovementsDestination) .HasForeignKey(m => m.DestinationWarehouseId) .OnDelete(DeleteBehavior.Restrict); - + modelBuilder.Entity() .HasOne(mw => mw.Material) .WithMany(m => m.MaterialWarehouses) diff --git a/PyroFetes/Repositories/DeliverersRepository.cs b/PyroFetes/Repositories/DeliverersRepository.cs index 0bf8c2e8..6d1ff5e0 100644 --- a/PyroFetes/Repositories/DeliverersRepository.cs +++ b/PyroFetes/Repositories/DeliverersRepository.cs @@ -2,4 +2,4 @@ using PyroFetes.Models; namespace PyroFetes.Repositories; -public class DeliverersRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); +public class DeliverersRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); \ No newline at end of file diff --git a/PyroFetes/Repositories/QuotationProductsRepository.cs b/PyroFetes/Repositories/QuotationProductsRepository.cs index 0d42cdc4..4bae3f0e 100644 --- a/PyroFetes/Repositories/QuotationProductsRepository.cs +++ b/PyroFetes/Repositories/QuotationProductsRepository.cs @@ -2,4 +2,4 @@ using PyroFetes.Models; namespace PyroFetes.Repositories; -public class QuotationProductsRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); +public class QuotationProductsRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); \ No newline at end of file diff --git a/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs index eae9b7e6..8435455b 100644 --- a/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs +++ b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs @@ -78,10 +78,10 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService { table.ColumnsDefinition(columns => { - columns.RelativeColumn(4); // Produit - columns.RelativeColumn(2); // Qté - columns.RelativeColumn(2); // PU - columns.RelativeColumn(2); // Total + columns.RelativeColumn(4); // Produit + columns.RelativeColumn(2); // Qté + columns.RelativeColumn(2); // PU + columns.RelativeColumn(2); // Total }); // En-têtes @@ -92,16 +92,16 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService header.Cell().Element(CellHeader).AlignRight().Text("PU"); header.Cell().Element(CellHeader).AlignRight().Text("Total"); }); - + foreach (ProductDelivery l in lignes) { table.Cell().Element(CellBody).Text(l.Product?.Name); table.Cell().Element(CellBody).AlignRight().Text(l.Quantity.ToString()); table.Cell().Element(CellBody).AlignRight().Text($"{l.Quantity:n2} €"); table.Cell().Element(CellBody).AlignRight().Text($"{l.Quantity * l.Quantity:n2} €"); - + totalQuantity += l.Quantity; - total += l.Quantity * l.Quantity; + total += l.Quantity * l.Quantity; } IContainer CellHeader(IContainer c) => @@ -121,13 +121,10 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService }); // Signature en bas à droite - page.Footer().AlignRight().Column(col => - { - col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); - }); + page.Footer().AlignRight().Column(col => { col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); }); }); }); return document.GeneratePdf(); } -} +} \ No newline at end of file diff --git a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs index c5ef60e2..6fe2e7a8 100644 --- a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs +++ b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs @@ -75,10 +75,10 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService { table.ColumnsDefinition(columns => { - columns.RelativeColumn(4); // Produit - columns.RelativeColumn(1); // Qté - columns.RelativeColumn(2); // PU - columns.RelativeColumn(2); // Total + columns.RelativeColumn(4); // Produit + columns.RelativeColumn(1); // Qté + columns.RelativeColumn(2); // PU + columns.RelativeColumn(2); // Total }); // En-têtes @@ -89,20 +89,20 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService header.Cell().Element(CellHeader).AlignRight().Text("PU"); header.Cell().Element(CellHeader).AlignRight().Text("Total"); }); - + foreach (PurchaseProduct l in lignes) { decimal price = l.Product!.Prices! .FirstOrDefault(p => p.SupplierId == l.PurchaseOrder!.SupplierId) ?.SellingPrice ?? 0; - + table.Cell().Element(CellBody).Text(l.Product?.Name); table.Cell().Element(CellBody).AlignRight().Text(l.Quantity.ToString()); table.Cell().Element(CellBody).AlignRight().Text($"{price:n2} €"); table.Cell().Element(CellBody).AlignRight().Text($"{l.Quantity * price:n2} €"); - + totalQuantity += l.Quantity; - total += l.Quantity * price; + total += l.Quantity * price; } IContainer CellHeader(IContainer c) => @@ -132,19 +132,16 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService right.Item().AlignRight().Text($"Total: {totalQuantity:n2} produits"); right.Item().AlignRight().Text($"Total HT: {total:n2} €"); right.Item().AlignRight().Text("Taxe: 20 %"); - right.Item().AlignRight().Text($"Total TTC: {(total * 1,2):n2} €"); + right.Item().AlignRight().Text($"Total TTC: {(total * 1, 2):n2} €"); }); }); }); // Signature en bas à droite - page.Footer().AlignRight().Column(col => - { - col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); - }); + page.Footer().AlignRight().Column(col => { col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); }); }); }); return document.GeneratePdf(); } -} +} \ No newline at end of file diff --git a/PyroFetes/Services/Pdf/QuotationPdfService.cs b/PyroFetes/Services/Pdf/QuotationPdfService.cs index 40e4b759..8bc5557e 100644 --- a/PyroFetes/Services/Pdf/QuotationPdfService.cs +++ b/PyroFetes/Services/Pdf/QuotationPdfService.cs @@ -74,10 +74,10 @@ public class QuotationPdfService : IQuotationPdfService { table.ColumnsDefinition(columns => { - columns.RelativeColumn(10); // Produit - columns.RelativeColumn(2); // Qté - columns.RelativeColumn(3); // PU - columns.RelativeColumn(3); // Total + columns.RelativeColumn(10); // Produit + columns.RelativeColumn(2); // Qté + columns.RelativeColumn(3); // PU + columns.RelativeColumn(3); // Total }); // En-têtes @@ -88,15 +88,15 @@ public class QuotationPdfService : IQuotationPdfService header.Cell().Element(CellHeader).AlignRight().Text("PU"); header.Cell().Element(CellHeader).AlignRight().Text("Total"); }); - + foreach (QuotationProduct l in lignes) { table.Cell().Element(CellBody).Text(l.Product?.Name); table.Cell().Element(CellBody).AlignRight().Text(l.Quantity.ToString()); table.Cell().Element(CellBody).AlignRight().Text($"{l.Quantity:n2} €"); table.Cell().Element(CellBody).AlignRight().Text($"{l.Quantity * l.Quantity:n2} €"); - - total = total + l.Quantity * l.Quantity; + + total = total + l.Quantity * l.Quantity; } IContainer CellHeader(IContainer c) => @@ -131,16 +131,13 @@ public class QuotationPdfService : IQuotationPdfService }); // Signature en bas à droite - page.Footer().AlignRight().Column(col => - { - col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); - }); + page.Footer().AlignRight().Column(col => { col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); }); }); }); - + // Pour avoir la vue du PDF en temps réel // document.ShowInCompanion(); return document.GeneratePdf(); } -} +} \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs index 5b1ae68b..8158a7f8 100644 --- a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs @@ -11,6 +11,6 @@ public class GetPurchaseOrderByIdWithProductsSpec : SingleResultSpecification x.Id == purchaseOrderId) .Include(x => x.PurchaseProducts!) .ThenInclude(p => p.Product) - .ThenInclude(p=> p!.Prices); + .ThenInclude(p => p!.Prices); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs b/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs index 2d801b6d..45e4f6e6 100644 --- a/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs +++ b/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs @@ -5,7 +5,7 @@ namespace PyroFetes.Specifications.PurchaseProducts; public sealed class GetPurchaseProductByProductIdAndPurchaseOrderIdSpec : SingleResultSpecification { - public GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(int productId, int purchaseOrderId) + public GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(int productId, int purchaseOrderId) { Query .Where(p => p.ProductId == productId && p.PurchaseOrderId == purchaseOrderId); diff --git a/PyroFetes/Specifications/Users/GetUserByNameSpec.cs b/PyroFetes/Specifications/Users/GetUserByNameSpec.cs index 2affac1c..78edf1fa 100644 --- a/PyroFetes/Specifications/Users/GetUserByNameSpec.cs +++ b/PyroFetes/Specifications/Users/GetUserByNameSpec.cs @@ -8,6 +8,6 @@ public sealed class GetUserByNameSpec : SingleResultSpecification public GetUserByNameSpec(string userName) { Query - .Where(x=> x.Name == userName); + .Where(x => x.Name == userName); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/WarehouseProducts/GetProductTotalQuantitySpec.cs b/PyroFetes/Specifications/WarehouseProducts/GetProductTotalQuantitySpec.cs index 9dd451ff..c860c36b 100644 --- a/PyroFetes/Specifications/WarehouseProducts/GetProductTotalQuantitySpec.cs +++ b/PyroFetes/Specifications/WarehouseProducts/GetProductTotalQuantitySpec.cs @@ -9,6 +9,5 @@ public sealed class GetProductTotalQuantitySpec : Specification wp.ProductId == productId); - } } \ No newline at end of file