Merged AutoMapper branch

This commit is contained in:
Cristiano
2025-11-13 14:44:28 +01:00
parent 6bc8281a37
commit 9684dbcbc7
9 changed files with 477 additions and 23 deletions

View File

@@ -0,0 +1,68 @@
using AutoMapper;
using PyroFetes.DTO.Deliverer.Request;
using PyroFetes.DTO.DeliveryNote.Request;
using PyroFetes.DTO.Price.Request;
using PyroFetes.DTO.Product.Request;
using PyroFetes.DTO.ProductDelivery.Request;
using PyroFetes.DTO.PurchaseOrder.Request;
using PyroFetes.DTO.PurchaseProduct.Request;
using PyroFetes.DTO.Quotation.Request;
using PyroFetes.DTO.QuotationProduct.Request;
using PyroFetes.DTO.SettingDTO.Request;
using PyroFetes.DTO.Supplier.Request;
using PyroFetes.DTO.User.Request;
using PyroFetes.DTO.WareHouseProduct.Request;
using PyroFetes.Models;
namespace PyroFetes.MappingProfiles;
public class DtoToEntityMappings : Profile
{
public DtoToEntityMappings()
{
CreateMap<CreateDelivererDto, Deliverer>();
CreateMap<UpdateDelivererDto, Deliverer>();
CreateMap<CreateDeliveryNoteDto, DeliveryNote>();
CreateMap<UpdateDeliveryNoteDto, DeliveryNote>();
CreateMap<PatchDeliveryNoteRealDeliveryDateDto, DeliveryNote>();
CreateMap<CreatePriceDto, Price>();
CreateMap<UpdatePriceDto, Price>();
CreateMap<PatchPriceSellingPriceDto, Price>();
CreateMap<CreateProductDto, Product>();
CreateMap<UpdateProductDto, Product>();
CreateMap<PatchProductMinimalStockDto, Product>();
CreateMap<CreateProductDeliveryDto, ProductDelivery>();
CreateMap<UpdateProductDeliveryDto, ProductDelivery>();
CreateMap<PatchPurchaseOrderPurchaseConditionsDto,PurchaseOrder>();
CreateMap<CreatePurchaseProductDto, PurchaseProduct>();
CreateMap<UpdatePurchaseProductDto, PurchaseProduct>();
CreateMap<PatchPurchaseProductQuantityDto, PurchaseProduct>();
CreateMap<PatchQuotationConditionsSaleDto, Quotation>();
CreateMap<PatchQuotationMessageDto, Quotation>();
CreateMap<CreateQuotationProductDto, QuotationProduct>();
CreateMap<UpdateQuotationProductDto, QuotationProduct>();
CreateMap<PatchQuotationProductQuantityDto, QuotationProduct>();
CreateMap<CreateSettingDto, Setting>();
CreateMap<PatchSettingElectronicSignatureDto, Setting>();
CreateMap<PatchSettingLogoDto, Setting>();
CreateMap<CreateSupplierDto, Supplier>();
CreateMap<UpdateSupplierDto, Supplier>();
CreateMap<PatchSupplierDeliveryDelayDto, Supplier>();
CreateMap<CreateUserDto, User>();
CreateMap<UpdateUserDto, User>();
CreateMap<PatchUserPasswordDto, User>();
CreateMap<PatchWareHouseProductQuantityDto, WarehouseProduct>();
}
}

View File

@@ -0,0 +1,46 @@
using AutoMapper;
using PyroFetes.DTO.Deliverer.Response;
using PyroFetes.DTO.DeliveryNote.Response;
using PyroFetes.DTO.Price.Response;
using PyroFetes.DTO.Product.Response;
using PyroFetes.DTO.ProductDelivery.Response;
using PyroFetes.DTO.PurchaseOrder.Response;
using PyroFetes.DTO.PurchaseProduct.Response;
using PyroFetes.DTO.Quotation.Response;
using PyroFetes.DTO.QuotationProduct.Response;
using PyroFetes.DTO.SettingDTO.Response;
using PyroFetes.DTO.User.Response;
using PyroFetes.DTO.WareHouseProduct.Response;
using PyroFetes.Models;
namespace PyroFetes.MappingProfiles;
public class EntityToDtoMappings : Profile
{
public EntityToDtoMappings()
{
CreateMap<Deliverer, GetDelivererDto>();
CreateMap<DeliveryNote, GetDeliveryNoteDto>();
CreateMap<Price, GetPriceDto>();
CreateMap<Product, GetProductDto>();
CreateMap<ProductDelivery, GetProductDeliveryDto>();
CreateMap<PurchaseOrder, GetPurchaseOrderDto>();
CreateMap<PurchaseProduct, GetPurchaseProductDto>();
CreateMap<Quotation, GetQuotationDto>();
CreateMap<QuotationProduct, GetQuotationProductDto>();
CreateMap<Setting, GetSettingDto>();
CreateMap<User, GetUserDto>();
CreateMap<WarehouseProduct, GetWareHouseProductDto>();
}
}