From e25a982b558bdd6865f2dcac51d7d71ead80c77f Mon Sep 17 00:00:00 2001 From: Sergio Matias Urquin Date: Sun, 31 Aug 2025 17:55:58 -0600 Subject: [PATCH] Fix user services --- .../UseCases/Users/Input/CreateUserRequest.cs | 2 -- .../UseCases/Users/Input/UpdateUserRequest.cs | 3 +-- Core.Thalos.Application/UseCases/Users/UserHandler.cs | 1 + .../UseCases/Users/Validator/CreateUserValidator.cs | 1 - .../UseCases/Users/Validator/UpdateUserValidator.cs | 1 - Core.Thalos.External/Core.Thalos.External.csproj | 4 ++-- 6 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Core.Thalos.Application/UseCases/Users/Input/CreateUserRequest.cs b/Core.Thalos.Application/UseCases/Users/Input/CreateUserRequest.cs index a4ad0f3..a298cfd 100644 --- a/Core.Thalos.Application/UseCases/Users/Input/CreateUserRequest.cs +++ b/Core.Thalos.Application/UseCases/Users/Input/CreateUserRequest.cs @@ -9,8 +9,6 @@ namespace Core.Thalos.Application.UseCases.Users.Input public string MiddleName { get; set; } = null!; public string LastName { get; set; } = null!; public string RoleId { get; set; } = null!; - public string[] Companies { get; set; } = null!; - public string[]? Projects { get; set; } public bool SendInvitation { get; set; } public bool Validate() diff --git a/Core.Thalos.Application/UseCases/Users/Input/UpdateUserRequest.cs b/Core.Thalos.Application/UseCases/Users/Input/UpdateUserRequest.cs index 2bf11dc..a293554 100644 --- a/Core.Thalos.Application/UseCases/Users/Input/UpdateUserRequest.cs +++ b/Core.Thalos.Application/UseCases/Users/Input/UpdateUserRequest.cs @@ -10,8 +10,7 @@ namespace Core.Thalos.Application.UseCases.Users.Input public string? MiddleName { get; set; } public string LastName { get; set; } = null!; public string RoleId { get; set; } = null!; - public string[] Companies { get; set; } = null!; - public string[]? Projects { get; set; } + public string TenantId { get; set; } = null!; public bool Validate() { return Email != null; diff --git a/Core.Thalos.Application/UseCases/Users/UserHandler.cs b/Core.Thalos.Application/UseCases/Users/UserHandler.cs index fa898b4..0452900 100644 --- a/Core.Thalos.Application/UseCases/Users/UserHandler.cs +++ b/Core.Thalos.Application/UseCases/Users/UserHandler.cs @@ -234,6 +234,7 @@ namespace Core.Thalos.Application.UseCases.Users MiddleName = command.MiddleName, LastName = command.LastName, RoleId = command.RoleId, + TenantId = command.TenantId }; var result = await _thalosDALService.UpdateUserAsync(request, request._Id, cancellationToken).ConfigureAwait(false); diff --git a/Core.Thalos.Application/UseCases/Users/Validator/CreateUserValidator.cs b/Core.Thalos.Application/UseCases/Users/Validator/CreateUserValidator.cs index 0eef68c..54f14cd 100644 --- a/Core.Thalos.Application/UseCases/Users/Validator/CreateUserValidator.cs +++ b/Core.Thalos.Application/UseCases/Users/Validator/CreateUserValidator.cs @@ -11,7 +11,6 @@ namespace Core.Thalos.Application.UseCases.Users.Validator RuleFor(i => i.Name).NotEmpty().NotNull().OverridePropertyName(x => x.Name).WithName("User Name").WithMessage("User Name is Obligatory."); RuleFor(i => i.LastName).NotEmpty().NotNull().OverridePropertyName(x => x.LastName).WithName("User LastName").WithMessage("User LastName is Obligatory."); RuleFor(i => i.RoleId).NotEmpty().NotNull().OverridePropertyName(x => x.RoleId).WithName("RoleId").WithMessage("RoleId is Obligatory."); - RuleFor(i => i.Companies).NotEmpty().NotNull().OverridePropertyName(x => x.Companies).WithName("Companies").WithMessage("Companies is Obligatory."); } } } diff --git a/Core.Thalos.Application/UseCases/Users/Validator/UpdateUserValidator.cs b/Core.Thalos.Application/UseCases/Users/Validator/UpdateUserValidator.cs index 98d9179..245f2ae 100644 --- a/Core.Thalos.Application/UseCases/Users/Validator/UpdateUserValidator.cs +++ b/Core.Thalos.Application/UseCases/Users/Validator/UpdateUserValidator.cs @@ -11,7 +11,6 @@ namespace Core.Thalos.Application.UseCases.Users.Validator RuleFor(i => i.Name).NotEmpty().NotNull().OverridePropertyName(x => x.Name).WithName("User Name").WithMessage("User Name is Obligatory."); RuleFor(i => i.LastName).NotEmpty().NotNull().OverridePropertyName(x => x.LastName).WithName("User LastName").WithMessage("User LastName is Obligatory."); RuleFor(i => i.RoleId).NotEmpty().NotNull().OverridePropertyName(x => x.RoleId).WithName("RoleId").WithMessage("RoleId is Obligatory."); - RuleFor(i => i.Companies).NotEmpty().NotNull().OverridePropertyName(x => x.Companies).WithName("Companies").WithMessage("Companies is Obligatory."); } } } diff --git a/Core.Thalos.External/Core.Thalos.External.csproj b/Core.Thalos.External/Core.Thalos.External.csproj index 5b23ce9..f20e869 100644 --- a/Core.Thalos.External/Core.Thalos.External.csproj +++ b/Core.Thalos.External/Core.Thalos.External.csproj @@ -7,9 +7,9 @@ + - - +