-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
127 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Application.DTOs.AccountCsv; | ||
|
||
public class GetAllAccountsResponse | ||
{ | ||
public List<AccountCsvModel> Accounts { get; set; } = new(); | ||
} |
15 changes: 2 additions & 13 deletions
15
src/Application/DTOs/TransactionCsv/GetAllTransactionsResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,6 @@ | ||
namespace Web.DTOs.Transaction; | ||
namespace Application.DTOs.TransactionCsv; | ||
|
||
public class GetAllTransactionsResponse | ||
{ | ||
public List<TransactionDto> Transactions { get; set; } = new(); | ||
|
||
public class TransactionDto | ||
{ | ||
public long TransactionId { get; set; } | ||
public long SourceAccountId { get; set; } | ||
public long DestinationAccountId { get; set; } | ||
public decimal Amount { get; set; } | ||
public DateTime Date { get; set; } | ||
public string Type { get; set; } = string.Empty; | ||
} | ||
|
||
public List<TransactionCsvModel> Transactions { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Application.DTOs.AccountCsv; | ||
using Domain.Entities; | ||
|
||
namespace Application.Mappers; | ||
|
||
public static class AccountMapper | ||
{ | ||
public static GetAllAccountsResponse ToGetAllAccountsResponse(this List<Account> accounts) | ||
{ | ||
return new GetAllAccountsResponse | ||
{ | ||
Accounts = accounts.Select(account => new AccountCsvModel | ||
{ | ||
AccountID = account.AccountId, | ||
CardID = account.CardId, | ||
IBAN = account.Iban, | ||
AccountType = account.AccountType, | ||
BranchTelephone = account.BranchTelephone, | ||
BranchAdress = account.BranchAddress, | ||
BranchName = account.BranchName, | ||
OwnerName = account.OwnerName, | ||
OwnerLastName = account.OwnerLastName, | ||
OwnerID = account.OwnerId | ||
}).ToList() | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
using Web.DTOs.Transaction; | ||
using Application.DTOs.TransactionCsv; | ||
using Domain.Entities; | ||
|
||
namespace Application.Mappers | ||
namespace Application.Mappers; | ||
public static class TransactionMapper | ||
{ | ||
public static class TransactionMapper | ||
public static GetAllTransactionsResponse ToGetAllTransactionsResponse(this List<Transaction> transactions) | ||
{ | ||
public static GetAllTransactionsResponse ToGetAllTransactionsResponse(this List<Transaction> transactions) | ||
return new GetAllTransactionsResponse | ||
{ | ||
return new GetAllTransactionsResponse | ||
Transactions = transactions.Select(transaction => new TransactionCsvModel | ||
{ | ||
Transactions = transactions.Select(transaction => new GetAllTransactionsResponse.TransactionDto | ||
{ | ||
TransactionId = transaction.TransactionId, | ||
SourceAccountId = transaction.SourceAccountId, | ||
DestinationAccountId = transaction.DestinationAccountId, | ||
Amount = transaction.Amount, | ||
Date = transaction.Date, | ||
Type = transaction.Type | ||
}).ToList() | ||
}; | ||
} | ||
TransactionID = transaction.TransactionId, | ||
SourceAcount = transaction.SourceAccountId, | ||
DestiantionAccount = transaction.DestinationAccountId, | ||
Amount = transaction.Amount, | ||
Date = transaction.Date, | ||
Type = transaction.Type | ||
}).ToList() | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters