From 756d25098ed492677b137c6cf86aa630af901289 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sat, 7 Oct 2023 10:21:15 +0200 Subject: [PATCH 01/57] Update version --- CHANGELOG.md | 2 ++ OpenBudgeteer.Blazor/Shared/NavMenu.razor | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e65049b..7a9a6d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### 1.8 (202x-xx-xx) + ### 1.7 (2023-10-03) * [Add] PostgreSQL support [#81](https://github.com/TheAxelander/OpenBudgeteer/issues/81) Thanks [csillaggyujto](https://github.com/csillaggyujto) diff --git a/OpenBudgeteer.Blazor/Shared/NavMenu.razor b/OpenBudgeteer.Blazor/Shared/NavMenu.razor index ab79411..c3f8e2d 100644 --- a/OpenBudgeteer.Blazor/Shared/NavMenu.razor +++ b/OpenBudgeteer.Blazor/Shared/NavMenu.razor @@ -61,7 +61,7 @@
From a574e0f04abf86b96e65b440f8177d0ebc3cf98c Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sat, 7 Oct 2023 10:50:06 +0200 Subject: [PATCH 02/57] Add Data Consistency check: Negative Transaction assigned to Income #177 --- CHANGELOG.md | 1 + .../ViewModels/DataConsistencyViewModel.cs | 67 ++++++++++++++++++- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a9a6d8..4aaab93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ### 1.8 (202x-xx-xx) +* [Add] Data Consistency Check: Negative Transaction assigned to Income [#177](https://github.com/TheAxelander/OpenBudgeteer/issues/177) ### 1.7 (2023-10-03) diff --git a/OpenBudgeteer.Core/ViewModels/DataConsistencyViewModel.cs b/OpenBudgeteer.Core/ViewModels/DataConsistencyViewModel.cs index 9328561..6f753d4 100644 --- a/OpenBudgeteer.Core/ViewModels/DataConsistencyViewModel.cs +++ b/OpenBudgeteer.Core/ViewModels/DataConsistencyViewModel.cs @@ -45,7 +45,8 @@ public async Task RunAllChecksAsync() CheckTransferReconciliationAsync(), CheckBucketBalanceAsync(), CheckBankTransactionWithoutBucketAssignmentAsync(), - CheckBudgetedTransactionOutsideOfValidityDateAsync() + CheckBudgetedTransactionOutsideOfValidityDateAsync(), + CheckNegativeBankTransactionAssignedToIncomeAsync() }; foreach (var result in await Task.WhenAll(checkTasks)) @@ -226,7 +227,9 @@ public async Task CheckBudgetedTransactionOutsideOfV ? new(DataConsistencyCheckResult.StatusCode.Alert, bucket.Name, invalidTransactions.Select(i => i.Transaction).ToList()) - : new(DataConsistencyCheckResult.StatusCode.Ok, bucket.Name, new List())); + : new(DataConsistencyCheckResult.StatusCode.Ok, + bucket.Name, + new List())); })); } @@ -246,7 +249,8 @@ public async Task CheckBudgetedTransactionOutsideOfV new string[4] { "Bucket", "Transaction Date", "Memo", "Amount" } }; - foreach (var result in results.Where(i => i.Item1 != DataConsistencyCheckResult.StatusCode.Ok)) + foreach (var result in results + .Where(i => i.Item1 != DataConsistencyCheckResult.StatusCode.Ok)) { foreach (var transaction in result.Item3) { @@ -266,4 +270,61 @@ public async Task CheckBudgetedTransactionOutsideOfV detailsBuilder); }); } + + /// + /// Checks if any negative has been assigned to Income + /// + /// Result of Data Consistency Check + public async Task CheckNegativeBankTransactionAssignedToIncomeAsync() + { + return await Task.Run(() => + { + var checkName = "Negative Bank Transaction assigned to Income"; + using var dbContext = new DatabaseContext(_dbOptions); + + var bankTransactions = dbContext.BudgetedTransaction + .Include(i => i.Transaction) + .Where(i => + i.BucketId == new Guid("00000000-0000-0000-0000-000000000001") && + i.Amount < 0) + .Select(i => i.Transaction) + .ToList(); + + var results = bankTransactions + .Select(bankTransaction => + new Tuple( + DataConsistencyCheckResult.StatusCode.Warning, + checkName, + bankTransaction)) + .ToList(); + + if (results.Count == 0) + { + return Task.FromResult(new DataConsistencyCheckResult( + checkName, + DataConsistencyCheckResult.StatusCode.Ok, + "All Transactions assigned to Income are positive", + new List())); + } + + var detailsBuilder = new List() + { + new string[3] { "Transaction Date", "Memo", "Amount" } + }; + + detailsBuilder.AddRange(results + .Select(i => new[] + { + i.Item3.TransactionDate.ToShortDateString(), + i.Item3.Memo, + i.Item3.Amount.ToString(CultureInfo.CurrentCulture) + })); + + return Task.FromResult(new DataConsistencyCheckResult( + checkName, + DataConsistencyCheckResult.StatusCode.Warning, + "Some Transactions assigned to Income are negative", + detailsBuilder)); + }); + } } \ No newline at end of file From 4cd9bd30da33c9bd621a252d1bf00172d8f915e6 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sat, 7 Oct 2023 11:12:09 +0200 Subject: [PATCH 03/57] Amounts displayed in consistent currency and number format #188 --- CHANGELOG.md | 1 + OpenBudgeteer.Blazor/Pages/Bucket.razor | 16 ++++++++-------- OpenBudgeteer.Blazor/Pages/Transaction.razor | 5 +++-- .../Shared/BucketDetailsDialog.razor | 3 ++- .../Shared/BucketSelectDialog.razor | 13 +++++++------ .../Shared/RecurringTransactionDialog.razor | 3 ++- .../Shared/TransactionDialog.razor | 3 ++- .../ViewModels/DataConsistencyViewModel.cs | 13 +++++++++---- 8 files changed, 34 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aaab93..14b2f0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### 1.8 (202x-xx-xx) * [Add] Data Consistency Check: Negative Transaction assigned to Income [#177](https://github.com/TheAxelander/OpenBudgeteer/issues/177) +* [Changed] Amounts displayed in consistent currency and number format [#188](https://github.com/TheAxelander/OpenBudgeteer/issues/188) ### 1.7 (2023-10-03) diff --git a/OpenBudgeteer.Blazor/Pages/Bucket.razor b/OpenBudgeteer.Blazor/Pages/Bucket.razor index f740141..a2d1a23 100644 --- a/OpenBudgeteer.Blazor/Pages/Bucket.razor +++ b/OpenBudgeteer.Blazor/Pages/Bucket.razor @@ -181,11 +181,11 @@ @bucketGroup.BucketGroup.Name - @bucketGroup.TotalBalance.ToString("N2") + @bucketGroup.TotalBalance.ToString("C", CultureInfo.CurrentCulture) - @(bucketGroup.TotalWant == 0 ? string.Empty : bucketGroup.TotalWant.ToString("N2")) - @(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("N2")) - @(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("N2")) + @(bucketGroup.TotalWant == 0 ? string.Empty : bucketGroup.TotalWant.ToString("C", CultureInfo.CurrentCulture)) + @(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("C", CultureInfo.CurrentCulture)) + @(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("C", CultureInfo.CurrentCulture)) @if (bucketGroup.IsHovered) { @@ -219,7 +219,7 @@
@bucket.Bucket.Name
} - @bucket.Balance.ToString("N2") + @bucket.Balance.ToString("C", CultureInfo.CurrentCulture) @if (bucket.Bucket.IsInactive) { @@ -232,9 +232,9 @@ @onkeyup="@(args => InOut_Changed(bucket, args))"/> } - @(bucket.Want == 0 ? string.Empty : bucket.Want.ToString("N2")) - @(bucket.In == 0 ? string.Empty : bucket.In.ToString("N2")) - @(bucket.Activity == 0 ? string.Empty : bucket.Activity.ToString("N2")) + @(bucket.Want == 0 ? string.Empty : bucket.Want.ToString("C", CultureInfo.CurrentCulture)) + @(bucket.In == 0 ? string.Empty : bucket.In.ToString("C", CultureInfo.CurrentCulture)) + @(bucket.Activity == 0 ? string.Empty : bucket.Activity.ToString("C", CultureInfo.CurrentCulture)) @if (bucket.IsProgressbarVisible) { diff --git a/OpenBudgeteer.Blazor/Pages/Transaction.razor b/OpenBudgeteer.Blazor/Pages/Transaction.razor index 62f10ba..b229d5d 100644 --- a/OpenBudgeteer.Blazor/Pages/Transaction.razor +++ b/OpenBudgeteer.Blazor/Pages/Transaction.razor @@ -3,6 +3,7 @@ @using OpenBudgeteer.Core.ViewModels @using Microsoft.EntityFrameworkCore @using System.Drawing +@using System.Globalization @using OpenBudgeteer.Core.Common @using OpenBudgeteer.Core.Common.Extensions @using OpenBudgeteer.Core.ViewModels.ItemViewModels @@ -188,13 +189,13 @@ @transaction.SelectedAccount.Name @transaction.Transaction.Payee @transaction.Transaction.Memo - @transaction.Transaction.Amount + @transaction.Transaction.Amount.ToString("C", CultureInfo.CurrentCulture) @foreach (var bucket in transaction.Buckets) {
@bucket.SelectedBucket.Name
-
@bucket.Amount
+
@bucket.Amount.ToString("C", CultureInfo.CurrentCulture)
} diff --git a/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor b/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor index 9cf2a06..d642d89 100644 --- a/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor @@ -3,6 +3,7 @@ @using ChartJs.Blazor.Charts @using OpenBudgeteer.Blazor.ViewModels @using OpenBudgeteer.Contracts.Models +@using System.Globalization @if (IsDialogVisible) { @@ -50,7 +51,7 @@ @transaction.SelectedAccount.Name @transaction.Transaction.Payee @transaction.Transaction.Memo - @transaction.Transaction.Amount + @transaction.Transaction.Amount.ToString("C", CultureInfo.CurrentCulture) } diff --git a/OpenBudgeteer.Blazor/Shared/BucketSelectDialog.razor b/OpenBudgeteer.Blazor/Shared/BucketSelectDialog.razor index f9a56cc..811da88 100644 --- a/OpenBudgeteer.Blazor/Shared/BucketSelectDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/BucketSelectDialog.razor @@ -1,5 +1,6 @@ @using OpenBudgeteer.Core.ViewModels @using System.Drawing +@using System.Globalization @using Microsoft.EntityFrameworkCore @using OpenBudgeteer.Contracts.Models @using OpenBudgeteer.Data @@ -47,9 +48,9 @@ @bucketGroup.BucketGroup.Name - @bucketGroup.TotalBalance.ToString("N2") - @(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("N2")) - @(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("N2")) + @bucketGroup.TotalBalance.ToString("C", CultureInfo.CurrentCulture) + @(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("C", CultureInfo.CurrentCulture)) + @(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("C", CultureInfo.CurrentCulture)) @@ -73,9 +74,9 @@ } - @bucket.Balance.ToString("N2") - @(bucket.In == 0 ? string.Empty : bucket.In.ToString("N2")) - @(bucket.Activity == 0 ? string.Empty : bucket.Activity.ToString("N2")) + @bucket.Balance.ToString("C", CultureInfo.CurrentCulture) + @(bucket.In == 0 ? string.Empty : bucket.In.ToString("C", CultureInfo.CurrentCulture)) + @(bucket.Activity == 0 ? string.Empty : bucket.Activity.ToString("C", CultureInfo.CurrentCulture)) @if (bucket.IsProgressbarVisible) { diff --git a/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor b/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor index 151fb2e..7e98106 100644 --- a/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor @@ -1,6 +1,7 @@ @using OpenBudgeteer.Core.Common @using OpenBudgeteer.Core.ViewModels @using System.Drawing +@using System.Globalization @using OpenBudgeteer.Core.ViewModels.ItemViewModels @if (IsDialogVisible) { @@ -87,7 +88,7 @@ @transaction.SelectedAccount.Name @transaction.Transaction.Payee @transaction.Transaction.Memo - @transaction.Transaction.Amount + @transaction.Transaction.Amount.ToString("C", CultureInfo.CurrentCulture) @if (transaction.IsHovered) { diff --git a/OpenBudgeteer.Blazor/Shared/TransactionDialog.razor b/OpenBudgeteer.Blazor/Shared/TransactionDialog.razor index 6535470..98ceaa1 100644 --- a/OpenBudgeteer.Blazor/Shared/TransactionDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/TransactionDialog.razor @@ -1,5 +1,6 @@ @using OpenBudgeteer.Core.ViewModels @using OpenBudgeteer.Contracts.Models +@using System.Globalization @if (IsDialogVisible) { @@ -35,7 +36,7 @@ @transaction.SelectedAccount.Name @transaction.Transaction.Payee @transaction.Transaction.Memo - @transaction.Transaction.Amount + @transaction.Transaction.Amount.ToString("C", CultureInfo.CurrentCulture) } diff --git a/OpenBudgeteer.Core/ViewModels/DataConsistencyViewModel.cs b/OpenBudgeteer.Core/ViewModels/DataConsistencyViewModel.cs index 6f753d4..8b63dd0 100644 --- a/OpenBudgeteer.Core/ViewModels/DataConsistencyViewModel.cs +++ b/OpenBudgeteer.Core/ViewModels/DataConsistencyViewModel.cs @@ -106,7 +106,12 @@ public async Task CheckBucketBalanceAsync() .Where(i => i.BucketId == bucket.BucketId) .Sum(i => i.Amount); results.Add(bucketBalance < 0 - ? new(DataConsistencyCheckResult.StatusCode.Warning, new string[2] { bucket.Name, bucketBalance.ToString(CultureInfo.CurrentCulture) }) + ? new(DataConsistencyCheckResult.StatusCode.Warning, + new string[2] + { + bucket.Name, + bucketBalance.ToString("C", CultureInfo.CurrentCulture) + }) : new(DataConsistencyCheckResult.StatusCode.Ok, Array.Empty())); })); } @@ -165,7 +170,7 @@ public async Task CheckBankTransactionWithoutBucketA { bankTransaction.TransactionDate.ToShortDateString(), bankTransaction.Memo, - bankTransaction.Amount.ToString(CultureInfo.CurrentCulture) + bankTransaction.Amount.ToString("C", CultureInfo.CurrentCulture) })); } })); @@ -258,7 +263,7 @@ public async Task CheckBudgetedTransactionOutsideOfV result.Item2, transaction.TransactionDate.ToShortDateString(), transaction.Memo, - transaction.Amount.ToString(CultureInfo.CurrentCulture) + transaction.Amount.ToString("C", CultureInfo.CurrentCulture) }); } } @@ -317,7 +322,7 @@ public async Task CheckNegativeBankTransactionAssign { i.Item3.TransactionDate.ToShortDateString(), i.Item3.Memo, - i.Item3.Amount.ToString(CultureInfo.CurrentCulture) + i.Item3.Amount.ToString("C", CultureInfo.CurrentCulture) })); return Task.FromResult(new DataConsistencyCheckResult( From 478d6ed6489b95cd596905f63948dff3ee1bb3b0 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sat, 7 Oct 2023 11:28:39 +0200 Subject: [PATCH 04/57] Fixed UI alignment for large numbers #189 --- CHANGELOG.md | 1 + OpenBudgeteer.Blazor/Pages/Transaction.razor | 4 ++-- OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor | 2 +- OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor | 2 +- OpenBudgeteer.Blazor/Shared/TransactionDialog.razor | 2 +- OpenBudgeteer.Blazor/wwwroot/css/custom.css | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b2f0a..95c2459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### 1.8 (202x-xx-xx) * [Add] Data Consistency Check: Negative Transaction assigned to Income [#177](https://github.com/TheAxelander/OpenBudgeteer/issues/177) * [Changed] Amounts displayed in consistent currency and number format [#188](https://github.com/TheAxelander/OpenBudgeteer/issues/188) +* [Fixed] UI alignment for large numbers [#189](https://github.com/TheAxelander/OpenBudgeteer/issues/189) ### 1.7 (2023-10-03) diff --git a/OpenBudgeteer.Blazor/Pages/Transaction.razor b/OpenBudgeteer.Blazor/Pages/Transaction.razor index b229d5d..c5a11ae 100644 --- a/OpenBudgeteer.Blazor/Pages/Transaction.razor +++ b/OpenBudgeteer.Blazor/Pages/Transaction.razor @@ -56,7 +56,7 @@ Account Payee Memo - Amount + Amount Buckets @@ -122,7 +122,7 @@ Account Payee Memo - Amount + Amount Buckets diff --git a/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor b/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor index d642d89..2cba57b 100644 --- a/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor @@ -40,7 +40,7 @@ Account Payee Memo - Amount + Amount diff --git a/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor b/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor index 7e98106..f4a14ae 100644 --- a/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor @@ -36,7 +36,7 @@ Account Payee Memo - Amount + Amount diff --git a/OpenBudgeteer.Blazor/Shared/TransactionDialog.razor b/OpenBudgeteer.Blazor/Shared/TransactionDialog.razor index 98ceaa1..89298a6 100644 --- a/OpenBudgeteer.Blazor/Shared/TransactionDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/TransactionDialog.razor @@ -25,7 +25,7 @@ Account Payee Memo - Amount + Amount diff --git a/OpenBudgeteer.Blazor/wwwroot/css/custom.css b/OpenBudgeteer.Blazor/wwwroot/css/custom.css index 488b0ad..9ff746f 100644 --- a/OpenBudgeteer.Blazor/wwwroot/css/custom.css +++ b/OpenBudgeteer.Blazor/wwwroot/css/custom.css @@ -31,7 +31,7 @@ table .header-row td, table .header-row th { text-align: right; } .col-bucket-numbers { - width: 90px; + width: 120px; } .col-buttons { text-align: right; From 8770d33ceea09b8751cc737aecbc594873eca520 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sat, 7 Oct 2023 11:37:13 +0200 Subject: [PATCH 05/57] Update appsettings.json --- .gitignore | 1 + OpenBudgeteer.Blazor/appsettings.Development.json | 10 ---------- OpenBudgeteer.Blazor/appsettings.json | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 OpenBudgeteer.Blazor/appsettings.Development.json diff --git a/.gitignore b/.gitignore index 8b3aafa..d3adfe1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ *.db-shm *.db-wal *.DS_Store +OpenBudgeteer.Blazor/appsettings.Development.json # User-specific files *.rsuser diff --git a/OpenBudgeteer.Blazor/appsettings.Development.json b/OpenBudgeteer.Blazor/appsettings.Development.json deleted file mode 100644 index 5173757..0000000 --- a/OpenBudgeteer.Blazor/appsettings.Development.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "DetailedErrors": true, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/OpenBudgeteer.Blazor/appsettings.json b/OpenBudgeteer.Blazor/appsettings.json index 5c88127..46f1b30 100644 --- a/OpenBudgeteer.Blazor/appsettings.json +++ b/OpenBudgeteer.Blazor/appsettings.json @@ -1,5 +1,5 @@ { - "CONNECTION_PROVIDER": "postgres", + "CONNECTION_PROVIDER": "TEMPDB", "APPSETTINGS_CULTURE": "en-US", "APPSETTINGS_THEME": "default", From 0c15959df49e6f0550ef2444f42e3cf9aeadcf21 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sat, 7 Oct 2023 11:53:57 +0200 Subject: [PATCH 06/57] Disable button display via hovering #155 --- CHANGELOG.md | 1 + OpenBudgeteer.Blazor/Pages/Bucket.razor | 36 ++++++++----------- OpenBudgeteer.Blazor/Pages/Rules.razor | 9 ++--- OpenBudgeteer.Blazor/Pages/Transaction.razor | 9 ++--- .../Shared/RecurringTransactionDialog.razor | 9 ++--- 5 files changed, 25 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95c2459..dfc0421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### 1.8 (202x-xx-xx) * [Add] Data Consistency Check: Negative Transaction assigned to Income [#177](https://github.com/TheAxelander/OpenBudgeteer/issues/177) * [Changed] Amounts displayed in consistent currency and number format [#188](https://github.com/TheAxelander/OpenBudgeteer/issues/188) +* [Changed] Buttons that appeared in the past only via hovering are now always displayed (was not working well, maybe additional rework in future) [#155](https://github.com/TheAxelander/OpenBudgeteer/issues/155) * [Fixed] UI alignment for large numbers [#189](https://github.com/TheAxelander/OpenBudgeteer/issues/189) ### 1.7 (2023-10-03) diff --git a/OpenBudgeteer.Blazor/Pages/Bucket.razor b/OpenBudgeteer.Blazor/Pages/Bucket.razor index a2d1a23..4ca8ad6 100644 --- a/OpenBudgeteer.Blazor/Pages/Bucket.razor +++ b/OpenBudgeteer.Blazor/Pages/Bucket.razor @@ -157,7 +157,7 @@ { - + @if (bucketGroup.InModification) { } @@ -206,7 +203,7 @@ @foreach (var bucket in bucketGroup.Buckets) { - + diff --git a/OpenBudgeteer.Blazor/Pages/Rules.razor b/OpenBudgeteer.Blazor/Pages/Rules.razor index f2c02ed..096f0bc 100644 --- a/OpenBudgeteer.Blazor/Pages/Rules.razor +++ b/OpenBudgeteer.Blazor/Pages/Rules.razor @@ -159,7 +159,7 @@ } else { - + @@ -172,11 +172,8 @@ } diff --git a/OpenBudgeteer.Blazor/Pages/Transaction.razor b/OpenBudgeteer.Blazor/Pages/Transaction.razor index c5a11ae..0ae12bb 100644 --- a/OpenBudgeteer.Blazor/Pages/Transaction.razor +++ b/OpenBudgeteer.Blazor/Pages/Transaction.razor @@ -184,7 +184,7 @@ } else { - + @@ -200,11 +200,8 @@ } } diff --git a/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor b/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor index f4a14ae..e8f04d8 100644 --- a/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/RecurringTransactionDialog.razor @@ -81,7 +81,7 @@ } else { - + @@ -90,11 +90,8 @@ } From 4058ac15ff411a2036236fb03b812e60b3f7f4a2 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sat, 7 Oct 2023 12:13:52 +0200 Subject: [PATCH 07/57] Create Transaction keeps last input date #187 --- CHANGELOG.md | 1 + OpenBudgeteer.Core/ViewModels/TransactionViewModel.cs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfc0421..0e238b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### 1.8 (202x-xx-xx) * [Add] Data Consistency Check: Negative Transaction assigned to Income [#177](https://github.com/TheAxelander/OpenBudgeteer/issues/177) +* [Add] Create Transaction keeps last input date [#187](https://github.com/TheAxelander/OpenBudgeteer/issues/187) * [Changed] Amounts displayed in consistent currency and number format [#188](https://github.com/TheAxelander/OpenBudgeteer/issues/188) * [Changed] Buttons that appeared in the past only via hovering are now always displayed (was not working well, maybe additional rework in future) [#155](https://github.com/TheAxelander/OpenBudgeteer/issues/155) * [Fixed] UI alignment for large numbers [#189](https://github.com/TheAxelander/OpenBudgeteer/issues/189) diff --git a/OpenBudgeteer.Core/ViewModels/TransactionViewModel.cs b/OpenBudgeteer.Core/ViewModels/TransactionViewModel.cs index ee54446..f8538a5 100644 --- a/OpenBudgeteer.Core/ViewModels/TransactionViewModel.cs +++ b/OpenBudgeteer.Core/ViewModels/TransactionViewModel.cs @@ -132,8 +132,8 @@ public TransactionViewModel(DbContextOptions dbOptions, YearMon { _dbOptions = dbOptions; _yearMonthViewModel = yearMonthViewModel; - ResetNewTransaction(); _transactions = new ObservableCollection(); + ResetNewTransaction(); //_yearMonthViewModel.SelectedYearMonthChanged += (sender) => { LoadData(); }; } @@ -281,7 +281,11 @@ public ViewModelOperationResult CreateItem() /// public void ResetNewTransaction() { + var lastEnteredDate = NewTransaction == null ? + _yearMonthViewModel.CurrentMonth : + NewTransaction.Transaction.TransactionDate; NewTransaction = new TransactionViewModelItem(_dbOptions, _yearMonthViewModel, true); + NewTransaction.Transaction.TransactionDate = lastEnteredDate; } /// From b1ce601d5b2a177420c072a426bc2ce0df7c4760 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sun, 15 Oct 2023 11:03:59 +0200 Subject: [PATCH 08/57] More responsive navigation bar #175 --- CHANGELOG.md | 1 + OpenBudgeteer.Blazor/Shared/MainLayout.razor | 39 +++++- OpenBudgeteer.Blazor/Shared/NavMenu.razor | 138 +++++++++---------- OpenBudgeteer.Blazor/wwwroot/css/custom.css | 8 ++ 4 files changed, 110 insertions(+), 76 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e238b3..309849d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * [Add] Create Transaction keeps last input date [#187](https://github.com/TheAxelander/OpenBudgeteer/issues/187) * [Changed] Amounts displayed in consistent currency and number format [#188](https://github.com/TheAxelander/OpenBudgeteer/issues/188) * [Changed] Buttons that appeared in the past only via hovering are now always displayed (was not working well, maybe additional rework in future) [#155](https://github.com/TheAxelander/OpenBudgeteer/issues/155) +* [Changed] More responsive navigation bar [#175](https://github.com/TheAxelander/OpenBudgeteer/issues/175) * [Fixed] UI alignment for large numbers [#189](https://github.com/TheAxelander/OpenBudgeteer/issues/189) ### 1.7 (2023-10-03) diff --git a/OpenBudgeteer.Blazor/Shared/MainLayout.razor b/OpenBudgeteer.Blazor/Shared/MainLayout.razor index ab3dedd..d5791f9 100644 --- a/OpenBudgeteer.Blazor/Shared/MainLayout.razor +++ b/OpenBudgeteer.Blazor/Shared/MainLayout.razor @@ -1,10 +1,45 @@ @inherits LayoutComponentBase +@using Microsoft.EntityFrameworkCore +@using OpenBudgeteer.Data +@inject DbContextOptions DbContextOptions
- +
@Body
-
\ No newline at end of file + + +@code { + + public string CurrentDatabase => new DatabaseContext(DbContextOptions).Database.GetDbConnection().Database; + +} \ No newline at end of file diff --git a/OpenBudgeteer.Blazor/Shared/NavMenu.razor b/OpenBudgeteer.Blazor/Shared/NavMenu.razor index c3f8e2d..8e6290d 100644 --- a/OpenBudgeteer.Blazor/Shared/NavMenu.razor +++ b/OpenBudgeteer.Blazor/Shared/NavMenu.razor @@ -1,75 +1,65 @@ -@using Microsoft.EntityFrameworkCore -@using OpenBudgeteer.Data -@inject DbContextOptions DbContextOptions - - - -@code { - - public string CurrentDatabase => new DatabaseContext(DbContextOptions).Database.GetDbConnection().Database; - -} + + + + + + diff --git a/OpenBudgeteer.Blazor/wwwroot/css/custom.css b/OpenBudgeteer.Blazor/wwwroot/css/custom.css index 9ff746f..7215eb6 100644 --- a/OpenBudgeteer.Blazor/wwwroot/css/custom.css +++ b/OpenBudgeteer.Blazor/wwwroot/css/custom.css @@ -92,6 +92,14 @@ button.btn-bucket { display: inline-block; /* restore setting from bootstrap 4 */ } +.nav-link { + white-space: nowrap; +} + +.navbar-toggler { + font-size: var(--bs-body-font-size); +} + .dropdown-item-sm { font-size: .875rem; /* Additional class to match font size of DropDownItem with SplitButton (btn-sm)*/ } From 837a365495173e13f5c27ff8bddd1859f8ec1f76 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Mon, 16 Oct 2023 16:10:06 +0200 Subject: [PATCH 09/57] Add demo data load for new databases #192 --- CHANGELOG.md | 1 + .../HostedDatabaseMigrator.cs | 5 + .../Initialization/DemoDataGenerator.cs | 455 ++++++++++++++++++ 3 files changed, 461 insertions(+) create mode 100644 OpenBudgeteer.Data/Initialization/DemoDataGenerator.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index fbbcc4e..71dcda8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### 1.8 (202x-xx-xx) * [Add] Data Consistency Check: Negative Transaction assigned to Income [#177](https://github.com/TheAxelander/OpenBudgeteer/issues/177) * [Add] Create Transaction keeps last input date [#187](https://github.com/TheAxelander/OpenBudgeteer/issues/187) +* [Add] An empty database can now be loaded with some demo data using `APPSETTINGS_DEMO_DATA: true` [#192](https://github.com/TheAxelander/OpenBudgeteer/issues/192) * [Changed] Amounts displayed in consistent currency and number format [#188](https://github.com/TheAxelander/OpenBudgeteer/issues/188) * [Changed] Buttons that appeared in the past only via hovering are now always displayed (was not working well, maybe additional rework in future) [#155](https://github.com/TheAxelander/OpenBudgeteer/issues/155) * [Changed] More responsive navigation bar [#175](https://github.com/TheAxelander/OpenBudgeteer/issues/175) diff --git a/OpenBudgeteer.Blazor/HostedDatabaseMigrator.cs b/OpenBudgeteer.Blazor/HostedDatabaseMigrator.cs index 246fec4..5250b17 100644 --- a/OpenBudgeteer.Blazor/HostedDatabaseMigrator.cs +++ b/OpenBudgeteer.Blazor/HostedDatabaseMigrator.cs @@ -16,6 +16,8 @@ public class HostedDatabaseMigrator : IHostedService private readonly IConfiguration _configuration; private readonly IDatabaseInitializer _databaseInitializer; private readonly IDatabaseOnlineChecker _onlineChecker; + + private const string APPSETTINGS_DEMO_DATA = "APPSETTINGS_DEMO_DATA"; public HostedDatabaseMigrator( DbContextOptions dbContextOptions, @@ -43,6 +45,9 @@ public async Task StartAsync(CancellationToken cancellationToken) await using var context = new DatabaseContext(_dbContextOptions); await context.Database.MigrateAsync(cancellationToken: cancellationToken); + + var initializeWithDemoData = _configuration.GetValue(APPSETTINGS_DEMO_DATA); + if (initializeWithDemoData) new DemoDataGenerator(_dbContextOptions).GenerateDemoData(); } public Task StopAsync(CancellationToken cancellationToken) diff --git a/OpenBudgeteer.Data/Initialization/DemoDataGenerator.cs b/OpenBudgeteer.Data/Initialization/DemoDataGenerator.cs new file mode 100644 index 0000000..a4403b7 --- /dev/null +++ b/OpenBudgeteer.Data/Initialization/DemoDataGenerator.cs @@ -0,0 +1,455 @@ +using System; +using System.Linq; +using Microsoft.EntityFrameworkCore; +using OpenBudgeteer.Contracts.Models; + +namespace OpenBudgeteer.Data.Initialization; + +public class DemoDataGenerator +{ + private readonly DbContextOptions _dbContextOptions; + + public DemoDataGenerator(DbContextOptions dbContextOptions) + { + _dbContextOptions = dbContextOptions; + } + + public void GenerateDemoData() + { + if (!IsDatabaseEmpty()) return; + + using var dbContext = new DatabaseContext(_dbContextOptions); + + // Create Accounts + var accountChecking = new Account() + { + AccountId = Guid.Empty, + Name = "Checking account", + IsActive = 1 + }; + var accountSavings = new Account() + { + AccountId = Guid.Empty, + Name = "Savings account", + IsActive = 1 + }; + dbContext.Account.AddRange(new []{ accountChecking, accountSavings }); + dbContext.SaveChanges(); + + // Create Buckets Groups + var bucketGroupRegularExpenses = new BucketGroup() + { + BucketGroupId = Guid.Empty, + Name = "Regular Expenses", + Position = 1 + }; + var bucketGroupSavings = new BucketGroup() + { + BucketGroupId = Guid.Empty, + Name = "Long Term Savings", + Position = 2 + }; + dbContext.BucketGroup.AddRange(new []{ bucketGroupRegularExpenses, bucketGroupSavings }); + dbContext.SaveChanges(); + + // Create Buckets + var firstOfThisMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); + var firstOfPreviousMonth = firstOfThisMonth.AddMonths(-1); + var bucketRent = new Bucket() + { + BucketId = Guid.Empty, + BucketGroupId = bucketGroupRegularExpenses.BucketGroupId, + Name = "Rent", + ValidFrom = firstOfPreviousMonth, + ColorCode = "IndianRed" + }; + var bucketHealthInsurance = new Bucket() + { + BucketId = Guid.Empty, + BucketGroupId = bucketGroupRegularExpenses.BucketGroupId, + Name = "Health Insurance", + ValidFrom = firstOfPreviousMonth, + ColorCode = "IndianRed" + }; + var bucketGroceries = new Bucket() + { + BucketId = Guid.Empty, + BucketGroupId = bucketGroupRegularExpenses.BucketGroupId, + Name = "Groceries", + ValidFrom = firstOfPreviousMonth, + ColorCode = "DarkOliveGreen" + }; + var bucketCarFuel = new Bucket() + { + BucketId = Guid.Empty, + BucketGroupId = bucketGroupRegularExpenses.BucketGroupId, + Name = "Car Fuel", + ValidFrom = firstOfPreviousMonth, + ColorCode = "DarkOliveGreen" + }; + var bucketVacationTrip = new Bucket() + { + BucketId = Guid.Empty, + BucketGroupId = bucketGroupSavings.BucketGroupId, + Name = "Vacation Trip", + ValidFrom = firstOfThisMonth, + ColorCode = "Goldenrod" + }; + var bucketReserves = new Bucket() + { + BucketId = Guid.Empty, + BucketGroupId = bucketGroupSavings.BucketGroupId, + Name = "Reserves", + ValidFrom = firstOfPreviousMonth, + ColorCode = "Orange" + }; + dbContext.Bucket.AddRange(new [] + { + bucketRent, bucketHealthInsurance, bucketGroceries, bucketCarFuel, + bucketVacationTrip, bucketReserves + }); + dbContext.SaveChanges(); + + // Create Bucket Versions + var bucketVersionRent = new BucketVersion() + { + BucketVersionId = Guid.Empty, + BucketId = bucketRent.BucketId, + BucketType = 2, + BucketTypeXParam = 1, + BucketTypeYParam = 400, + BucketTypeZParam = DateTime.MinValue, + ValidFrom = bucketRent.ValidFrom, + Version = 1 + }; + var bucketVersionHealthInsurance = new BucketVersion() + { + BucketVersionId = Guid.Empty, + BucketId = bucketHealthInsurance.BucketId, + BucketType = 3, + BucketTypeXParam = 3, + BucketTypeYParam = 150, + BucketTypeZParam = bucketHealthInsurance.ValidFrom.AddMonths(2), + ValidFrom = bucketHealthInsurance.ValidFrom, + Version = 1 + }; + var bucketVersionGroceries = new BucketVersion() + { + BucketVersionId = Guid.Empty, + BucketId = bucketGroceries.BucketId, + BucketType = 2, + BucketTypeXParam = 1, + BucketTypeYParam = 300, + BucketTypeZParam = DateTime.MinValue, + ValidFrom = bucketGroceries.ValidFrom, + Version = 1 + }; + var bucketVersionCarFuel = new BucketVersion() + { + BucketVersionId = Guid.Empty, + BucketId = bucketCarFuel.BucketId, + BucketType = 2, + BucketTypeXParam = 1, + BucketTypeYParam = 100, + BucketTypeZParam = DateTime.MinValue, + ValidFrom = bucketCarFuel.ValidFrom, + Version = 1 + }; + var bucketVersionVacationTrip = new BucketVersion() + { + BucketVersionId = Guid.Empty, + BucketId = bucketVacationTrip.BucketId, + BucketType = 4, + BucketTypeXParam = 0, + BucketTypeYParam = 600, + BucketTypeZParam = bucketVacationTrip.ValidFrom.AddMonths(5), + ValidFrom = bucketVacationTrip.ValidFrom, + Version = 1 + }; + var bucketVersionReserves = new BucketVersion() + { + BucketVersionId = Guid.Empty, + BucketId = bucketReserves.BucketId, + BucketType = 1, + BucketTypeXParam = 0, + BucketTypeYParam = 0, + BucketTypeZParam = DateTime.MinValue, + ValidFrom = bucketReserves.ValidFrom, + Version = 1 + }; + dbContext.BucketVersion.AddRange(new [] + { + bucketVersionRent, bucketVersionHealthInsurance, bucketVersionGroceries, bucketVersionCarFuel, + bucketVersionVacationTrip, bucketVersionReserves + }); + dbContext.SaveChanges(); + + // Create Bank Transactions + var transactionOpeningCheckingAccount = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(-1), + AccountId = accountChecking.AccountId, + Memo = "Opening Transaction", + Amount = new decimal(1500.35) + }; + var transactionSalary = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 28).AddMonths(-1), + AccountId = accountChecking.AccountId, + Memo = "Salary", + Amount = new decimal(2300.57) + }; + var transactionRent1 = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 10).AddMonths(-1), + AccountId = accountChecking.AccountId, + Memo = "Rent", + Amount = -400 + }; + var transactionRent2 = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 10), + AccountId = accountChecking.AccountId, + Memo = "Rent", + Amount = -400 + }; + var transactionGroceries1 = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 4).AddMonths(-1), + AccountId = accountChecking.AccountId, + Memo = "Supermarket", + Amount = new decimal(-23.87) + }; + var transactionGroceries2 = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 11).AddMonths(-1), + AccountId = accountChecking.AccountId, + Memo = "Supermarket", + Amount = new decimal(-40.34) + }; + var transactionGroceries3 = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 2), + AccountId = accountChecking.AccountId, + Memo = "Supermarket", + Amount = new decimal(-10.50) + }; + var transactionSplit = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 25).AddMonths(-1), + AccountId = accountChecking.AccountId, + Memo = "Weekend shopping", + Amount = new decimal(-170.51) + }; + var transactionTransfer1 = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 29).AddMonths(-1), + AccountId = accountChecking.AccountId, + Memo = "Bank Transfer", + Amount = -1500 + }; + var transactionTransfer2 = new BankTransaction() + { + TransactionId = Guid.Empty, + TransactionDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 29).AddMonths(-1), + AccountId = accountSavings.AccountId, + Memo = "Bank Transfer", + Amount = 1500 + }; + dbContext.BankTransaction.AddRange(new [] + { + transactionOpeningCheckingAccount, transactionSalary, + transactionRent1, transactionRent2, + transactionGroceries1, transactionGroceries2, transactionGroceries3, + transactionSplit, transactionTransfer1, transactionTransfer2 + }); + dbContext.SaveChanges(); + + // Create BucketMovements + var movementRent1 = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = firstOfPreviousMonth, + BucketId = bucketRent.BucketId, + Amount = 400 + }; + var movementRent2 = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = firstOfThisMonth, + BucketId = bucketRent.BucketId, + Amount = 400 + }; + var movementInsurance1 = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = firstOfPreviousMonth, + BucketId = bucketHealthInsurance.BucketId, + Amount = 50 + }; + var movementInsurance2 = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = firstOfThisMonth, + BucketId = bucketHealthInsurance.BucketId, + Amount = 50 + }; + var movementGroceries1 = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = firstOfPreviousMonth, + BucketId = bucketGroceries.BucketId, + Amount = 300 + }; + var movementGroceries2 = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = firstOfThisMonth, + BucketId = bucketGroceries.BucketId, + Amount = 300 + }; + var movementCarFuel1 = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = firstOfPreviousMonth, + BucketId = bucketCarFuel.BucketId, + Amount = 100 + }; + var movementCarFuel2 = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = firstOfThisMonth, + BucketId = bucketCarFuel.BucketId, + Amount = 100 + }; + var movementVacationTrip = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = firstOfThisMonth, + BucketId = bucketVacationTrip.BucketId, + Amount = 100 + }; + var movementReserves = new BucketMovement() + { + BucketMovementId = Guid.Empty, + MovementDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 28).AddMonths(-1), + BucketId = bucketReserves.BucketId, + Amount = 1000 + }; + dbContext.BucketMovement.AddRange(new [] + { + movementRent1, movementInsurance1, movementGroceries1, movementCarFuel1, movementVacationTrip, movementReserves, + movementRent2, movementInsurance2, movementGroceries2, movementCarFuel2 + }); + dbContext.SaveChanges(); + + // Create BudgetedTransactions + + var budgetedTransactionOpeningCheckingAccount = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionOpeningCheckingAccount.TransactionId, + BucketId = new Guid("00000000-0000-0000-0000-000000000001"), + Amount = transactionOpeningCheckingAccount.Amount + }; + var budgetedTransactionSalary = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionSalary.TransactionId, + BucketId = new Guid("00000000-0000-0000-0000-000000000001"), + Amount = transactionSalary.Amount + }; + var budgetedTransactionRent1 = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionRent1.TransactionId, + BucketId = bucketRent.BucketId, + Amount = transactionRent1.Amount + }; + var budgetedTransactionRent2 = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionRent2.TransactionId, + BucketId = bucketRent.BucketId, + Amount = transactionRent2.Amount + }; + var budgetedTransactionGroceries1 = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionGroceries1.TransactionId, + BucketId = bucketGroceries.BucketId, + Amount = transactionGroceries1.Amount + }; + var budgetedTransactionGroceries2 = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionGroceries2.TransactionId, + BucketId = bucketGroceries.BucketId, + Amount = transactionGroceries2.Amount + }; + var budgetedTransactionGroceries3 = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionGroceries3.TransactionId, + BucketId = bucketGroceries.BucketId, + Amount = transactionGroceries3.Amount + }; + var budgetedTransactionSplit1 = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionSplit.TransactionId, + BucketId = bucketCarFuel.BucketId, + Amount = new decimal(-90.86) + }; + var budgetedTransactionSplit2 = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionSplit.TransactionId, + BucketId = bucketGroceries.BucketId, + Amount = transactionSplit.Amount - budgetedTransactionSplit1.Amount + }; + var budgetedTransactionTransfer1 = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionTransfer1.TransactionId, + BucketId = new Guid("00000000-0000-0000-0000-000000000002"), + Amount = transactionTransfer1.Amount + }; + var budgetedTransactionTransfer2 = new BudgetedTransaction() + { + BudgetedTransactionId = Guid.Empty, + TransactionId = transactionTransfer2.TransactionId, + BucketId = new Guid("00000000-0000-0000-0000-000000000002"), + Amount = transactionTransfer2.Amount + }; + dbContext.BudgetedTransaction.AddRange(new [] + { + budgetedTransactionOpeningCheckingAccount, budgetedTransactionSalary, budgetedTransactionRent1, + budgetedTransactionRent2, budgetedTransactionGroceries1, budgetedTransactionGroceries2, + budgetedTransactionGroceries3, budgetedTransactionSplit1, budgetedTransactionSplit2, + budgetedTransactionTransfer1, budgetedTransactionTransfer2 + }); + dbContext.SaveChanges(); + } + + private bool IsDatabaseEmpty() + { + using var dbContext = new DatabaseContext(_dbContextOptions); + if (dbContext.Account.Any()) return false; + if (dbContext.Bucket.Any(i => i.BucketGroupId != new Guid("00000000-0000-0000-0000-000000000001"))) return false; + if (dbContext.BankTransaction.Any()) return false; + if (dbContext.BucketMovement.Any()) return false; + if (dbContext.BudgetedTransaction.Any()) return false; + + return true; + } +} \ No newline at end of file From e6e49bc1b1576fd17a81feea104f04450153f5f2 Mon Sep 17 00:00:00 2001 From: Luca Berneking Date: Wed, 1 Nov 2023 16:51:37 +0100 Subject: [PATCH 10/57] Fix Mapping Rules with Account Name Allows to create mapping rules based on the account name of the transaction --- .../ViewModels/ItemViewModels/TransactionViewModelItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenBudgeteer.Core/ViewModels/ItemViewModels/TransactionViewModelItem.cs b/OpenBudgeteer.Core/ViewModels/ItemViewModels/TransactionViewModelItem.cs index 63e196e..fb6a8e1 100644 --- a/OpenBudgeteer.Core/ViewModels/ItemViewModels/TransactionViewModelItem.cs +++ b/OpenBudgeteer.Core/ViewModels/ItemViewModels/TransactionViewModelItem.cs @@ -579,7 +579,7 @@ string GetFieldValue(int comparisionField) { return (comparisionField switch { - 1 => Transaction.AccountId.ToString(), + 1 => SelectedAccount?.Name ?? "", 2 => Transaction.Payee, 3 => Transaction.Memo, 4 => Transaction.Amount.ToString(CultureInfo.CurrentCulture), From bca6733091b0d644958bbd5a80bca681da521a58 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Thu, 2 Nov 2023 10:21:08 +0100 Subject: [PATCH 11/57] Add #199 to CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71dcda8..106a0a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * [Changed] Buttons that appeared in the past only via hovering are now always displayed (was not working well, maybe additional rework in future) [#155](https://github.com/TheAxelander/OpenBudgeteer/issues/155) * [Changed] More responsive navigation bar [#175](https://github.com/TheAxelander/OpenBudgeteer/issues/175) * [Fixed] UI alignment for large numbers [#189](https://github.com/TheAxelander/OpenBudgeteer/issues/189) +* [Fixed] Mapping Rules using the Account Name instead of Account Id [#199](https://github.com/TheAxelander/OpenBudgeteer/pull/199) Thanks [Lucaber](https://github.com/Lucaber) ### 1.7.1 (2023-10-16) From fbdaa77b83c4064641d441f398cdccd82ff404b4 Mon Sep 17 00:00:00 2001 From: Luca Berneking Date: Thu, 2 Nov 2023 22:09:28 +0100 Subject: [PATCH 12/57] Fix adding a mapping rule to an existing RuleSet Adding a new mapping rule to an existing rule set failed due to the missing `BucketRuleSetId` in the new mapping rule. ``` info: 11/2/2023 21:57:07.541 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (0ms) [Parameters=[@p0='5218bcea-c96c-4278-8ab1-153b3bc26ec0', @p1='37f1851c-2100-4350-8785-2f3e736a2fc3', @p2='1', @p3='1', @p4='foo' (Nullable = false) (Size = 3)], CommandType='Text', CommandTimeout='30'] INSERT INTO "MappingRule" ("MappingRuleId", "BucketRuleSetId", "ComparisionField", "ComparisionType", "ComparisionValue") VALUES (@p0, @p1, @p2, @p3, @p4); fail: 11/2/2023 21:57:07.542 RelationalEventId.CommandError[20102] (Microsoft.EntityFrameworkCore.Database.Command) Failed executing DbCommand (0ms) [Parameters=[@p0='a54fa405-376d-4c79-acd4-4851e1d68100', @p1='00000000-0000-0000-0000-000000000000', @p2='2', @p3='1', @p4='asd' (Nullable = false) (Size = 3)], CommandType='Text', CommandTimeout='30'] INSERT INTO "MappingRule" ("MappingRuleId", "BucketRuleSetId", "ComparisionField", "ComparisionType", "ComparisionValue") VALUES (@p0, @p1, @p2, @p3, @p4); fail: 11/2/2023 21:57:07.542 CoreEventId.SaveChangesFailed[10000] (Microsoft.EntityFrameworkCore.Update) An exception occurred in the database while saving changes for context type 'OpenBudgeteer.Data.DatabaseContext'. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 19: 'FOREIGN KEY constraint failed'. ``` --- .../ViewModels/ItemViewModels/RuleSetViewModelItem.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/OpenBudgeteer.Core/ViewModels/ItemViewModels/RuleSetViewModelItem.cs b/OpenBudgeteer.Core/ViewModels/ItemViewModels/RuleSetViewModelItem.cs index e60dff4..133ef03 100644 --- a/OpenBudgeteer.Core/ViewModels/ItemViewModels/RuleSetViewModelItem.cs +++ b/OpenBudgeteer.Core/ViewModels/ItemViewModels/RuleSetViewModelItem.cs @@ -168,10 +168,6 @@ public ViewModelOperationResult CreateUpdateRuleSetItem() // CREATE if (dbContext.CreateBucketRuleSet(RuleSet) == 0) throw new Exception("Rule could not be created in database."); - foreach (var mappingRule in MappingRules) - { - mappingRule.MappingRule.BucketRuleSetId = RuleSet.BucketRuleSetId; - } } else { @@ -180,15 +176,13 @@ public ViewModelOperationResult CreateUpdateRuleSetItem() i.BucketRuleSetId == RuleSet.BucketRuleSetId)); dbContext.UpdateBucketRuleSet(RuleSet); - foreach (var mappingRule in MappingRules) - { - mappingRule.GenerateRuleOutput(); - } } foreach (var mappingRuleViewModelItem in MappingRules) { mappingRuleViewModelItem.MappingRule.MappingRuleId = Guid.Empty; + mappingRuleViewModelItem.MappingRule.BucketRuleSetId = RuleSet.BucketRuleSetId; + mappingRuleViewModelItem.GenerateRuleOutput(); } dbContext.CreateMappingRules(MappingRules .Select(i => i.MappingRule) From d20c9f89c43e973ceeb5940e8ebbb5f06ef263bb Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Fri, 10 Nov 2023 22:58:24 +0100 Subject: [PATCH 13/57] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 106a0a2..30d2def 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * [Changed] More responsive navigation bar [#175](https://github.com/TheAxelander/OpenBudgeteer/issues/175) * [Fixed] UI alignment for large numbers [#189](https://github.com/TheAxelander/OpenBudgeteer/issues/189) * [Fixed] Mapping Rules using the Account Name instead of Account Id [#199](https://github.com/TheAxelander/OpenBudgeteer/pull/199) Thanks [Lucaber](https://github.com/Lucaber) +* [Fixed] Adding a Mapping Rule to an existing Rule Set failed [#200](https://github.com/TheAxelander/OpenBudgeteer/pull/200) Thanks [Lucaber](https://github.com/Lucaber) ### 1.7.1 (2023-10-16) From 34c99f9208ff7735cddc73c9b523603985b5bfcd Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Fri, 10 Nov 2023 23:02:03 +0100 Subject: [PATCH 14/57] Implemented Repository pattern #139 and first ViewModel refactoring #195 --- .../HostedDatabaseMigrator.cs | 6 +- .../OpenBudgeteer.Blazor.csproj | 7 +- OpenBudgeteer.Blazor/Pages/Account.razor | 91 +-- OpenBudgeteer.Blazor/Pages/Account.razor.cs | 90 ++ OpenBudgeteer.Blazor/Pages/Bucket.razor | 194 +---- OpenBudgeteer.Blazor/Pages/Bucket.razor.cs | 173 ++++ .../Pages/DataConsistency.razor | 23 +- .../Pages/DataConsistency.razor.cs | 24 + OpenBudgeteer.Blazor/Pages/Import.razor | 307 +------ OpenBudgeteer.Blazor/Pages/Import.razor.cs | 313 +++++++ OpenBudgeteer.Blazor/Pages/Index.razor | 35 +- OpenBudgeteer.Blazor/Pages/Index.razor.cs | 35 + OpenBudgeteer.Blazor/Pages/Report.razor | 24 - OpenBudgeteer.Blazor/Pages/Report.razor.cs | 32 + OpenBudgeteer.Blazor/Pages/Rules.razor | 121 +-- OpenBudgeteer.Blazor/Pages/Rules.razor.cs | 118 +++ OpenBudgeteer.Blazor/Pages/Transaction.razor | 186 +---- .../Pages/Transaction.razor.cs | 184 +++++ OpenBudgeteer.Blazor/Pages/_Host.cshtml | 1 - OpenBudgeteer.Blazor/Pages/_Layout.cshtml | 1 - OpenBudgeteer.Blazor/Program.cs | 4 - .../Shared/BucketDetailsDialog.razor | 10 +- .../Shared/BucketSelectDialog.razor | 11 +- .../Shared/DeleteConfirmationDialog.razor | 7 +- .../Shared/EditAccountDialog.razor | 6 +- .../Shared/EditBucketDialog.razor | 45 +- .../Shared/ErrorMessageDialog.razor | 5 +- OpenBudgeteer.Blazor/Shared/InfoDialog.razor | 4 +- OpenBudgeteer.Blazor/Shared/MainLayout.razor | 2 +- .../Shared/NewBucketGroupDialog.razor | 7 +- .../Shared/RecurringTransactionDialog.razor | 37 +- .../Shared/TransactionDialog.razor | 12 +- .../Shared/YearMonthSelector.razor | 5 +- OpenBudgeteer.Blazor/Startup.cs | 15 +- .../BlazorBucketStatisticsViewModel.cs | 33 +- ...wModel.cs => BlazorReportPageViewModel.cs} | 167 ++-- OpenBudgeteer.Contracts/Models/Account.cs | 27 - .../Models/BankTransaction.cs | 61 -- OpenBudgeteer.Contracts/Models/BaseObject.cs | 26 - OpenBudgeteer.Contracts/Models/Bucket.cs | 70 -- OpenBudgeteer.Contracts/Models/BucketGroup.cs | 29 - .../Models/BucketMovement.cs | 54 -- .../Models/BucketRuleSet.cs | 44 - .../Models/BucketVersion.cs | 139 ---- .../Models/BudgetedTransaction.cs | 53 -- .../Models/ImportProfile.cs | 173 ---- .../OpenBudgeteer.Core.Data.Contracts.csproj | 13 + .../Repositories/IAccountRepository.cs | 8 + .../IBankTransactionRepository.cs | 8 + .../Repositories/IBaseRepository.cs | 17 + .../Repositories/IBucketGroupRepository.cs | 8 + .../Repositories/IBucketMovementRepository.cs | 8 + .../Repositories/IBucketRepository.cs | 8 + .../Repositories/IBucketRuleSetRepository.cs | 8 + .../Repositories/IBucketVersionRepository.cs | 8 + .../IBudgetedTransactionRepository.cs | 8 + .../Repositories/IImportProfileRepository.cs | 8 + .../Repositories/IMappingRuleRepository.cs | 8 + .../IRecurringBankTransactionRepository.cs | 8 + .../Repositories/IRepositoryManager.cs | 16 + .../Services/IAccountService.cs | 9 + .../Services/IBankTransactionService.cs | 13 + .../Services/IBaseService.cs | 14 + .../Services/IBucketGroupService.cs | 11 + .../Services/IBucketMovementService.cs | 10 + .../Services/IBucketRuleSetService.cs | 10 + .../Services/IBucketService.cs | 17 + .../Services/IBudgetedTransactionService.cs | 18 + .../Services/IImportProfileService.cs | 8 + .../IRecurringBankTransactionService.cs | 9 + .../Services/IServiceManager.cs | 14 + .../DatabaseContext.cs | 22 + .../Models/Account.cs | 15 + .../Models/BankTransaction.cs | 25 + .../Models/Bucket.cs | 30 + .../Models/BucketGroup.cs | 16 + .../Models/BucketMovement.cs | 21 + .../Models/BucketRuleSet.cs | 21 + .../Models/BucketVersion.cs | 34 + .../Models/BudgetedTransaction.cs | 24 + .../Models/IEntity.cs | 6 + .../Models/ImportProfile.cs | 47 ++ .../Models/MappingRule.cs | 56 +- .../Models/RecurringBankTransaction.cs | 93 +-- .../OpenBudgeteer.Core.Data.Entities.csproj | 13 + .../20200605093534_InitialCreate.Designer.cs | 6 +- .../20200605093534_InitialCreate.cs | 2 +- ...0200608152707_DecimalPrecision.Designer.cs | 6 +- .../20200608152707_DecimalPrecision.cs | 2 +- ...00612082229_FixedBucketVersion.Designer.cs | 6 +- .../20200612082229_FixedBucketVersion.cs | 2 +- ...04_DefaultIncomeTransferBucket.Designer.cs | 6 +- ...00622121904_DefaultIncomeTransferBucket.cs | 2 +- .../20200701071320_BucketColor.Designer.cs | 6 +- .../20200701071320_BucketColor.cs | 2 +- ...0200701133458_DateTimeDataType.Designer.cs | 6 +- .../20200701133458_DateTimeDataType.cs | 2 +- ...4081215_ImportProfileDelimiter.Designer.cs | 6 +- .../20200704081215_ImportProfileDelimiter.cs | 2 +- ..._ImportProfileDateNumberFormat.Designer.cs | 6 +- ...707141613_ImportProfileDateNumberFormat.cs | 2 +- .../20200723111131_BucketNotes.Designer.cs | 6 +- .../20200723111131_BucketNotes.cs | 2 +- ...2402_AutomaticBucketAssignment.Designer.cs | 6 +- ...0200822152402_AutomaticBucketAssignment.cs | 2 +- ...20213195537_ImportCreditColumn.Designer.cs | 3 +- .../20220213195537_ImportCreditColumn.cs | 2 +- ...03950_RecurringBankTransaction.Designer.cs | 10 +- ...20220625103950_RecurringBankTransaction.cs | 8 +- ...ImportProfileAdditionalSetting.Designer.cs | 10 +- ...25200805_ImportProfileAdditionalSetting.cs | 6 +- .../20230211161733_GuidKeys.Designer.cs | 10 +- .../20230211161733_GuidKeys.cs | 8 +- ...48_CleanupGuidMigrationColumns.Designer.cs | 10 +- ...30211165848_CleanupGuidMigrationColumns.cs | 8 +- .../20230215072945_AddForeignKey.Designer.cs | 10 +- .../20230215072945_AddForeignKey.cs | 6 +- .../DatabaseServiceModelSnapshot.cs | 3 +- ...udgeteer.Core.Data.MySql.Migrations.csproj | 4 +- .../20230509101553_InitialCreate.Designer.cs | 63 +- .../20230509101553_InitialCreate.cs | 2 +- .../20230509110446_InitialData.Designer.cs | 63 +- .../20230509110446_InitialData.cs | 2 +- .../DatabaseContextModelSnapshot.cs | 63 +- ...eteer.Core.Data.Postgres.Migrations.csproj | 4 +- .../AccountRepository.cs | 12 + .../BankTransactionRepository.cs | 31 + .../BaseRepository.cs | 61 ++ .../BucketGroupRepository.cs | 27 + .../BucketMovementRepository.cs | 12 + .../BucketRepository.cs | 30 + .../BucketRuleSetRepository.cs | 31 + .../BucketVersionRepository.cs | 12 + .../BudgetedTransactionRepository.cs | 31 + .../ImportProfileRepository.cs | 31 + .../MappingRuleRepository.cs | 12 + .../OpenBudgeteer.Core.Data.Repository.csproj | 13 + .../RecurringBankTransactionRepository.cs | 31 + .../AccountService.cs | 83 ++ .../BankTransactionService.cs | 183 +++++ .../BaseService.cs | 125 +++ .../BucketGroupService.cs | 215 +++++ .../BucketMovementService.cs | 60 ++ .../BucketRuleSetService.cs | 156 ++++ .../BucketService.cs | 404 +++++++++ .../BudgetedTransactionService.cs | 167 ++++ .../ImportProfileService.cs | 16 + .../OpenBudgeteer.Core.Data.Services.csproj | 15 + .../RecurringBankTransactionService.cs | 99 +++ .../ServiceManager.cs | 42 + .../20200925091603_InitialCreate.Designer.cs | 3 +- .../20200925091603_InitialCreate.cs | 2 +- ...200925091907_AddInitialRecords.Designer.cs | 3 +- .../20200925091907_AddInitialRecords.cs | 2 +- ...20213195523_ImportCreditColumn.Designer.cs | 3 +- .../20220213195523_ImportCreditColumn.cs | 2 +- ...04034_RecurringBankTransaction.Designer.cs | 3 +- ...20220625104034_RecurringBankTransaction.cs | 2 +- ...ImportProfileAdditionalSetting.Designer.cs | 3 +- ...25200835_ImportProfileAdditionalSetting.cs | 2 +- .../20230211163815_GuidKeysStep1.Designer.cs | 3 +- .../20230211163815_GuidKeysStep1.cs | 2 +- .../20230211163906_GuidKeysStep2.Designer.cs | 3 +- .../20230211163906_GuidKeysStep2.cs | 2 +- .../20230211164007_GuidKeysStep3.Designer.cs | 3 +- .../20230211164007_GuidKeysStep3.cs | 2 +- .../20230211165645_GuidKeysStep4.Designer.cs | 3 +- .../20230211165645_GuidKeysStep4.cs | 2 +- .../20230215072958_AddForeignKey.Designer.cs | 3 +- .../20230215072958_AddForeignKey.cs | 2 +- ...dgeteer.Core.Data.Sqlite.Migrations.csproj | 4 +- .../SqliteDatabaseContextModelSnapshot.cs | 3 +- .../ConfigurationKeyConstants.cs | 2 +- .../DatabaseInitializationExtensions.cs | 7 +- .../DbContextOptionsFactory.cs | 13 +- .../DesignTimeDbContext.cs | 3 +- .../Initialization/DemoDataGenerator.cs | 203 ++--- .../Initialization/IDatabaseInitializer.cs | 2 +- .../MariaDbDatabaseInitializer.cs | 2 +- .../Initialization/NoOpDatabaseInitializer.cs | 2 +- .../PostgresDatabaseInitializer.cs | 2 +- .../OnlineChecker/IDatabaseOnlineChecker.cs | 2 +- .../OnlineChecker/NoopOnlineChecker.cs | 2 +- .../OnlineChecker/PingPortOnlineChecker.cs | 2 +- .../OnlineChecker/PostgresOnlineChecker.cs | 2 +- .../OpenBudgeteer.Core.Data.csproj | 10 +- OpenBudgeteer.Core.Test/DbConnector.cs | 44 - .../Extension/DeleteAllExtension.cs | 19 + .../OpenBudgeteer.Core.Test.csproj | 9 +- OpenBudgeteer.Core.Test/TestServiceManager.cs | 116 +++ .../AccountViewModelIsolatedTest.cs | 36 +- .../ViewModelTest/AccountViewModelTest.cs | 57 +- .../ViewModelTest/BaseTest.cs | 20 + .../BucketViewModelIsolatedTest.cs | 104 +-- .../ViewModelTest/BucketViewModelTest.cs | 770 +++++++++--------- .../ViewModelTest/ImportDataViewModelTest.cs | 581 +++++++------ .../ViewModelTest/TransactionViewModelTest.cs | 170 ++-- .../YearMonthSelectorViewModelTest.cs | 14 +- .../Common/CsvBankTransactionMapping.cs | 126 +++ .../Common}/DataConsistencyCheckResult.cs | 2 +- .../Common/EventClasses/AmountChangedArgs.cs | 8 +- .../DeleteAssignmentRequestArgs.cs | 8 +- .../Extensions/DuplicateMatchComparer.cs | 25 + .../Common/Extensions/StringValueAttribute.cs | 2 +- .../Common/Extensions/TransactionFilter.cs | 18 + .../Common/ParsedBankTransaction.cs | 23 + OpenBudgeteer.Core/OpenBudgeteer.Core.csproj | 5 +- .../ViewModels/AccountViewModel.cs | 96 --- .../ViewModels/BucketViewModel.cs | 447 ---------- .../EntityViewModels/AccountViewModel.cs | 122 +++ .../BucketGroupViewModel.cs} | 93 +-- .../EntityViewModels/BucketViewModel.cs | 507 ++++++++++++ .../EntityViewModels/MappingRuleViewModel.cs | 30 + .../PartialBucketViewModel.cs | 131 +++ .../RecurringTransactionViewModel.cs | 317 +++++++ .../EntityViewModels/RuleSetViewModel.cs | 218 +++++ .../EntityViewModels/TransactionViewModel.cs | 561 +++++++++++++ .../{ => Helper}/BucketDetailsViewModel.cs | 106 +-- .../Helper/BucketListingViewModel.cs | 105 +++ .../RecurringTransactionHandlerViewModel.cs} | 49 +- .../Helper/TransactionListingViewModel.cs | 139 ++++ .../YearMonthSelectorViewModel.cs | 24 +- .../ItemViewModels/AccountViewModelItem.cs | 102 --- .../ItemViewModels/BucketViewModelItem.cs | 746 ----------------- .../MappingRuleViewModelItem.cs | 61 -- ...onthlyBucketExpensesReportViewModelItem.cs | 38 - .../PartialBucketViewModelItem.cs | 135 --- .../RecurringTransactionViewModelItem.cs | 317 ------- .../ItemViewModels/RuleSetViewModelItem.cs | 214 ----- .../TransactionViewModelItem.cs | 590 -------------- .../PageViewModels/AccountPageViewModel.cs | 62 ++ .../PageViewModels/BucketPageViewModel.cs | 333 ++++++++ .../DataConsistencyPageViewModel.cs} | 176 ++-- .../ImportPageViewModel.cs} | 277 ++----- .../PageViewModels/ReportPageViewModel.cs | 262 ++++++ .../RulesPageViewModel.cs} | 101 ++- .../TransactionPageViewModel.cs | 252 ++++++ .../ViewModels/ReportViewModel.cs | 266 ------ .../ViewModels/TransactionViewModel.cs | 423 ---------- .../ViewModels/ViewModelBase.cs | 14 +- OpenBudgeteer.Data/DatabaseContext.cs | 387 --------- OpenBudgeteer.sln | 36 +- 242 files changed, 8571 insertions(+), 7609 deletions(-) create mode 100644 OpenBudgeteer.Blazor/Pages/Account.razor.cs create mode 100644 OpenBudgeteer.Blazor/Pages/Bucket.razor.cs create mode 100644 OpenBudgeteer.Blazor/Pages/DataConsistency.razor.cs create mode 100644 OpenBudgeteer.Blazor/Pages/Import.razor.cs create mode 100644 OpenBudgeteer.Blazor/Pages/Index.razor.cs create mode 100644 OpenBudgeteer.Blazor/Pages/Report.razor.cs create mode 100644 OpenBudgeteer.Blazor/Pages/Rules.razor.cs create mode 100644 OpenBudgeteer.Blazor/Pages/Transaction.razor.cs rename OpenBudgeteer.Blazor/ViewModels/{BlazorReportViewModel.cs => BlazorReportPageViewModel.cs} (71%) delete mode 100644 OpenBudgeteer.Contracts/Models/Account.cs delete mode 100644 OpenBudgeteer.Contracts/Models/BankTransaction.cs delete mode 100644 OpenBudgeteer.Contracts/Models/BaseObject.cs delete mode 100644 OpenBudgeteer.Contracts/Models/Bucket.cs delete mode 100644 OpenBudgeteer.Contracts/Models/BucketGroup.cs delete mode 100644 OpenBudgeteer.Contracts/Models/BucketMovement.cs delete mode 100644 OpenBudgeteer.Contracts/Models/BucketRuleSet.cs delete mode 100644 OpenBudgeteer.Contracts/Models/BucketVersion.cs delete mode 100644 OpenBudgeteer.Contracts/Models/BudgetedTransaction.cs delete mode 100644 OpenBudgeteer.Contracts/Models/ImportProfile.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/OpenBudgeteer.Core.Data.Contracts.csproj create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IAccountRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IBankTransactionRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IBaseRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IBucketGroupRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IBucketMovementRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IBucketRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IBucketRuleSetRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IBucketVersionRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IBudgetedTransactionRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IImportProfileRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IMappingRuleRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IRecurringBankTransactionRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Repositories/IRepositoryManager.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IAccountService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IBankTransactionService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IBaseService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IBucketGroupService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IBucketMovementService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IBucketRuleSetService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IBucketService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IBudgetedTransactionService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IImportProfileService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IRecurringBankTransactionService.cs create mode 100644 OpenBudgeteer.Core.Data.Contracts/Services/IServiceManager.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/DatabaseContext.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/Account.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/BankTransaction.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/Bucket.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/BucketGroup.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/BucketMovement.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/BucketRuleSet.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/BucketVersion.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/BudgetedTransaction.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/IEntity.cs create mode 100644 OpenBudgeteer.Core.Data.Entities/Models/ImportProfile.cs rename {OpenBudgeteer.Contracts => OpenBudgeteer.Core.Data.Entities}/Models/MappingRule.cs (59%) rename {OpenBudgeteer.Contracts => OpenBudgeteer.Core.Data.Entities}/Models/RecurringBankTransaction.cs (51%) create mode 100644 OpenBudgeteer.Core.Data.Entities/OpenBudgeteer.Core.Data.Entities.csproj rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200605093534_InitialCreate.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200605093534_InitialCreate.cs (99%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200608152707_DecimalPrecision.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200608152707_DecimalPrecision.cs (97%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200612082229_FixedBucketVersion.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200612082229_FixedBucketVersion.cs (90%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200622121904_DefaultIncomeTransferBucket.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200622121904_DefaultIncomeTransferBucket.cs (95%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200701071320_BucketColor.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200701071320_BucketColor.cs (90%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200701133458_DateTimeDataType.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200701133458_DateTimeDataType.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200704081215_ImportProfileDelimiter.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200704081215_ImportProfileDelimiter.cs (94%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200707141613_ImportProfileDateNumberFormat.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200707141613_ImportProfileDateNumberFormat.cs (93%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200723111131_BucketNotes.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200723111131_BucketNotes.cs (90%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200822152402_AutomaticBucketAssignment.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20200822152402_AutomaticBucketAssignment.cs (97%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20220213195537_ImportCreditColumn.Designer.cs (99%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20220213195537_ImportCreditColumn.cs (99%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20220625103950_RecurringBankTransaction.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20220625103950_RecurringBankTransaction.cs (95%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20221125200805_ImportProfileAdditionalSetting.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20221125200805_ImportProfileAdditionalSetting.cs (94%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20230211161733_GuidKeys.Designer.cs (99%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20230211161733_GuidKeys.cs (99%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20230211165848_CleanupGuidMigrationColumns.Designer.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20230211165848_CleanupGuidMigrationColumns.cs (99%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20230215072945_AddForeignKey.Designer.cs (99%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/20230215072945_AddForeignKey.cs (98%) rename {OpenBudgeteer.Data.MySql.Migrations => OpenBudgeteer.Core.Data.MySql.Migrations}/DatabaseServiceModelSnapshot.cs (99%) rename OpenBudgeteer.Data.MySql.Migrations/OpenBudgeteer.Data.MySql.Migrations.csproj => OpenBudgeteer.Core.Data.MySql.Migrations/OpenBudgeteer.Core.Data.MySql.Migrations.csproj (85%) rename {OpenBudgeteer.Data.Postgres.Migrations => OpenBudgeteer.Core.Data.Postgres.Migrations}/20230509101553_InitialCreate.Designer.cs (87%) rename {OpenBudgeteer.Data.Postgres.Migrations => OpenBudgeteer.Core.Data.Postgres.Migrations}/20230509101553_InitialCreate.cs (99%) rename {OpenBudgeteer.Data.Postgres.Migrations => OpenBudgeteer.Core.Data.Postgres.Migrations}/20230509110446_InitialData.Designer.cs (87%) rename {OpenBudgeteer.Data.Postgres.Migrations => OpenBudgeteer.Core.Data.Postgres.Migrations}/20230509110446_InitialData.cs (97%) rename {OpenBudgeteer.Data.Postgres.Migrations => OpenBudgeteer.Core.Data.Postgres.Migrations}/DatabaseContextModelSnapshot.cs (87%) rename OpenBudgeteer.Data.Postgres.Migrations/OpenBudgeteer.Data.Postgres.Migrations.csproj => OpenBudgeteer.Core.Data.Postgres.Migrations/OpenBudgeteer.Core.Data.Postgres.Migrations.csproj (85%) create mode 100644 OpenBudgeteer.Core.Data.Repository/AccountRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/BankTransactionRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/BaseRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/BucketGroupRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/BucketMovementRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/BucketRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/BucketRuleSetRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/BucketVersionRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/BudgetedTransactionRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/ImportProfileRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/MappingRuleRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Repository/OpenBudgeteer.Core.Data.Repository.csproj create mode 100644 OpenBudgeteer.Core.Data.Repository/RecurringBankTransactionRepository.cs create mode 100644 OpenBudgeteer.Core.Data.Services/AccountService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/BankTransactionService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/BaseService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/BucketGroupService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/BucketMovementService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/BucketRuleSetService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/BucketService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/BudgetedTransactionService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/ImportProfileService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/OpenBudgeteer.Core.Data.Services.csproj create mode 100644 OpenBudgeteer.Core.Data.Services/RecurringBankTransactionService.cs create mode 100644 OpenBudgeteer.Core.Data.Services/ServiceManager.cs rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20200925091603_InitialCreate.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20200925091603_InitialCreate.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20200925091907_AddInitialRecords.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20200925091907_AddInitialRecords.cs (95%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20220213195523_ImportCreditColumn.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20220213195523_ImportCreditColumn.cs (91%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20220625104034_RecurringBankTransaction.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20220625104034_RecurringBankTransaction.cs (96%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20221125200835_ImportProfileAdditionalSetting.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20221125200835_ImportProfileAdditionalSetting.cs (97%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230211163815_GuidKeysStep1.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230211163815_GuidKeysStep1.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230211163906_GuidKeysStep2.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230211163906_GuidKeysStep2.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230211164007_GuidKeysStep3.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230211164007_GuidKeysStep3.cs (96%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230211165645_GuidKeysStep4.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230211165645_GuidKeysStep4.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230215072958_AddForeignKey.Designer.cs (99%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/20230215072958_AddForeignKey.cs (99%) rename OpenBudgeteer.Data.Sqlite.Migrations/OpenBudgeteer.Data.Sqlite.Migrations.csproj => OpenBudgeteer.Core.Data.Sqlite.Migrations/OpenBudgeteer.Core.Data.Sqlite.Migrations.csproj (83%) rename {OpenBudgeteer.Data.Sqlite.Migrations => OpenBudgeteer.Core.Data.Sqlite.Migrations}/SqliteDatabaseContextModelSnapshot.cs (99%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/ConfigurationKeyConstants.cs (96%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/DatabaseInitializationExtensions.cs (93%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/DbContextOptionsFactory.cs (93%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/DesignTimeDbContext.cs (92%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/Initialization/DemoDataGenerator.cs (72%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/Initialization/IDatabaseInitializer.cs (79%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/Initialization/MariaDbDatabaseInitializer.cs (98%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/Initialization/NoOpDatabaseInitializer.cs (86%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/Initialization/PostgresDatabaseInitializer.cs (98%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/OnlineChecker/IDatabaseOnlineChecker.cs (83%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/OnlineChecker/NoopOnlineChecker.cs (83%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/OnlineChecker/PingPortOnlineChecker.cs (95%) rename {OpenBudgeteer.Data => OpenBudgeteer.Core.Data}/OnlineChecker/PostgresOnlineChecker.cs (98%) rename OpenBudgeteer.Data/OpenBudgeteer.Data.csproj => OpenBudgeteer.Core.Data/OpenBudgeteer.Core.Data.csproj (92%) delete mode 100644 OpenBudgeteer.Core.Test/DbConnector.cs create mode 100644 OpenBudgeteer.Core.Test/Extension/DeleteAllExtension.cs create mode 100644 OpenBudgeteer.Core.Test/TestServiceManager.cs create mode 100644 OpenBudgeteer.Core.Test/ViewModelTest/BaseTest.cs create mode 100644 OpenBudgeteer.Core/Common/CsvBankTransactionMapping.cs rename {OpenBudgeteer.Contracts/Models => OpenBudgeteer.Core/Common}/DataConsistencyCheckResult.cs (92%) create mode 100644 OpenBudgeteer.Core/Common/Extensions/DuplicateMatchComparer.cs create mode 100644 OpenBudgeteer.Core/Common/Extensions/TransactionFilter.cs create mode 100644 OpenBudgeteer.Core/Common/ParsedBankTransaction.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/AccountViewModel.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/BucketViewModel.cs create mode 100644 OpenBudgeteer.Core/ViewModels/EntityViewModels/AccountViewModel.cs rename OpenBudgeteer.Core/ViewModels/{ItemViewModels/BucketGroupViewModelItem.cs => EntityViewModels/BucketGroupViewModel.cs} (60%) create mode 100644 OpenBudgeteer.Core/ViewModels/EntityViewModels/BucketViewModel.cs create mode 100644 OpenBudgeteer.Core/ViewModels/EntityViewModels/MappingRuleViewModel.cs create mode 100644 OpenBudgeteer.Core/ViewModels/EntityViewModels/PartialBucketViewModel.cs create mode 100644 OpenBudgeteer.Core/ViewModels/EntityViewModels/RecurringTransactionViewModel.cs create mode 100644 OpenBudgeteer.Core/ViewModels/EntityViewModels/RuleSetViewModel.cs create mode 100644 OpenBudgeteer.Core/ViewModels/EntityViewModels/TransactionViewModel.cs rename OpenBudgeteer.Core/ViewModels/{ => Helper}/BucketDetailsViewModel.cs (74%) create mode 100644 OpenBudgeteer.Core/ViewModels/Helper/BucketListingViewModel.cs rename OpenBudgeteer.Core/ViewModels/{RecurringTransactionViewModel.cs => Helper/RecurringTransactionHandlerViewModel.cs} (62%) create mode 100644 OpenBudgeteer.Core/ViewModels/Helper/TransactionListingViewModel.cs rename OpenBudgeteer.Core/ViewModels/{ => Helper}/YearMonthSelectorViewModel.cs (81%) delete mode 100644 OpenBudgeteer.Core/ViewModels/ItemViewModels/AccountViewModelItem.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/ItemViewModels/BucketViewModelItem.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/ItemViewModels/MappingRuleViewModelItem.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/ItemViewModels/MonthlyBucketExpensesReportViewModelItem.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/ItemViewModels/PartialBucketViewModelItem.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/ItemViewModels/RecurringTransactionViewModelItem.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/ItemViewModels/RuleSetViewModelItem.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/ItemViewModels/TransactionViewModelItem.cs create mode 100644 OpenBudgeteer.Core/ViewModels/PageViewModels/AccountPageViewModel.cs create mode 100644 OpenBudgeteer.Core/ViewModels/PageViewModels/BucketPageViewModel.cs rename OpenBudgeteer.Core/ViewModels/{DataConsistencyViewModel.cs => PageViewModels/DataConsistencyPageViewModel.cs} (62%) rename OpenBudgeteer.Core/ViewModels/{ImportDataViewModel.cs => PageViewModels/ImportPageViewModel.cs} (63%) create mode 100644 OpenBudgeteer.Core/ViewModels/PageViewModels/ReportPageViewModel.cs rename OpenBudgeteer.Core/ViewModels/{RulesViewModel.cs => PageViewModels/RulesPageViewModel.cs} (60%) create mode 100644 OpenBudgeteer.Core/ViewModels/PageViewModels/TransactionPageViewModel.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/ReportViewModel.cs delete mode 100644 OpenBudgeteer.Core/ViewModels/TransactionViewModel.cs delete mode 100644 OpenBudgeteer.Data/DatabaseContext.cs diff --git a/OpenBudgeteer.Blazor/HostedDatabaseMigrator.cs b/OpenBudgeteer.Blazor/HostedDatabaseMigrator.cs index 5250b17..45bc337 100644 --- a/OpenBudgeteer.Blazor/HostedDatabaseMigrator.cs +++ b/OpenBudgeteer.Blazor/HostedDatabaseMigrator.cs @@ -4,9 +4,9 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using OpenBudgeteer.Data; -using OpenBudgeteer.Data.Initialization; -using OpenBudgeteer.Data.OnlineChecker; +using OpenBudgeteer.Core.Data.Entities; +using OpenBudgeteer.Core.Data.Initialization; +using OpenBudgeteer.Core.Data.OnlineChecker; namespace OpenBudgeteer.Blazor; diff --git a/OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj b/OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj index e5a2716..15e1ba4 100644 --- a/OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj +++ b/OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj @@ -6,6 +6,7 @@ false Linux OpenBudgeteer + enable @@ -22,9 +23,9 @@ - - - + + + diff --git a/OpenBudgeteer.Blazor/Pages/Account.razor b/OpenBudgeteer.Blazor/Pages/Account.razor index 4972068..a1aaeca 100644 --- a/OpenBudgeteer.Blazor/Pages/Account.razor +++ b/OpenBudgeteer.Blazor/Pages/Account.razor @@ -1,12 +1,6 @@ @page "/account" -@using OpenBudgeteer.Core.ViewModels -@using Microsoft.EntityFrameworkCore -@using OpenBudgeteer.Core.ViewModels.ItemViewModels @using System.Globalization -@using OpenBudgeteer.Core.Common -@using OpenBudgeteer.Data -@inject DbContextOptions DbContextOptions
@@ -35,8 +29,8 @@ Title="@_editAccountDialogTitle" DataContext="@_editAccountDialogDataContext" IsDialogVisible="@_isEditAccountModalDialogVisible" - OnSaveClickCallback="@(() => SaveChanges(_editAccountDialogDataContext))" - OnCancelClickCallback="@(() => CancelChanges())"/> + OnSaveClickCallback="@(() => SaveChanges(_editAccountDialogDataContext!))" + OnCancelClickCallback="@(CancelChanges)"/> - -@code { - AccountViewModel _dataContext; - TransactionViewModel _transactionModalDialogDataContext; - - bool _isEditAccountModalDialogVisible; - string _editAccountDialogTitle; - AccountViewModelItem _editAccountDialogDataContext; - - - bool _isTransactionModalDialogVisible; - bool _isTransactionModalDialogDataContextLoading; - - bool _isErrorModalDialogVisible; - string _errorModalDialogMessage; - - protected override void OnInitialized() - { - _dataContext = new AccountViewModel(DbContextOptions); - HandleResult(_dataContext.LoadData()); - } - - private void CreateNewAccount() - { - _editAccountDialogTitle = "New Account"; - _editAccountDialogDataContext = _dataContext.PrepareNewAccount(); - _isEditAccountModalDialogVisible = true; - } - - private void EditAccount(AccountViewModelItem account) - { - _editAccountDialogTitle = "Edit Account"; - _editAccountDialogDataContext = account; - _isEditAccountModalDialogVisible = true; - } - - - private void SaveChanges(AccountViewModelItem account) - { - _isEditAccountModalDialogVisible = false; - HandleResult(account.CreateUpdateAccount()); - } - - private void CancelChanges() - { - _isEditAccountModalDialogVisible = false; - HandleResult(_dataContext.LoadData()); - } - - private void CloseAccount(AccountViewModelItem account) - { - HandleResult(account.CloseAccount()); - } - - void HandleResult(ViewModelOperationResult result) - { - if (!result.IsSuccessful) - { - _errorModalDialogMessage = result.Message; - _isErrorModalDialogVisible = true; - } - if (result.ViewModelReloadRequired) - { - _dataContext.LoadData(); - StateHasChanged(); - } - } - - async void DisplayAccountTransactions(AccountViewModelItem account) - { - _isTransactionModalDialogVisible = true; - _isTransactionModalDialogDataContextLoading = true; - - _transactionModalDialogDataContext = new TransactionViewModel(DbContextOptions, new YearMonthSelectorViewModel()); - HandleResult(await _transactionModalDialogDataContext.LoadDataAsync(account.Account)); - - _isTransactionModalDialogDataContextLoading = false; - StateHasChanged(); - } -} + \ No newline at end of file diff --git a/OpenBudgeteer.Blazor/Pages/Account.razor.cs b/OpenBudgeteer.Blazor/Pages/Account.razor.cs new file mode 100644 index 0000000..95817ba --- /dev/null +++ b/OpenBudgeteer.Blazor/Pages/Account.razor.cs @@ -0,0 +1,90 @@ +using Microsoft.AspNetCore.Components; +using OpenBudgeteer.Core.Common; +using OpenBudgeteer.Core.Data.Contracts.Services; +using OpenBudgeteer.Core.ViewModels.EntityViewModels; +using OpenBudgeteer.Core.ViewModels.Helper; +using OpenBudgeteer.Core.ViewModels.PageViewModels; + +namespace OpenBudgeteer.Blazor.Pages; + +public partial class Account : ComponentBase +{ + [Inject] private IServiceManager ServiceManager { get; set; } = null!; + + private AccountPageViewModel _dataContext = null!; + private TransactionListingViewModel? _transactionModalDialogDataContext; + + private bool _isEditAccountModalDialogVisible; + private string _editAccountDialogTitle = string.Empty; + private AccountViewModel? _editAccountDialogDataContext; + + private bool _isTransactionModalDialogVisible; + private bool _isTransactionModalDialogDataContextLoading; + + private bool _isErrorModalDialogVisible; + private string _errorModalDialogMessage = string.Empty; + + protected override void OnInitialized() + { + _dataContext = new AccountPageViewModel(ServiceManager); + HandleResult(_dataContext.LoadData()); + } + + private void CreateNewAccount() + { + _editAccountDialogTitle = "New Account"; + _editAccountDialogDataContext = AccountViewModel.CreateEmpty(ServiceManager); + _isEditAccountModalDialogVisible = true; + } + + private void EditAccount(AccountViewModel account) + { + _editAccountDialogTitle = "Edit Account"; + _editAccountDialogDataContext = account; + _isEditAccountModalDialogVisible = true; + } + + + private void SaveChanges(AccountViewModel account) + { + _isEditAccountModalDialogVisible = false; + HandleResult(account.CreateUpdateAccount()); + } + + private void CancelChanges() + { + _isEditAccountModalDialogVisible = false; + HandleResult(_dataContext.LoadData()); + } + + private void CloseAccount(AccountViewModel account) + { + HandleResult(account.CloseAccount()); + } + + private void HandleResult(ViewModelOperationResult result) + { + if (!result.IsSuccessful) + { + _errorModalDialogMessage = result.Message; + _isErrorModalDialogVisible = true; + } + if (result.ViewModelReloadRequired) + { + _dataContext.LoadData(); + StateHasChanged(); + } + } + + private async void DisplayAccountTransactions(AccountViewModel account) + { + _isTransactionModalDialogVisible = true; + _isTransactionModalDialogDataContextLoading = true; + + _transactionModalDialogDataContext = new TransactionListingViewModel(ServiceManager); + HandleResult(await _transactionModalDialogDataContext.LoadDataAsync(account.Account)); + + _isTransactionModalDialogDataContextLoading = false; + StateHasChanged(); + } +} \ No newline at end of file diff --git a/OpenBudgeteer.Blazor/Pages/Bucket.razor b/OpenBudgeteer.Blazor/Pages/Bucket.razor index 4ca8ad6..a7d04a7 100644 --- a/OpenBudgeteer.Blazor/Pages/Bucket.razor +++ b/OpenBudgeteer.Blazor/Pages/Bucket.razor @@ -1,15 +1,6 @@ @page "/bucket" -@using OpenBudgeteer.Blazor.ViewModels -@using OpenBudgeteer.Core.ViewModels -@using OpenBudgeteer.Core.ViewModels.ItemViewModels -@using Microsoft.EntityFrameworkCore @using System.Drawing @using System.Globalization -@using OpenBudgeteer.Contracts.Models -@using OpenBudgeteer.Core.Common -@using OpenBudgeteer.Data -@inject DbContextOptions DbContextOptions -@inject YearMonthSelectorViewModel YearMonthDataContext + + + + + +
+ @if (Env.IsDevelopment()) + { + + An unhandled exception has occurred. See browser dev tools for details. + + } + else + { + + An error has occurred. This app may no longer respond until reloaded. + + } + Reload + 🗙 +
+ +
+
+ + App Icons by Icons8 + +
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj b/OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj index 15e1ba4..0bbbba2 100644 --- a/OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj +++ b/OpenBudgeteer.Blazor/OpenBudgeteer.Blazor.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 c146cdfd-f78c-4fb3-8be0-4e15e589371a false Linux @@ -11,14 +11,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + diff --git a/OpenBudgeteer.Blazor/Pages/_Host.cshtml b/OpenBudgeteer.Blazor/Pages/_Host.cshtml deleted file mode 100644 index 6ab39d7..0000000 --- a/OpenBudgeteer.Blazor/Pages/_Host.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@page "/" -@namespace OpenBudgeteer.Blazor.Pages -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@{ - Layout = "_Layout"; -} - - diff --git a/OpenBudgeteer.Blazor/Pages/_Layout.cshtml b/OpenBudgeteer.Blazor/Pages/_Layout.cshtml deleted file mode 100644 index 2345379..0000000 --- a/OpenBudgeteer.Blazor/Pages/_Layout.cshtml +++ /dev/null @@ -1,73 +0,0 @@ -@using Microsoft.AspNetCore.Components.Web -@using OpenBudgeteer.Core.Common; -@namespace OpenBudgeteer.Blazor.Pages -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers - - - - - - - OpenBudgeteer - - - - - - - - - - - - @RenderBody() - -
- - An error has occurred. This application may no longer respond until reloaded. - - - An unhandled exception has occurred. See browser dev tools for details. - - Reload - 🗙 -
- -
-
- - App Icons by Icons8 - -
-
- - - - - - - - - - - - - - - - - - diff --git a/OpenBudgeteer.Blazor/Program.cs b/OpenBudgeteer.Blazor/Program.cs index 939bf0c..d11d58b 100644 --- a/OpenBudgeteer.Blazor/Program.cs +++ b/OpenBudgeteer.Blazor/Program.cs @@ -1,28 +1,60 @@ using System; -using Microsoft.AspNetCore.Hosting; +using System.Text; +using Microsoft.AspNetCore.Builder; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using OpenBudgeteer.Blazor; +using OpenBudgeteer.Core.Common; +using OpenBudgeteer.Core.Data; +using OpenBudgeteer.Core.Data.Contracts.Services; +using OpenBudgeteer.Core.Data.Entities; +using OpenBudgeteer.Core.Data.Services; +using OpenBudgeteer.Core.ViewModels.Helper; +using Tewr.Blazor.FileReader; -namespace OpenBudgeteer.Blazor; +const string APPSETTINGS_CULTURE = "APPSETTINGS_CULTURE"; +const string APPSETTINGS_THEME = "APPSETTINGS_THEME"; -public class Program +AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddLocalization(); +builder.Services.AddRazorPages(); +builder.Services.AddRazorComponents() + .AddInteractiveServerComponents(); +builder.Services.AddFileReaderService(); +builder.Services.AddHostedService(); +builder.Services.AddDatabase(builder.Configuration); +builder.Services.AddScoped(x => new ServiceManager(x.GetRequiredService>())); +builder.Services.AddScoped(x => new YearMonthSelectorViewModel(x.GetRequiredService())); + +Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); // Required to read ANSI Text files + +var app = builder.Build(); + +if (!app.Environment.IsDevelopment()) { - public static void Main(string[] args) - { - AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); - CreateHostBuilder(args).Build().Run(); - } - - private static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureServices(service => - { - service.AddHostedService(); - }) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - - + app.UseExceptionHandler("/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); } + +app.UseHttpsRedirection(); +app.UseStaticFiles(); + +app.UseRequestLocalization(builder.Configuration.GetValue(APPSETTINGS_CULTURE, "en-US") ?? "en-US"); +AppSettings.Theme = builder.Configuration.GetValue(APPSETTINGS_THEME, "Default") ?? "Default"; + +//app.UseRouting(); +app.UseAntiforgery(); +/*app.UseEndpoints(endpoints => +{ + endpoints.MapRazorComponents().AddInteractiveServerRenderMode(); +});*/ +app.MapRazorComponents() + .AddInteractiveServerRenderMode(); + +app.Run(); + diff --git a/OpenBudgeteer.Blazor/Routes.razor b/OpenBudgeteer.Blazor/Routes.razor new file mode 100644 index 0000000..f2a6457 --- /dev/null +++ b/OpenBudgeteer.Blazor/Routes.razor @@ -0,0 +1,10 @@ + + + + + + +

Sorry, there's nothing at this address.

+
+
+
\ No newline at end of file diff --git a/OpenBudgeteer.Blazor/Startup.cs b/OpenBudgeteer.Blazor/Startup.cs deleted file mode 100644 index 9e52d36..0000000 --- a/OpenBudgeteer.Blazor/Startup.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Text; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using OpenBudgeteer.Core.Common; -using OpenBudgeteer.Core.Data; -using OpenBudgeteer.Core.Data.Contracts.Services; -using OpenBudgeteer.Core.Data.Entities; -using OpenBudgeteer.Core.Data.Services; -using OpenBudgeteer.Core.ViewModels.Helper; -using Tewr.Blazor.FileReader; - -namespace OpenBudgeteer.Blazor; - -public class Startup -{ - private const string APPSETTINGS_CULTURE = "APPSETTINGS_CULTURE"; - private const string APPSETTINGS_THEME = "APPSETTINGS_THEME"; - - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 - public void ConfigureServices(IServiceCollection services) - { - services.AddLocalization(); - services.AddRazorPages(); - services.AddServerSideBlazor(); - services.AddFileReaderService(); - services.AddDatabase(Configuration); - services.AddScoped(x => new ServiceManager(x.GetRequiredService>())); - services.AddScoped(x => new YearMonthSelectorViewModel(x.GetRequiredService())); - - Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); // Required to read ANSI Text files - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - else - { - app.UseExceptionHandler("/Error"); - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. - app.UseHsts(); - } - - app.UseHttpsRedirection(); - app.UseStaticFiles(); - - app.UseRequestLocalization(Configuration.GetValue(APPSETTINGS_CULTURE, "en-US") ?? "en-US"); - AppSettings.Theme = Configuration.GetValue(APPSETTINGS_THEME, "Default") ?? "Default"; - - app.UseRouting(); - - app.UseEndpoints(endpoints => - { - endpoints.MapBlazorHub(); - endpoints.MapFallbackToPage("/_Host"); - }); - } -} diff --git a/OpenBudgeteer.Blazor/_Imports.razor b/OpenBudgeteer.Blazor/_Imports.razor index b901302..b32aa31 100644 --- a/OpenBudgeteer.Blazor/_Imports.razor +++ b/OpenBudgeteer.Blazor/_Imports.razor @@ -7,3 +7,4 @@ @using Microsoft.JSInterop @using OpenBudgeteer.Blazor @using OpenBudgeteer.Blazor.Shared +@using static Microsoft.AspNetCore.Components.Web.RenderMode diff --git a/OpenBudgeteer.Core.Data.Contracts/OpenBudgeteer.Core.Data.Contracts.csproj b/OpenBudgeteer.Core.Data.Contracts/OpenBudgeteer.Core.Data.Contracts.csproj index 006070f..f94b5e7 100644 --- a/OpenBudgeteer.Core.Data.Contracts/OpenBudgeteer.Core.Data.Contracts.csproj +++ b/OpenBudgeteer.Core.Data.Contracts/OpenBudgeteer.Core.Data.Contracts.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/OpenBudgeteer.Core.Data.Entities/OpenBudgeteer.Core.Data.Entities.csproj b/OpenBudgeteer.Core.Data.Entities/OpenBudgeteer.Core.Data.Entities.csproj index b8c1ecc..27b5a23 100644 --- a/OpenBudgeteer.Core.Data.Entities/OpenBudgeteer.Core.Data.Entities.csproj +++ b/OpenBudgeteer.Core.Data.Entities/OpenBudgeteer.Core.Data.Entities.csproj @@ -1,13 +1,13 @@ - net7.0 + net8.0 enable enable - + diff --git a/OpenBudgeteer.Core.Data.MySql.Migrations/OpenBudgeteer.Core.Data.MySql.Migrations.csproj b/OpenBudgeteer.Core.Data.MySql.Migrations/OpenBudgeteer.Core.Data.MySql.Migrations.csproj index bd5ac22..899b3af 100644 --- a/OpenBudgeteer.Core.Data.MySql.Migrations/OpenBudgeteer.Core.Data.MySql.Migrations.csproj +++ b/OpenBudgeteer.Core.Data.MySql.Migrations/OpenBudgeteer.Core.Data.MySql.Migrations.csproj @@ -1,19 +1,19 @@ - net7.0 + net8.0 disable enable ..\OpenBudgeteer.Data\bin\ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/OpenBudgeteer.Core.Data.Postgres.Migrations/OpenBudgeteer.Core.Data.Postgres.Migrations.csproj b/OpenBudgeteer.Core.Data.Postgres.Migrations/OpenBudgeteer.Core.Data.Postgres.Migrations.csproj index c6013ab..20cce74 100644 --- a/OpenBudgeteer.Core.Data.Postgres.Migrations/OpenBudgeteer.Core.Data.Postgres.Migrations.csproj +++ b/OpenBudgeteer.Core.Data.Postgres.Migrations/OpenBudgeteer.Core.Data.Postgres.Migrations.csproj @@ -1,19 +1,19 @@ - net7.0 + net8.0 disable enable ..\OpenBudgeteer.Data\bin\ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/OpenBudgeteer.Core.Data.Repository/OpenBudgeteer.Core.Data.Repository.csproj b/OpenBudgeteer.Core.Data.Repository/OpenBudgeteer.Core.Data.Repository.csproj index f43c5f4..e97872a 100644 --- a/OpenBudgeteer.Core.Data.Repository/OpenBudgeteer.Core.Data.Repository.csproj +++ b/OpenBudgeteer.Core.Data.Repository/OpenBudgeteer.Core.Data.Repository.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/OpenBudgeteer.Core.Data.Services/OpenBudgeteer.Core.Data.Services.csproj b/OpenBudgeteer.Core.Data.Services/OpenBudgeteer.Core.Data.Services.csproj index 0b53576..2e8129c 100644 --- a/OpenBudgeteer.Core.Data.Services/OpenBudgeteer.Core.Data.Services.csproj +++ b/OpenBudgeteer.Core.Data.Services/OpenBudgeteer.Core.Data.Services.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/OpenBudgeteer.Core.Data.Sqlite.Migrations/OpenBudgeteer.Core.Data.Sqlite.Migrations.csproj b/OpenBudgeteer.Core.Data.Sqlite.Migrations/OpenBudgeteer.Core.Data.Sqlite.Migrations.csproj index e4f4754..cdfb333 100644 --- a/OpenBudgeteer.Core.Data.Sqlite.Migrations/OpenBudgeteer.Core.Data.Sqlite.Migrations.csproj +++ b/OpenBudgeteer.Core.Data.Sqlite.Migrations/OpenBudgeteer.Core.Data.Sqlite.Migrations.csproj @@ -1,18 +1,18 @@ - net7.0 + net8.0 disable enable ..\OpenBudgeteer.Data\bin\ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/OpenBudgeteer.Core.Data/OpenBudgeteer.Core.Data.csproj b/OpenBudgeteer.Core.Data/OpenBudgeteer.Core.Data.csproj index 45a9b1a..72a4363 100644 --- a/OpenBudgeteer.Core.Data/OpenBudgeteer.Core.Data.csproj +++ b/OpenBudgeteer.Core.Data/OpenBudgeteer.Core.Data.csproj @@ -1,25 +1,25 @@ - net7.0 + net8.0 disable enable - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - + + + + + + + + diff --git a/OpenBudgeteer.Core.Test/OpenBudgeteer.Core.Test.csproj b/OpenBudgeteer.Core.Test/OpenBudgeteer.Core.Test.csproj index f0345e9..7b4c800 100644 --- a/OpenBudgeteer.Core.Test/OpenBudgeteer.Core.Test.csproj +++ b/OpenBudgeteer.Core.Test/OpenBudgeteer.Core.Test.csproj @@ -6,7 +6,7 @@ 10 - net7.0 + net8.0 enable
@@ -34,15 +34,15 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs b/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs index d569dd1..0ae4a1b 100644 --- a/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs +++ b/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs @@ -44,7 +44,7 @@ public async Task LoadDataAsync_CheckBucketGroupAssignedBuckets(List buc Name = bucketName, ColorCode = "Red", ValidFrom = new DateTime(2010, 1, 1), - CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } + BucketVersions = new List { new() { BucketType = 1, Version = 1 } } }; ServiceManager.BucketService.Create(newBucket); } @@ -90,7 +90,7 @@ public async Task LoadDataAsync_CheckBucketSorting(List bucketNamesUnsor Name = bucketName, ColorCode = "Red", ValidFrom = new DateTime(2010, 1, 1), - CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } + BucketVersions = new List { new() { BucketType = 1, Version = 1 } } }; ServiceManager.BucketService.Create(newBucket); } @@ -160,11 +160,14 @@ bool expectedBucketAvailable ValidFrom = bucketActiveSince, IsInactive = bucketIsInactive, IsInactiveFrom = bucketIsInActiveFrom, - CurrentVersion = new BucketVersion() + BucketVersions = new List { - Version = 1, - BucketType = 1, - ValidFrom = bucketActiveSince + new() + { + Version = 1, + BucketType = 1, + ValidFrom = bucketActiveSince + } } }; @@ -200,21 +203,21 @@ public async Task LoadDataAsync_CheckValidFromHandling() BucketGroupId = testBucketGroup.Id, Name = "Bucket Active Current Month", ValidFrom = new DateTime(2010, 1, 1), - CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } + BucketVersions = new List { new() { Version = 1, BucketType = 1 } } }; var testBucket2 = new Bucket { BucketGroupId = testBucketGroup.Id, Name = "Bucket Active Past", ValidFrom = new DateTime(2009, 1, 1), - CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } + BucketVersions = new List { new() { Version = 1, BucketType = 1 } } }; var testBucket3 = new Bucket { BucketGroupId = testBucketGroup.Id, Name = "Bucket Active Future", ValidFrom = new DateTime(2010, 2, 1), - CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } + BucketVersions = new List { new() { Version = 1, BucketType = 1 } } }; ServiceManager.BucketService.Create(testBucket1); @@ -259,14 +262,14 @@ public async Task LoadDataAsync_CheckCalculatedValues() BucketGroupId = testBucketGroup.Id, Name = "Bucket 1", ValidFrom = new DateTime(2010, 1, 1), - CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } + BucketVersions = new List { new() { Version = 1, BucketType = 1 } } }; var testBucket2 = new Bucket { BucketGroupId = testBucketGroup.Id, Name = "Bucket 2", ValidFrom = new DateTime(2010, 1, 1), - CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } + BucketVersions = new List { new() { Version = 1, BucketType = 1 } } }; ServiceManager.BucketService.Create(testBucket1); @@ -349,7 +352,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with pending Want", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } + BucketVersions = new List + { + new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, + } }, new List(), new List(), @@ -360,7 +366,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with fulfilled Want", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } + BucketVersions = new List + { + new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, + } }, new List(), new List @@ -374,7 +383,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket pending Want including expense", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } + BucketVersions = new List + { + new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, + } }, new List { @@ -388,7 +400,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket fulfilled Want including expense", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } + BucketVersions = new List + { + new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, + } }, new List { @@ -405,7 +420,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with partial fulfilled Want", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } + BucketVersions = new List + { + new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, + } }, new List(), new List @@ -419,7 +437,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with over fulfilled Want", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } + BucketVersions = new List + { + new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, + } }, new List(), new List @@ -470,7 +491,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, with Want", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, + } }, new List(), new List(), @@ -481,7 +505,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, without Want", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, + } }, new List(), new List @@ -495,7 +522,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, with Want", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List @@ -514,7 +544,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, without Want", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List @@ -534,7 +567,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, fulfilled target", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List @@ -553,7 +589,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, over-fulfilled target", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List @@ -572,7 +611,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, no input", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List(), @@ -583,7 +625,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, input not in sync", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List @@ -599,7 +644,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "100 every 3 months, with Want", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,3,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,3,1) }, + } }, new List(), new List(), @@ -610,7 +658,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "100 every 3 months, last month, with Want", ValidFrom = new DateTime(2009,11,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) }, + } }, new List(), new List @@ -625,7 +676,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "100 every 3 months, last month, input not in sync", ValidFrom = new DateTime(2009,11,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) }, + } }, new List(), new List @@ -640,7 +694,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, with expenses", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List { @@ -663,7 +720,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, 2nd year, last 6 months, with Want", ValidFrom = new DateTime(2008,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,6,1) }, + } }, new List { @@ -707,7 +767,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-12, no input", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, + } }, new List(), new List(), @@ -718,7 +781,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-12, input in current Month", ValidFrom = new DateTime(2010,1,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, + } }, new List(), new List @@ -732,7 +798,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, input in sync", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List @@ -751,7 +820,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, fulfilled target", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List @@ -770,7 +842,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, over-fulfilled target", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List @@ -789,7 +864,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, input not in sync", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, + } }, new List(), new List @@ -805,7 +883,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2009-12, target not reached", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,12,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,12,1) }, + } }, new List(), new List @@ -821,7 +902,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "30 until 2010-01, target reached, with expense in target month", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) }, + } }, new List { @@ -840,7 +924,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "30 until 2010-01, target reached, with lower expense in target month", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) }, + } }, new List { @@ -859,7 +946,10 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "30 until 2010-01, target reached, with higher expense in target month", ValidFrom = new DateTime(2009,7,1), - CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) } + BucketVersions = new List + { + new() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) }, + } }, new List { diff --git a/OpenBudgeteer.Core/OpenBudgeteer.Core.csproj b/OpenBudgeteer.Core/OpenBudgeteer.Core.csproj index 450f6f6..50f78df 100644 --- a/OpenBudgeteer.Core/OpenBudgeteer.Core.csproj +++ b/OpenBudgeteer.Core/OpenBudgeteer.Core.csproj @@ -1,17 +1,17 @@ - net7.0 + net8.0 enable - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/docker-compose.yml b/docker-compose.yml index 0c0f25d..cb4026d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,10 @@ version: "3" services: openbudgeteer: - image: openbudgeteer:alpha + image: openbudgeteer:pre-release container_name: openbudgeteer ports: - - 8081:80 + - 8081:8080 environment: - CONNECTION_PROVIDER=tempdb - APPSETTINGS_CULTURE=en-US From 9b5bab1971fe6b38871c76ff0c8189ba9d454024 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sun, 26 Nov 2023 11:54:52 +0100 Subject: [PATCH 25/57] Fix Unit Tests --- .../ViewModelTest/BucketViewModelTest.cs | 170 +++++------------- 1 file changed, 40 insertions(+), 130 deletions(-) diff --git a/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs b/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs index 0ae4a1b..d569dd1 100644 --- a/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs +++ b/OpenBudgeteer.Core.Test/ViewModelTest/BucketViewModelTest.cs @@ -44,7 +44,7 @@ public async Task LoadDataAsync_CheckBucketGroupAssignedBuckets(List buc Name = bucketName, ColorCode = "Red", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { BucketType = 1, Version = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; ServiceManager.BucketService.Create(newBucket); } @@ -90,7 +90,7 @@ public async Task LoadDataAsync_CheckBucketSorting(List bucketNamesUnsor Name = bucketName, ColorCode = "Red", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { BucketType = 1, Version = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; ServiceManager.BucketService.Create(newBucket); } @@ -160,14 +160,11 @@ bool expectedBucketAvailable ValidFrom = bucketActiveSince, IsInactive = bucketIsInactive, IsInactiveFrom = bucketIsInActiveFrom, - BucketVersions = new List + CurrentVersion = new BucketVersion() { - new() - { - Version = 1, - BucketType = 1, - ValidFrom = bucketActiveSince - } + Version = 1, + BucketType = 1, + ValidFrom = bucketActiveSince } }; @@ -203,21 +200,21 @@ public async Task LoadDataAsync_CheckValidFromHandling() BucketGroupId = testBucketGroup.Id, Name = "Bucket Active Current Month", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; var testBucket2 = new Bucket { BucketGroupId = testBucketGroup.Id, Name = "Bucket Active Past", ValidFrom = new DateTime(2009, 1, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; var testBucket3 = new Bucket { BucketGroupId = testBucketGroup.Id, Name = "Bucket Active Future", ValidFrom = new DateTime(2010, 2, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; ServiceManager.BucketService.Create(testBucket1); @@ -262,14 +259,14 @@ public async Task LoadDataAsync_CheckCalculatedValues() BucketGroupId = testBucketGroup.Id, Name = "Bucket 1", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; var testBucket2 = new Bucket { BucketGroupId = testBucketGroup.Id, Name = "Bucket 2", ValidFrom = new DateTime(2010, 1, 1), - BucketVersions = new List { new() { Version = 1, BucketType = 1 } } + CurrentVersion = new BucketVersion { Version = 1, BucketType = 1 } }; ServiceManager.BucketService.Create(testBucket1); @@ -352,10 +349,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with pending Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List(), new List(), @@ -366,10 +360,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with fulfilled Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List(), new List @@ -383,10 +374,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket pending Want including expense", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List { @@ -400,10 +388,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket fulfilled Want including expense", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List { @@ -420,10 +405,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with partial fulfilled Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List(), new List @@ -437,10 +419,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Month new Bucket { Name = "Bucket with over fulfilled Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 2, BucketTypeYParam = 10 }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 2, BucketTypeYParam = 10 } }, new List(), new List @@ -491,10 +470,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, with Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } }, new List(), new List(), @@ -505,10 +481,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, without Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } }, new List(), new List @@ -522,10 +495,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, with Want", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -544,10 +514,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, without Want", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -567,10 +534,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, fulfilled target", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -589,10 +553,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, over-fulfilled target", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -611,10 +572,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, no input", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List(), @@ -625,10 +583,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, input not in sync", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -644,10 +599,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "100 every 3 months, with Want", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,3,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,3,1) } }, new List(), new List(), @@ -658,10 +610,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "100 every 3 months, last month, with Want", ValidFrom = new DateTime(2009,11,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) } }, new List(), new List @@ -676,10 +625,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "100 every 3 months, last month, input not in sync", ValidFrom = new DateTime(2009,11,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 3, BucketTypeYParam = 100, BucketTypeZParam = new DateTime(2010,1,1) } }, new List(), new List @@ -694,10 +640,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, last 6 months, with expenses", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List { @@ -720,10 +663,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_Expen new Bucket { Name = "120 every 12 months, 2nd year, last 6 months, with Want", ValidFrom = new DateTime(2008,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 3, BucketTypeXParam = 12, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,6,1) } }, new List { @@ -767,10 +707,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-12, no input", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } }, new List(), new List(), @@ -781,10 +718,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-12, input in current Month", ValidFrom = new DateTime(2010,1,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,12,1) } }, new List(), new List @@ -798,10 +732,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, input in sync", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -820,10 +751,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, fulfilled target", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -842,10 +770,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, over-fulfilled target", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -864,10 +789,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2010-06, input not in sync", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2010,6,1) } }, new List(), new List @@ -883,10 +805,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "120 until 2009-12, target not reached", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,12,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 120, BucketTypeZParam = new DateTime(2009,12,1) } }, new List(), new List @@ -902,10 +821,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "30 until 2010-01, target reached, with expense in target month", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) } }, new List { @@ -924,10 +840,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "30 until 2010-01, target reached, with lower expense in target month", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) } }, new List { @@ -946,10 +859,7 @@ public static IEnumerable TestData_CheckWantAndDetailCalculation_SaveX new Bucket { Name = "30 until 2010-01, target reached, with higher expense in target month", ValidFrom = new DateTime(2009,7,1), - BucketVersions = new List - { - new() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) }, - } + CurrentVersion = new BucketVersion() { Version = 1, BucketType = 4, BucketTypeYParam = 30, BucketTypeZParam = new DateTime(2010,1,1) } }, new List { From 9e406668834d76885440bf1d711c32957fa1b0ef Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sun, 26 Nov 2023 11:59:15 +0100 Subject: [PATCH 26/57] Add multi-platform tag in Dockerfile --- Dockerfile | 9 ++++----- OpenBudgeteer.API/Dockerfile | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0de8f37..1c3f1c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,3 @@ -#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. - FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base WORKDIR /app ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 @@ -7,13 +5,14 @@ ENV DOTNET_RUNNING_IN_CONTAINER=true ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false RUN apk add --no-cache icu-libs icu-data-full -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG TARGETARCH ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 WORKDIR /src COPY . . -RUN dotnet restore +RUN dotnet restore -a $TARGETARCH WORKDIR "/src/OpenBudgeteer.Blazor" -RUN dotnet publish "OpenBudgeteer.Blazor.csproj" --no-self-contained -c Release -o /app/publish +RUN dotnet publish "OpenBudgeteer.Blazor.csproj" --no-self-contained -c Release -a $TARGETARCH -o /app/publish FROM base AS final WORKDIR /app diff --git a/OpenBudgeteer.API/Dockerfile b/OpenBudgeteer.API/Dockerfile index a147c8c..46f4171 100644 --- a/OpenBudgeteer.API/Dockerfile +++ b/OpenBudgeteer.API/Dockerfile @@ -3,17 +3,17 @@ WORKDIR /api ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 ENV DOTNET_RUNNING_IN_CONTAINER=true ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false -EXPOSE 80 -EXPOSE 443 RUN apk add --no-cache icu-libs icu-data-full -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG TARGETARCH +ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 WORKDIR /src COPY ["OpenBudgeteer.API/OpenBudgeteer.API.csproj", "OpenBudgeteer.API/"] -RUN dotnet restore "OpenBudgeteer.API/OpenBudgeteer.API.csproj" +RUN dotnet restore "OpenBudgeteer.API/OpenBudgeteer.API.csproj" -a $TARGETARCH COPY . . WORKDIR "/src/OpenBudgeteer.API" -RUN dotnet publish "OpenBudgeteer.API.csproj" -r linux-musl-x64 --no-self-contained -c Release -o /api/publish +RUN dotnet publish "OpenBudgeteer.API.csproj" --no-self-contained -c Release -a $TARGETARCH -o /api/publish FROM base AS final WORKDIR /api From d656080f10cd589b6487ff535bcd549dd40c568d Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sun, 26 Nov 2023 12:07:43 +0100 Subject: [PATCH 27/57] Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 693717d..911fb66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * [Add] Create Transaction keeps last input date [#187](https://github.com/TheAxelander/OpenBudgeteer/issues/187) * [Add] An empty database can be loaded now with some demo data using `APPSETTINGS_DEMO_DATA: true` [#192](https://github.com/TheAxelander/OpenBudgeteer/issues/192) * [Add] First version of Web API in a separate Docker Image [#127](https://github.com/TheAxelander/OpenBudgeteer/issues/127) +* [Changed] Migrated to .Net 8 [#198](https://github.com/TheAxelander/OpenBudgeteer/issues/198) * [Changed] Amounts displayed in consistent currency and number format [#188](https://github.com/TheAxelander/OpenBudgeteer/issues/188) * [Changed] Buttons that appeared in the past only via hovering are now always displayed (was not working well, maybe additional rework in future) [#155](https://github.com/TheAxelander/OpenBudgeteer/issues/155) * [Changed] More responsive navigation bar [#175](https://github.com/TheAxelander/OpenBudgeteer/issues/175) @@ -10,6 +11,7 @@ * [Fixed] UI alignment for large numbers [#189](https://github.com/TheAxelander/OpenBudgeteer/issues/189) * [Fixed] Mapping Rules using the Account Name instead of Account Id [#199](https://github.com/TheAxelander/OpenBudgeteer/pull/199) Thanks [Lucaber](https://github.com/Lucaber) * [Fixed] Adding a Mapping Rule to an existing Rule Set failed [#200](https://github.com/TheAxelander/OpenBudgeteer/pull/200) Thanks [Lucaber](https://github.com/Lucaber) +* [Fixed] Builds for ARM64 are available again [#131](https://github.com/TheAxelander/OpenBudgeteer/issues/131) ### 1.7.1 (2023-10-16) From 0b92eeb235eb00bce425b607e4d7618f0ab681f1 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sun, 26 Nov 2023 12:15:02 +0100 Subject: [PATCH 28/57] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 911fb66..3988868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * [Add] Create Transaction keeps last input date [#187](https://github.com/TheAxelander/OpenBudgeteer/issues/187) * [Add] An empty database can be loaded now with some demo data using `APPSETTINGS_DEMO_DATA: true` [#192](https://github.com/TheAxelander/OpenBudgeteer/issues/192) * [Add] First version of Web API in a separate Docker Image [#127](https://github.com/TheAxelander/OpenBudgeteer/issues/127) +* [Breaking Change] Docker Image now listens on port 8080 (new .Net 8 default) * [Changed] Migrated to .Net 8 [#198](https://github.com/TheAxelander/OpenBudgeteer/issues/198) * [Changed] Amounts displayed in consistent currency and number format [#188](https://github.com/TheAxelander/OpenBudgeteer/issues/188) * [Changed] Buttons that appeared in the past only via hovering are now always displayed (was not working well, maybe additional rework in future) [#155](https://github.com/TheAxelander/OpenBudgeteer/issues/155) From f774d726576cd057ac1cb3de2cd5948cfb8641b5 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sun, 26 Nov 2023 12:16:35 +0100 Subject: [PATCH 29/57] Update README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 0d14723..80b2505 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ For a quick ramp-up up of OpenBudgeteer using Docker and Sqlite use below comman docker run -d --name='openbudgeteer' \ -e 'CONNECTION_PROVIDER'='SQLITE' \ -e 'CONNECTION_DATABASE'='/srv/openbudgeteer.db' \ + -p 8080:8080 -v 'data:/srv' \ 'axelander/openbudgeteer:pre-release' ``` @@ -51,6 +52,8 @@ services: openbudgeteer: image: axelander/openbudgeteer:pre-release container_name: openbudgeteer + ports: + - 8080:8080 environment: - CONNECTION_PROVIDER=SQLITE - CONNECTION_DATABASE=/srv/openbudgeteer.db From abad9df4352c25a6a87edd641e54d2023988ecde Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Sun, 26 Nov 2023 12:17:03 +0100 Subject: [PATCH 30/57] Fix README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 80b2505..cd2a4cc 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ For a quick ramp-up up of OpenBudgeteer using Docker and Sqlite use below comman docker run -d --name='openbudgeteer' \ -e 'CONNECTION_PROVIDER'='SQLITE' \ -e 'CONNECTION_DATABASE'='/srv/openbudgeteer.db' \ - -p 8080:8080 + -p 8080:8080 \ -v 'data:/srv' \ 'axelander/openbudgeteer:pre-release' ``` From c2e67be7e95db5e76b7130e409cc8e63891fcaa2 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Wed, 6 Dec 2023 07:52:27 +0100 Subject: [PATCH 31/57] Fix missing UI refresh on Transaction Page for deleting a BankTransaction #206 --- .../ViewModels/EntityViewModels/TransactionViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenBudgeteer.Core/ViewModels/EntityViewModels/TransactionViewModel.cs b/OpenBudgeteer.Core/ViewModels/EntityViewModels/TransactionViewModel.cs index f142bad..bb2b37f 100644 --- a/OpenBudgeteer.Core/ViewModels/EntityViewModels/TransactionViewModel.cs +++ b/OpenBudgeteer.Core/ViewModels/EntityViewModels/TransactionViewModel.cs @@ -576,7 +576,7 @@ public ViewModelOperationResult DeleteTransaction() try { ServiceManager.BankTransactionService.Delete(TransactionId); - return new ViewModelOperationResult(true); + return new ViewModelOperationResult(true, true); } catch (Exception e) { From 875a41b1cb541741548a5149c043c974ee3f2e86 Mon Sep 17 00:00:00 2001 From: Alexander Preibisch Date: Wed, 6 Dec 2023 17:28:19 +0100 Subject: [PATCH 32/57] Update Bootstrap, Redesign of Navigation Menu and Footer --- CHANGELOG.md | 1 + OpenBudgeteer.Blazor/App.razor | 16 +- OpenBudgeteer.Blazor/Pages/Import.razor | 3 +- OpenBudgeteer.Blazor/Shared/MainLayout.razor | 65 +- OpenBudgeteer.Blazor/Shared/NavMenu.razor | 73 +- .../wwwroot/css/StickyFooter.css | 18 - .../wwwroot/css/bootstrap/bootstrap-icons.css | 150 +- .../css/bootstrap/bootstrap-icons.json | 142 +- .../css/bootstrap/cerulean/bootstrap.css | 7204 ++++----- .../css/bootstrap/cerulean/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/cosmo/bootstrap.css | 6834 +++++---- .../css/bootstrap/cosmo/bootstrap.min.css | 16 +- .../css/bootstrap/cyborg/bootstrap.css | 7168 ++++----- .../css/bootstrap/cyborg/bootstrap.min.css | 16 +- .../css/bootstrap/darkly/bootstrap.css | 7182 ++++----- .../css/bootstrap/darkly/bootstrap.min.css | 16 +- .../css/bootstrap/default/bootstrap.css | 12068 ++++++++++++++++ .../css/bootstrap/default/bootstrap.min.css | 7 +- .../bootstrap/default/bootstrap.min.css.map | 1 - .../css/bootstrap/flatly/bootstrap.css | 7184 ++++----- .../css/bootstrap/flatly/bootstrap.min.css | 16 +- .../css/bootstrap/fonts/bootstrap-icons.woff | Bin 164352 -> 176088 bytes .../css/bootstrap/fonts/bootstrap-icons.woff2 | Bin 121296 -> 130648 bytes .../css/bootstrap/journal/bootstrap.css | 7209 ++++----- .../css/bootstrap/journal/bootstrap.min.css | 16 +- .../css/bootstrap/litera/bootstrap.css | 7222 ++++----- .../css/bootstrap/litera/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/lumen/bootstrap.css | 7167 ++++----- .../css/bootstrap/lumen/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/lux/bootstrap.css | 6726 +++++---- .../css/bootstrap/lux/bootstrap.min.css | 16 +- .../css/bootstrap/materia/bootstrap.css | 7798 +++++----- .../css/bootstrap/materia/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/minty/bootstrap.css | 7233 ++++----- .../css/bootstrap/minty/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/morph/bootstrap.css | 7310 +++++----- .../css/bootstrap/morph/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/pulse/bootstrap.css | 6915 +++++---- .../css/bootstrap/pulse/bootstrap.min.css | 16 +- .../css/bootstrap/quartz/bootstrap.css | 7156 ++++----- .../css/bootstrap/quartz/bootstrap.min.css | 16 +- .../css/bootstrap/sandstone/bootstrap.css | 6995 +++++---- .../css/bootstrap/sandstone/bootstrap.min.css | 16 +- .../css/bootstrap/simplex/bootstrap.css | 7208 ++++----- .../css/bootstrap/simplex/bootstrap.min.css | 16 +- .../css/bootstrap/sketchy/bootstrap.css | 7301 +++++----- .../css/bootstrap/sketchy/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/slate/bootstrap.css | 7351 +++++----- .../css/bootstrap/slate/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/solar/bootstrap.css | 7183 ++++----- .../css/bootstrap/solar/bootstrap.min.css | 16 +- .../css/bootstrap/spacelab/bootstrap.css | 7234 ++++----- .../css/bootstrap/spacelab/bootstrap.min.css | 16 +- .../css/bootstrap/superhero/bootstrap.css | 7192 ++++----- .../css/bootstrap/superhero/bootstrap.min.css | 16 +- .../css/bootstrap/united/bootstrap.css | 7154 ++++----- .../css/bootstrap/united/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/vapor/bootstrap.css | 7173 ++++----- .../css/bootstrap/vapor/bootstrap.min.css | 16 +- .../wwwroot/css/bootstrap/yeti/bootstrap.css | 7188 ++++----- .../css/bootstrap/yeti/bootstrap.min.css | 16 +- .../css/bootstrap/zephyr/bootstrap.css | 7066 +++++---- .../css/bootstrap/zephyr/bootstrap.min.css | 16 +- OpenBudgeteer.Blazor/wwwroot/css/custom.css | 105 - OpenBudgeteer.Blazor/wwwroot/css/site.css | 166 +- .../js/bootstrap/bootstrap.bundle.min.js | 6 +- .../js/bootstrap/bootstrap.bundle.min.js.map | 2 +- 67 files changed, 110374 insertions(+), 82202 deletions(-) delete mode 100644 OpenBudgeteer.Blazor/wwwroot/css/StickyFooter.css create mode 100644 OpenBudgeteer.Blazor/wwwroot/css/bootstrap/default/bootstrap.css delete mode 100644 OpenBudgeteer.Blazor/wwwroot/css/bootstrap/default/bootstrap.min.css.map delete mode 100644 OpenBudgeteer.Blazor/wwwroot/css/custom.css mode change 100755 => 100644 OpenBudgeteer.Blazor/wwwroot/js/bootstrap/bootstrap.bundle.min.js mode change 100755 => 100644 OpenBudgeteer.Blazor/wwwroot/js/bootstrap/bootstrap.bundle.min.js.map diff --git a/CHANGELOG.md b/CHANGELOG.md index 3988868..a55db7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * [Changed] Buttons that appeared in the past only via hovering are now always displayed (was not working well, maybe additional rework in future) [#155](https://github.com/TheAxelander/OpenBudgeteer/issues/155) * [Changed] More responsive navigation bar [#175](https://github.com/TheAxelander/OpenBudgeteer/issues/175) * [Changed] Enable editing of imported file [#196](https://github.com/TheAxelander/OpenBudgeteer/issues/196) +* [Changed] Redesign of Navigation Menu and Footer * [Fixed] UI alignment for large numbers [#189](https://github.com/TheAxelander/OpenBudgeteer/issues/189) * [Fixed] Mapping Rules using the Account Name instead of Account Id [#199](https://github.com/TheAxelander/OpenBudgeteer/pull/199) Thanks [Lucaber](https://github.com/Lucaber) * [Fixed] Adding a Mapping Rule to an existing Rule Set failed [#200](https://github.com/TheAxelander/OpenBudgeteer/pull/200) Thanks [Lucaber](https://github.com/Lucaber) diff --git a/OpenBudgeteer.Blazor/App.razor b/OpenBudgeteer.Blazor/App.razor index 02a095e..08feb91 100644 --- a/OpenBudgeteer.Blazor/App.razor +++ b/OpenBudgeteer.Blazor/App.razor @@ -10,11 +10,9 @@ OpenBudgeteer - + - - -
-
-
-
- -
-
- Income -
- @_dataContext.Income.ToString("C", CultureInfo.CurrentCulture) -
-
+
+
+
-
-
-
- -
-
- Expenses -
- @_dataContext.Expenses.ToString("C", CultureInfo.CurrentCulture) -
-
+
+
-
-
-
- -
-
- Month Balance -
- @_dataContext.MonthBalance.ToString("C", CultureInfo.CurrentCulture) -
-
+
+
-
-
-
- -
-
- Bank Balance -
- @_dataContext.BankBalance.ToString("C", CultureInfo.CurrentCulture) -
-
+
+
-
-
-
-
-
-
- -
-
- Budget -
- @_dataContext.Budget.ToString("C", CultureInfo.CurrentCulture) -
-
+
+
+
+
+
+
+
-
-
-
- -
-
- Pending Want -
- @_dataContext.PendingWant.ToString("C", CultureInfo.CurrentCulture) -
-
+
+
-
-
-
- -
-
- Remaining Budget -
- @_dataContext.RemainingBudget.ToString("C", CultureInfo.CurrentCulture) -
-
+
+
-
-
-
- -
-
- Negative Bucket Balance -
- @_dataContext.NegativeBucketBalance.ToString("C", CultureInfo.CurrentCulture) -
-
+
+
-
-
- - - - -
- +
+ + + + +
@@ -187,14 +187,11 @@ @(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("C", CultureInfo.CurrentCulture)) @(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("C", CultureInfo.CurrentCulture)) - @if (bucketGroup.IsHovered) - { - - - - - - } + + + + +
@if (bucket.Bucket.IsInactive) { @@ -255,18 +252,15 @@ } - @if (bucket.IsHovered) + @if (bucket.Bucket.IsInactive) + { + + } + else { - if (bucket.Bucket.IsInactive) - { - - } - else - { - - - - } + + + }
@ruleSet.RuleSet.Priority @ruleSet.RuleSet.Name
@ruleSet.TargetBucket.Name
- @if (ruleSet.IsHovered) - { - - - } + +
@transaction.Transaction.TransactionDate.ToShortDateString() @transaction.SelectedAccount.Name @transaction.Transaction.Payee - @if (transaction.IsHovered) - { - - - } + +
@transaction.Transaction.FirstOccurrenceDate.ToShortDateString() Every @transaction.Transaction.RecurrenceAmount @transaction.SelectedRecurrenceType.Value@transaction.Transaction.Memo @transaction.Transaction.Amount.ToString("C", CultureInfo.CurrentCulture) - @if (transaction.IsHovered) - { - - - } + +
@@ -134,131 +79,130 @@ - - - - - + + + + + - -
Bucket Balance InOutWantInActivityDetailsWantInActivityDetails
- -@foreach (var bucketGroup in _dataContext.BucketGroups) -{ - - - + + @foreach (var bucketGroup in _dataContext.BucketGroups) + { + @if (bucketGroup.InModification) { - } else { - - - - - - + + + + + + } - - -
+
- +
- +
- +
+
- @bucketGroup.Name
- -
@bucketGroup.TotalBalance.ToString("C", CultureInfo.CurrentCulture)@(bucketGroup.TotalWant == 0 ? string.Empty : bucketGroup.TotalWant.ToString("C", CultureInfo.CurrentCulture))@(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("C", CultureInfo.CurrentCulture))@(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("C", CultureInfo.CurrentCulture)) + + @bucketGroup.TotalBalance.ToString("C", CultureInfo.CurrentCulture)@(bucketGroup.TotalWant == 0 ? string.Empty : bucketGroup.TotalWant.ToString("C", CultureInfo.CurrentCulture))@(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("C", CultureInfo.CurrentCulture))@(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("C", CultureInfo.CurrentCulture)) - +
- - - - @foreach (var bucket in bucketGroup.Buckets) - { - - + +
- @if (bucket.IsInactive) - { -
- @($"{bucket.Name} (Inactive from: {bucket.IsInactiveFrom.ToShortDateString()})") -
- } - else +
+ + + @foreach (var bucket in bucketGroup.Buckets) { -
@bucket.Name
- } - - - - - - - + - + + + + + + + + } - - - } - -
@bucket.Balance.ToString("C", CultureInfo.CurrentCulture) - @if (bucket.IsInactive) - { - - } - else - { - - } - @(bucket.Want == 0 ? string.Empty : bucket.Want.ToString("C", CultureInfo.CurrentCulture))@(bucket.In == 0 ? string.Empty : bucket.In.ToString("C", CultureInfo.CurrentCulture))@(bucket.Activity == 0 ? string.Empty : bucket.Activity.ToString("C", CultureInfo.CurrentCulture)) - @if (bucket.IsProgressbarVisible) - { -
-
-
-
- @bucket.Progress% +
+ @if (bucket.IsInactive) + { +
+ @($"{bucket.Name} (Inactive from: {bucket.IsInactiveFrom.ToShortDateString()})")
- - - -
-
- @bucket.Details -
-
- } -
- @if (bucket.IsInactive) - { - - } - else - { - - - + } + else + { +
@bucket.Name
+ } +
@bucket.Balance.ToString("C", CultureInfo.CurrentCulture) + @if (bucket.IsInactive) + { + + } + else + { + + } + @(bucket.Want == 0 ? string.Empty : bucket.Want.ToString("C", CultureInfo.CurrentCulture))@(bucket.In == 0 ? string.Empty : bucket.In.ToString("C", CultureInfo.CurrentCulture))@(bucket.Activity == 0 ? string.Empty : bucket.Activity.ToString("C", CultureInfo.CurrentCulture)) + @if (bucket.IsProgressbarVisible) + { +
+
+
+
+ @bucket.Progress% +
+
+
+
+
+
+ @bucket.Details +
+
+ } +
+ @if (bucket.IsInactive) + { + + } + else + { + + + + } +
-} +
+ + + } + +
-
+
@if (_step4Enabled) { - + } @if (_dataContext.SelectedImportProfile.ImportProfileId != Guid.Empty) { - - + + }
-
-
+
+
-
+
-
- - -
-
+

