Skip to content

Commit 0be0b27

Browse files
docs: improve examples
1 parent 683e297 commit 0be0b27

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

subscription_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ func TestSubscriptionPriceIntervalsWithOptionalParams(t *testing.T) {
509509
"subscription_id",
510510
orb.SubscriptionPriceIntervalsParams{
511511
Add: orb.F([]orb.SubscriptionPriceIntervalsParamsAdd{{
512-
StartDate: orb.F[orb.SubscriptionPriceIntervalsParamsAddStartDateUnion](shared.UnionTime(time.Now())),
512+
StartDate: orb.F[orb.SubscriptionPriceIntervalsParamsAddStartDateUnion](shared.BillingCycleRelativeDate(shared.BillingCycleRelativeDateStartOfTerm)),
513513
AllocationPrice: orb.F(shared.NewAllocationPriceParam{
514514
Amount: orb.F("10.00"),
515515
Cadence: orb.F(shared.NewAllocationPriceCadenceMonthly),
@@ -533,7 +533,7 @@ func TestSubscriptionPriceIntervalsWithOptionalParams(t *testing.T) {
533533
AmountDiscount: orb.F(0.000000),
534534
DiscountType: orb.F(orb.SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParamsDiscountTypeAmount),
535535
}}),
536-
EndDate: orb.F[orb.SubscriptionPriceIntervalsParamsAddEndDateUnion](shared.UnionTime(time.Now())),
536+
EndDate: orb.F[orb.SubscriptionPriceIntervalsParamsAddEndDateUnion](shared.BillingCycleRelativeDate(shared.BillingCycleRelativeDateStartOfTerm)),
537537
ExternalPriceID: orb.F("external_price_id"),
538538
Filter: orb.F("my_property > 100 AND my_other_property = 'bar'"),
539539
FixedFeeQuantityTransitions: orb.F([]orb.SubscriptionPriceIntervalsParamsAddFixedFeeQuantityTransition{{
@@ -589,7 +589,7 @@ func TestSubscriptionPriceIntervalsWithOptionalParams(t *testing.T) {
589589
UsageCustomerIDs: orb.F([]string{"string"}),
590590
}}),
591591
AddAdjustments: orb.F([]orb.SubscriptionPriceIntervalsParamsAddAdjustment{{
592-
StartDate: orb.F[orb.SubscriptionPriceIntervalsParamsAddAdjustmentsStartDateUnion](shared.UnionTime(time.Now())),
592+
StartDate: orb.F[orb.SubscriptionPriceIntervalsParamsAddAdjustmentsStartDateUnion](shared.BillingCycleRelativeDate(shared.BillingCycleRelativeDateStartOfTerm)),
593593
Adjustment: orb.F[orb.SubscriptionPriceIntervalsParamsAddAdjustmentsAdjustmentUnion](shared.NewPercentageDiscountParam{
594594
AdjustmentType: orb.F(shared.NewPercentageDiscountAdjustmentTypePercentageDiscount),
595595
PercentageDiscount: orb.F(0.000000),
@@ -606,15 +606,15 @@ func TestSubscriptionPriceIntervalsWithOptionalParams(t *testing.T) {
606606
PriceType: orb.F(shared.NewPercentageDiscountPriceTypeUsage),
607607
}),
608608
AdjustmentID: orb.F("h74gfhdjvn7ujokd"),
609-
EndDate: orb.F[orb.SubscriptionPriceIntervalsParamsAddAdjustmentsEndDateUnion](shared.UnionTime(time.Now())),
609+
EndDate: orb.F[orb.SubscriptionPriceIntervalsParamsAddAdjustmentsEndDateUnion](shared.BillingCycleRelativeDate(shared.BillingCycleRelativeDateStartOfTerm)),
610610
}}),
611611
AllowInvoiceCreditOrVoid: orb.F(true),
612612
CanDeferBilling: orb.F(true),
613613
Edit: orb.F([]orb.SubscriptionPriceIntervalsParamsEdit{{
614614
PriceIntervalID: orb.F("sdfs6wdjvn7ujokd"),
615615
BillingCycleDay: orb.F(int64(0)),
616616
CanDeferBilling: orb.F(true),
617-
EndDate: orb.F[orb.SubscriptionPriceIntervalsParamsEditEndDateUnion](shared.UnionTime(time.Now())),
617+
EndDate: orb.F[orb.SubscriptionPriceIntervalsParamsEditEndDateUnion](shared.BillingCycleRelativeDate(shared.BillingCycleRelativeDateStartOfTerm)),
618618
Filter: orb.F("my_property > 100 AND my_other_property = 'bar'"),
619619
FixedFeeQuantityTransitions: orb.F([]orb.SubscriptionPriceIntervalsParamsEditFixedFeeQuantityTransition{{
620620
EffectiveDate: orb.F(time.Now()),
@@ -623,13 +623,13 @@ func TestSubscriptionPriceIntervalsWithOptionalParams(t *testing.T) {
623623
MetricParameterOverrides: orb.F(map[string]interface{}{
624624
"foo": "bar",
625625
}),
626-
StartDate: orb.F[orb.SubscriptionPriceIntervalsParamsEditStartDateUnion](shared.UnionTime(time.Now())),
626+
StartDate: orb.F[orb.SubscriptionPriceIntervalsParamsEditStartDateUnion](shared.BillingCycleRelativeDate(shared.BillingCycleRelativeDateStartOfTerm)),
627627
UsageCustomerIDs: orb.F([]string{"string"}),
628628
}}),
629629
EditAdjustments: orb.F([]orb.SubscriptionPriceIntervalsParamsEditAdjustment{{
630630
AdjustmentIntervalID: orb.F("sdfs6wdjvn7ujokd"),
631-
EndDate: orb.F[orb.SubscriptionPriceIntervalsParamsEditAdjustmentsEndDateUnion](shared.UnionTime(time.Now())),
632-
StartDate: orb.F[orb.SubscriptionPriceIntervalsParamsEditAdjustmentsStartDateUnion](shared.UnionTime(time.Now())),
631+
EndDate: orb.F[orb.SubscriptionPriceIntervalsParamsEditAdjustmentsEndDateUnion](shared.BillingCycleRelativeDate(shared.BillingCycleRelativeDateStartOfTerm)),
632+
StartDate: orb.F[orb.SubscriptionPriceIntervalsParamsEditAdjustmentsStartDateUnion](shared.BillingCycleRelativeDate(shared.BillingCycleRelativeDateStartOfTerm)),
633633
}}),
634634
},
635635
)

0 commit comments

Comments
 (0)