1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-04 20:50:21 -05:00

Renamed InviteUsersValidation to InviteUsersValidator

This commit is contained in:
jrmccannon 2025-03-24 12:34:36 -05:00
parent 5f41d1eb23
commit 982611bd1b
No known key found for this signature in database
GPG Key ID: CF03F3DB01CE96A6
4 changed files with 12 additions and 12 deletions

View File

@ -22,7 +22,7 @@ namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUse
public class InviteOrganizationUsersCommand(IEventService eventService,
IOrganizationUserRepository organizationUserRepository,
IInviteUsersValidation inviteUsersValidation,
IInviteUsersValidator inviteUsersValidator,
IPaymentService paymentService,
IOrganizationRepository organizationRepository,
IReferenceEventService referenceEventService,
@ -98,7 +98,7 @@ public class InviteOrganizationUsersCommand(IEventService eventService,
return new Failure<IEnumerable<OrganizationUser>>(NoUsersToInvite);
}
var validationResult = await inviteUsersValidation.ValidateAsync(new InviteUserOrganizationValidationRequest
var validationResult = await inviteUsersValidator.ValidateAsync(new InviteUserOrganizationValidationRequest
{
Invites = invitesToSend.ToArray(),
InviteOrganization = request.InviteOrganization,

View File

@ -15,13 +15,13 @@ using SecretsManagerSubscriptionUpdate = Bit.Core.AdminConsole.OrganizationFeatu
namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Validation;
public interface IInviteUsersValidation : IValidator<InviteUserOrganizationValidationRequest>;
public interface IInviteUsersValidator : IValidator<InviteUserOrganizationValidationRequest>;
public class InviteUsersValidation(
public class InviteUsersValidator(
IGlobalSettings globalSettings,
IProviderRepository providerRepository,
IPaymentService paymentService,
IOrganizationRepository organizationRepository) : IInviteUsersValidation
IOrganizationRepository organizationRepository) : IInviteUsersValidator
{
public async Task<ValidationResult<InviteUserOrganizationValidationRequest>> ValidateAsync(InviteUserOrganizationValidationRequest request)
{

View File

@ -174,7 +174,7 @@ public static class OrganizationServiceCollectionExtensions
services.AddScoped<IHasConfirmedOwnersExceptQuery, HasConfirmedOwnersExceptQuery>();
services.AddScoped<IInviteOrganizationUsersCommand, InviteOrganizationUsersCommand>();
services.AddScoped<IInviteUsersValidation, InviteUsersValidation>();
services.AddScoped<IInviteUsersValidator, InviteUsersValidator>();
services.AddScoped<ISendOrganizationInvitesCommand, SendOrganizationInvitesCommand>();
}

View File

@ -53,7 +53,7 @@ public class InviteOrganizationUserCommandTests
.SelectKnownEmailsAsync(organization.Id, Arg.Any<IEnumerable<string>>(), false)
.Returns([user.Email]);
sutProvider.GetDependency<IInviteUsersValidation>()
sutProvider.GetDependency<IInviteUsersValidator>()
.ValidateAsync(Arg.Any<InviteUserOrganizationValidationRequest>())
.Returns(new Valid<InviteUserOrganizationValidationRequest>(GetInviteValidationRequestMock(request, organizationDto)));
@ -105,7 +105,7 @@ public class InviteOrganizationUserCommandTests
.GetByIdAsync(organization.Id)
.Returns(organization);
sutProvider.GetDependency<IInviteUsersValidation>()
sutProvider.GetDependency<IInviteUsersValidator>()
.ValidateAsync(Arg.Any<InviteUserOrganizationValidationRequest>())
.Returns(new Valid<InviteUserOrganizationValidationRequest>(GetInviteValidationRequestMock(request, organizationDto)));
@ -157,7 +157,7 @@ public class InviteOrganizationUserCommandTests
.GetByIdAsync(organization.Id)
.Returns(organization);
sutProvider.GetDependency<IInviteUsersValidation>()
sutProvider.GetDependency<IInviteUsersValidator>()
.ValidateAsync(Arg.Any<InviteUserOrganizationValidationRequest>())
.Returns(new Invalid<InviteUserOrganizationValidationRequest>(new Error<InviteUserOrganizationValidationRequest>(errorMessage, new InviteUserOrganizationValidationRequest())));
@ -216,7 +216,7 @@ public class InviteOrganizationUserCommandTests
.GetByIdAsync(organization.Id)
.Returns(organization);
sutProvider.GetDependency<IInviteUsersValidation>()
sutProvider.GetDependency<IInviteUsersValidator>()
.ValidateAsync(Arg.Any<InviteUserOrganizationValidationRequest>())
.Returns(new Valid<InviteUserOrganizationValidationRequest>(GetInviteValidationRequestMock(request, organizationDto)
.WithPasswordManagerUpdate(new PasswordManagerSubscriptionUpdate(organizationDto, organization.Seats.Value, 1))));
@ -276,7 +276,7 @@ public class InviteOrganizationUserCommandTests
orgRepository.GetByIdAsync(organization.Id)
.Returns(organization);
sutProvider.GetDependency<IInviteUsersValidation>()
sutProvider.GetDependency<IInviteUsersValidator>()
.ValidateAsync(Arg.Any<InviteUserOrganizationValidationRequest>())
.Returns(new Valid<InviteUserOrganizationValidationRequest>(GetInviteValidationRequestMock(request, organizationDto)
.WithPasswordManagerUpdate(passwordManagerUpdate)));
@ -342,7 +342,7 @@ public class InviteOrganizationUserCommandTests
orgRepository.GetByIdAsync(organization.Id)
.Returns(organization);
sutProvider.GetDependency<IInviteUsersValidation>()
sutProvider.GetDependency<IInviteUsersValidator>()
.ValidateAsync(Arg.Any<InviteUserOrganizationValidationRequest>())
.Returns(new Valid<InviteUserOrganizationValidationRequest>(GetInviteValidationRequestMock(request, organizationDto)
.WithSecretsManagerUpdate(secretsManagerSubscriptionUpdate)));