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

Rearranged some things. Fixed the tests.

This commit is contained in:
jrmccannon 2025-03-31 10:10:54 -05:00
parent 5f0d55b472
commit 58c3864601
No known key found for this signature in database
GPG Key ID: CF03F3DB01CE96A6
3 changed files with 8 additions and 7 deletions

View File

@ -60,7 +60,8 @@ public class PostUserCommand(
var request = model.ToRequest(
scimProvider: scimProvider,
inviteOrganization: new InviteOrganization(organization, plan),
performedAt: timeProvider.GetUtcNow());
performedAt: timeProvider.GetUtcNow(),
hasSecretsManagerStandalone);
var orgUsers = await organizationUserRepository
.GetManyDetailsByOrganizationAsync(request.InviteOrganization.OrganizationId);

View File

@ -34,16 +34,16 @@ public class InviteUsersPasswordManagerValidator(
return new Valid<PasswordManagerSubscriptionUpdate>(subscriptionUpdate);
}
if (subscriptionUpdate.SeatsRequiredToAdd == 0)
{
return new Valid<PasswordManagerSubscriptionUpdate>(subscriptionUpdate);
}
if (subscriptionUpdate.PasswordManagerPlan.BaseSeats + subscriptionUpdate.SeatsRequiredToAdd <= 0)
{
return new Invalid<PasswordManagerSubscriptionUpdate>(new PasswordManagerMustHaveSeatsError(subscriptionUpdate));
}
if (subscriptionUpdate.NewUsersToAdd == 0)
{
return new Valid<PasswordManagerSubscriptionUpdate>(subscriptionUpdate);
}
if (subscriptionUpdate.MaxSeatsReached)
{
return new Invalid<PasswordManagerSubscriptionUpdate>(

View File

@ -75,7 +75,7 @@ public class InviteUsersPasswordManagerValidatorTests
public async Task Validate_GivenThePlanDoesNotAllowAdditionalSeats_ShouldBeInvalidMessageOfPlanNotAllowingSeats(Organization organization,
SutProvider<InviteUsersPasswordManagerValidator> sutProvider)
{
organization.Seats = 8;
organization.Seats = 4;
organization.MaxAutoscaleSeats = 9;
var seatsOccupiedByUsers = 4;
var additionalSeats = 4;