using AutoMapper; using ExpenseTracker.Application.Common.Mappings; using ExpenseTracker.Application.Transactions; using ExpenseTracker.Domain.Entities; namespace ExpenseTracker.Application.Accounts; public class AccountJsonDto : IMapFrom { public string Name { get; set; } public string? Description { get; set; } public string Currency { get; set; } public IEnumerable? Transactions { get; set; } public void Mapping(Profile profile) { profile.CreateMap() .ForMember(d => d.Currency, opt => opt.MapFrom(s => s.Currency.Name)); profile.CreateMap() .ForMember(d => d.Currency, opt => opt.MapFrom(s => Domain.Enums.Currency.FromName(s.Currency))); } }