Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/buildwindowsimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
steps:
- uses: actions/checkout@v2.3.4

- name: Install NET 9
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '9.0.x'

- name: Get the version
id: get_version
uses: battila7/get-version-action@v2
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
steps:
- uses: actions/checkout@v2.3.4

- name: Install NET 9
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '9.0.x'

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/nightlybuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
steps:
- uses: actions/checkout@v2.3.4

- name: Install NET 9
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '9.0.x'

- name: Set Up Variables
run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:

steps:
- uses: actions/checkout@v2.3.4

- name: Install NET 9
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '9.0.x'

- name: Restore Nuget Packages
run: dotnet restore EstateReportingAPI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pushtomaster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0

- name: Install NET 9
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '9.0.x'

- name: Restore Nuget Packages
run: dotnet restore EstateReportingAPI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MediatR" Version="12.4.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="8.6.1" />
<PackageReference Include="Shared" Version="2025.3.1" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.2.10" />
<PackageReference Include="MediatR" Version="12.5.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="9.6.5" />
<PackageReference Include="Shared" Version="2025.6.1" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.5.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions EstateReportingAPI.BusinessLogic/ReportingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ public async Task<TodaysSales> GetTodaysFailedSales(Guid estateId, DateTime comp
TodaysSales response = new TodaysSales{
ComparisonSalesCount = comparisonSales.Count,
ComparisonSalesValue = comparisonSales.Sum(),
ComparisonAverageSalesValue = comparisonSales.Sum() / comparisonSales.Count,
ComparisonAverageSalesValue = SafeDivide(comparisonSales.Sum(),comparisonSales.Count),
TodaysSalesCount = todaysSales.Count,
TodaysSalesValue = todaysSales.Sum(),
TodaysAverageSalesValue = todaysSales.Sum() / todaysSales.Count
TodaysAverageSalesValue = SafeDivide(todaysSales.Sum(),todaysSales.Count)
};
return response;
}
Expand Down
6 changes: 3 additions & 3 deletions EstateReportingAPI.Client/EstateReportingAPI.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net9.0</TargetFrameworks>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);IncludeP2PAssets</TargetsForTfmSpecificBuildOutput>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClientProxyBase" Version="2025.3.1" />
<PackageReference Include="ClientProxyBase" Version="2025.6.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Shared.Results" Version="2025.3.1" />
<PackageReference Include="Shared.Results" Version="2025.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion EstateReportingAPI.Client/EstateReportingApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace EstateReportingAPI.Client{
using ClientProxyBase;
using DataTransferObjects;
using DataTrasferObjects;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;

public class EstateReportingApiClient : ClientProxyBase, IEstateReportingApiClient{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<DebugType>None</DebugType>
</PropertyGroup>
Expand Down
12 changes: 7 additions & 5 deletions EstateReportingAPI.IntegrationTests/DimensionControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
await helper.AddCalendarYear(year);
}

List<CalendarYear> years = await ApiClient.GetCalendarYears(string.Empty, Guid.NewGuid(), CancellationToken.None);

var result = await ApiClient.GetCalendarYears(string.Empty, Guid.NewGuid(), CancellationToken.None);
result.IsSuccess.ShouldBeTrue();
var years = result.Data;
years.ShouldNotBeNull();
years.Count.ShouldBe(yearList.Count);
}
Expand All @@ -52,9 +53,10 @@
List<DateTime> datesInYear = helper.GetDatesForYear(DateTime.Now.Year);
await helper.AddCalendarDates(datesInYear);

List<ComparisonDate> dates = await ApiClient.GetComparisonDates(string.Empty, Guid.NewGuid(), CancellationToken.None);

List<DateTime> expectedDates = datesInYear.Where(d => d <= DateTime.Now.Date.AddDays(-1)).ToList();
Result<List<ComparisonDate>> result = await ApiClient.GetComparisonDates(string.Empty, Guid.NewGuid(), CancellationToken.None);
result.IsSuccess.ShouldBeTrue();
List<ComparisonDate> dates = result.Data;
List <DateTime> expectedDates = datesInYear.Where(d => d <= DateTime.Now.Date.AddDays(-1)).ToList();
int expectedCount = expectedDates.Count + 2;
dates.ShouldNotBeNull();
dates.Count.ShouldBe(expectedCount);
Expand Down Expand Up @@ -273,7 +275,7 @@

}

public void Dispose()

Check warning on line 278 in EstateReportingAPI.IntegrationTests/DimensionControllerTests.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

