Refactor. Add data layer
This commit is contained in:
1 parent
3b7e4e6ec5
commit
b6b794f0b4
82 files changed
+2930
-2811
No files matched your search
@@ -0,0 +1,14 @@
|
||||
using BudgetApp.Data.Entities;
|
||||
|
||||
namespace BudgetApp.Data.Interfaces;
|
||||
|
||||
public interface IAccountRepository
|
||||
{
|
||||
Task<List<Account>> GetAccountsAsync(string userId);
|
||||
Task<Account?> GetAccountAsync(int id, string userId);
|
||||
Task CreateAccountAsync(Account account);
|
||||
Task UpdateAccountAsync(Account account);
|
||||
Task UpdateBalanceAsync(int id, string userId, decimal newBalance);
|
||||
Task UpdateAccountDetailsAsync(int id, string userId, string name, string color, string currencyCode);
|
||||
Task DeleteAccountAsync(int id, string userId);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using BudgetApp.Data.Entities;
|
||||
|
||||
namespace BudgetApp.Data.Interfaces;
|
||||
|
||||
public interface ICategoryRepository
|
||||
{
|
||||
Task<List<Category>> GetCategoriesAsync(string userId);
|
||||
Task EnsureDefaultCategoriesAsync(string userId);
|
||||
Task CreateCategoryAsync(Category category);
|
||||
Task UpdateCategoryAsync(int id, string userId, string name, string icon);
|
||||
Task DeleteCategoryAsync(int id, string userId);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using BudgetApp.Data.Entities;
|
||||
|
||||
namespace BudgetApp.Data.Interfaces;
|
||||
|
||||
public interface ISalaryRepository
|
||||
{
|
||||
Task<List<Salary>> GetSalariesAsync(string userId);
|
||||
Task CreateSalaryAsync(Salary salary, DateTime windowEnd);
|
||||
Task DeleteSalaryAsync(int id, string userId);
|
||||
Task MaterializeSalaryTransactionsAsync(string userId, DateTime windowEnd);
|
||||
Task<DateTime?> GetNextPaydateAsync(int salaryId);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using BudgetApp.Data.Entities;
|
||||
|
||||
namespace BudgetApp.Data.Interfaces;
|
||||
|
||||
public interface ITransactionRepository
|
||||
{
|
||||
Task<List<Transaction>> GetTransactionsAsync(string userId);
|
||||
Task<List<Transaction>> GetRecentTransactionsAsync(string userId, int count = 5);
|
||||
Task<List<Transaction>> GetUpcomingTransactionsAsync(string userId, int count = 5);
|
||||
Task<List<Transaction>> GetTransactionsInRangeAsync(string userId, DateTime from, DateTime to);
|
||||
Task<List<Transaction>> GetTransactionsByAccountAsync(int accountId, string userId);
|
||||
Task CreateTransactionAsync(Transaction transaction);
|
||||
Task UpdateTransactionAsync(int id, string userId, string description, decimal amount, DateTime date,
|
||||
TransactionType type, int accountId, int? categoryId,
|
||||
RecurrenceType recurrenceType = RecurrenceType.None, DateTime? recurrenceEndDate = null);
|
||||
Task DeleteTransactionAsync(int id, string userId);
|
||||
Task DeleteTransactionSeriesAsync(int id, string userId);
|
||||
Task MarkAsPaidAsync(int id, string userId, bool isPaid = true);
|
||||
Task MaterializeRecurringTransactionsAsync(string userId, DateTime? windowEnd = null);
|
||||
}
|
||||
Reference in new issue
Block a user