-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPaymentsApplicationAutoMapperProfile.cs
More file actions
84 lines (78 loc) · 4.4 KB
/
PaymentsApplicationAutoMapperProfile.cs
File metadata and controls
84 lines (78 loc) · 4.4 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
using AutoMapper;
using Unity.GrantManager.Applications;
using Unity.GrantManager.GlobalTag;
using Unity.GrantManager.Payments;
using Unity.Payments.Domain.AccountCodings;
using Unity.Payments.Domain.PaymentConfigurations;
using Unity.Payments.Domain.PaymentRequests;
using Unity.Payments.Domain.PaymentTags;
using Unity.Payments.Domain.PaymentThresholds;
using Unity.Payments.Domain.Suppliers;
using Unity.Payments.PaymentConfigurations;
using Unity.Payments.PaymentRequests;
using Unity.Payments.PaymentTags;
using Unity.Payments.PaymentThresholds;
using Unity.Payments.Suppliers;
using Volo.Abp.Users;
namespace Unity.Payments;
public class PaymentsApplicationAutoMapperProfile : Profile
{
public PaymentsApplicationAutoMapperProfile()
{
CreateMap<PaymentRequest, PaymentRequestDto>()
.ForMember(dest => dest.ErrorSummary, opt => opt.Ignore())
.ForMember(dest => dest.AccountCoding, opt => opt.MapFrom(src => src.AccountCoding))
.ForMember(dest => dest.AccountCodingDisplay, opt => opt.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<CreateUpdateAccountCodingDto, AccountCoding>()
.ForMember(dest => dest.TenantId, opt => opt.Ignore())
.ForMember(dest => dest.LastModificationTime, opt => opt.Ignore())
.ForMember(dest => dest.LastModifierId, opt => opt.Ignore())
.ForMember(dest => dest.CreationTime, opt => opt.Ignore())
.ForMember(dest => dest.CreatorId, opt => opt.Ignore())
.ForMember(dest => dest.ExtraProperties, opt => opt.Ignore())
.ForMember(dest => dest.ConcurrencyStamp, opt => opt.Ignore())
.ForMember(dest => dest.Id, opt => opt.Ignore());
CreateMap<PaymentConfiguration, PaymentConfigurationDto>();
CreateMap<AccountCoding, AccountCodingDto>();
CreateMap<AccountCodingDto, CreateUpdateAccountCodingDto>();
CreateMap<CreateUpdateAccountCodingDto, AccountCoding>()
.ForMember(dest => dest.TenantId, opt => opt.Ignore())
.ForMember(dest => dest.LastModificationTime, opt => opt.Ignore())
.ForMember(dest => dest.LastModifierId, opt => opt.Ignore())
.ForMember(dest => dest.CreationTime, opt => opt.Ignore())
.ForMember(dest => dest.CreatorId, opt => opt.Ignore())
.ForMember(dest => dest.ExtraProperties, opt => opt.Ignore())
.ForMember(dest => dest.ConcurrencyStamp, opt => opt.Ignore())
.ForMember(dest => dest.Id, opt => opt.Ignore());
CreateMap<PaymentThresholdDto, UpdatePaymentThresholdDto>()
.ForMember(dest => dest.UserName, opt => opt.Ignore());
CreateMap<PaymentThreshold, PaymentThresholdDto>()
.ForMember(dest => dest.UserName, opt => opt.Ignore());
CreateMap<UpdatePaymentThresholdDto, PaymentThreshold>()
.ForMember(dest => dest.TenantId, opt => opt.Ignore())
.ForMember(dest => dest.IsDeleted, opt => opt.Ignore())
.ForMember(dest => dest.DeleterId, opt => opt.Ignore())
.ForMember(dest => dest.DeletionTime, opt => opt.Ignore())
.ForMember(dest => dest.LastModificationTime, opt => opt.Ignore())
.ForMember(dest => dest.LastModifierId, opt => opt.Ignore())
.ForMember(dest => dest.CreationTime, opt => opt.Ignore())
.ForMember(dest => dest.CreatorId, opt => opt.Ignore())
.ForMember(dest => dest.ExtraProperties, opt => opt.Ignore())
.ForMember(dest => dest.ConcurrencyStamp, opt => opt.Ignore())
.ForMember(dest => dest.Id, opt => opt.Ignore());
CreateMap<IUserData, PaymentUserDto>();
CreateMap<Tag, GlobalTagDto>();
CreateMap<PaymentTag, PaymentTagDto>();
CreateMap<TagSummaryCount, TagSummaryCountDto>();
}
}