mirror of
https://github.com/bitwarden/server.git
synced 2025-03-12 13:29:14 +01:00
Scale seats before inserting ProviderOrganization when adding existing organization (#5420)
This commit is contained in:
parent
4f73081e41
commit
228ce3b2e9
@ -111,10 +111,15 @@ public class ProviderBillingService(
|
||||
Key = key
|
||||
};
|
||||
|
||||
/*
|
||||
* We have to scale the provider's seats before the ProviderOrganization
|
||||
* row is inserted so the added organization's seats don't get double counted.
|
||||
*/
|
||||
await ScaleSeats(provider, organization.PlanType, organization.Seats!.Value);
|
||||
|
||||
await Task.WhenAll(
|
||||
organizationRepository.ReplaceAsync(organization),
|
||||
providerOrganizationRepository.CreateAsync(providerOrganization),
|
||||
ScaleSeats(provider, organization.PlanType, organization.Seats!.Value)
|
||||
providerOrganizationRepository.CreateAsync(providerOrganization)
|
||||
);
|
||||
|
||||
var clientCustomer = await subscriberService.GetCustomer(organization);
|
||||
|
Loading…
Reference in New Issue
Block a user