Skip to content

Commit

Permalink
Merge branch 'main' into cbs/remove_message_count_listener
Browse files Browse the repository at this point in the history
  • Loading branch information
CBrohus authored Mar 29, 2023
2 parents 84d0b8e + 5a1dadb commit 4c6b142
Show file tree
Hide file tree
Showing 22 changed files with 230 additions and 90 deletions.
18 changes: 11 additions & 7 deletions source/Api/Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,24 @@ limitations under the License.
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Energinet.DataHub.Core.App.Common.Security" Version="7.4.0" />
<PackageReference Include="Energinet.DataHub.Core.App.FunctionApp" Version="7.4.0" />
<PackageReference Include="Energinet.DataHub.Core.Logging" Version="2.2.3" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" Version="1.1.0" />
<PackageReference Include="Energinet.DataHub.Core.App.Common.Security" Version="7.4.1" />
<PackageReference Include="Energinet.DataHub.Core.App.FunctionApp" Version="7.4.1" />
<PackageReference Include="Energinet.DataHub.Core.Logging" Version="2.2.4" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" Version="1.2.0-preview1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.ServiceBus" Version="5.7.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.7.0" OutputItemType="Analyzer" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.10.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.9.0-preview2" OutputItemType="Analyzer" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.13.0" />
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.5.22">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23121.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
14 changes: 9 additions & 5 deletions source/Application/Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ limitations under the License.
<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="MediatR" Version="12.0.1" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.4" />
<PackageReference Include="NodaTime" Version="3.1.6" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0-preview.2.23128.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-preview.2.23128.3" />
<PackageReference Include="NodaTime" Version="3.1.9" />
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.5.22">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23121.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,3 @@ public ForwardAggregationResult(Aggregation result)

public Aggregation Result { get; }
}

