1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-22 16:57:36 +01:00

[AC-2488] Return default state for billing metadata when Organization has no Stripe entities (#4018)

* Return default state for billing metadata when no stripe entities

* Fix tests
This commit is contained in:
Alex Morask 2024-04-25 09:21:05 -04:00 committed by GitHub
parent b12e881ece
commit eac2b9f0b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,8 @@
namespace Bit.Core.Billing.Models;
public record OrganizationMetadataDTO(
bool IsOnSecretsManagerStandalone);
bool IsOnSecretsManagerStandalone)
{
public static OrganizationMetadataDTO Default() => new(
IsOnSecretsManagerStandalone: default);
}

View File

@ -29,7 +29,7 @@ public class OrganizationBillingQueries(
if (customer == null || subscription == null)
{
return null;
return OrganizationMetadataDTO.Default();
}
var isOnSecretsManagerStandalone = IsOnSecretsManagerStandalone(organization, customer, subscription);

View File

@ -35,7 +35,7 @@ public class OrganizationBillingQueriesTests
var metadata = await sutProvider.Sut.GetMetadata(organizationId);
Assert.Null(metadata);
Assert.False(metadata.IsOnSecretsManagerStandalone);
}
[Theory, BitAutoData]
@ -50,7 +50,7 @@ public class OrganizationBillingQueriesTests
var metadata = await sutProvider.Sut.GetMetadata(organizationId);
Assert.Null(metadata);
Assert.False(metadata.IsOnSecretsManagerStandalone);
}
[Theory, BitAutoData]