fix error and add CreatePurchaseOrder.cs

This commit is contained in:
2025-12-13 11:24:01 +01:00
parent 2a42e1010f
commit 35d3e58d86
8 changed files with 88 additions and 8 deletions

View File

@@ -38,6 +38,7 @@ public class DtoToEntityMappings : Profile
CreateMap<CreateProductDeliveryDto, ProductDelivery>();
CreateMap<UpdateProductDeliveryDto, ProductDelivery>();
CreateMap<CreatePurchaseOrderDto, PurchaseOrder>();
CreateMap<PatchPurchaseOrderPurchaseConditionsDto,PurchaseOrder>();
CreateMap<CreatePurchaseProductDto, PurchaseProduct>();

View File

@@ -32,9 +32,19 @@ public class EntityToDtoMappings : Profile
CreateMap<ProductDelivery, GetProductDeliveryDto>();
CreateMap<PurchaseOrder, GetPurchaseOrderDto>();
// CreateMap<PurchaseOrder, GetPurchaseOrderDto>();
//
// CreateMap<PurchaseProduct, GetPurchaseProductDto>();
CreateMap<PurchaseProduct, GetPurchaseProductDto>();
CreateMap<PurchaseOrder, GetPurchaseOrderDto>()
.ForMember(dest => dest.Products,
opt => opt.MapFrom(src => src.PurchaseProducts));
CreateMap<PurchaseProduct, GetPurchaseProductDto>()
.ForMember(dest => dest.ProductId, opt => opt.MapFrom(src => src.ProductId))
.ForMember(dest => dest.Quantity, opt => opt.MapFrom(src => src.Quantity))
.ForMember(dest => dest.ProductName, opt => opt.MapFrom(src => src.Product.Name))
.ForMember(dest => dest.ProductReferences, opt => opt.MapFrom(src => src.Product.Reference));
CreateMap<Quotation, GetQuotationDto>();