Skip to content

Commit bec38ef

Browse files
this commit refactor the web api project to use the internal ASP.NET package with middleware and reusable components
1 parent c1c5b19 commit bec38ef

10 files changed

Lines changed: 7 additions & 96 deletions

File tree

Boundaries/Comanda.Payments/Source/Comanda.Payments.WebApi/Comanda.Payments.WebApi.csproj

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.1" />
16-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
17-
<PackageReference Include="Scalar.AspNetCore" Version="2.12.7" />
18-
<PackageReference Include="Scalar.AspNetCore.Microsoft" Version="2.12.7" />
19-
<PackageReference Include="Sentry.AspNetCore" Version="6.0.0" />
20-
<PackageReference Include="Sentry.Serilog" Version="6.0.0" />
21-
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
22-
<PackageReference Include="Serilog.Sinks.Seq" Version="9.0.0" />
23-
<PackageReference Include="HttpsRichardy.Federation.Sdk" Version="4.2.0" />
15+
<PackageReference Include="Comanda.Internal.AspNet" Version="0.69.8" />
2416
</ItemGroup>
2517

2618
<ItemGroup>

Boundaries/Comanda.Payments/Source/Comanda.Payments.WebApi/Constants/Headers.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

Boundaries/Comanda.Payments/Source/Comanda.Payments.WebApi/Constants/SecuritySchemes.cs

Lines changed: 0 additions & 7 deletions
This file was deleted.

Boundaries/Comanda.Payments/Source/Comanda.Payments.WebApi/Interceptors/CorrelationInterceptor.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

Boundaries/Comanda.Payments/Source/Comanda.Payments.WebApi/Middlewares/CorrelationMiddleware.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

Boundaries/Comanda.Payments/Source/Comanda.Payments.WebApi/Middlewares/CorrelationMiddlewareExtension.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

Boundaries/Comanda.Payments/Source/Comanda.Payments.WebApi/Usings.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
global using Microsoft.AspNetCore.Authorization;
66
global using Microsoft.OpenApi.Models;
77

8-
global using Comanda.Payments.WebApi.Constants;
98
global using Comanda.Payments.WebApi.Interceptors;
109
global using Comanda.Payments.WebApi.Extensions;
11-
global using Comanda.Payments.WebApi.Middlewares;
1210
global using Comanda.Payments.Domain.Errors;
1311

1412
global using Comanda.Payments.Application.Payloads.Traceability;
@@ -21,10 +19,13 @@
2119
global using Comanda.Internal.Contracts.Clients;
2220
global using Comanda.Internal.Contracts.Clients.Interfaces;
2321

22+
global using Comanda.Internal.AspNet.Middlewares;
23+
global using Comanda.Internal.AspNet.Constants;
24+
global using Comanda.Internal.AspNet.Interceptors;
25+
2426
global using HttpsRichardy.Dispatcher.Contracts;
2527
global using HttpsRichardy.Federation.Sdk.Extensions;
2628

2729
global using Scalar.AspNetCore;
2830
global using Serilog;
29-
global using Serilog.Context;
3031
global using FluentValidation.AspNetCore;

Boundaries/Comanda.Payments/Tests/Integration/PaymentEndpointTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public async Task CreateCheckoutSession_ReturnsSuccess_AndPersistsPayment()
119119
Content = content
120120
};
121121

122-
httpRequest.Headers.Add(WebApi.Constants.Headers.Credential, "mocked.credential");
122+
httpRequest.Headers.Add(Internal.AspNet.Constants.Headers.Credential, "mocked.credential");
123123

124124
/* act: send POST request to create checkout session */
125125
var response = await httpClient.SendAsync(httpRequest, TestContext.Current.CancellationToken);

Boundaries/Comanda.Payments/Tests/Unit/Intecerptors/CredentialInterceptorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public async Task When_CredentialHeaderIsProvided_ThenBearerAuthorizationShouldB
88
var credential = Identifier.Generate<Payment>();
99
var httpContext = new DefaultHttpContext();
1010

11-
httpContext.Request.Headers[WebApi.Constants.Headers.Credential] = credential;
11+
httpContext.Request.Headers[Internal.AspNet.Constants.Headers.Credential] = credential;
1212

1313
var accessor = new HttpContextAccessor
1414
{

Boundaries/Comanda.Payments/nuget.config

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)