Skip to content
Open
4 changes: 3 additions & 1 deletion api/v3/handlers/subscriptions/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ func TestToAPIBillingSubscriptionViewRoundtrip(t *testing.T) {
// given: a subscription created from the example plan, which has phases and rate cards
cust := deps.CustomerAdapter.CreateExampleCustomer(t)
_ = deps.FeatureConnector.CreateExampleFeatures(t, deps.ExampleMeterID)
plan := deps.PlanHelper.CreatePlan(t, subscriptiontestutils.GetExamplePlanInput(t))
taxCode := deps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
plan := deps.PlanHelper.CreatePlan(t, subscriptiontestutils.GetExamplePlanInput(t, taxConfig))

spec, err := subscription.NewSpecFromPlan(plan, subscription.CreateSubscriptionCustomerInput{
CustomerId: cust.ID,
Expand Down
6 changes: 4 additions & 2 deletions api/v3/handlers/subscriptions/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ func TestMigrateSubscriptionHandler(t *testing.T) {
defer db.Cleanup(t)
deps := subscriptiontestutils.NewService(t, db)
deps.FeatureConnector.CreateExampleFeatures(t, deps.ExampleMeterID)
taxCode := deps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
plan := deps.PlanHelper.CreatePlan(t, subscriptiontestutils.BuildTestPlanInput(t).
AddPhase(nil, subscriptiontestutils.ExampleRateCard1.Clone()).Build())
AddPhase(nil, subscriptiontestutils.ExampleRateCard1(taxConfig)).Build())
before := subscriptiontestutils.CreateSubscriptionFromPlan(t, &deps, plan, start)

clock.FreezeTime(start.Add(24 * time.Hour))
deps.PlanHelper.CreatePlan(t, subscriptiontestutils.BuildTestPlanInput(t).
AddPhase(nil, subscriptiontestutils.ExampleRateCard1.Clone(), subscriptiontestutils.ExampleRateCard2.Clone()).Build())
AddPhase(nil, subscriptiontestutils.ExampleRateCard1(taxConfig), subscriptiontestutils.ExampleRateCard2.Clone()).Build())
clock.FreezeTime(start.Add(10 * 24 * time.Hour))

resolver, err := featureresolver.New(deps.FeatureConnector)
Expand Down
24 changes: 4 additions & 20 deletions openmeter/productcatalog/plan/adapter/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ func TestPostgresAdapter(t *testing.T) {
t,
namespace,
pctestutils.WithPlanKey("custom-plan-currency"),
withoutTaxConfig,
func(t *testing.T, p *productcatalog.Plan) {
t.Helper()
p.Currency = custom.Reference()
Expand Down Expand Up @@ -686,11 +685,11 @@ func TestListPlansExcludeUnrepresentableCurrencies(t *testing.T) {

namespace := pctestutils.NewTestNamespace(t)

plain := pctestutils.NewTestPlan(t, namespace, pctestutils.WithPlanKey("plain"), withoutTaxConfig)
plain := pctestutils.NewTestPlan(t, namespace, pctestutils.WithPlanKey("plain"))
_, err := env.PlanRepository.CreatePlan(t.Context(), plain)
require.NoError(t, err, "creating plain plan must not fail")

withOverride := pctestutils.NewTestPlan(t, namespace, pctestutils.WithPlanKey("with-override"), withoutTaxConfig)
withOverride := pctestutils.NewTestPlan(t, namespace, pctestutils.WithPlanKey("with-override"))
overriddenRateCard, ok := withOverride.Phases[0].RateCards[0].(*productcatalog.FlatFeeRateCard)
require.True(t, ok, "default test plan rate card must be flat fee")
custom, err := env.Currency.CreateCurrency(t.Context(), currencytestutils.NewCreateCurrencyInput(namespace, "TOKEN", "Tokens", "tok"))
Expand All @@ -699,7 +698,7 @@ func TestListPlansExcludeUnrepresentableCurrencies(t *testing.T) {
_, err = env.PlanRepository.CreatePlan(t.Context(), withOverride)
require.NoError(t, err, "creating plan with rate-card currency override must not fail")

withCustomDefault := pctestutils.NewTestPlan(t, namespace, pctestutils.WithPlanKey("with-custom-default"), withoutTaxConfig)
withCustomDefault := pctestutils.NewTestPlan(t, namespace, pctestutils.WithPlanKey("with-custom-default"))
withCustomDefault.Currency = custom.Reference()
_, err = env.PlanRepository.CreatePlan(t.Context(), withCustomDefault)
require.NoError(t, err, "creating plan with custom default currency must not fail")
Expand Down Expand Up @@ -728,21 +727,6 @@ func TestListPlansExcludeUnrepresentableCurrencies(t *testing.T) {
})
}

func withoutTaxConfig(t *testing.T, p *productcatalog.Plan) {
t.Helper()

for _, phase := range p.Phases {
for _, rateCard := range phase.RateCards {
err := rateCard.ChangeMeta(func(meta productcatalog.RateCardMeta) (productcatalog.RateCardMeta, error) {
meta.TaxConfig = nil

return meta, nil
})
require.NoError(t, err)
}
}
}

type createPlanVersionInput struct {
Namespace string
Version int
Expand Down Expand Up @@ -776,7 +760,7 @@ func testListPlanStatusFilter(ctx context.Context, t *testing.T, repo plan.Repos

ns := "list-plan-status-filter"

planV1Input := pctestutils.NewTestPlan(t, ns, withoutTaxConfig)
planV1Input := pctestutils.NewTestPlan(t, ns)

err := createPlanVersion(ctx, repo, createPlanVersionInput{
Namespace: ns,
Expand Down
10 changes: 1 addition & 9 deletions openmeter/productcatalog/planaddon/adapter/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@ func TestPlanAddonAdapterBackfillsTaxConfigFromTaxCode(t *testing.T) {
},
})

planInput := pctestutils.NewTestPlan(t, namespace)
err := planInput.Phases[0].RateCards[0].ChangeMeta(func(meta productcatalog.RateCardMeta) (productcatalog.RateCardMeta, error) {
meta.TaxConfig = &productcatalog.TaxConfig{
TaxCodeID: lo.ToPtr(taxCode.ID),
}

return meta, nil
})
require.NoError(t, err)
planInput := pctestutils.NewTestPlan(t, namespace, pctestutils.WithRateCardTaxCode(taxCode))

createdPlan, err := env.PlanRepository.CreatePlan(ctx, planInput)
require.NoError(t, err)
Expand Down
32 changes: 22 additions & 10 deletions openmeter/productcatalog/subscription/service/change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ func TestChange(t *testing.T) {

t.Run("Should change to different plan", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)

now := testutils.GetRFC3339Time(t, "2021-01-01T00:01:10Z")
clock.SetTime(now)
Expand Down Expand Up @@ -98,7 +100,7 @@ func TestChange(t *testing.T) {
Description: lo.ToPtr("Test Phase 4 Description"),
},
RateCards: productcatalog.RateCards{
subscriptiontestutils.ExampleRateCard1.Clone(),
subscriptiontestutils.ExampleRateCard1(taxConfig),
},
})

Expand Down Expand Up @@ -146,7 +148,9 @@ func TestChange(t *testing.T) {

t.Run("Should change to different plan starting from specific phase", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)

now := testutils.GetRFC3339Time(t, "2021-01-01T00:01:10Z")
clock.SetTime(now)
Expand Down Expand Up @@ -198,7 +202,7 @@ func TestChange(t *testing.T) {
Description: lo.ToPtr("Test Phase 4 Description"),
},
RateCards: productcatalog.RateCards{
subscriptiontestutils.ExampleRateCard1.Clone(),
subscriptiontestutils.ExampleRateCard1(taxConfig),
},
})

Expand Down Expand Up @@ -268,7 +272,9 @@ func TestChange(t *testing.T) {

t.Run("Should not allow changing to inactive plan", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)

now := testutils.GetRFC3339Time(t, "2021-01-01T00:01:10Z")
clock.SetTime(now)
Expand Down Expand Up @@ -320,7 +326,7 @@ func TestChange(t *testing.T) {
Description: lo.ToPtr("Test Phase 4 Description"),
},
RateCards: productcatalog.RateCards{
subscriptiontestutils.ExampleRateCard1.Clone(),
subscriptiontestutils.ExampleRateCard1(taxConfig),
},
})

Expand Down Expand Up @@ -386,7 +392,9 @@ func TestChange(t *testing.T) {

t.Run("Should apply the settlement mode override when creating from a plan reference", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
require.Equal(t, productcatalog.CreditThenInvoiceSettlementMode, examplePlanInput.Plan.SettlementMode)

now := testutils.GetRFC3339Time(t, "2021-01-01T00:01:10Z")
Expand Down Expand Up @@ -430,7 +438,9 @@ func TestChange(t *testing.T) {

t.Run("Should apply the settlement mode override when changing to a plan reference", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)

now := testutils.GetRFC3339Time(t, "2021-01-01T00:01:10Z")
clock.SetTime(now)
Expand Down Expand Up @@ -532,7 +542,9 @@ func TestChangeInlineCustomPlanRejectsMissingFeature(t *testing.T) {
customer := deps.CustomerAdapter.CreateExampleCustomer(t)
deps.FeatureConnector.CreateExampleFeatures(t, deps.ExampleMeterID)

currentPlanInput := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
currentPlanInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
currentPlanInput.Plan.Key = ""
currentPlanInput.Plan.Version = 0
currentPlan := plansubscription.PlanInput{}
Expand All @@ -552,7 +564,7 @@ func TestChangeInlineCustomPlanRejectsMissingFeature(t *testing.T) {
require.NoError(t, err)

const missingFeatureKey = "missing-change-feature"
replacementPlanInput := subscriptiontestutils.GetExamplePlanInput(t)
replacementPlanInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
replacementPlanInput.Plan.Key = ""
replacementPlanInput.Plan.Version = 0
require.NoError(t, replacementPlanInput.Plan.Phases[0].RateCards[0].ChangeMeta(func(meta productcatalog.RateCardMeta) (productcatalog.RateCardMeta, error) {
Expand Down
28 changes: 21 additions & 7 deletions openmeter/productcatalog/subscription/service/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ func TestCreateInlineCustomPlanRejectsMissingFeature(t *testing.T) {
deps.FeatureConnector.CreateExampleFeatures(t, deps.ExampleMeterID)

const missingFeatureKey = "missing-feature"
planInput := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
planInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
planInput.Plan.Key = ""
planInput.Plan.Version = 0
require.NoError(t, planInput.Plan.Phases[0].RateCards[0].ChangeMeta(func(meta productcatalog.RateCardMeta) (productcatalog.RateCardMeta, error) {
Expand Down Expand Up @@ -151,8 +153,10 @@ func TestCreateSettlementModeOverride(t *testing.T) {
cust := deps.subDeps.CustomerAdapter.CreateExampleCustomer(t)
deps.subDeps.FeatureConnector.CreateExampleFeatures(t, deps.subDeps.ExampleMeterID)

taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
// Build a custom plan input; clear Key/Version so PlanFromPlanInput accepts it.
planInput := subscriptiontestutils.GetExamplePlanInput(t)
planInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
require.Equal(t, productcatalog.CreditThenInvoiceSettlementMode, planInput.Plan.SettlementMode, "precondition: plan default must be CreditThenInvoice")
planInput.Plan.Key = ""
planInput.Plan.Version = 0
Expand Down Expand Up @@ -198,7 +202,9 @@ func TestCreateSettlementModeOverride(t *testing.T) {
cust := deps.subDeps.CustomerAdapter.CreateExampleCustomer(t)
deps.subDeps.FeatureConnector.CreateExampleFeatures(t, deps.subDeps.ExampleMeterID)

examplePlanInput := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
require.Equal(t, productcatalog.CreditThenInvoiceSettlementMode, examplePlanInput.Plan.SettlementMode, "precondition: plan default must be CreditThenInvoice")

plan1 := deps.subDeps.PlanHelper.CreatePlan(t, examplePlanInput)
Expand Down Expand Up @@ -255,7 +261,9 @@ func TestCreateInlineCustomCurrencyMaterializesManagedIdentity(t *testing.T) {
))
require.NoError(t, err)

planInput := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
planInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
planInput.Plan.Key = ""
planInput.Plan.Version = 0
planInput.Plan.Currency = managedCurrency.Reference()
Expand Down Expand Up @@ -322,7 +330,9 @@ func TestCreateInlineCustomCurrencyGatedByCredits(t *testing.T) {
customer := deps.CustomerAdapter.CreateExampleCustomer(t)
deps.FeatureConnector.CreateExampleFeatures(t, deps.ExampleMeterID)

planInput := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
planInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
planInput.Plan.Key = ""
planInput.Plan.Version = 0
planInput.Plan.Currency = currencies.NewCurrencyReference("CREDITS")
Expand Down Expand Up @@ -377,7 +387,9 @@ func TestCreateInlineEntitlementRateCardResolvesFeatureByID(t *testing.T) {
featureIDByKey[f.Key] = f.ID
}

planInput := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
planInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
planInput.Plan.Key = ""
planInput.Plan.Version = 0

Expand Down Expand Up @@ -430,7 +442,9 @@ func TestCreateInlineCreditOnlyPlanSkipsCurrencyCostBasis(t *testing.T) {
))
require.NoError(t, err)

planInput := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
planInput := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
planInput.Plan.Key = ""
planInput.Plan.Version = 0
planInput.Plan.SettlementMode = productcatalog.CreditOnlySettlementMode
Expand Down
20 changes: 15 additions & 5 deletions openmeter/productcatalog/subscription/service/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ func TestMigrate(t *testing.T) {

t.Run("Should migrate to latest version of plan when none is specified", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)

now := testutils.GetRFC3339Time(t, "2021-01-01T00:01:10Z")
clock.SetTime(now)
Expand Down Expand Up @@ -120,7 +122,9 @@ func TestMigrate(t *testing.T) {

t.Run("Should migrate to specific version of plan when provided", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)

now := testutils.GetRFC3339Time(t, "2021-01-01T00:01:10Z")
clock.SetTime(now)
Expand Down Expand Up @@ -194,7 +198,9 @@ func TestMigrate(t *testing.T) {

t.Run("Should not allow migrating to same or smaller version", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)

now := testutils.GetRFC3339Time(t, "2021-01-01T00:01:10Z")
clock.SetTime(now)
Expand Down Expand Up @@ -273,7 +279,9 @@ func TestMigrate(t *testing.T) {

t.Run("Should replace the subscription when a starting phase is supplied", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t)
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)

now := testutils.GetRFC3339Time(t, "2021-01-01T00:01:10Z")
clock.SetTime(now)
Expand Down Expand Up @@ -396,8 +404,10 @@ func TestMigrateReturnsCurrentSnapshotFromUnderLock(t *testing.T) {

deps := subscriptiontestutils.NewService(t, db)
deps.FeatureConnector.CreateExampleFeatures(t, deps.ExampleMeterID)
taxCode := deps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
planInput := subscriptiontestutils.BuildTestPlanInput(t).AddPhase(nil,
subscriptiontestutils.ExampleRateCard1.Clone(),
subscriptiontestutils.ExampleRateCard1(taxConfig),
).Build()
p1 := deps.PlanHelper.CreatePlan(t, planInput)
before := subscriptiontestutils.CreateSubscriptionFromPlan(t, &deps, p1, start)
Expand Down
6 changes: 4 additions & 2 deletions openmeter/productcatalog/subscription/service/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ func TestDiscountPersisting(t *testing.T) {

t.Run("Should persist discounts", func(t *testing.T) {
withDeps(t, func(t *testing.T, deps tDeps) {
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t)
examplePlanInput1.Phases[0].RateCards[0] = subscriptiontestutils.ExampleRateCardWithDiscounts.Clone()
taxCode := deps.subDeps.TaxCodeEnv.CreateTaxCode(t, subscriptiontestutils.ExampleNamespace, subscriptiontestutils.GetExampleTaxCodeInput())
taxConfig := subscriptiontestutils.ExampleTaxConfig(taxCode)
examplePlanInput1 := subscriptiontestutils.GetExamplePlanInput(t, taxConfig)
examplePlanInput1.Phases[0].RateCards[0] = subscriptiontestutils.ExampleRateCardWithDiscounts(taxConfig)

ctx := context.Background()

Expand Down
Loading
Loading