public class ForwardAggregationResultHandler : IRequestHandler<ForwardAggregationResult, Unit>
{
private readonly IAggregationResultForwardingRepository _transactions;
private readonly IOutgoingMessageStore _outgoingMessageStore;

public ForwardAggregationResultHandler(IAggregationResultForwardingRepository transactions, IOutgoingMessageStore outgoingMessageStore)
{
_transactions = transactions;
_outgoingMessageStore = outgoingMessageStore;
}

public Task<Unit> Handle(ForwardAggregationResult request, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(request);
var transaction = new AggregationResultForwarding(TransactionId.New());
_transactions.Add(transaction);
_outgoingMessageStore.Add(transaction.CreateMessage(request.Result));
return Unit.Task;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2020 Energinet DataHub A/S
//
// Licensed under the Apache License, Version 2.0 (the "License2");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Threading;
using System.Threading.Tasks;
using Application.OutgoingMessages;
using Domain.Transactions;
using Domain.Transactions.Aggregations;
using MediatR;

namespace Application.Transactions.Aggregations;

public class ForwardAggregationResultHandler : IRequestHandler<ForwardAggregationResult, Unit>
{
private readonly IAggregationResultForwardingRepository _transactions;
private readonly IOutgoingMessageStore _outgoingMessageStore;

public ForwardAggregationResultHandler(IAggregationResultForwardingRepository transactions, IOutgoingMessageStore outgoingMessageStore)
{
_transactions = transactions;
_outgoingMessageStore = outgoingMessageStore;
}

public Task<Unit> Handle(ForwardAggregationResult request, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(request);
var transaction = new AggregationResultForwarding(TransactionId.New());
_transactions.Add(transaction);
_outgoingMessageStore.Add(transaction.CreateMessage(request.Result));
return Unit.Task;
}
}
27 changes: 27 additions & 0 deletions source/Application/Transactions/MoveIn/BusinessService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2020 Energinet DataHub A/S
//
// Licensed under the Apache License, Version 2.0 (the "License2");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;

namespace Application.Transactions.MoveIn;

public class BusinessService
{
public BusinessService(Uri requestEndPoint)
{
RequestEndPoint = requestEndPoint;
}

public Uri RequestEndPoint { get; set; }
}
20 changes: 20 additions & 0 deletions source/Application/Transactions/MoveIn/GridOperator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2020 Energinet DataHub A/S
//
// Licensed under the Apache License, Version 2.0 (the "License2");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Application.Transactions.MoveIn;

public class GridOperator
{
public int GracePeriodInDaysAfterEffectiveDateIfNotUpdated { get; set; }
}
25 changes: 25 additions & 0 deletions source/Application/Transactions/MoveIn/MessageDelivery.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2020 Energinet DataHub A/S
//
// Licensed under the Apache License, Version 2.0 (the "License2");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Application.Transactions.MoveIn;

public class MessageDelivery
{
public MessageDelivery(GridOperator gridOperator)
{
GridOperator = gridOperator;
}

public GridOperator GridOperator { get; set; }
}
25 changes: 0 additions & 25 deletions source/Application/Transactions/MoveIn/MoveInSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,3 @@ public MoveInSettings(MessageDelivery messageDelivery, BusinessService businessS

public MessageDelivery MessageDelivery { get; set; }
}

public class BusinessService
{
public BusinessService(Uri requestEndPoint)
{
RequestEndPoint = requestEndPoint;
}

public Uri RequestEndPoint { get; set; }
}

public class MessageDelivery
{
public MessageDelivery(GridOperator gridOperator)
{
GridOperator = gridOperator;
}

public GridOperator GridOperator { get; set; }
}

public class GridOperator
{
public int GracePeriodInDaysAfterEffectiveDateIfNotUpdated { get; set; }
}
6 changes: 5 additions & 1 deletion source/ApplyDBMigrationsApp/ApplyDBMigrationsApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ limitations under the License.
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23121.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 6 additions & 2 deletions source/ArchitectureTests/ArchitectureTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ limitations under the License.
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0-preview-20230223-05" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -36,7 +36,11 @@ limitations under the License.
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23121.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 6 additions & 2 deletions source/CimMessageAdapter/CimMessageAdapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ limitations under the License.

<ItemGroup>
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.13.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-preview.2.23128.3" />
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.5.22">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23121.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
14 changes: 13 additions & 1 deletion source/DocumentValidation/DocumentValidation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JsonSchema.Net" Version="4.0.0" />
<PackageReference Include="JsonSchema.Net" Version="4.0.1" />
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.5.22">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23121.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 6 additions & 2 deletions source/Domain/Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ limitations under the License.

<ItemGroup>
<PackageReference Include="MediatR" Version="12.0.1" />
<PackageReference Include="NodaTime" Version="3.1.6" />
<PackageReference Include="NodaTime" Version="3.1.9" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" />
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.5.22">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23121.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ limitations under the License.
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23121.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
18 changes: 11 additions & 7 deletions source/Infrastructure/Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ limitations under the License.
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="6.1.0" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="7.0.0-rc2.5" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="7.0.0-rc2.11" />
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.13.1" />
<PackageReference Include="Energinet.DataHub.Core.App.FunctionApp" Version="7.4.0" />
<PackageReference Include="Energinet.DataHub.Core.Logging" Version="2.2.3" />
<PackageReference Include="Energinet.DataHub.Core.App.FunctionApp" Version="7.4.1" />
<PackageReference Include="Energinet.DataHub.Core.Logging" Version="2.2.4" />
<PackageReference Include="Energinet.DataHub.EnergySupplying.IntegrationEvents" Version="1.0.2" />
<PackageReference Include="Energinet.DataHub.EnergySupplying.RequestResponse" Version="1.2.0" />
<PackageReference Include="Energinet.DataHub.MeteringPoints.IntegrationEvents" Version="1.0.4" />
<PackageReference Include="Energinet.DataHub.MeteringPoints.RequestResponse" Version="1.0.4" />
<PackageReference Include="Energinet.DataHub.Wholesale.Contracts" Version="2.2.1" />
<PackageReference Include="Energinet.DataHub.Wholesale.Contracts" Version="2.2.4" />
<PackageReference Include="MediatR" Version="12.0.1" />
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.6.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0-preview.2.23128.3" />
<PackageReference Include="NodaTime.Serialization.Protobuf" Version="2.0.0" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" />
<PackageReference Include="Polly" Version="7.2.3" />
Expand All @@ -41,7 +41,11 @@ limitations under the License.
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23121.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading

0 comments on commit 4c6b142

Please sign in to comment.