Skip to content

Commit

Permalink
Merge pull request killbill#1773 from reshmabidikar/work-for-release-…
Browse files Browse the repository at this point in the history
…0.23x-1030-blocking-states

1030 - Removed remaining TODO statements
  • Loading branch information
sbrossie authored Sep 26, 2022
2 parents 34c1671 + 997c996 commit 7b4cf27
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public DefaultBlockingState(final UUID id,
this.blockBilling = blockBilling;
this.effectiveDate = effectiveDate;
this.totalOrdering = totalOrdering;
this.isActive = true; //TODO_1030 - should this be false?
this.isActive = true;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public BlockingState getEntitlementCancellationEvent(final UUID subscriptionId)

public Iterable<SubscriptionBaseTransition> getPendingSubscriptionEvents(final DateTime effectiveDatetime, final SubscriptionBaseTransitionType... types) {
final List<SubscriptionBaseTransitionType> typeList = List.of(types);
return subscription.getAllTransitions(false) //TODO_1030 backward compatibility
return subscription.getAllTransitions(false)
.stream()
.filter(input -> !input.getEffectiveTransitionTime().isBefore(effectiveDatetime) &&
typeList.contains(input.getTransitionType()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public AccountEventsStreams buildForAccount(final Map<UUID, List<SubscriptionBas
allSubscriptionsForBundle,
accountBCD,
catalog,
false, //TODO_1030: Revisit to check if any modifications are needed here
false, //includeDeletedEvents set to false since deleted events are not needed while building entitlements for account.
internalTenantContext);

}
Expand All @@ -253,7 +253,7 @@ public AccountEventsStreams buildForAccount(final Map<UUID, List<SubscriptionBas
accountBCD,
bcdCache,
catalog,
false, //TODO_1030: Revisit to check if any modifications are needed here
false, //includeDeletedEvents - set to false since it does not matter while building entitlements for account.
internalTenantContext);
eventsStreamPerBundle.get(bundleId).add(eventStream);
}
Expand All @@ -274,7 +274,7 @@ public List<EventsStream> buildForBundle(final UUID bundleId, final InternalTena

final List<EventsStream> eventsStreams = new LinkedList<EventsStream>();
for (final SubscriptionBase subscription : subscriptionsForBundle) {
eventsStreams.add(buildForEntitlement(bundle, subscription, subscriptionsForBundle, false, internalTenantContext)); //TODO_1030-revisit to check if any modifications are needed here
eventsStreams.add(buildForEntitlement(bundle, subscription, subscriptionsForBundle, false, internalTenantContext)); //includeDeletedEvents is set to false since it does not matter while building entitlements for bundle.
}
return eventsStreams;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public List<BlockingState> getBlockingActiveForAccount(final VersionedCatalog ca
}

@Override
public List<BlockingState> getByBlockingIds(final Iterable<UUID> blockableIds, final boolean includeDeletedEvents, final InternalTenantContext context) { //TODO_1030: Revisit later to check if changes are required for includeDeletedEvents
public List<BlockingState> getByBlockingIds(final Iterable<UUID> blockableIds, final boolean includeDeletedEvents, final InternalTenantContext context) {
final List<BlockingState> result = new ArrayList<>();
for (final UUID cur : blockableIds) {
final List<BlockingState> objs = blockingStates.get(cur);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private TimedPhase getTimedPhaseOnChange(final DefaultSubscriptionBase subscript
effectiveDate,
// This method is only called while doing the change, hence we want to pass the change effective date
effectiveDate,
subscription.getAllTransitions(false).get(0).getNextPhase().getPhaseType(), //TODO_1030 backward compatibility
subscription.getAllTransitions(false).get(0).getNextPhase().getPhaseType(),
newPlanInitialPhaseType,
which,
catalog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ public void testCreateSubscriptionAndCheckSubscriptionEvents() throws Subscripti
eventsAfterChange = dao.getEventsForSubscription(subscription.getId(), true, internalCallContext);
assertNotNull(eventsAfterChange);
testUtil.printEvents(eventsAfterChange);
//TODO_1030: Is the order of events correct? Revisit once the rest of the code is in place
assertTrue(eventsAfterChange.size() == 3); //Returns PhaseEvent as well

event = eventsAfterChange.get(0);
Expand Down

0 comments on commit 7b4cf27

Please sign in to comment.