diff --git a/.github/workflows/docker-image-master.yml b/.github/workflows/docker-image-master.yml index 692c5d6..e1bbb18 100644 --- a/.github/workflows/docker-image-master.yml +++ b/.github/workflows/docker-image-master.yml @@ -5,7 +5,7 @@ on: branches: [ master ] env: - DOTNET_VERSION: '7.0.103' # The .NET SDK version to use + DOTNET_VERSION: '8.0.100' # The .NET SDK version to use jobs: test: diff --git a/.github/workflows/docker-image-pre-release.yml b/.github/workflows/docker-image-pre-release.yml index b6644d8..ba7c92a 100644 --- a/.github/workflows/docker-image-pre-release.yml +++ b/.github/workflows/docker-image-pre-release.yml @@ -5,7 +5,7 @@ on: branches: [ pre-release ] env: - DOTNET_VERSION: '7.0.103' # The .NET SDK version to use + DOTNET_VERSION: '8.0.100' # The .NET SDK version to use jobs: test: @@ -56,4 +56,5 @@ jobs: push: true tags: axelander/openbudgeteer:pre-release # file: OpenBudgeteer.Blazor/Dockerfile - platforms: linux/amd64 + platforms: linux/arm64,linux/amd64 +# platforms: linux/amd64 diff --git a/Dockerfile b/Dockerfile index e497431..0de8f37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,19 @@ #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:7.0-alpine AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base WORKDIR /app 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:7.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 WORKDIR /src COPY . . -RUN dotnet restore -r linux-musl-x64 +RUN dotnet restore WORKDIR "/src/OpenBudgeteer.Blazor" -RUN dotnet publish "OpenBudgeteer.Blazor.csproj" -r linux-musl-x64 --no-self-contained -c Release -o /app/publish +RUN dotnet publish "OpenBudgeteer.Blazor.csproj" --no-self-contained -c Release -o /app/publish FROM base AS final WORKDIR /app diff --git a/OpenBudgeteer.API/Dockerfile b/OpenBudgeteer.API/Dockerfile index f496ebb..a147c8c 100644 --- a/OpenBudgeteer.API/Dockerfile +++ b/OpenBudgeteer.API/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base WORKDIR /api ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 ENV DOTNET_RUNNING_IN_CONTAINER=true @@ -7,7 +7,7 @@ EXPOSE 80 EXPOSE 443 RUN apk add --no-cache icu-libs icu-data-full -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["OpenBudgeteer.API/OpenBudgeteer.API.csproj", "OpenBudgeteer.API/"] RUN dotnet restore "OpenBudgeteer.API/OpenBudgeteer.API.csproj" diff --git a/OpenBudgeteer.API/OpenBudgeteer.API.csproj b/OpenBudgeteer.API/OpenBudgeteer.API.csproj index 21127ad..a19dd35 100644 --- a/OpenBudgeteer.API/OpenBudgeteer.API.csproj +++ b/OpenBudgeteer.API/OpenBudgeteer.API.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable Linux @@ -25,7 +25,7 @@ - + diff --git a/OpenBudgeteer.API/Program.cs b/OpenBudgeteer.API/Program.cs index 694d54b..161b824 100644 --- a/OpenBudgeteer.API/Program.cs +++ b/OpenBudgeteer.API/Program.cs @@ -339,8 +339,3 @@ await recurringTransactionService.CreatePendingBankTransactionAsync(yearMonth)) //} app.Run(); - -internal record WeatherForecast(DateTime Date, int TemperatureC, string? Summary) -{ - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); -} \ No newline at end of file diff --git a/OpenBudgeteer.Blazor/App.razor b/OpenBudgeteer.Blazor/App.razor index bf6c773..02a095e 100644 --- a/OpenBudgeteer.Blazor/App.razor +++ b/OpenBudgeteer.Blazor/App.razor @@ -1,11 +1,78 @@ - - - - - - - -

Sorry, there's nothing at this address.

-
-
-
+@using Microsoft.Extensions.Hosting +@using OpenBudgeteer.Core.Common +@inject IHostEnvironment Env + + + + + + + OpenBudgeteer + + + + + + + + + + + + + +
+ @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