From ed7715814b473fb6b42a979bee5ea661a6568cb9 Mon Sep 17 00:00:00 2001 From: Pavel Brm <5097196+pavelbrm@users.noreply.github.com> Date: Thu, 24 Oct 2024 21:30:22 +1300 Subject: [PATCH] fix: set sku_variant when linking mobile orders (#2677) --- services/skus/skus.go | 3 +++ services/skus/skus_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/services/skus/skus.go b/services/skus/skus.go index d24e4bbd4..e48be665c 100644 --- a/services/skus/skus.go +++ b/services/skus/skus.go @@ -238,6 +238,7 @@ func newOrderItemReqNewMobileSet(env string) map[string]model.OrderItemRequestNe leom := model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium", + SKUVnt: "brave-leo-premium", // Location depends on env. Description: "Premium access to Leo", CredentialType: "time-limited-v2", @@ -252,6 +253,7 @@ func newOrderItemReqNewMobileSet(env string) map[string]model.OrderItemRequestNe leoa := model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium-year", + SKUVnt: "brave-leo-premium-year", // Location depends on env. Description: "Premium access to Leo Yearly", CredentialType: "time-limited-v2", @@ -266,6 +268,7 @@ func newOrderItemReqNewMobileSet(env string) map[string]model.OrderItemRequestNe vpnm := model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", // Location depends on env. Description: "brave-vpn-premium", CredentialType: "time-limited-v2", diff --git a/services/skus/skus_test.go b/services/skus/skus_test.go index 5fcb2016a..77770c1ef 100644 --- a/services/skus/skus_test.go +++ b/services/skus/skus_test.go @@ -227,6 +227,7 @@ func TestNewOrderItemReqForSubID(t *testing.T) { req: model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium", + SKUVnt: "brave-leo-premium", Location: "leo.brave.software", Description: "Premium access to Leo", CredentialType: "time-limited-v2", @@ -253,6 +254,7 @@ func TestNewOrderItemReqForSubID(t *testing.T) { req: model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium", + SKUVnt: "brave-leo-premium", Location: "leo.brave.software", Description: "Premium access to Leo", CredentialType: "time-limited-v2", @@ -279,6 +281,7 @@ func TestNewOrderItemReqForSubID(t *testing.T) { req: model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium-year", + SKUVnt: "brave-leo-premium-year", Location: "leo.brave.software", Description: "Premium access to Leo Yearly", CredentialType: "time-limited-v2", @@ -305,6 +308,7 @@ func TestNewOrderItemReqForSubID(t *testing.T) { req: model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium-year", + SKUVnt: "brave-leo-premium-year", Location: "leo.brave.software", Description: "Premium access to Leo Yearly", CredentialType: "time-limited-v2", @@ -331,6 +335,7 @@ func TestNewOrderItemReqForSubID(t *testing.T) { req: model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.brave.software", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -357,6 +362,7 @@ func TestNewOrderItemReqForSubID(t *testing.T) { req: model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.brave.software", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -383,6 +389,7 @@ func TestNewOrderItemReqForSubID(t *testing.T) { req: model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.brave.software", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -409,6 +416,7 @@ func TestNewOrderItemReqForSubID(t *testing.T) { req: model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.brave.software", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -470,6 +478,7 @@ func TestNewCreateOrderReqNewMobile(t *testing.T) { { Quantity: 1, SKU: "brave-leo-premium", + SKUVnt: "brave-leo-premium", Location: "leo.brave.software", Description: "Premium access to Leo", CredentialType: "time-limited-v2", @@ -505,6 +514,7 @@ func TestNewCreateOrderReqNewMobile(t *testing.T) { { Quantity: 1, SKU: "brave-leo-premium-year", + SKUVnt: "brave-leo-premium-year", Location: "leo.bravesoftware.com", Description: "Premium access to Leo Yearly", CredentialType: "time-limited-v2", @@ -540,6 +550,7 @@ func TestNewCreateOrderReqNewMobile(t *testing.T) { { Quantity: 1, SKU: "brave-leo-premium", + SKUVnt: "brave-leo-premium", Location: "leo.brave.com", Description: "Premium access to Leo", CredentialType: "time-limited-v2", @@ -576,6 +587,7 @@ func TestNewCreateOrderReqNewMobile(t *testing.T) { { Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.brave.software", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -611,6 +623,7 @@ func TestNewCreateOrderReqNewMobile(t *testing.T) { { Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.bravesoftware.com", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -646,6 +659,7 @@ func TestNewCreateOrderReqNewMobile(t *testing.T) { { Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.brave.com", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -689,6 +703,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-leo-premium": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium", + SKUVnt: "brave-leo-premium", Location: "leo.brave.com", Description: "Premium access to Leo", CredentialType: "time-limited-v2", @@ -706,6 +721,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-leo-premium-year": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium-year", + SKUVnt: "brave-leo-premium-year", Location: "leo.brave.com", Description: "Premium access to Leo Yearly", CredentialType: "time-limited-v2", @@ -723,6 +739,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-vpn-premium": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.brave.com", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -746,6 +763,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-leo-premium": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium", + SKUVnt: "brave-leo-premium", Location: "leo.bravesoftware.com", Description: "Premium access to Leo", CredentialType: "time-limited-v2", @@ -763,6 +781,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-leo-premium-year": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium-year", + SKUVnt: "brave-leo-premium-year", Location: "leo.bravesoftware.com", Description: "Premium access to Leo Yearly", CredentialType: "time-limited-v2", @@ -780,6 +799,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-vpn-premium": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.bravesoftware.com", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -803,6 +823,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-leo-premium": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium", + SKUVnt: "brave-leo-premium", Location: "leo.brave.software", Description: "Premium access to Leo", CredentialType: "time-limited-v2", @@ -820,6 +841,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-leo-premium-year": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium-year", + SKUVnt: "brave-leo-premium-year", Location: "leo.brave.software", Description: "Premium access to Leo Yearly", CredentialType: "time-limited-v2", @@ -837,6 +859,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-vpn-premium": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.brave.software", Description: "brave-vpn-premium", CredentialType: "time-limited-v2", @@ -860,6 +883,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-leo-premium": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium", + SKUVnt: "brave-leo-premium", Location: "leo.brave.software", Description: "Premium access to Leo", CredentialType: "time-limited-v2", @@ -877,6 +901,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-leo-premium-year": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-leo-premium-year", + SKUVnt: "brave-leo-premium-year", Location: "leo.brave.software", Description: "Premium access to Leo Yearly", CredentialType: "time-limited-v2", @@ -894,6 +919,7 @@ func TestNewOrderItemReqNewMobileSet(t *testing.T) { "brave-vpn-premium": model.OrderItemRequestNew{ Quantity: 1, SKU: "brave-vpn-premium", + SKUVnt: "brave-vpn-premium", Location: "vpn.brave.software", Description: "brave-vpn-premium", CredentialType: "time-limited-v2",