File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,8 @@ func (c Timing) ResolveForSpec(spec SubscriptionSpec) (time.Time, error) {
7171 case TimingImmediate :
7272 return clock .Now (), nil
7373 case TimingNextBillingCycle :
74- currentPhase , exists := spec .GetCurrentPhaseAt (clock .Now ())
75- if ! exists {
76- // If there isn't a current phase, the subscription hasn't started or has already ended
77- return def , models .NewGenericValidationError (fmt .Errorf ("billing isn't active for the subscription, there isn't a next_billing_cycle" ))
78- }
79-
80- if ! currentPhase .HasBillables () {
81- return def , models .NewGenericValidationError (fmt .Errorf ("current phase has no billables, there isn't a next_billing_cycle" ))
74+ if spec .BillingCadence .IsZero () {
75+ return def , models .NewGenericValidationError (fmt .Errorf ("subscription does not have a billing cadence, there isn't a next_billing_cycle" ))
8276 }
8377
8478 period , err := spec .GetAlignedBillingPeriodAt (clock .Now ())
You can’t perform that action at this time.
0 commit comments