From 6b0e29afdb7c5080ced977965e8b90f27f603828 Mon Sep 17 00:00:00 2001 From: Xavier Date: Sun, 29 Oct 2023 09:25:02 -0700 Subject: [PATCH 1/2] Upgrade to FunctionalDDD 1.1.0-alpha.28 --- Api/src/2022-12-21/Controllers/DinnersController.cs | 2 ++ Api/src/2022-12-21/Controllers/MenusController.cs | 4 +++- .../Neutral/Controllers/AuthenticationController.cs | 4 +++- .../Commands/RegisterCommandHandler.cs | 2 +- .../src/Menus/Commands/CreateMenuCommandHandler.cs | 2 +- Directory.Packages.props | 12 ++++++------ Domain/src/Common/ValueObjects/Description.cs | 2 +- Domain/src/Common/ValueObjects/Name.cs | 2 +- Domain/src/Dinner/ValueObjects/DinnerId.cs | 2 +- Domain/src/Host/ValueObjects/HostId.cs | 2 +- Domain/src/Menu/ValueObjects/MenuId.cs | 2 +- Domain/src/Menu/ValueObjects/MenuItemId.cs | 2 +- Domain/src/Menu/ValueObjects/MenuSectionId.cs | 2 +- Domain/src/MenuReview/ValueObjects/MenuId.cs | 2 +- Domain/src/User/ValueObjects/FirstName.cs | 2 +- Domain/src/User/ValueObjects/LastName.cs | 2 +- Domain/src/User/ValueObjects/Password.cs | 2 +- Domain/src/User/ValueObjects/UserId.cs | 2 +- 18 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Api/src/2022-12-21/Controllers/DinnersController.cs b/Api/src/2022-12-21/Controllers/DinnersController.cs index 8621ccf..1a36240 100644 --- a/Api/src/2022-12-21/Controllers/DinnersController.cs +++ b/Api/src/2022-12-21/Controllers/DinnersController.cs @@ -8,6 +8,8 @@ /// [ApiVersion("2022-10-01")] [Route("[controller]")] +[Consumes("application/json")] +[Produces("application/json")] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status200OK)] public class DinnersController : ControllerBase diff --git a/Api/src/2022-12-21/Controllers/MenusController.cs b/Api/src/2022-12-21/Controllers/MenusController.cs index ce4730f..40fb144 100644 --- a/Api/src/2022-12-21/Controllers/MenusController.cs +++ b/Api/src/2022-12-21/Controllers/MenusController.cs @@ -2,7 +2,7 @@ using Asp.Versioning; using BuberDinner.Api._2022_12_21.Models.Menus; -using FunctionalDDD.Results.Asp; +using FunctionalDDD.Asp; using Mapster; using Mediator; using Microsoft.AspNetCore.Mvc; @@ -12,6 +12,8 @@ /// [ApiVersion("2022-10-01")] [Route("hosts/{hostId}/menus")] +[Consumes("application/json")] +[Produces("application/json")] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status201Created)] diff --git a/Api/src/Neutral/Controllers/AuthenticationController.cs b/Api/src/Neutral/Controllers/AuthenticationController.cs index 7936f50..57b70b7 100644 --- a/Api/src/Neutral/Controllers/AuthenticationController.cs +++ b/Api/src/Neutral/Controllers/AuthenticationController.cs @@ -2,7 +2,7 @@ using Asp.Versioning; using BuberDinner.Api.Neutral.Models.Authentication; -using FunctionalDDD.Results.Asp; +using FunctionalDDD.Asp; using Mapster; using Mediator; using Microsoft.AspNetCore.Authorization; @@ -13,6 +13,8 @@ /// [AllowAnonymous] [ApiVersionNeutral] +[Consumes("application/json")] +[Produces("application/json")] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status200OK)] [Route("[controller]")] diff --git a/Application/src/Authentication/Commands/RegisterCommandHandler.cs b/Application/src/Authentication/Commands/RegisterCommandHandler.cs index 102cd9c..0c41c17 100644 --- a/Application/src/Authentication/Commands/RegisterCommandHandler.cs +++ b/Application/src/Authentication/Commands/RegisterCommandHandler.cs @@ -33,7 +33,7 @@ public ValueTask> Handle(RegisterCommand request, C private async ValueTask> CreateUser(RegisterCommand command, CancellationToken cancellationToken) => await User.New(command.UserId, command.FirstName, command.LastName, command.Email, command.Password) - .TeeAsync(user => _userRepository.Add(user, cancellationToken)); + .TapAsync(user => _userRepository.Add(user, cancellationToken)); private async ValueTask> ValidateUserDoesNotExist(UserId id, CancellationToken cancellationToken) { diff --git a/Application/src/Menus/Commands/CreateMenuCommandHandler.cs b/Application/src/Menus/Commands/CreateMenuCommandHandler.cs index 1616720..55f28fc 100644 --- a/Application/src/Menus/Commands/CreateMenuCommandHandler.cs +++ b/Application/src/Menus/Commands/CreateMenuCommandHandler.cs @@ -21,7 +21,7 @@ public ValueTask> Handle(CreateMenuCommand request, CancellationTok private async ValueTask> CreateMenu(CreateMenuCommand request, CancellationToken cancellationToken) => await Menu.New(request.Name, request.Description, CreateMenuSections(request.Sections), request.HostId) - .TeeAsync(menu => _menuRepository.Add(menu, cancellationToken)); + .TapAsync(menu => _menuRepository.Add(menu, cancellationToken)); private static IReadOnlyList CreateMenuSections(IReadOnlyList commands) => commands diff --git a/Directory.Packages.props b/Directory.Packages.props index 14fc810..752addd 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,17 +1,17 @@ - 0.1.0-alpha.40 + 1.1.0-alpha.28 - - - - - + + + + + diff --git a/Domain/src/Common/ValueObjects/Description.cs b/Domain/src/Common/ValueObjects/Description.cs index 5f2b7e7..c944060 100644 --- a/Domain/src/Common/ValueObjects/Description.cs +++ b/Domain/src/Common/ValueObjects/Description.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class Description : RequiredString +public partial class Description : RequiredString { } diff --git a/Domain/src/Common/ValueObjects/Name.cs b/Domain/src/Common/ValueObjects/Name.cs index d1392c4..44eb766 100644 --- a/Domain/src/Common/ValueObjects/Name.cs +++ b/Domain/src/Common/ValueObjects/Name.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class Name : RequiredString +public partial class Name : RequiredString { } diff --git a/Domain/src/Dinner/ValueObjects/DinnerId.cs b/Domain/src/Dinner/ValueObjects/DinnerId.cs index 872e1e9..6bb8583 100644 --- a/Domain/src/Dinner/ValueObjects/DinnerId.cs +++ b/Domain/src/Dinner/ValueObjects/DinnerId.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class DinnerId : RequiredGuid +public partial class DinnerId : RequiredGuid { } diff --git a/Domain/src/Host/ValueObjects/HostId.cs b/Domain/src/Host/ValueObjects/HostId.cs index e852917..ef12211 100644 --- a/Domain/src/Host/ValueObjects/HostId.cs +++ b/Domain/src/Host/ValueObjects/HostId.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class HostId : RequiredGuid +public partial class HostId : RequiredGuid { } diff --git a/Domain/src/Menu/ValueObjects/MenuId.cs b/Domain/src/Menu/ValueObjects/MenuId.cs index 796ee92..5325b78 100644 --- a/Domain/src/Menu/ValueObjects/MenuId.cs +++ b/Domain/src/Menu/ValueObjects/MenuId.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class MenuId : RequiredGuid +public partial class MenuId : RequiredGuid { } diff --git a/Domain/src/Menu/ValueObjects/MenuItemId.cs b/Domain/src/Menu/ValueObjects/MenuItemId.cs index 03f4a47..86caa30 100644 --- a/Domain/src/Menu/ValueObjects/MenuItemId.cs +++ b/Domain/src/Menu/ValueObjects/MenuItemId.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class MenuItemId : RequiredGuid +public partial class MenuItemId : RequiredGuid { } diff --git a/Domain/src/Menu/ValueObjects/MenuSectionId.cs b/Domain/src/Menu/ValueObjects/MenuSectionId.cs index a3cbae2..9b7f3d3 100644 --- a/Domain/src/Menu/ValueObjects/MenuSectionId.cs +++ b/Domain/src/Menu/ValueObjects/MenuSectionId.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class MenuSectionId : RequiredGuid +public partial class MenuSectionId : RequiredGuid { } diff --git a/Domain/src/MenuReview/ValueObjects/MenuId.cs b/Domain/src/MenuReview/ValueObjects/MenuId.cs index acf8c74..589dc66 100644 --- a/Domain/src/MenuReview/ValueObjects/MenuId.cs +++ b/Domain/src/MenuReview/ValueObjects/MenuId.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class MenuReviewId : RequiredGuid +public partial class MenuReviewId : RequiredGuid { } diff --git a/Domain/src/User/ValueObjects/FirstName.cs b/Domain/src/User/ValueObjects/FirstName.cs index 786a770..eb42fad 100644 --- a/Domain/src/User/ValueObjects/FirstName.cs +++ b/Domain/src/User/ValueObjects/FirstName.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class FirstName : RequiredString +public partial class FirstName : RequiredString { } diff --git a/Domain/src/User/ValueObjects/LastName.cs b/Domain/src/User/ValueObjects/LastName.cs index 916ed87..35797cd 100644 --- a/Domain/src/User/ValueObjects/LastName.cs +++ b/Domain/src/User/ValueObjects/LastName.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class LastName : RequiredString +public partial class LastName : RequiredString { } diff --git a/Domain/src/User/ValueObjects/Password.cs b/Domain/src/User/ValueObjects/Password.cs index 62f6725..049d703 100644 --- a/Domain/src/User/ValueObjects/Password.cs +++ b/Domain/src/User/ValueObjects/Password.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class Password : RequiredString +public partial class Password : RequiredString { } diff --git a/Domain/src/User/ValueObjects/UserId.cs b/Domain/src/User/ValueObjects/UserId.cs index 88b0b33..5ccb51a 100644 --- a/Domain/src/User/ValueObjects/UserId.cs +++ b/Domain/src/User/ValueObjects/UserId.cs @@ -2,6 +2,6 @@ using FunctionalDDD.Domain; -public partial class UserId : RequiredString +public partial class UserId : RequiredString { } From 6f4d731f821e0255aa9e5260815e3f0763b915de Mon Sep 17 00:00:00 2001 From: Xavier Date: Sun, 29 Oct 2023 09:26:59 -0700 Subject: [PATCH 2/2] Update nuget packages. --- Directory.Packages.props | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 752addd..043c73d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,8 +4,8 @@ - - + + @@ -17,27 +17,27 @@ - + - + - + - + - + - + \ No newline at end of file