diff --git a/src/PowderCoating.Application/Mappings/InvoiceProfile.cs b/src/PowderCoating.Application/Mappings/InvoiceProfile.cs index e18f687..8e1fe57 100644 --- a/src/PowderCoating.Application/Mappings/InvoiceProfile.cs +++ b/src/PowderCoating.Application/Mappings/InvoiceProfile.cs @@ -33,6 +33,10 @@ public class InvoiceProfile : Profile .ForMember(d => d.BalanceDue, o => o.MapFrom(s => s.BalanceDue)) .ForMember(d => d.SalesTaxAccountName, o => o.MapFrom(s => s.SalesTaxAccount != null ? $"{s.SalesTaxAccount.AccountNumber} – {s.SalesTaxAccount.Name}" : null)) + // These three collections are built manually in BuildInvoiceDtoAsync — no AutoMapper element map exists. + // AutoMapper 12+ throws for non-empty collections with no registered element mapping, so Ignore here. + .ForMember(d => d.Refunds, o => o.Ignore()) + .ForMember(d => d.CreditApplications, o => o.Ignore()) .ForMember(d => d.GiftCertificateRedemptions, o => o.Ignore()); CreateMap()