private BillingActionPolicy getPlanChangePolicy(final PlanPhaseSpecifier from, final PlanSpecifier to, final StaticCatalog catalog) throws CatalogApiException { final BillingActionPolicy result = DefaultCaseChange.getResult(changeCase, from, to, catalog); return (result != null) ? result : BillingActionPolicy.END_OF_TERM; }
public static <K> K getResult(final DefaultCase<K>[] cases, final PlanSpecifier planSpec, final StaticCatalog catalog) throws CatalogApiException { if (cases != null) { for (final DefaultCase<K> c : cases) { final K result = c.getResult(planSpec, catalog); if (result != null) { return result; } } } return null; }
@Override public String toString() { return "DefaultCaseCancelPolicy{" + "policy =" + policy + ", phaseType =" + getPhaseType() + ", product=" + getProduct() + ", productCategory=" + getProductCategory() + ", billingPeriod=" + getBillingPeriod() + ", priceList=" + getPriceList() + '}'; }
@BeforeMethod(groups = "fast") public void beforeMethod() { cat = new MockCatalog(); final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[0]; final DefaultCaseChangePlanPolicy casePolicy = new DefaultCaseChangePlanPolicy().setPolicy(BillingActionPolicy.END_OF_TERM); final DefaultCaseChangePlanAlignment caseAlignment = new DefaultCaseChangePlanAlignment().setAlignment(PlanAlignmentChange.START_OF_SUBSCRIPTION); final DefaultCasePriceList casePriceList = new DefaultCasePriceList().setToPriceList(priceList2); cat.getPlanRules(). setChangeCase(new DefaultCaseChangePlanPolicy[]{casePolicy}). setChangeAlignmentCase(new DefaultCaseChangePlanAlignment[]{caseAlignment}). setPriceListCase(new DefaultCasePriceList[]{casePriceList}); }
@Override public String toString() { return "DefaultCaseChangePlanPolicy {" + "policy=" + policy + ", phaseType=" + getPhaseType() + ", fromProduct=" + getFromProduct() + ", fromProductCategory=" + getFromProductCategory() + ", fromBillingPeriod=" + getFromBillingPeriod() + ", fromPriceList=" + getFromPriceList() + ", toProduct=" + getToProduct() + ", toProductCategory=" + getToProductCategory() + ", toBillingPeriod=" + getToBillingPeriod() + ", toPriceList=" + getToPriceList() + '}'; }
@Override public String toString() { return "DefaultCaseBillingAlignment {" + "alignment=" + alignment + ", phaseType=" + getPhaseType() + ", product=" + getProduct() + ", productCategory=" + getProductCategory() + ", billingPeriod=" + getBillingPeriod() + ", priceList=" + getPriceList() + '}'; }
public DefaultCaseResult(final DefaultProduct product, final ProductCategory productCategory, final BillingPeriod billingPeriod, final DefaultPriceList priceList, final PhaseType phaseType, final Result policy) { setProduct(product); setProductCategory(productCategory); setBillingPeriod(billingPeriod); setPriceList(priceList); setPhaseType(phaseType); this.policy = policy; }
@Override public String toString() { return "DefaultCaseCreateAlignment {" + "alignment =" + alignment + ", product=" + getProduct() + ", productCategory=" + getProductCategory() + ", billingPeriod=" + getBillingPeriod() + ", priceList=" + getPriceList() + '}'; }
public DefaultCaseResult(final DefaultProduct product, final ProductCategory productCategory, final BillingPeriod billingPeriod, final DefaultPriceList priceList, final Result policy) { setProduct(product); setProductCategory(productCategory); setBillingPeriod(billingPeriod); setPriceList(priceList); this.policy = policy; }
public T getResult(final PlanSpecifier planPhase, final StaticCatalog c) throws CatalogApiException { if (satisfiesCase(planPhase, c)) { return getResult(); } return null; }
public static <K> K getResult(final DefaultCasePhase<K>[] cases, final PlanPhaseSpecifier planSpec, final StaticCatalog catalog) throws CatalogApiException { if (cases != null) { for (final DefaultCasePhase<K> cp : cases) { final K result = cp.getResult(planSpec, catalog); if (result != null) { return result; } } } return null; }
@Override public PlanChangeResult planChange(final PlanPhaseSpecifier from, final PlanSpecifier to) throws CatalogApiException { return planRules.planChange(from, to, this); }
@Override public PlanAlignmentCreate planCreateAlignment(final PlanSpecifier specifier) throws CatalogApiException { return planRules.getPlanCreateAlignment(specifier, this); }
@Override public BillingActionPolicy planCancelPolicy(final PlanPhaseSpecifier planPhase) throws CatalogApiException { return planRules.getPlanCancelPolicy(planPhase, this); }
@Override public BillingAlignment billingAlignment(final PlanPhaseSpecifier planPhase) throws CatalogApiException { return planRules.getBillingAlignment(planPhase, this); }
private PlanAlignmentChange getPlanChangeAlignment(final PlanPhaseSpecifier from, final PlanSpecifier to, final StaticCatalog catalog) throws CatalogApiException { final PlanAlignmentChange result = DefaultCaseChange.getResult(changeAlignmentCase, from, to, catalog); return (result != null) ? result : PlanAlignmentChange.START_OF_BUNDLE; }
public BillingActionPolicy getPlanCancelPolicy(final PlanPhaseSpecifier planPhase, final StaticCatalog catalog) throws CatalogApiException { final BillingActionPolicy result = DefaultCasePhase.getResult(cancelCase, planPhase, catalog); return (result != null) ? result : BillingActionPolicy.END_OF_TERM; }
public PlanAlignmentCreate getPlanCreateAlignment(final PlanSpecifier specifier, final StaticCatalog catalog) throws CatalogApiException { final PlanAlignmentCreate result = DefaultCase.getResult(createAlignmentCase, specifier, catalog); return (result != null) ? result : PlanAlignmentCreate.START_OF_BUNDLE; }
public static <K> K getResult(final DefaultCaseChange<K>[] cases, final PlanPhaseSpecifier from, final PlanSpecifier to, final StaticCatalog catalog) throws CatalogApiException { if (cases != null) { for (final DefaultCaseChange<K> cc : cases) { final K result = cc.getResult(from, to, catalog); if (result != null) { return result; } } } return null; }
public BillingAlignment getBillingAlignment(final PlanPhaseSpecifier planPhase, final StaticCatalog catalog) throws CatalogApiException { final BillingAlignment result = DefaultCasePhase.getResult(billingAlignmentCase, planPhase, catalog); return (result != null) ? result : BillingAlignment.ACCOUNT; }