5/20/2016 9:39:43 PM
or when switching to next PHASE after a change of Plan to respect the original initial phase (skipped phases) if any. Fixes #549.
Consider scenario where we create a subscription with a Plan P (TRIAL, DISCOUNT, EVERGREEN) and decide to start on the DISCOUNT Phase. When later we switch to another similar Plan P' (TRIAL, DISCOUNT, EVERGREEN) with a SUBSCRIPTION alignment, we also expect to start rhe alignment logic from the DISCOUNT phase for P' (but before the fix this was not the case).
Following scenario could also happen:
* In case the new Plan P' has a DISCOUNT phase but does not have the same shape (i.e does not have a TRIAL) we ignore that, and stil align starting from DISCOUNT phase (which actually really mean we ignore that the subscription initially started on a DISCOUNT phase because we only support TRIAL, DISCOUNT, EVERGREEN so nothing could have come before DISCOUNT)
* In case the new Plan P' does not have a DISCOUNT phase, we ignore the subscription initially started on a DISCOUNT phase and align from the begining of the phase of the new Plan P'