if (oldestCatalog || // Prevent issue with time granularity -- see #760 return new CatalogPlanEntry(c, plan); } else { // It's an existing subscription if (plan.getEffectiveDateForExistingSubscriptions() != null) { // If it is null, any change to this catalog does not apply to existing subscriptions final DateTime existingSubscriptionDate = CatalogDateHelper.toUTCDateTime(plan.getEffectiveDateForExistingSubscriptions()); if (requestedDate.isAfter(existingSubscriptionDate)) { // This plan is now applicable to existing subs return new CatalogPlanEntry(c, plan); candidateInSubsequentCatalog = new CatalogPlanEntry(c, plan);
if (oldestCatalog || // Prevent issue with time granularity -- see #760 return new CatalogPlanEntry(c, plan); } else { // It's an existing subscription if (plan.getEffectiveDateForExistingSubscriptions() != null) { // If it is null, any change to this catalog does not apply to existing subscriptions final DateTime existingSubscriptionDate = CatalogDateHelper.toUTCDateTime(plan.getEffectiveDateForExistingSubscriptions()); if (requestedDate.isAfter(existingSubscriptionDate)) { // This plan is now applicable to existing subs return new CatalogPlanEntry(c, plan); candidateInSubsequentCatalog = new CatalogPlanEntry(c, plan);
private StaticCatalog getStaticCatalog(final PlanSpecifier spec, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(spec), requestedDate, subscriptionStartDate); return entry.getStaticCatalog(); }
@Override public PriceList findPriceListForPlan(final String planName, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(planName), requestedDate, subscriptionStartDate); return entry.getStaticCatalog().findCurrentPricelist(entry.getPlan().getPriceListName()); }
@Override public Plan findPlan(final String name, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(name), requestedDate, subscriptionStartDate); return entry.getPlan(); }
@Override public Plan createOrFindPlan(final PlanSpecifier spec, final PlanPhasePriceOverridesWithCallContext overrides, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(spec, overrides), requestedDate, subscriptionStartDate); return entry.getPlan(); }
private StaticCatalog getStaticCatalog(final PlanSpecifier spec, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(spec), requestedDate, subscriptionStartDate); return entry.getStaticCatalog(); }
@Override public PriceList findPriceListForPlan(final String planName, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(planName), requestedDate, subscriptionStartDate); return entry.getStaticCatalog().findCurrentPricelist(entry.getPlan().getPriceListName()); }
@Override public Plan createOrFindPlan(final PlanSpecifier spec, final PlanPhasePriceOverridesWithCallContext overrides, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(spec, overrides), requestedDate, subscriptionStartDate); return entry.getPlan(); }
@Override public Plan findPlan(final String name, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(name), requestedDate, subscriptionStartDate); return entry.getPlan(); }