From 07827aa111c64c27a1e174facecbb3c6e145b1f5 Mon Sep 17 00:00:00 2001 From: Xavier Date: Sun, 17 Sep 2023 11:48:23 -0700 Subject: [PATCH] Update to FunctionalDDD Version 1.1.0-alpha.13 --- Api/src/2022-12-21/Controllers/MenusController.cs | 1 + .../Neutral/Controllers/AuthenticationController.cs | 1 + .../Neutral/Models/Authentication/RegisterRequest.cs | 1 + Api/tests/2022-12-21/CreateMenuRequestTests.cs | 1 + Api/tests/Neutral/LoginRequestTests.cs | 1 + Api/tests/Neutral/RegisterRequestTests.cs | 2 ++ .../src/Authentication/Commands/RegisterCommand.cs | 1 + .../tests/Authentication/AuthenticationTests.cs | 1 + Directory.Build.props | 2 +- Directory.Packages.props | 10 +++++----- Domain/src/Common/Errors/Errors.Authentication.cs | 2 ++ Domain/src/Common/Errors/Errors.User.cs | 2 ++ 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/Entities/MenuItem.cs | 2 ++ Domain/src/Menu/Entities/MenuSection.cs | 2 ++ Domain/src/Menu/Menu.cs | 3 +++ 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/Entities/User.cs | 3 +++ 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 ++ Domain/tests/MenuTests.cs | 1 + Domain/tests/UserTests.cs | 2 ++ Infrastructure/src/Persistence/Dto/UserDto.cs | 1 + Infrastructure/tests/UserRespositoryTests.cs | 1 + 32 files changed, 58 insertions(+), 6 deletions(-) diff --git a/Api/src/2022-12-21/Controllers/MenusController.cs b/Api/src/2022-12-21/Controllers/MenusController.cs index d6c0b4d..c856ecf 100644 --- a/Api/src/2022-12-21/Controllers/MenusController.cs +++ b/Api/src/2022-12-21/Controllers/MenusController.cs @@ -2,6 +2,7 @@ using Asp.Versioning; using BuberDinner.Api._2022_12_21.Models.Menus; +using FunctionalDDD.Asp; using Mapster; using Mediator; using Microsoft.AspNetCore.Mvc; diff --git a/Api/src/Neutral/Controllers/AuthenticationController.cs b/Api/src/Neutral/Controllers/AuthenticationController.cs index dbf10d4..f0a78ba 100644 --- a/Api/src/Neutral/Controllers/AuthenticationController.cs +++ b/Api/src/Neutral/Controllers/AuthenticationController.cs @@ -2,6 +2,7 @@ using Asp.Versioning; using BuberDinner.Api.Neutral.Models.Authentication; +using FunctionalDDD.Asp; using Mapster; using Mediator; using Microsoft.AspNetCore.Authorization; diff --git a/Api/src/Neutral/Models/Authentication/RegisterRequest.cs b/Api/src/Neutral/Models/Authentication/RegisterRequest.cs index a97545e..d045ea7 100644 --- a/Api/src/Neutral/Models/Authentication/RegisterRequest.cs +++ b/Api/src/Neutral/Models/Authentication/RegisterRequest.cs @@ -1,6 +1,7 @@ namespace BuberDinner.Api.Neutral.Models.Authentication; using BuberDinner.Application.Services.Authentication.Commands; +using FunctionalDDD.CommonValueObjects; using FirstNameClass = Domain.User.ValueObjects.FirstName; using LastNameClass = Domain.User.ValueObjects.LastName; using PasswordClass = Domain.User.ValueObjects.Password; diff --git a/Api/tests/2022-12-21/CreateMenuRequestTests.cs b/Api/tests/2022-12-21/CreateMenuRequestTests.cs index 226ffd0..4b046b9 100644 --- a/Api/tests/2022-12-21/CreateMenuRequestTests.cs +++ b/Api/tests/2022-12-21/CreateMenuRequestTests.cs @@ -4,6 +4,7 @@ using BuberDinner.Application.Menus.Commands; using BuberDinner.Domain.Common.ValueObjects; using BuberDinner.Domain.Host.ValueObject; +using FunctionalDDD.RailwayOrientedProgramming.Errors; public class CreateMenuRequestTests { diff --git a/Api/tests/Neutral/LoginRequestTests.cs b/Api/tests/Neutral/LoginRequestTests.cs index cbdb723..687f619 100644 --- a/Api/tests/Neutral/LoginRequestTests.cs +++ b/Api/tests/Neutral/LoginRequestTests.cs @@ -2,6 +2,7 @@ using BuberDinner.Api.Neutral.Models.Authentication; using BuberDinner.Domain.User.ValueObjects; +using FunctionalDDD.RailwayOrientedProgramming.Errors; public class LoginRequestTests { diff --git a/Api/tests/Neutral/RegisterRequestTests.cs b/Api/tests/Neutral/RegisterRequestTests.cs index 0126b97..351e9f5 100644 --- a/Api/tests/Neutral/RegisterRequestTests.cs +++ b/Api/tests/Neutral/RegisterRequestTests.cs @@ -2,6 +2,8 @@ using BuberDinner.Api.Neutral.Models.Authentication; using BuberDinner.Domain.User.ValueObjects; +using FunctionalDDD.CommonValueObjects; +using FunctionalDDD.RailwayOrientedProgramming.Errors; public class RegisterRequestTests { diff --git a/Application/src/Authentication/Commands/RegisterCommand.cs b/Application/src/Authentication/Commands/RegisterCommand.cs index 9f39484..7beada2 100644 --- a/Application/src/Authentication/Commands/RegisterCommand.cs +++ b/Application/src/Authentication/Commands/RegisterCommand.cs @@ -2,6 +2,7 @@ using BuberDinner.Application.Services.Authentication.Common; using BuberDinner.Domain.User.ValueObjects; +using FunctionalDDD.CommonValueObjects; using Mediator; public class RegisterCommand diff --git a/Application/tests/Authentication/AuthenticationTests.cs b/Application/tests/Authentication/AuthenticationTests.cs index 88542d8..68d2ac9 100644 --- a/Application/tests/Authentication/AuthenticationTests.cs +++ b/Application/tests/Authentication/AuthenticationTests.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using BuberDinner.Application.Services.Authentication.Commands; using BuberDinner.Domain.User.ValueObjects; + using FunctionalDDD.CommonValueObjects; using Mediator; public class AuthenticationTests diff --git a/Directory.Build.props b/Directory.Build.props index f400e64..020c3f7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -23,7 +23,7 @@ - + diff --git a/Directory.Packages.props b/Directory.Packages.props index ad7e2f9..bdb765a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,11 +7,11 @@ - - - - - + + + + + diff --git a/Domain/src/Common/Errors/Errors.Authentication.cs b/Domain/src/Common/Errors/Errors.Authentication.cs index d51466e..2042d02 100644 --- a/Domain/src/Common/Errors/Errors.Authentication.cs +++ b/Domain/src/Common/Errors/Errors.Authentication.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Errors; +using FunctionalDDD.RailwayOrientedProgramming.Errors; + public partial class Errors { public static class Authentication diff --git a/Domain/src/Common/Errors/Errors.User.cs b/Domain/src/Common/Errors/Errors.User.cs index 1e30412..5e10dcf 100644 --- a/Domain/src/Common/Errors/Errors.User.cs +++ b/Domain/src/Common/Errors/Errors.User.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Errors; +using FunctionalDDD.RailwayOrientedProgramming.Errors; + public partial class Errors { public static class User diff --git a/Domain/src/Common/ValueObjects/Description.cs b/Domain/src/Common/ValueObjects/Description.cs index 94ce3a0..57cbf06 100644 --- a/Domain/src/Common/ValueObjects/Description.cs +++ b/Domain/src/Common/ValueObjects/Description.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Common.ValueObjects; +using FunctionalDDD.CommonValueObjects; + public partial class Description : RequiredString { } diff --git a/Domain/src/Common/ValueObjects/Name.cs b/Domain/src/Common/ValueObjects/Name.cs index 2562b00..9ac62da 100644 --- a/Domain/src/Common/ValueObjects/Name.cs +++ b/Domain/src/Common/ValueObjects/Name.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Common.ValueObjects; +using FunctionalDDD.CommonValueObjects; + public partial class Name : RequiredString { } diff --git a/Domain/src/Dinner/ValueObjects/DinnerId.cs b/Domain/src/Dinner/ValueObjects/DinnerId.cs index 9e90e81..02bd026 100644 --- a/Domain/src/Dinner/ValueObjects/DinnerId.cs +++ b/Domain/src/Dinner/ValueObjects/DinnerId.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Dinner.ValueObject; +using FunctionalDDD.CommonValueObjects; + public partial class DinnerId : RequiredGuid { } diff --git a/Domain/src/Host/ValueObjects/HostId.cs b/Domain/src/Host/ValueObjects/HostId.cs index 121d136..412e683 100644 --- a/Domain/src/Host/ValueObjects/HostId.cs +++ b/Domain/src/Host/ValueObjects/HostId.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Host.ValueObject; +using FunctionalDDD.CommonValueObjects; + public partial class HostId : RequiredGuid { } diff --git a/Domain/src/Menu/Entities/MenuItem.cs b/Domain/src/Menu/Entities/MenuItem.cs index 24a8ad4..17b67f6 100644 --- a/Domain/src/Menu/Entities/MenuItem.cs +++ b/Domain/src/Menu/Entities/MenuItem.cs @@ -3,6 +3,8 @@ using BuberDinner.Domain.Common.ValueObjects; using BuberDinner.Domain.Menu.ValueObject; using FluentValidation; +using FunctionalDDD.DomainDrivenDesign; +using FunctionalDDD.FluentValidation; public class MenuItem : Entity { diff --git a/Domain/src/Menu/Entities/MenuSection.cs b/Domain/src/Menu/Entities/MenuSection.cs index 9ea8e92..c957d44 100644 --- a/Domain/src/Menu/Entities/MenuSection.cs +++ b/Domain/src/Menu/Entities/MenuSection.cs @@ -3,6 +3,8 @@ using BuberDinner.Domain.Common.ValueObjects; using BuberDinner.Domain.Menu.ValueObject; using FluentValidation; +using FunctionalDDD.DomainDrivenDesign; +using FunctionalDDD.FluentValidation; public class MenuSection : Entity { diff --git a/Domain/src/Menu/Menu.cs b/Domain/src/Menu/Menu.cs index 77cc99e..696c7df 100644 --- a/Domain/src/Menu/Menu.cs +++ b/Domain/src/Menu/Menu.cs @@ -7,6 +7,9 @@ using BuberDinner.Domain.Menu.Entities; using BuberDinner.Domain.Menu.ValueObject; using FluentValidation; +using FunctionalDDD.DomainDrivenDesign; +using FunctionalDDD.FluentValidation; + public class Menu : AggregateRoot { public Name Name { get; } diff --git a/Domain/src/Menu/ValueObjects/MenuId.cs b/Domain/src/Menu/ValueObjects/MenuId.cs index e25c371..196b343 100644 --- a/Domain/src/Menu/ValueObjects/MenuId.cs +++ b/Domain/src/Menu/ValueObjects/MenuId.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Menu.ValueObject; +using FunctionalDDD.CommonValueObjects; + public partial class MenuId : RequiredGuid { } diff --git a/Domain/src/Menu/ValueObjects/MenuItemId.cs b/Domain/src/Menu/ValueObjects/MenuItemId.cs index 4302087..1087b6a 100644 --- a/Domain/src/Menu/ValueObjects/MenuItemId.cs +++ b/Domain/src/Menu/ValueObjects/MenuItemId.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Menu.ValueObject; +using FunctionalDDD.CommonValueObjects; + public partial class MenuItemId : RequiredGuid { } diff --git a/Domain/src/Menu/ValueObjects/MenuSectionId.cs b/Domain/src/Menu/ValueObjects/MenuSectionId.cs index c87cc39..bcd8cf7 100644 --- a/Domain/src/Menu/ValueObjects/MenuSectionId.cs +++ b/Domain/src/Menu/ValueObjects/MenuSectionId.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Menu.ValueObject; +using FunctionalDDD.CommonValueObjects; + public partial class MenuSectionId : RequiredGuid { } diff --git a/Domain/src/MenuReview/ValueObjects/MenuId.cs b/Domain/src/MenuReview/ValueObjects/MenuId.cs index 0600dd4..8ed7359 100644 --- a/Domain/src/MenuReview/ValueObjects/MenuId.cs +++ b/Domain/src/MenuReview/ValueObjects/MenuId.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.Menu.ValueObject; +using FunctionalDDD.CommonValueObjects; + public partial class MenuReviewId : RequiredGuid { } diff --git a/Domain/src/User/Entities/User.cs b/Domain/src/User/Entities/User.cs index a97dc19..a71ffc8 100644 --- a/Domain/src/User/Entities/User.cs +++ b/Domain/src/User/Entities/User.cs @@ -2,6 +2,9 @@ using BuberDinner.Domain.User.ValueObjects; using FluentValidation; +using FunctionalDDD.CommonValueObjects; +using FunctionalDDD.DomainDrivenDesign; +using FunctionalDDD.FluentValidation; public class User : Entity { diff --git a/Domain/src/User/ValueObjects/FirstName.cs b/Domain/src/User/ValueObjects/FirstName.cs index 49f7414..506ce8b 100644 --- a/Domain/src/User/ValueObjects/FirstName.cs +++ b/Domain/src/User/ValueObjects/FirstName.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.User.ValueObjects; +using FunctionalDDD.CommonValueObjects; + public partial class FirstName : RequiredString { } diff --git a/Domain/src/User/ValueObjects/LastName.cs b/Domain/src/User/ValueObjects/LastName.cs index bc8d06b..f86ce5c 100644 --- a/Domain/src/User/ValueObjects/LastName.cs +++ b/Domain/src/User/ValueObjects/LastName.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.User.ValueObjects; +using FunctionalDDD.CommonValueObjects; + public partial class LastName : RequiredString { } diff --git a/Domain/src/User/ValueObjects/Password.cs b/Domain/src/User/ValueObjects/Password.cs index 74659e3..59acabf 100644 --- a/Domain/src/User/ValueObjects/Password.cs +++ b/Domain/src/User/ValueObjects/Password.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.User.ValueObjects; +using FunctionalDDD.CommonValueObjects; + public partial class Password : RequiredString { } diff --git a/Domain/src/User/ValueObjects/UserId.cs b/Domain/src/User/ValueObjects/UserId.cs index f16e223..d07926f 100644 --- a/Domain/src/User/ValueObjects/UserId.cs +++ b/Domain/src/User/ValueObjects/UserId.cs @@ -1,5 +1,7 @@ namespace BuberDinner.Domain.User.ValueObjects; +using FunctionalDDD.CommonValueObjects; + public partial class UserId : RequiredString { } diff --git a/Domain/tests/MenuTests.cs b/Domain/tests/MenuTests.cs index 6217e1c..4f88f11 100644 --- a/Domain/tests/MenuTests.cs +++ b/Domain/tests/MenuTests.cs @@ -5,6 +5,7 @@ using BuberDinner.Domain.Menu; using BuberDinner.Domain.Menu.Entities; using BuberDinner.Domain.Menu.ValueObject; +using FunctionalDDD.RailwayOrientedProgramming.Errors; public class MenuTests { diff --git a/Domain/tests/UserTests.cs b/Domain/tests/UserTests.cs index b2cf504..8e28834 100644 --- a/Domain/tests/UserTests.cs +++ b/Domain/tests/UserTests.cs @@ -2,6 +2,8 @@ using BuberDinner.Domain.User.Entities; using BuberDinner.Domain.User.ValueObjects; +using FunctionalDDD.CommonValueObjects; +using FunctionalDDD.RailwayOrientedProgramming.Errors; #pragma warning disable IDE0007 // Use var keyword public class UserTests diff --git a/Infrastructure/src/Persistence/Dto/UserDto.cs b/Infrastructure/src/Persistence/Dto/UserDto.cs index 3d9b303..4c96113 100644 --- a/Infrastructure/src/Persistence/Dto/UserDto.cs +++ b/Infrastructure/src/Persistence/Dto/UserDto.cs @@ -2,6 +2,7 @@ using BuberDinner.Domain.User.Entities; using BuberDinner.Domain.User.ValueObjects; +using FunctionalDDD.CommonValueObjects; public class UserDto { diff --git a/Infrastructure/tests/UserRespositoryTests.cs b/Infrastructure/tests/UserRespositoryTests.cs index 4aee53a..08a9065 100644 --- a/Infrastructure/tests/UserRespositoryTests.cs +++ b/Infrastructure/tests/UserRespositoryTests.cs @@ -3,6 +3,7 @@ using BuberDinner.Domain.User.Entities; using BuberDinner.Domain.User.ValueObjects; using BuberDinner.Infrastructure.Persistence.Cosmos; +using FunctionalDDD.CommonValueObjects; using Xunit.Categories; [Category("ComponentTests")]