'DimensionsControllerTests.Dispose()' hides inherited member 'ControllerTestsBase.Dispose()'. Use the new keyword if hiding was intended.
{
EstateManagementGenericContext context = new EstateManagementSqlServerContext(GetLocalConnectionString($"EstateReportingReadModel{TestId.ToString()}"));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<DebugType>None</DebugType>
<TargetFramework>net9.0</TargetFramework>
<DebugType>Full</DebugType>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="TransactionProcessor.Database" Version="2025.2.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.14" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.5.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -21,14 +21,14 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="Shared" Version="2025.3.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="2025.3.1" />
<PackageReference Include="Shared" Version="2025.6.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="2025.6.1" />
<PackageReference Include="Ductus.FluentDocker" Version="2.10.59" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.4.0" />
<PackageReference Include="SecurityService.Client" Version="2025.1.1" />
<PackageReference Include="Lamar" Version="14.0.1" />
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="14.0.1" />
<PackageReference Include="NLog" Version="5.5.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.5.0" />
<PackageReference Include="SecurityService.Client" Version="2025.5.1" />
<PackageReference Include="Lamar" Version="15.0.0" />
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="15.0.0" />

</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@

var result = await ApiClient.GetTopBottomOperatorData(string.Empty, Guid.NewGuid(), DataTransferObjects.TopBottom.Bottom, 3, CancellationToken.None);
result.IsSuccess.ShouldBeTrue();
List<TopBottomOperatorData>? topBottomOperatorData = result.Data;

Check warning on line 185 in EstateReportingAPI.IntegrationTests/FactTransactionsControllerTests.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
topBottomOperatorData.ShouldNotBeNull();
topBottomOperatorData[0].OperatorName.ShouldBe("Voucher");
topBottomOperatorData[0].SalesValue.ShouldBe(transactionsDictionary["Voucher"].Sum(p => p.TransactionAmount));
Expand Down Expand Up @@ -1310,7 +1310,8 @@
var comparisonDateTransactions = new List<Transaction>();
DatabaseHelper helper = new DatabaseHelper(context);
// TODO: make counts dynamic
DateTime todaysDateTime = DateTime.Now;
DateTime todaysDateTime = DateTime.Now.Date;
todaysDateTime = todaysDateTime.AddHours(12).AddMinutes(30);

Dictionary<string, int> transactionCounts = new() { { "Test Merchant 1", 3 }, { "Test Merchant 2", 6 }, { "Test Merchant 3", 2 }, { "Test Merchant 4", 0 } };

Expand Down Expand Up @@ -1338,7 +1339,7 @@
foreach ((Guid productId, String productName, Decimal? productValue) product in productList) {
var transactionCount = transactionCounts.Single(m => m.Key == merchant.Name).Value;
for (int i = 0; i < transactionCount; i++) {
Transaction transaction = await helper.BuildTransactionX(comparisonDate, merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
Transaction transaction = await helper.BuildTransactionX(comparisonDate.AddHours(-1), merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
comparisonDateTransactions.Add(transaction);
}
}
Expand Down
2 changes: 1 addition & 1 deletion EstateReportingAPI.Models/EstateReportingAPI.Models.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DebugType>None</DebugType>
Expand Down
18 changes: 9 additions & 9 deletions EstateReportingAPI.Tests/EstateReportingAPI.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<DebugType>None</DebugType>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.14">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
1 change: 1 addition & 0 deletions EstateReportingAPI/Controllers/DimensionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using EstateReportingAPI.Models;
using MediatR;
using Shared.Results;
using Shared.Results.Web;
using SimpleResults;

namespace EstateReportingAPI.Controllers
Expand Down
1 change: 1 addition & 0 deletions EstateReportingAPI/Controllers/FactSettlementController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics.CodeAnalysis;
using EstateReportingAPI.BusinessLogic.Queries;
using Shared.Results.Web;

namespace EstateReportingAPI.Controllers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using JasperFx.Core;
using MediatR;
using Shared.Results;
using Shared.Results.Web;

namespace EstateReportingAPI.Controllers{
using DataTransferObjects;
Expand Down
2 changes: 1 addition & 1 deletion EstateReportingAPI/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM stuartferguson/txnprocbase AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
COPY ["EstateReportingAPI/NuGet.Config", "."]
COPY ["EstateReportingAPI/EstateReportingAPI.csproj", "EstateReportingAPI/"]
Expand Down
2 changes: 1 addition & 1 deletion EstateReportingAPI/Dockerfilewindows
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM stuartferguson/txnprocbasewindows AS base
USER ContainerAdministrator
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build
WORKDIR /src
COPY ["EstateReportingAPI/NuGet.Config", "."]
COPY ["EstateReportingAPI/EstateReportingAPI.csproj", "EstateReportingAPI/"]
Expand Down
35 changes: 18 additions & 17 deletions EstateReportingAPI/EstateReportingAPI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>3ed94abc-423c-49b8-ac5d-edc80e1eaa74</UserSecretsId>
Expand All @@ -10,32 +10,33 @@

<ItemGroup>

<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.14" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.2" />
<PackageReference Include="Shared.Results" Version="2025.3.1" />
<PackageReference Include="Shared.Results" Version="2025.6.1" />
<PackageReference Include="Shared.Results.Web" Version="2025.6.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Lamar" Version="14.0.1" />
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="14.0.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.4.0" />
<PackageReference Include="Shared" Version="2025.3.1" />
<PackageReference Include="Lamar" Version="15.0.0" />
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="15.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.5.0" />
<PackageReference Include="Shared" Version="2025.6.1" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.14" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="7.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="7.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.3.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.14" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.2.10" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="8.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="8.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="8.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="8.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.5" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.5.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading