Skip to content

Commit c0b0279

Browse files
digaomatiasRodrigo Leoteclaude
authored
fix: add TypeDisplayName to AccountWithBalanceDto (#197)
* fix: add TypeDisplayName to AccountWithBalanceDto Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use declarative MapProperty for TypeDisplayName mapping * fix: add MapperIgnoreSource attributes for unmapped Account members --------- Co-authored-by: Rodrigo Leote <rodrigol@leapthought.co.nz> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2d66146 commit c0b0279

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/Core/MyMascada.Application/Features/Accounts/DTOs/AccountWithBalanceDto.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class AccountWithBalanceDto : ISharingMetadata
77
public int Id { get; set; }
88
public string Name { get; set; } = string.Empty;
99
public int Type { get; set; }
10+
public string TypeDisplayName { get; set; } = string.Empty;
1011
public string? Institution { get; set; }
1112
public decimal CurrentBalance { get; set; } // Static balance from account
1213
public decimal CalculatedBalance { get; set; } // Real-time calculated balance from transactions

src/Core/MyMascada.Application/Features/Accounts/Mappings/AccountMapper.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,20 @@ public static AccountDto ToDto(Account account)
6565
public static partial void ApplyTo(UpdateAccountDto dto, Account account);
6666

6767
// Account -> AccountWithBalanceDto
68+
[MapProperty(nameof(Account.Type), nameof(AccountWithBalanceDto.TypeDisplayName), Use = nameof(GetAccountTypeDisplayName))]
6869
[MapperIgnoreTarget(nameof(AccountWithBalanceDto.CalculatedBalance))]
6970
[MapperIgnoreTarget(nameof(AccountWithBalanceDto.IsOwner))]
7071
[MapperIgnoreTarget(nameof(AccountWithBalanceDto.IsSharedWithMe))]
7172
[MapperIgnoreTarget(nameof(AccountWithBalanceDto.ShareRole))]
7273
[MapperIgnoreTarget(nameof(AccountWithBalanceDto.SharedByUserName))]
74+
[MapperIgnoreSource(nameof(Account.UserId))]
75+
[MapperIgnoreSource(nameof(Account.Transactions))]
76+
[MapperIgnoreSource(nameof(Account.BankConnection))]
77+
[MapperIgnoreSource(nameof(Account.Shares))]
78+
[MapperIgnoreSource(nameof(Account.IsDeleted))]
79+
[MapperIgnoreSource(nameof(Account.LastReconciledDate))]
80+
[MapperIgnoreSource(nameof(Account.LastReconciledBalance))]
81+
[MapperIgnoreSource(nameof(Account.LastFourDigits))]
7382
public static partial AccountWithBalanceDto ToWithBalanceDto(Account account);
7483

7584
// Account -> AccountDetailsDto (with custom TypeDisplayName)

0 commit comments

Comments
 (0)