Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashendrickx committed Oct 31, 2024
1 parent 204ef2d commit 079d899
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,18 +484,11 @@ public async Task ChangePlan(ChangeProviderPlanCommand command)

public async Task UpdateSeatMinimums(UpdateProviderSeatMinimumsCommand command)
{
var provider = await providerRepository.GetByIdAsync(command.Id);

if (provider == null)
{
throw new BadRequestException("Provider not found.");
}

var subscription = await stripeAdapter.SubscriptionGetAsync(provider.GatewaySubscriptionId);
var subscription = await stripeAdapter.SubscriptionGetAsync(command.GatewaySubscriptionId);

var subscriptionItemOptionsList = new List<SubscriptionItemOptions>();

var providerPlans = await providerPlanRepository.GetByProviderId(provider.Id);
var providerPlans = await providerPlanRepository.GetByProviderId(command.Id);

foreach (var newPlanConfiguration in command.Configuration)
{
Expand Down Expand Up @@ -564,7 +557,7 @@ public async Task UpdateSeatMinimums(UpdateProviderSeatMinimumsCommand command)

if (subscriptionItemOptionsList.Count > 0)
{
await stripeAdapter.SubscriptionUpdateAsync(provider.GatewaySubscriptionId,
await stripeAdapter.SubscriptionUpdateAsync(command.GatewaySubscriptionId,
new SubscriptionUpdateOptions { Items = subscriptionItemOptionsList });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1158,21 +1158,6 @@ await stripeAdapter.Received(1)

#region UpdateSeatMinimums

[Theory, BitAutoData]
public async Task UpdateSeatMinimums_NullProvider_ThrowsArgumentNullException(
UpdateProviderSeatMinimumsCommand command,
SutProvider<ProviderBillingService> sutProvider)
{
// Arrange
sutProvider.GetDependency<IProviderRepository>().GetByIdAsync(Arg.Any<Guid>()).Returns((Provider)null);

// Act
var actual = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.UpdateSeatMinimums(command));

// Assert
Assert.Equal("Provider not found.", actual.Message);
}

[Theory, BitAutoData]
public async Task UpdateSeatMinimums_NegativeSeatMinimum_ThrowsBadRequestException(
Provider provider,
Expand Down

0 comments on commit 079d899

Please sign in to comment.