-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPaymentsApplicationAutoMapperProfile.cs
More file actions
37 lines (33 loc) · 1.53 KB
/
PaymentsApplicationAutoMapperProfile.cs
File metadata and controls
37 lines (33 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using AutoMapper;
using Unity.Payments.Domain.PaymentConfigurations;
using Unity.Payments.Domain.PaymentRequests;
using Unity.Payments.Domain.PaymentTags;
using Unity.Payments.Domain.Suppliers;
using Unity.Payments.PaymentConfigurations;
using Unity.Payments.PaymentRequests;
using Unity.Payments.PaymentTags;
using Unity.Payments.Suppliers;
using Volo.Abp.Users;
namespace Unity.Payments;
public class PaymentsApplicationAutoMapperProfile : Profile
{
public PaymentsApplicationAutoMapperProfile()
{
CreateMap<PaymentRequest, PaymentRequestDto>()
.ForMember(dest => dest.ErrorSummary, options => options.Ignore())
.ForMember(dest => dest.Site, opt => opt.MapFrom(src => src.Site))
.ForMember(dest => dest.CreatorUser, opt => opt.Ignore())
.ForMember(dest => dest.PaymentTags, opt => opt.MapFrom(src => src.PaymentTags));
CreateMap<PaymentRequest, PaymentDetailsDto>()
.ForMember(dest => dest.Site, opt => opt.MapFrom(src => src.Site));
CreateMap<ExpenseApproval, ExpenseApprovalDto>()
.ForMember(x => x.DecisionUser, map => map.Ignore());
CreateMap<Site, SiteDto>()
.ForMember(dest => dest.PaymentGroup, opt => opt.MapFrom(s => s.PaymentGroup.ToString()));
CreateMap<Supplier, SupplierDto>();
CreateMap<PaymentConfiguration, PaymentConfigurationDto>();
CreateMap<IUserData, PaymentUserDto>();
CreateMap<PaymentTag, PaymentTagDto>();
CreateMap<TagSummaryCount, TagSummaryCountDto>();
}
}