diff --git a/.github/workflows/chapter-4-contracts-workflow.yml b/.github/workflows/chapter-4-contracts-workflow.yml index ba6a14aa..3e61ba5c 100644 --- a/.github/workflows/chapter-4-contracts-workflow.yml +++ b/.github/workflows/chapter-4-contracts-workflow.yml @@ -27,7 +27,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Add Evolutionary Architecture Nuget Source uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main with: @@ -52,7 +52,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Add Evolutionary Architecture Nuget Source uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main with: diff --git a/.github/workflows/chapter-4-package-workflow.yml b/.github/workflows/chapter-4-package-workflow.yml index 2b1a661c..3738308e 100644 --- a/.github/workflows/chapter-4-package-workflow.yml +++ b/.github/workflows/chapter-4-package-workflow.yml @@ -27,7 +27,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Restore dependencies run: dotnet restore - name: Build @@ -45,7 +45,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Restore dependencies run: dotnet restore - name: Test @@ -64,7 +64,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Pack Projects run: | diff --git a/.github/workflows/chapter-4-workflow.yml b/.github/workflows/chapter-4-workflow.yml index fafe75f2..4824e82d 100644 --- a/.github/workflows/chapter-4-workflow.yml +++ b/.github/workflows/chapter-4-workflow.yml @@ -28,7 +28,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Add Evolutionary Architecture Nuget Source uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main with: @@ -53,7 +53,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Add Evolutionary Architecture Nuget Source uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@main with: diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Directory.Build.props b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Directory.Build.props index 4e4b16a0..673a7a9b 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Directory.Build.props +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Directory.Build.props @@ -3,7 +3,7 @@ EvolutionaryArchitecture.$(MSBuildProjectName) $(AssemblyName) - net9.0 + net10.0 latest true true diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Fitnet.Common.Core/Fitnet.Common.Core.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Fitnet.Common.Core/Fitnet.Common.Core.csproj index e70f667e..86871759 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Fitnet.Common.Core/Fitnet.Common.Core.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Fitnet.Common.Core/Fitnet.Common.Core.csproj @@ -1,7 +1,7 @@ - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Fitnet.Common.Infrastructure/Fitnet.Common.Infrastructure.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Fitnet.Common.Infrastructure/Fitnet.Common.Infrastructure.csproj index 692cfa1a..26354f83 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Fitnet.Common.Infrastructure/Fitnet.Common.Infrastructure.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Common/Fitnet.Common.Infrastructure/Fitnet.Common.Infrastructure.csproj @@ -2,10 +2,9 @@ - - - - - + + + + \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Build.props b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Build.props index 32629cc7..21ff713d 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Build.props +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Build.props @@ -3,7 +3,7 @@ EvolutionaryArchitecture.$(MSBuildProjectName) $(AssemblyName) - net9.0 + net10.0 latest true true diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Packages.props b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Packages.props new file mode 100644 index 00000000..d82425af --- /dev/null +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Packages.props @@ -0,0 +1,44 @@ + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Dockerfile b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Dockerfile index f15cb2cc..1491b7a3 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Dockerfile +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Dockerfile @@ -1,9 +1,9 @@ -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src COPY Directory.Build.props ./ COPY ["Fitnet.Contracts/Fitnet.Contracts.csproj", "Fitnet.Contracts/"] diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api.UnitTests/Fitnet.Contracts.Api.UnitTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api.UnitTests/Fitnet.Contracts.Api.UnitTests.csproj index 3ceeeb28..5c241224 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api.UnitTests/Fitnet.Contracts.Api.UnitTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api.UnitTests/Fitnet.Contracts.Api.UnitTests.csproj @@ -1,20 +1,20 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -28,9 +28,5 @@ - - - - \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/AttachAnnexToBindingContract/AttachAnnexToBindingContractEndpoint.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/AttachAnnexToBindingContract/AttachAnnexToBindingContractEndpoint.cs index 6bd85529..02b4f087 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/AttachAnnexToBindingContract/AttachAnnexToBindingContractEndpoint.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/AttachAnnexToBindingContract/AttachAnnexToBindingContractEndpoint.cs @@ -18,11 +18,8 @@ internal static void MapAttachAnnexToBindingContract(this IEndpointRouteBuilder await contractsModule.ExecuteCommandAsync(request.ToCommand(id), cancellationToken) .Match(annexId => Results.Created(BuildUrl(id, annexId), annexId), errors => errors.ToProblem())) - .WithOpenApi(operation => new(operation) - { - Summary = "Attach annex to existing binding contract", - Description = "This endpoint is used to attach an annex to an existing binding contract.", - }) + .WithSummary("Attach annex to existing binding contract") + .WithDescription("This endpoint is used to attach an annex to an existing binding contract.") .Produces(StatusCodes.Status201Created) .Produces(StatusCodes.Status404NotFound) .Produces(StatusCodes.Status409Conflict) diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/Fitnet.Contracts.Api.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/Fitnet.Contracts.Api.csproj index 001181fb..384cc80c 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/Fitnet.Contracts.Api.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/Fitnet.Contracts.Api.csproj @@ -17,7 +17,8 @@ - + + \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/PrepareContract/PrepareContractEndpoint.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/PrepareContract/PrepareContractEndpoint.cs index 92f6fcd7..4f636d1f 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/PrepareContract/PrepareContractEndpoint.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/PrepareContract/PrepareContractEndpoint.cs @@ -17,12 +17,8 @@ await contractsModule.ExecuteCommandAsync(request.ToCommand(), cancellationToken contractId => Results.Created(ContractsApiPaths.GetPreparedContractPath(contractId), (object?)contractId), errors => errors.ToProblem())) .ValidateRequest() - .WithOpenApi(operation => new(operation) - { - Summary = "Triggers preparation of a new contract for new or existing customer", - Description = - "This endpoint is used to prepare a new contract for new and existing customers.", - }) + .WithSummary("Triggers preparation of a new contract for new or existing customer") + .WithDescription("This endpoint is used to prepare a new contract for new and existing customers.") .Produces(StatusCodes.Status201Created) .Produces(StatusCodes.Status409Conflict) .Produces(StatusCodes.Status500InternalServerError); diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/SignContract/SignContractEndpoint.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/SignContract/SignContractEndpoint.cs index 64ed579d..2499e7b1 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/SignContract/SignContractEndpoint.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/SignContract/SignContractEndpoint.cs @@ -20,12 +20,8 @@ await contractsModule bindingContractId => Results.Created($"/{ContractsApiPaths.BindingContracts}/{bindingContractId}", bindingContractId), errors => errors.ToProblem())) .ValidateRequest() - .WithOpenApi(operation => new(operation) - { - Summary = "Signs prepared contract", - Description = - "This endpoint is used to sign prepared contract by customer.", - }) + .WithSummary("Signs prepared contract") + .WithDescription("This endpoint is used to sign prepared contract by customer.") .Produces(StatusCodes.Status201Created) .Produces(StatusCodes.Status404NotFound) .Produces(StatusCodes.Status409Conflict) diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/TerminateBindingContract/TerminateBindingContractEndpoint.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/TerminateBindingContract/TerminateBindingContractEndpoint.cs index f81312a7..ea2257a9 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/TerminateBindingContract/TerminateBindingContractEndpoint.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/TerminateBindingContract/TerminateBindingContractEndpoint.cs @@ -19,11 +19,8 @@ await contractsModule.ExecuteCommandAsync(new TerminateBindingContractCommand(bi .Match( _ => Results.NoContent(), errors => errors.ToProblem())) - .WithOpenApi(operation => new(operation) - { - Summary = "Terminates binding contract", - Description = "This endpoint is used to terminate an existing binding contract." - }) + .WithSummary("Terminates binding contract") + .WithDescription("This endpoint is used to terminate an existing binding contract.") .Produces(StatusCodes.Status204NoContent) .Produces(StatusCodes.Status404NotFound) .Produces(StatusCodes.Status409Conflict) diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/TerminateBindingContract/TerminateContractEndpoint.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/TerminateBindingContract/TerminateContractEndpoint.cs index 35f8132e..d2dddcff 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/TerminateBindingContract/TerminateContractEndpoint.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Api/TerminateBindingContract/TerminateContractEndpoint.cs @@ -19,11 +19,8 @@ internal static void MapTerminateContract(this IEndpointRouteBuilder app) => app return response; }) - .WithOpenApi(operation => new(operation) - { - Summary = "Terminate Binding Contract", - Description = "This endpoint is used to terminate a binding contract by invoking a termination.", - }) + .WithSummary("Terminate Binding Contract") + .WithDescription("This endpoint is used to terminate a binding contract by invoking a termination.") .Produces(StatusCodes.Status204NoContent) .Produces(StatusCodes.Status404NotFound) .Produces(StatusCodes.Status409Conflict) diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/Fitnet.Contracts.AppHost.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/Fitnet.Contracts.AppHost.csproj new file mode 100644 index 00000000..17bdc845 --- /dev/null +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/Fitnet.Contracts.AppHost.csproj @@ -0,0 +1,18 @@ + + + + + Exe + + + + + + + + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/Program.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/Program.cs new file mode 100644 index 00000000..1248f767 --- /dev/null +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/Program.cs @@ -0,0 +1,21 @@ +using Projects; + +var builder = DistributedApplication.CreateBuilder(args); + +var postgres = builder.AddPostgres("postgres") + .WithImage("postgres", "14.3") + .WithPgAdmin(); + +var fitnetDatabase = postgres.AddDatabase("fitnetsdb", "fitnet"); + +var rabbitmq = builder.AddRabbitMQ("rabbitmq") + .WithManagementPlugin(); + +builder.AddProject("fitnet-contracts-microservice") + .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development") + .WithReference(fitnetDatabase, "Database__ConnectionString") + .WithReference(rabbitmq, "EventBus__ConnectionString") + .WaitFor(postgres) + .WaitFor(rabbitmq); + +await builder.Build().RunAsync(); diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/appsettings.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/appsettings.json new file mode 100644 index 00000000..c06aa74a --- /dev/null +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.AppHost/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.DistributedApplication": "Information" + } + } +} diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Application/Fitnet.Contracts.Application.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Application/Fitnet.Contracts.Application.csproj index 1294f88a..db4b8d6a 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Application/Fitnet.Contracts.Application.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Application/Fitnet.Contracts.Application.csproj @@ -1,11 +1,11 @@ - - - - - - + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core.UnitTests/Fitnet.Contracts.Core.UnitTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core.UnitTests/Fitnet.Contracts.Core.UnitTests.csproj index d2d4b430..db05a216 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core.UnitTests/Fitnet.Contracts.Core.UnitTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core.UnitTests/Fitnet.Contracts.Core.UnitTests.csproj @@ -5,22 +5,22 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/Fitnet.Contracts.Core.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/Fitnet.Contracts.Core.csproj index ea07f1c6..182d4aba 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/Fitnet.Contracts.Core.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/Fitnet.Contracts.Core.csproj @@ -5,9 +5,9 @@ - - - + + + \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184153_MakeSignedAtColumnNullable.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184153_MakeSignedAtColumnNullable.cs index 8b35b64c..9edfabc1 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184153_MakeSignedAtColumnNullable.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184153_MakeSignedAtColumnNullable.cs @@ -1,6 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Contracts.Data.Database.Migrations; + using System; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184328_AddCustomerIdColumn.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184328_AddCustomerIdColumn.cs index cf6a802e..9d2c633a 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184328_AddCustomerIdColumn.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230601184328_AddCustomerIdColumn.cs @@ -1,6 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Contracts.Data.Database.Migrations; + using System; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230624171216_ContractsAddColumnsToSupportContractExpiration.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230624171216_ContractsAddColumnsToSupportContractExpiration.cs index 9afbaab9..609ed7f7 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230624171216_ContractsAddColumnsToSupportContractExpiration.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20230624171216_ContractsAddColumnsToSupportContractExpiration.cs @@ -1,6 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Contracts.Data.Database.Migrations; + using System; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240314062526_AddBindingContractTable.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240314062526_AddBindingContractTable.cs index 693d8108..d7016004 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240314062526_AddBindingContractTable.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240314062526_AddBindingContractTable.cs @@ -1,6 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Contracts.Data.Database.Migrations; + using System; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240507073145_ChangeBindingContractTerminatedAtToNullable.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240507073145_ChangeBindingContractTerminatedAtToNullable.cs index 35168c70..19bf460f 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240507073145_ChangeBindingContractTerminatedAtToNullable.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240507073145_ChangeBindingContractTerminatedAtToNullable.cs @@ -1,6 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Contracts.Infrastructure.Database.Migrations; + using System; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20241026165318_AddSignature.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20241026165318_AddSignature.cs index f5f85dd2..1effbd74 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20241026165318_AddSignature.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20241026165318_AddSignature.cs @@ -1,6 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Contracts.Infrastructure.Database.Migrations; + using Microsoft.EntityFrameworkCore.Migrations; /// diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/EventBus/EventBusModule.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/EventBus/EventBusModule.cs index b9c03abf..186a460f 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/EventBus/EventBusModule.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/EventBus/EventBusModule.cs @@ -18,12 +18,31 @@ internal static IServiceCollection AddEventBus(this IServiceCollection services, configurator.UsingRabbitMq((context, factoryConfigurator) => { var options = context.GetRequiredService>(); - var externalEventBusConfigured = options.Value is not null; - if (!externalEventBusConfigured) + var eventBusOptions = options.Value; + if (eventBusOptions is null) { return; } + var uri = eventBusOptions!.Uri; + var username = eventBusOptions!.Username; + var password = eventBusOptions!.Password; + + if (!string.IsNullOrEmpty(uri)) + { + factoryConfigurator.Host(uri, h => + { + if (!string.IsNullOrEmpty(username)) + { + h.Username(username); + } + if (!string.IsNullOrEmpty(password)) + { + h.Password(password); + } + }); + } + factoryConfigurator.ConfigureEndpoints(context); }); }); diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj index dbb232f3..aac3070c 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Fitnet.Contracts.Infrastructure.csproj @@ -5,13 +5,12 @@ - - - - - - - + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj index ebdf6f17..094aec41 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj @@ -4,7 +4,6 @@ 1.0.7 - - + \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/Fitnet.Contracts.IntegrationTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/Fitnet.Contracts.IntegrationTests.csproj index 31cf1a79..7240619f 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/Fitnet.Contracts.IntegrationTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationTests/Fitnet.Contracts.IntegrationTests.csproj @@ -5,14 +5,11 @@ - - - - - - - - + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.sln b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.sln index 0e93a9f8..65dbb577 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.sln +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fitnet.Contracts.Api.UnitTe EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fitnet.Contracts.IntegrationEvents", "Fitnet.Contracts.IntegrationEvents\Fitnet.Contracts.IntegrationEvents.csproj", "{0A0A7C05-D0FB-4FC3-95D3-1B1511D0B24D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fitnet.Contracts.AppHost", "Fitnet.Contracts.AppHost\Fitnet.Contracts.AppHost.csproj", "{B1C2D3E4-5F6A-7B8C-9D0E-1F2345678901}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -62,6 +64,10 @@ Global {0A0A7C05-D0FB-4FC3-95D3-1B1511D0B24D}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A0A7C05-D0FB-4FC3-95D3-1B1511D0B24D}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A0A7C05-D0FB-4FC3-95D3-1B1511D0B24D}.Release|Any CPU.Build.0 = Release|Any CPU + {B1C2D3E4-5F6A-7B8C-9D0E-1F2345678901}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1C2D3E4-5F6A-7B8C-9D0E-1F2345678901}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1C2D3E4-5F6A-7B8C-9D0E-1F2345678901}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1C2D3E4-5F6A-7B8C-9D0E-1F2345678901}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {ABC9D0F9-7D4F-4C89-8A68-B2DCB5DF93A8} = {FA67FD7C-D24A-4733-B6A5-FF78713CBFCD} diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Fitnet.Contracts.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Fitnet.Contracts.csproj index d1d1b3fd..9e9d68a9 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Fitnet.Contracts.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts/Fitnet.Contracts.csproj @@ -5,9 +5,9 @@ - - - + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/nuget.config b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/nuget.config index ebc8ad3a..e6aa1996 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/nuget.config +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/nuget.config @@ -10,6 +10,14 @@ + + + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Build.props b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Build.props index 32629cc7..21ff713d 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Build.props +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Build.props @@ -3,7 +3,7 @@ EvolutionaryArchitecture.$(MSBuildProjectName) $(AssemblyName) - net9.0 + net10.0 latest true true diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Packages.props b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Packages.props new file mode 100644 index 00000000..da0c946a --- /dev/null +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Packages.props @@ -0,0 +1,34 @@ + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Dockerfile b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Dockerfile index 248ebe90..8a5b15ed 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Dockerfile +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Dockerfile @@ -1,9 +1,9 @@ -FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src COPY Directory.Build.props ./ COPY ["Fitnet/Fitnet.csproj", "Fitnet/"] diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.AppHost/Fitnet.AppHost.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.AppHost/Fitnet.AppHost.csproj new file mode 100644 index 00000000..0e64a105 --- /dev/null +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.AppHost/Fitnet.AppHost.csproj @@ -0,0 +1,17 @@ + + + + + Exe + + + + + + + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.AppHost/Program.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.AppHost/Program.cs new file mode 100644 index 00000000..165c8a88 --- /dev/null +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.AppHost/Program.cs @@ -0,0 +1,16 @@ +using Projects; + +var builder = DistributedApplication.CreateBuilder(args); + +var postgres = builder.AddPostgres("postgres") + .WithImage("postgres", "14.3") + .WithPgAdmin(); + +var fitnetDatabase = postgres.AddDatabase("fitnetsdb", "fitnet"); + +builder.AddProject("fitnet-modular-monolith") + .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development") + .WithReference(fitnetDatabase, "Database__ConnectionString") + .WaitFor(postgres); + +await builder.Build().RunAsync(); diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.AppHost/appsettings.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.AppHost/appsettings.json new file mode 100644 index 00000000..c06aa74a --- /dev/null +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.AppHost/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.DistributedApplication": "Information" + } + } +} diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.sln b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.sln index 7523a1f5..906b22a6 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.sln +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.sln @@ -2,6 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fitnet", "Fitnet\Fitnet.csproj", "{F794BA2B-0F1A-4D1C-93B8-32B916FDEDEC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fitnet.AppHost", "Fitnet.AppHost\Fitnet.AppHost.csproj", "{A1B2C3D4-5E6F-7890-ABCD-EF1234567890}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Reports", "Reports", "{7D3193F0-C731-4683-893F-53CE8087D7E2}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Passes", "Passes", "{732AD772-11C2-4DCC-B6DC-D59EABEF335B}" @@ -78,6 +80,10 @@ Global {76B919C8-0434-4A54-AFD3-07F817CCEC38}.Debug|Any CPU.Build.0 = Debug|Any CPU {76B919C8-0434-4A54-AFD3-07F817CCEC38}.Release|Any CPU.ActiveCfg = Release|Any CPU {76B919C8-0434-4A54-AFD3-07F817CCEC38}.Release|Any CPU.Build.0 = Release|Any CPU + {A1B2C3D4-5E6F-7890-ABCD-EF1234567890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1B2C3D4-5E6F-7890-ABCD-EF1234567890}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1B2C3D4-5E6F-7890-ABCD-EF1234567890}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1B2C3D4-5E6F-7890-ABCD-EF1234567890}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {B834E435-6093-4174-9AC1-10D2E7398D31} = {732AD772-11C2-4DCC-B6DC-D59EABEF335B} diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Fitnet.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Fitnet.csproj index 159a1ee1..44ae7601 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Fitnet.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet/Fitnet.csproj @@ -5,8 +5,9 @@ - - + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/Fitnet.Offers.Api.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/Fitnet.Offers.Api.csproj index 79055801..25f478f7 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/Fitnet.Offers.Api.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.Api/Fitnet.Offers.Api.csproj @@ -14,8 +14,7 @@ - - + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOffersTable.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOffersTable.cs index 8480b7c2..b6852185 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOffersTable.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Database/Migrations/20230503180337_CreateOffersTable.cs @@ -1,6 +1,7 @@ #nullable disable namespace SuperSimpleArchitecture.Fitnet.Migrations.OffersPersistenceMigrations; + using System; using System.Diagnostics.CodeAnalysis; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj index a1a6d536..04928e00 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Fitnet.Offers.DataAccess/Fitnet.Offers.DataAccess.csproj @@ -1,8 +1,7 @@ - - - - + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/Fitnet.Offers.IntegrationTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/Fitnet.Offers.IntegrationTests.csproj index d0de8fbc..ffff88b1 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/Fitnet.Offers.IntegrationTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Offers/Tests/Fitnet.Offers.IntegrationTests/Fitnet.Offers.IntegrationTests.csproj @@ -5,14 +5,10 @@ - - - - - - - - + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Common/EventBus/EventBusModule.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Common/EventBus/EventBusModule.cs index 5740084e..7fd48715 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Common/EventBus/EventBusModule.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Common/EventBus/EventBusModule.cs @@ -21,11 +21,31 @@ internal static IServiceCollection AddEventBus(this IServiceCollection services, configurator.UsingRabbitMq((context, factoryConfigurator) => { var options = context.GetRequiredService>(); - var externalEventBusConfigured = options.Value is not null; - if (!externalEventBusConfigured) + var eventBusOptions = options.Value; + if (eventBusOptions is null) { return; } + + var uri = eventBusOptions!.Uri; + var username = eventBusOptions!.Username; + var password = eventBusOptions!.Password; + + if (!string.IsNullOrEmpty(uri)) + { + factoryConfigurator.Host(uri, h => + { + if (!string.IsNullOrEmpty(username)) + { + h.Username(username); + } + if (!string.IsNullOrEmpty(password)) + { + h.Password(password); + } + }); + } + factoryConfigurator.ConfigureEndpoints(context); }); configurator.ConfigureOutbox(); diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Fitnet.Passes.Api.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Fitnet.Passes.Api.csproj index 1e0d1354..83319935 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Fitnet.Passes.Api.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/Fitnet.Passes.Api.csproj @@ -15,12 +15,12 @@ - - - - - - - + + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/GetAllPasses/GetAllPassesEndpoint.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/GetAllPasses/GetAllPassesEndpoint.cs index 0e1dfcca..3a9f29e0 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/GetAllPasses/GetAllPassesEndpoint.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/GetAllPasses/GetAllPassesEndpoint.cs @@ -19,12 +19,8 @@ internal static void MapGetAllPasses(this IEndpointRouteBuilder app) => return Results.Ok(response); }) - .WithOpenApi(operation => new(operation) - { - Summary = "Returns all passes that exist in the system", - Description = - "This endpoint is used to retrieve all existing passes.", - }) + .WithSummary("Returns all passes that exist in the system") + .WithDescription("This endpoint is used to retrieve all existing passes.") .Produces() .Produces(StatusCodes.Status500InternalServerError); } \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/MarkPassAsExpired/MarkPassAsExpiredEndpoint.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/MarkPassAsExpired/MarkPassAsExpiredEndpoint.cs index 4d3714fa..67ac2aa6 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/MarkPassAsExpired/MarkPassAsExpiredEndpoint.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.Api/MarkPassAsExpired/MarkPassAsExpiredEndpoint.cs @@ -32,12 +32,8 @@ internal static void MapMarkPassAsExpired(this IEndpointRouteBuilder app) => app return Results.NoContent(); }) - .WithOpenApi(operation => new(operation) - { - Summary = "Marks pass which expired", - Description = - "This endpoint is used to mark expired pass. Based on that it is possible to offer new contract to customer.", - }) + .WithSummary("Marks pass which expired") + .WithDescription("This endpoint is used to mark expired pass. Based on that it is possible to offer new contract to customer.") .Produces(StatusCodes.Status204NoContent) .Produces(StatusCodes.Status404NotFound) .Produces(StatusCodes.Status500InternalServerError); diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs index 2f854018..b1d93547 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Database/Migrations/20230503180338_CreatePassesTable.cs @@ -1,6 +1,7 @@ #nullable disable namespace EvolutionaryArchitecture.Fitnet.Passes.DataAccess.Database; + using System; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj index b02a1872..4c85000d 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.DataAccess/Fitnet.Passes.DataAccess.csproj @@ -1,10 +1,9 @@ - - - - - + + + + \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.IntegrationEvents/Fitnet.Passes.IntegrationEvents.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.IntegrationEvents/Fitnet.Passes.IntegrationEvents.csproj index d3f5a374..c538c004 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.IntegrationEvents/Fitnet.Passes.IntegrationEvents.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Fitnet.Passes.IntegrationEvents/Fitnet.Passes.IntegrationEvents.csproj @@ -1,9 +1,8 @@ - + - - + \ No newline at end of file diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/Fitnet.Passes.IntegrationTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/Fitnet.Passes.IntegrationTests.csproj index cc3f7132..0eae106a 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/Fitnet.Passes.IntegrationTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Passes/Tests/Fitnet.Passes.IntegrationTests/Fitnet.Passes.IntegrationTests.csproj @@ -5,14 +5,10 @@ - - - - - - - - + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/Fitnet.Reports.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/Fitnet.Reports.csproj index 4a15f478..44618532 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/Fitnet.Reports.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/Fitnet.Reports.csproj @@ -3,14 +3,14 @@ - - - - - - - - + + + + + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/GenerateNewPassesRegistrationsPerMonthReport/GenerateNewPassesPerMonthReportEndpoint.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/GenerateNewPassesRegistrationsPerMonthReport/GenerateNewPassesPerMonthReportEndpoint.cs index 93f10202..96911ad4 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/GenerateNewPassesRegistrationsPerMonthReport/GenerateNewPassesPerMonthReportEndpoint.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Fitnet.Reports/GenerateNewPassesRegistrationsPerMonthReport/GenerateNewPassesPerMonthReportEndpoint.cs @@ -18,12 +18,8 @@ internal static void MapGenerateNewPassesRegistrationsPerMonthReport(this IEndpo return Results.Ok(newPassesRegistrationsPerMonthResponse); }) - .WithOpenApi(operation => new(operation) - { - Summary = "Returns report of all passes registered in a month", - Description = - "This endpoint is used to retrieve all passes that were registered in a given month." - }) + .WithSummary("Returns report of all passes registered in a month") + .WithDescription("This endpoint is used to retrieve all passes that were registered in a given month.") .Produces() .Produces(StatusCodes.Status500InternalServerError); } diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/Fitnet.Reports.IntegrationTests.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/Fitnet.Reports.IntegrationTests.csproj index 0d26023b..cc68b42a 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/Fitnet.Reports.IntegrationTests.csproj +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Reports/Tests/Fitnet.Reports.IntegrationTests/Fitnet.Reports.IntegrationTests.csproj @@ -5,14 +5,10 @@ - - - - - - - - + + + + diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/nuget.config b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/nuget.config index d4fe5249..56d956e1 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/nuget.config +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/nuget.config @@ -10,6 +10,14 @@ + + + + + + + +