refactor(app): implement year filtering for accounts and enhance dashboard PDF generation
This commit is contained in:
@@ -77,6 +77,17 @@ public class EntryService : IEntryService
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<int>> GetAllEntryYearsAsync()
|
||||
{
|
||||
await using var db = await _dbFactory.CreateDbContextAsync();
|
||||
|
||||
return await db.Entries
|
||||
.Select(e => e.Date.Year)
|
||||
.Distinct()
|
||||
.OrderByDescending(y => y)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<EntryDto> CreateEntryAsync(int accountId, EntryType type, DateTime date, string title, decimal amount)
|
||||
{
|
||||
await using var db = await _dbFactory.CreateDbContextAsync();
|
||||
|
||||
Reference in New Issue
Block a user