Some fixes

This commit is contained in:
Cristiano
2026-03-26 15:35:11 +01:00
parent 3487baad87
commit 0312f02028
6 changed files with 10 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ public class GetPriceDto
public int SupplierDeliveryDelay { get; set; }
public int ProductId { get; set; }
public string? ProductReferences { get; set; }
public string? ProductReference { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public int ProductCaliber { get; set; }

View File

@@ -13,6 +13,7 @@ public class GetPurchaseProductDto
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
public decimal ProductPrice { get; set; }
public int PurchaseOrderId { get; set; }
public string? PurchaseOrderPurchaseConditions { get; set; }

View File

@@ -34,7 +34,8 @@ public class EntityToDtoMappings : Profile
// CreateMap<PurchaseOrder, GetPurchaseOrderDto>();
//
// CreateMap<PurchaseProduct, GetPurchaseProductDto>();
CreateMap<PurchaseProduct, GetPurchaseProductDto>();
CreateMap<PurchaseOrder, GetPurchaseOrderDto>()
.ForMember(dest => dest.Products,

View File

@@ -8,6 +8,7 @@ public sealed class GetProductByIdSpec : Specification<Product>
public GetProductByIdSpec(int? productId)
{
Query
.Where(p => p.Id == productId);
.Where(p => p.Id == productId)
.Include(p => p.Prices);
}
}

View File

@@ -10,6 +10,7 @@ public class GetPurchaseOrderByIdWithProductsSpec : Specification<PurchaseOrder>
Query
.Where(p => p.Id == purchaseOrderId)
.Include(p => p.PurchaseProducts!)
.ThenInclude(pp => pp.Product);
.ThenInclude(pp => pp.Product)
.ThenInclude(pp=> pp!.Prices);
}
}