-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: implement ResultPattern for Expenses (#204) * fix: add base controller (#204) * refactor: implement ResultPatter for ExpenseItems (#204) * refactor: implement ResultPattern for Categories (#204) * refactor: Implement ResultPatter for Incomes (#204) * refactor: implement ResultPattern in Projects (#204) * refactor: change error codes to not found in case of empty object (#204) * fix: resolve add-project e2e test fail (#204) * Update EasyFinance.Server/EasyFinance.Server.csproj --------- Co-authored-by: Felipe Soares <[email protected]>
- Loading branch information
1 parent
47807b6
commit 68413ee
Showing
102 changed files
with
1,144 additions
and
537 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
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
2 changes: 1 addition & 1 deletion
2
EasyFinance.Application/Contracts/Persistence/IGenericRepository.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
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
7 changes: 7 additions & 0 deletions
7
EasyFinance.Application/DTOs/AccessControl/UserDeleteRequestDTO.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EasyFinance.Application.DTOs.AccessControl | ||
{ | ||
public class UserDeleteRequestDTO | ||
{ | ||
public string ConfirmationToken { get; set; } = string.Empty; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
EasyFinance.Application/DTOs/AccessControl/UserRequestDTO.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace EasyFinance.Application.DTOs.AccessControl | ||
{ | ||
public class UserRequestDTO | ||
{ | ||
public string FirstName { get; set; } = "Default"; | ||
public string LastName { get; set; } = "Default"; | ||
public string PreferredCurrency { get; set; } = string.Empty; | ||
public string TimeZoneId { get; set; } = string.Empty; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
EasyFinance.Application/DTOs/AccessControl/UserResponseDTO.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using EasyFinance.Domain.AccessControl; | ||
using EasyFinance.Infrastructure.Validators; | ||
using System; | ||
|
||
namespace EasyFinance.Application.DTOs.AccessControl | ||
{ | ||
public class UserResponseDTO | ||
{ | ||
public UserResponseDTO(User user) | ||
{ | ||
TimeZoneValidator.TryGetTimeZoneInfo(user.TimeZoneId, out var timeZoneInfo); | ||
|
||
if (user != null) | ||
{ | ||
Id = user.Id; | ||
Email = user.Email; | ||
FirstName = user.FirstName; | ||
LastName = user.LastName; | ||
PreferredCurrency = user.PreferredCurrency; | ||
TimeZone = timeZoneInfo; | ||
Enabled = user.Enabled; | ||
IsFirstLogin = user.HasIncompletedInformation; | ||
EmailConfirmed = user.EmailConfirmed; | ||
TwoFactorEnabled = user.TwoFactorEnabled; | ||
} | ||
} | ||
|
||
public Guid Id { get; set; } | ||
public string Email { get; set; } = string.Empty; | ||
public string FirstName { get; set; } = string.Empty; | ||
public string LastName { get; set; } = string.Empty; | ||
public string PreferredCurrency { get; set; } = string.Empty; | ||
public TimeZoneInfo TimeZone { get; set; } | ||
public bool Enabled { get; set; } | ||
public bool IsFirstLogin { get; set; } | ||
public bool EmailConfirmed { get; set; } | ||
public bool TwoFactorEnabled { get; set; } | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
EasyFinance.Application/DTOs/AccessControl/UserSearchResponseDTO.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using EasyFinance.Domain.AccessControl; | ||
using System; | ||
|
||
namespace EasyFinance.Application.DTOs.AccessControl | ||
{ | ||
public class UserSearchResponseDTO | ||
{ | ||
public UserSearchResponseDTO(User user) | ||
{ | ||
if (user != null) | ||
{ | ||
Id = user.Id; | ||
FirstName = user.FirstName; | ||
LastName = user.LastName; | ||
Email = user.Email; | ||
} | ||
} | ||
|
||
public Guid Id { get; protected set; } | ||
public string FirstName { get; protected set; } | ||
public string LastName { get; protected set; } | ||
public string Email { get; protected set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
EasyFinance.Application/DTOs/Financial/BaseExpenseRequestDTO.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class BaseExpenseRequestDTO : BaseFinancialDTO | ||
{ | ||
public ICollection<ExpenseItemRequestDTO> Items { get; set; } = new List<ExpenseItemRequestDTO>(); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
EasyFinance.Application/DTOs/Financial/BaseExpenseResponseDTO.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class BaseExpenseResponseDTO : BaseFinancialDTO | ||
{ | ||
public ICollection<ExpenseItemResponseDTO> Items { get; set; } = new List<ExpenseItemResponseDTO>(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
EasyFinance.Application/DTOs/Financial/BaseFinancialDTO.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
|
||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public abstract class BaseFinancialDTO | ||
{ | ||
public string Name { get; set; } = string.Empty; | ||
public DateTime Date { get; set; } | ||
public decimal Amount { get; set; } | ||
} | ||
} |
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,7 @@ | ||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class CategoryRequestDTO | ||
{ | ||
public string Name { get; set; } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
EasyFinance.Application/DTOs/Financial/CategoryResponseDTO.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using EasyFinance.Domain.Financial; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class CategoryResponseDTO | ||
{ | ||
public Guid Id { get; set; } | ||
public string Name { get; set; } | ||
public ICollection<Expense> Expenses { get; set; } = new List<Expense>(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
EasyFinance.Application/DTOs/Financial/ExpenseItemRequestDTO.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class ExpenseItemRequestDTO : BaseExpenseRequestDTO | ||
{ | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
EasyFinance.Application/DTOs/Financial/ExpenseItemResponseDTO.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
|
||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class ExpenseItemResponseDTO : BaseExpenseResponseDTO | ||
{ | ||
public Guid Id { get; set; } | ||
} | ||
} |
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,7 @@ | ||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class ExpenseRequestDTO : BaseExpenseRequestDTO | ||
{ | ||
public int Budget { get; set; } | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
EasyFinance.Application/DTOs/Financial/ExpenseResponseDTO.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class ExpenseResponseDTO : BaseExpenseResponseDTO | ||
{ | ||
public Guid Id { get; set; } | ||
public int Budget { get; set; } | ||
} | ||
} |
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 EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class IncomeRequestDTO : BaseFinancialDTO | ||
{ | ||
} | ||
} |
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,9 @@ | ||
using System; | ||
|
||
namespace EasyFinance.Application.DTOs.Financial | ||
{ | ||
public class IncomeResponseDTO : BaseFinancialDTO | ||
{ | ||
public Guid Id { get; set; } | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
EasyFinance.Application/DTOs/FinancialProject/ProjectRequestDTO.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using EasyFinance.Domain.FinancialProject; | ||
|
||
namespace EasyFinance.Application.DTOs.FinancialProject | ||
{ | ||
public class ProjectRequestDTO | ||
{ | ||
public string Name { get; set; } = string.Empty; | ||
public ProjectType Type { get; set; } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
EasyFinance.Application/DTOs/FinancialProject/ProjectResponseDTO.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Text.Json.Serialization; | ||
using EasyFinance.Domain.FinancialProject; | ||
|
||
namespace EasyFinance.Application.DTOs.FinancialProject | ||
{ | ||
public class ProjectResponseDTO | ||
{ | ||
public Guid Id { get; set; } | ||
public string Name { get; set; } = string.Empty; | ||
public ProjectType Type { get; set; } | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
EasyFinance.Application/Features/AccessControlService/AccessControlService.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
Oops, something went wrong.