e.g. yyyy-MM-dd, dd.MM.yyyy, MM/dd/yyyy

-
+
+
+
+ + +
+

Use BCP 47 language tag like en-US or de-DE

-
+
@@ -128,8 +130,8 @@
-
-
+
+
-
+
-
Additional Mapping Settings:
-
-
-
- - -
-
- - -
-
- - -
-
+
Additional Mapping Settings:
+
+ + +
+
+ + +
+
+ + +
+
@switch (_dataContext.SelectedImportProfile.AdditionalSettingCreditValue) { case ImportProfileViewModel.AdditionalSettingsForCreditValues.CreditInSeparateColumns: -
+
-
+
@@ -237,7 +237,7 @@
-
+
@@ -245,7 +245,7 @@
@if (_dataContext.SelectedImportProfile.AdditionalSettingAmountCleanup) { -
+
@@ -269,34 +269,36 @@
- @if (!_isValidationRunning) - { - - } - else - { - - } - - @if (_dataContext.ValidRecords > 0 && !_isValidationRunning) - { - @if (!_isImportRunning) +
+ @if (!_isValidationRunning) { - - + } else { - + Validating... + } - } -
+ + @if (_dataContext.ValidRecords > 0 && !_isValidationRunning) + { + @if (!_isImportRunning) + { + + + } + else + { + + } + } +
+
Total Records: @_dataContext.TotalRecords
Valid Records: @_dataContext.ValidRecords
Records with errors: @_dataContext.RecordsWithErrors
@@ -309,14 +311,14 @@ @if (_dataContext.ParsedRecords.Any(i => i.IsValid)) { -
+
Preview (Valid Records)
- - + + @@ -326,20 +328,20 @@ { - - + + }
DateAccountPayeeAccountPayee Memo Amount
@transaction.Result.TransactionDate.ToShortDateString()@_dataContext.SelectedImportProfile.Account.Name@transaction.Result.Payee@_dataContext.SelectedImportProfile.Account.Name@transaction.Result.Payee @transaction.Result.Memo @transaction.Result.Amount
-
+
} - + @if (_dataContext.ParsedRecords.Any(i => !i.IsValid)) { -
+
Records with error:
@@ -359,46 +361,46 @@ }
-
+
} - + @if (_dataContext.Duplicates.Any()) {
Potential Duplicates:
- - - - - - - - + + + + + + + + - @foreach (var duplicate in _dataContext.Duplicates) + @foreach (var duplicate in _dataContext.Duplicates) + { + + + + + + + + + foreach (var bankTransaction in duplicate.Item2) { - - - - - - - + + + + + + - foreach (var bankTransaction in duplicate.Item2) - { - - - - - - - - } } + }
DateAccountPayeeMemoAmount
DateAccountPayeeMemoAmount
@duplicate.Item1.Result.TransactionDate.ToShortDateString()@_dataContext.SelectedImportProfile.Account.Name@duplicate.Item1.Result.Payee@duplicate.Item1.Result.Memo@duplicate.Item1.Result.Amount
@duplicate.Item1.Result.TransactionDate.ToShortDateString()@_dataContext.SelectedImportProfile.Account.Name@duplicate.Item1.Result.Payee@duplicate.Item1.Result.Memo@duplicate.Item1.Result.Amount
@bankTransaction.TransactionDate.ToShortDateString()@_dataContext.SelectedImportProfile.Account.Name@bankTransaction.Payee@bankTransaction.Memo@bankTransaction.Amount
@bankTransaction.TransactionDate.ToShortDateString()@_dataContext.SelectedImportProfile.Account.Name@bankTransaction.Payee@bankTransaction.Memo@bankTransaction.Amount
diff --git a/OpenBudgeteer.Blazor/Pages/Index.razor b/OpenBudgeteer.Blazor/Pages/Index.razor index a83fd27..a8981f2 100644 --- a/OpenBudgeteer.Blazor/Pages/Index.razor +++ b/OpenBudgeteer.Blazor/Pages/Index.razor @@ -16,13 +16,13 @@ -
-
-
-
- +
+
+
+
+ ...
-
+
OpenBudgeteer Repository

Access source code hosted on Github

@@ -30,12 +30,12 @@
-
-
-
- +
+
+
+ ...
-
+
Create Issue

Found a bug or missing a feature? Create an issue on Github

@@ -43,12 +43,12 @@
-
-
-
- +
+
+
+ ...
-
+
Display Change Log

See latest updates and changes.

diff --git a/OpenBudgeteer.Blazor/Pages/Report.razor b/OpenBudgeteer.Blazor/Pages/Report.razor index cb13edd..a721882 100644 --- a/OpenBudgeteer.Blazor/Pages/Report.razor +++ b/OpenBudgeteer.Blazor/Pages/Report.razor @@ -2,44 +2,56 @@ @using ChartJs.Blazor.Charts
-
-

Month Balances

- +
+
+

Month Balances

+ +
-
-

Bank Balances

- +
+
+

Bank Balances

+ +
-
-

Income & Expenses per Month

- +
+
+

Income & Expenses per Month

+ +
-
-

Income & Expenses per Year

- +
+
+

Income & Expenses per Year

+ +
-
-

Bucket Monthly Expenses

- @foreach (var config in _monthBucketExpensesConfigsLeft) - { -
@config.Item1
-
- -
- } +
+
+

Bucket Monthly Expenses

+ @foreach (var config in _monthBucketExpensesConfigsLeft) + { +
@config.Item1
+
+ +
+ } +
-
-

Bucket Monthly Expenses

- @foreach (var config in _monthBucketExpensesConfigsRight) - { -
@config.Item1
-
- -
- } +
+
+

Bucket Monthly Expenses

+ @foreach (var config in _monthBucketExpensesConfigsRight) + { +
@config.Item1
+
+ +
+ } +
diff --git a/OpenBudgeteer.Blazor/Pages/Transaction.razor b/OpenBudgeteer.Blazor/Pages/Transaction.razor index 470cc49..84d9d1e 100644 --- a/OpenBudgeteer.Blazor/Pages/Transaction.razor +++ b/OpenBudgeteer.Blazor/Pages/Transaction.razor @@ -3,40 +3,36 @@ @using System.Globalization @using OpenBudgeteer.Core.Common.Extensions -
-
- @if (_massEditEnabled) - { - - - } - else - { - - - -
- - + + } + else + { + + + +
+ + - -
+ + +
+ } + - @foreach (var filter in Enum.GetValues()) - { - - } - -
- + +
@if (_newTransactionEnabled) @@ -44,21 +40,21 @@ - - - - - - - + + + + + + - - - - - - + + +
DateAccountPayeeMemoAmountBuckets + DateAccountPayeeMemoAmountBuckets
+ + + @foreach (var bucket in _dataContext.NewTransaction.Buckets) @@ -97,7 +93,7 @@ } -
+ @@ -109,14 +105,14 @@ - - - - - - - - + + + + + + + @@ -125,10 +121,10 @@ @if (transaction.InModification) { - - - - - - + + +
DateAccountPayeeMemoAmountBuckets +
DateAccountPayeeMemoAmountBuckets
+ + + @foreach (var bucket in transaction.Buckets) @@ -167,7 +163,7 @@ } - - - - - - - + + + + + - diff --git a/OpenBudgeteer.Blazor/Shared/BucketStatsElement.razor b/OpenBudgeteer.Blazor/Shared/BucketStatsElement.razor new file mode 100644 index 0000000..cfb3b5d --- /dev/null +++ b/OpenBudgeteer.Blazor/Shared/BucketStatsElement.razor @@ -0,0 +1,21 @@ +
+
+ +
+
+ @Title +
+ @Amount +
+
+ +@code { + [Parameter] + public string? ImageUrl { get; set; } + + [Parameter] + public string? Title { get; set; } + + [Parameter] + public string? Amount { get; set; } +} \ No newline at end of file diff --git a/OpenBudgeteer.Blazor/Shared/MainLayout.razor b/OpenBudgeteer.Blazor/Shared/MainLayout.razor index 0241007..56a39b1 100644 --- a/OpenBudgeteer.Blazor/Shared/MainLayout.razor +++ b/OpenBudgeteer.Blazor/Shared/MainLayout.razor @@ -15,8 +15,8 @@
OpenBudgeteer - Database: @CurrentDatabase - Version: 1.8 (Change Log) + Database: @CurrentDatabase + Version: 1.8 (Change Log)
diff --git a/OpenBudgeteer.Blazor/Shared/YearMonthSelector.razor b/OpenBudgeteer.Blazor/Shared/YearMonthSelector.razor index e0b6333..c412501 100644 --- a/OpenBudgeteer.Blazor/Shared/YearMonthSelector.razor +++ b/OpenBudgeteer.Blazor/Shared/YearMonthSelector.razor @@ -9,7 +9,7 @@ } -
+
- - + + @@ -118,8 +118,8 @@ - - + - -
+ @@ -177,12 +173,12 @@ else {
@transaction.TransactionDate.ToShortDateString()@transaction.AccountName@transaction.Payee@transaction.Memo@transaction.Amount.ToString("C", CultureInfo.CurrentCulture) + @transaction.TransactionDate.ToShortDateString()@transaction.AccountName@transaction.Payee@transaction.Memo@transaction.Amount.ToString("C", CultureInfo.CurrentCulture) @foreach (var bucket in transaction.Buckets) {
@@ -191,7 +187,7 @@
}
+ Want In ActivityDetailsDetails
@(bucketGroup.TotalWant == 0 ? string.Empty : bucketGroup.TotalWant.ToString("C", CultureInfo.CurrentCulture)) @(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("C", CultureInfo.CurrentCulture)) @(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("C", CultureInfo.CurrentCulture)) + @@ -163,7 +163,7 @@ @(bucket.Want == 0 ? string.Empty : bucket.Want.ToString("C", CultureInfo.CurrentCulture)) @(bucket.In == 0 ? string.Empty : bucket.In.ToString("C", CultureInfo.CurrentCulture)) @(bucket.Activity == 0 ? string.Empty : bucket.Activity.ToString("C", CultureInfo.CurrentCulture)) + @if (bucket.IsProgressbarVisible) {
@@ -182,7 +182,7 @@
}
+ @if (bucket.IsInactive) { diff --git a/OpenBudgeteer.Blazor/Pages/DataConsistency.razor b/OpenBudgeteer.Blazor/Pages/DataConsistency.razor index 2f411e2..2fd147c 100644 --- a/OpenBudgeteer.Blazor/Pages/DataConsistency.razor +++ b/OpenBudgeteer.Blazor/Pages/DataConsistency.razor @@ -69,18 +69,8 @@ } -@if (_isLoadingDialogVisible) -{ - - -} + diff --git a/OpenBudgeteer.Blazor/Pages/Rules.razor b/OpenBudgeteer.Blazor/Pages/Rules.razor index 96cce16..c6a57e3 100644 --- a/OpenBudgeteer.Blazor/Pages/Rules.razor +++ b/OpenBudgeteer.Blazor/Pages/Rules.razor @@ -5,42 +5,41 @@ @using OpenBudgeteer.Core.Common.Extensions @using OpenBudgeteer.Core.ViewModels.EntityViewModels -
-
- @if (_massEditEnabled) - { - - - } - else - { - - - } -
+
+ @if (_massEditEnabled) + { + + + } + else + { + + + }
@if (_newMappingRuleSetIsEnabled) { - +
- - - - + + + + + - - - + + - - @@ -90,10 +89,11 @@
PriorityRule NameTarget BucketMapping RulesPriorityRule NameTarget BucketMapping Rules
+ + @foreach (var mappingRule in _dataContext.NewRuleSet.MappingRules) @@ -78,7 +77,7 @@
+
- - - - + + + + + @@ -102,14 +102,14 @@ @if (ruleSet.InModification) { - - - + + - - @@ -156,10 +156,10 @@ else { - - - - + + + - diff --git a/OpenBudgeteer.Blazor/Pages/Transaction.razor b/OpenBudgeteer.Blazor/Pages/Transaction.razor index 84d9d1e..ee4a3c1 100644 --- a/OpenBudgeteer.Blazor/Pages/Transaction.razor +++ b/OpenBudgeteer.Blazor/Pages/Transaction.razor @@ -46,7 +46,7 @@ - @@ -93,7 +93,7 @@ } - - @@ -163,7 +163,7 @@ } - - diff --git a/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor b/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor index cc6aa3a..247fe02 100644 --- a/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/BucketDetailsDialog.razor @@ -36,9 +36,9 @@ - - - + + + @@ -47,8 +47,8 @@ { - - + + @@ -58,19 +58,25 @@
-
-

Month Balances

- +
+
+

Month Balances

+ +
-
-

Input & Output

- +
+
+

Input & Output

+ +
-
-

Balance Progression

- +
+
+

Balance Progression

+ +
diff --git a/OpenBudgeteer.Blazor/Shared/BucketSelectDialog.razor b/OpenBudgeteer.Blazor/Shared/BucketSelectDialog.razor index 2b4cae1..9dbe4fa 100644 --- a/OpenBudgeteer.Blazor/Shared/BucketSelectDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/BucketSelectDialog.razor @@ -28,9 +28,9 @@
- - - + + + @@ -49,9 +49,9 @@ - - - + + + @@ -75,9 +75,9 @@ - - - + +
PriorityRule NameTarget BucketMapping RulesPriorityRule NameTarget BucketMapping Rules
+ + @foreach (var mappingRule in ruleSet.MappingRules) @@ -147,7 +147,7 @@
+
@ruleSet.Priority@ruleSet.Name
@ruleSet.TargetBucketName
+ @ruleSet.Priority@ruleSet.Name
@ruleSet.TargetBucketName
    @foreach (var mappingRule in ruleSet.MappingRules) { @@ -167,7 +167,7 @@ }
+ Memo Amount Buckets +
+ @@ -112,7 +112,7 @@ Memo Amount Buckets +
+ @@ -187,7 +187,7 @@ } +
DateAccountPayeeMemoAccountPayeeMemo Amount
@transaction.TransactionDate.ToShortDateString()@transaction.AccountName@transaction.Payee@transaction.AccountName@transaction.Payee @transaction.Memo @transaction.Amount.ToString("C", CultureInfo.CurrentCulture)
Bucket BalanceInActivityDetailsInActivityDetails
@bucketGroup.TotalBalance.ToString("C", CultureInfo.CurrentCulture)@(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("C", CultureInfo.CurrentCulture))@(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("C", CultureInfo.CurrentCulture))@(bucketGroup.TotalIn == 0 ? string.Empty : bucketGroup.TotalIn.ToString("C", CultureInfo.CurrentCulture))@(bucketGroup.TotalActivity == 0 ? string.Empty : bucketGroup.TotalActivity.ToString("C", CultureInfo.CurrentCulture))
@bucket.Balance.ToString("C", CultureInfo.CurrentCulture)@(bucket.In == 0 ? string.Empty : bucket.In.ToString("C", CultureInfo.CurrentCulture))@(bucket.Activity == 0 ? string.Empty : bucket.Activity.ToString("C", CultureInfo.CurrentCulture)) + @(bucket.In == 0 ? string.Empty : bucket.In.ToString("C", CultureInfo.CurrentCulture))@(bucket.Activity == 0 ? string.Empty : bucket.Activity.ToString("C", CultureInfo.CurrentCulture)) @if (bucket.IsProgressbarVisible) {
diff --git a/OpenBudgeteer.Blazor/Shared/EditBucketDialog.razor b/OpenBudgeteer.Blazor/Shared/EditBucketDialog.razor index e05ef1a..01b273e 100644 --- a/OpenBudgeteer.Blazor/Shared/EditBucketDialog.razor +++ b/OpenBudgeteer.Blazor/Shared/EditBucketDialog.razor @@ -11,12 +11,12 @@