@Override public PlanPhase findPhase(final String phaseName, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final String planName = DefaultPlanPhase.planName(phaseName); final Plan plan = findPlan(planName, requestedDate, subscriptionStartDate); return plan.findPhase(phaseName); }
@Override public PlanPhase findCurrentPhase(final String name) throws CatalogApiException { if (name == null || plans == null) { throw new CatalogApiException(ErrorCode.CAT_NO_SUCH_PHASE, name); } final String planName = DefaultPlanPhase.planName(name); final Plan plan = findCurrentPlan(planName); return plan.findPhase(name); }
final PlanPhase nextPhase = (nextPlan != null && nextPhaseName != null) ? nextPlan.findPhase(nextPhaseName) : null; final PriceList nextPriceList = (nextPlan != null) ? catalog.findPriceListForPlan(nextPlanName, cur.getEffectiveDate(), getAlignStartDate()) : null;
planPhaseName = phaseEV.getPhase(); phaseType = prevPlan != null ? prevPlan.findPhase(phaseEV.getPhase()).getPhaseType() : null; plan = prevPlan; productName = prevProductName; planPhaseName = userEV.getEventPlanPhase(); plan = (userEV.getEventPlan() != null) ? catalog.findPlan(userEV.getEventPlan(), cur.getEffectiveDate(), startDate) : null; phaseType = (plan != null && userEV.getEventPlanPhase() != null) ? plan.findPhase(userEV.getEventPlanPhase()).getPhaseType() : prevPhaseType; productName = (plan != null) ? plan.getProduct().getName() : prevProductName; billingPeriod = (userEV.getEventPlanPhase() != null) ? getBillingPeriod(catalog, userEV.getEventPlanPhase(), cur.getEffectiveDate(), startDate) : prevBillingPeriod;
@Override public PlanPhase findPhase(final String phaseName, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final String planName = DefaultPlanPhase.planName(phaseName); final Plan plan = findPlan(planName, requestedDate, subscriptionStartDate); return plan.findPhase(phaseName); }
@Override public PlanPhase findCurrentPhase(final String name) throws CatalogApiException { if (name == null || plans == null) { throw new CatalogApiException(ErrorCode.CAT_NO_SUCH_PHASE, name); } final String planName = DefaultPlanPhase.planName(name); final Plan plan = findCurrentPlan(planName); return plan.findPhase(name); }
final PlanPhase planPhase = plan.findPhase(phaseName); if (planPhase != null) { prettyPlanPhaseName = planPhase.getPrettyName();
private PlanPhaseSpecifier getPlanPhaseSpecifierFromTransition(final Catalog catalog, final SubscriptionInternalEvent transition) throws CatalogApiException { final Plan prevPlan = (transition.getPreviousPlan() != null) ? catalog.findPlan(transition.getPreviousPlan(), transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null; final Plan nextPlan = (transition.getNextPlan() != null) ? catalog.findPlan(transition.getNextPlan(), transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null; final Plan plan = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ? nextPlan : prevPlan; final PlanPhase prevPhase = prevPlan != null && transition.getPreviousPhase() != null ? prevPlan.findPhase(transition.getPreviousPhase()) : null; final PlanPhase nextPhase = nextPlan != null && transition.getNextPhase() != null ? nextPlan.findPhase(transition.getNextPhase()) : null; final PlanPhase phase = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ? nextPhase : prevPhase; return new PlanPhaseSpecifier(plan.getName(), phase.getPhaseType()); }
this.planPhase = (planPhaseName != null && this.plan != null) ? this.plan.findPhase(planPhaseName) : null; this.nextPlanPhase = this.planPhase; this.planPhase = (planPhaseName != null && this.plan != null) ? this.plan.findPhase(planPhaseName) : null; this.nextPlanPhase = null; final PlanPhase prevPlanPhase = (prevPhaseName != null && prevPlan != null) ? prevPlan.findPhase(prevPhaseName) : null; this.billingPeriod = getRecurringBillingPeriod(prevPlanPhase);
final PlanPhase nextPhase = (nextPlan != null && nextPhaseName != null) ? nextPlan.findPhase(nextPhaseName) : null; final PriceList nextPriceList = (nextPlan != null) ? catalog.findPriceListForPlan(nextPlanName, cur.getEffectiveDate(), getAlignStartDate()) : null;
planPhaseName = phaseEV.getPhase(); phaseType = prevPlan != null ? prevPlan.findPhase(phaseEV.getPhase()).getPhaseType() : null; plan = prevPlan; productName = prevProductName; planPhaseName = userEV.getEventPlanPhase(); plan = (userEV.getEventPlan() != null) ? catalog.findPlan(userEV.getEventPlan(), cur.getEffectiveDate(), startDate) : null; phaseType = (plan != null && userEV.getEventPlanPhase() != null) ? plan.findPhase(userEV.getEventPlanPhase()).getPhaseType() : prevPhaseType; productName = (plan != null) ? plan.getProduct().getName() : prevProductName; billingPeriod = (userEV.getEventPlanPhase() != null) ? getBillingPeriod(catalog, userEV.getEventPlanPhase(), cur.getEffectiveDate(), startDate) : prevBillingPeriod;