From a51e4c0a7c4e8bbfa99b204ea0d14aebd20198c0 Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:22:15 -0400 Subject: [PATCH] Used PO ID instead of Org ID on accident (#4500) --- .../Services/Implementations/ProviderEventService.cs | 2 +- test/Billing.Test/Services/ProviderEventServiceTests.cs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Billing/Services/Implementations/ProviderEventService.cs b/src/Billing/Services/Implementations/ProviderEventService.cs index b741e834f..e716f8f16 100644 --- a/src/Billing/Services/Implementations/ProviderEventService.cs +++ b/src/Billing/Services/Implementations/ProviderEventService.cs @@ -76,7 +76,7 @@ public class ProviderEventService( ProviderId = parsedProviderId, InvoiceId = invoice.Id, InvoiceNumber = invoice.Number, - ClientId = client.Id, + ClientId = client.OrganizationId, ClientName = client.OrganizationName, PlanName = client.Plan, AssignedSeats = client.Seats ?? 0, diff --git a/test/Billing.Test/Services/ProviderEventServiceTests.cs b/test/Billing.Test/Services/ProviderEventServiceTests.cs index 47c2f8450..e76cf0d28 100644 --- a/test/Billing.Test/Services/ProviderEventServiceTests.cs +++ b/test/Billing.Test/Services/ProviderEventServiceTests.cs @@ -169,10 +169,14 @@ public class ProviderEventServiceTests _stripeFacade.GetSubscription(subscriptionId).Returns(subscription); + var client1Id = Guid.NewGuid(); + var client2Id = Guid.NewGuid(); + var clients = new List { new () { + OrganizationId = client1Id, OrganizationName = "Client 1", Plan = "Teams (Monthly)", Seats = 50, @@ -181,6 +185,7 @@ public class ProviderEventServiceTests }, new () { + OrganizationId = client2Id, OrganizationName = "Client 2", Plan = "Enterprise (Monthly)", Seats = 50, @@ -228,6 +233,7 @@ public class ProviderEventServiceTests options.InvoiceId == invoice.Id && options.InvoiceNumber == invoice.Number && options.ClientName == "Client 1" && + options.ClientId == client1Id && options.PlanName == "Teams (Monthly)" && options.AssignedSeats == 50 && options.UsedSeats == 30 && @@ -239,6 +245,7 @@ public class ProviderEventServiceTests options.InvoiceId == invoice.Id && options.InvoiceNumber == invoice.Number && options.ClientName == "Client 2" && + options.ClientId == client2Id && options.PlanName == "Enterprise (Monthly)" && options.AssignedSeats == 50 && options.UsedSeats == 30 &&