mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +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:
parent
b12e881ece
commit
eac2b9f0b8
@ -1,4 +1,8 @@
|
||||
namespace Bit.Core.Billing.Models;
|
||||
|
||||
public record OrganizationMetadataDTO(
|
||||
bool IsOnSecretsManagerStandalone);
|
||||
bool IsOnSecretsManagerStandalone)
|
||||
{
|
||||
public static OrganizationMetadataDTO Default() => new(
|
||||
IsOnSecretsManagerStandalone: default);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public class OrganizationBillingQueries(
|
||||
|
||||
if (customer == null || subscription == null)
|
||||
{
|
||||
return null;
|
||||
return OrganizationMetadataDTO.Default();
|
||||
}
|
||||
|
||||
var isOnSecretsManagerStandalone = IsOnSecretsManagerStandalone(organization, customer, subscription);
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user