@Override public String toString() { return eventType.toString() + "_" + (category == null ? MISC : category.toString().toUpperCase()); }
@Override public Entitlement doOperation(final CallContext ctx) throws InterruptedException, TimeoutException, EntitlementApiException { final PlanPhaseSpecifier spec = new PlanPhaseSpecifier(entitlement.getProductName(), ProductCategory.valueOf(entitlement.getProductCategory()), BillingPeriod.valueOf(entitlement.getBillingPeriod()), entitlement.getPriceList(), null); final UUID accountId = entitlement.getAccountId() != null ? UUID.fromString(entitlement.getAccountId()) : null; final LocalDate inputLocalDate = toLocalDate(accountId, requestedDate, callContext); final UUID bundleId = entitlement.getBundleId() != null ? UUID.fromString(entitlement.getBundleId()) : null; return (entitlement.getProductCategory().equals(ProductCategory.ADD_ON.toString())) ? entitlementApi.addEntitlement(bundleId, spec, inputLocalDate, callContext) : entitlementApi.createBaseEntitlement(accountId, spec, entitlement.getExternalKey(), inputLocalDate, callContext); }
ProductJson productJson = productMap.get(product.getName()); if (productJson == null) { productJson = new ProductJson(product.getCategory().toString(), product.getName(), toProductNames(product.getIncluded()),
public BusinessInvoiceItemModelDao(@Nullable final String externalKey, final InvoiceItem invoiceItem, @Nullable final Plan plan, @Nullable final PlanPhase planPhase) { this(invoiceItem.getAmount(), planPhase != null ? planPhase.getBillingPeriod().toString() : null, invoiceItem.getCreatedDate(), invoiceItem.getCurrency(), /* Populate end date for fixed items for convenience (null in invoice_items table) */ (invoiceItem.getEndDate() == null && planPhase != null) ? invoiceItem.getStartDate().plus(planPhase.getDuration().toJodaPeriod()) : invoiceItem.getEndDate(), externalKey, invoiceItem.getInvoiceId(), invoiceItem.getId(), invoiceItem.getLinkedItemId(), invoiceItem.getInvoiceItemType().toString(), planPhase != null ? planPhase.getPhaseType().toString() : null, plan != null ? plan.getProduct().getCategory().toString() : null, plan != null ? plan.getProduct().getName() : null, plan != null ? plan.getProduct().getCatalogName() : null, planPhase != null ? planPhase.getName() : null, invoiceItem.getStartDate(), invoiceItem.getUpdatedDate()); }
this.eventType = bstModelDao.getEvent().getEventType().toString(); if (bstModelDao.getEvent().getCategory() != null) { this.category = bstModelDao.getEvent().getCategory().toString(); } else { this.category = null; this.prevProductName = bstModelDao.getPreviousSubscription().getProductName(); this.prevProductType = bstModelDao.getPreviousSubscription().getProductType(); this.prevProductCategory = bstModelDao.getPreviousSubscription().getProductCategory().toString(); this.prevSlug = bstModelDao.getPreviousSubscription().getSlug(); this.prevPhase = bstModelDao.getPreviousSubscription().getPhase(); this.nextProductName = bstModelDao.getNextSubscription().getProductName(); this.nextProductType = bstModelDao.getNextSubscription().getProductType(); this.nextProductCategory = bstModelDao.getNextSubscription().getProductCategory().toString(); this.nextSlug = bstModelDao.getNextSubscription().getSlug(); this.nextPhase = bstModelDao.getNextSubscription().getPhase();