Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for 1060 #1118

Merged
merged 8 commits into from Mar 14, 2019

Conversation

Projects
None yet
2 participants
@sbrossie
Copy link
Member

sbrossie commented Mar 12, 2019

No description provided.

sbrossie added some commits Mar 12, 2019

subscription, junction: Introduce new event in the billing stream to …
…capture upcoming catalog CHANGE. See #1060, #1110

This is an important change which removes most (all) the catalog logic from junction/invoice and allow to fix for free
all the scenarii with catalog change + effectiveDateForExistingSubscriptions.

TODO: Fix Beatrix tests and add new tests
@pierre

pierre approved these changes Mar 12, 2019

Copy link
Member

pierre left a comment

Very cool! 🎉

Just a few suggestions...

@@ -79,12 +74,20 @@ public Integer getBcdLocal() {
public String toString() {
return "DefaultSubscriptionBillingEvent{" +
"type=" + type +
", planName='" + planName + '\'' +
", planPhaseName='" + planPhaseName + '\'' +
", plan='" + plan + '\'' +

This comment has been minimized.

@pierre

pierre Mar 12, 2019

Member

Unclear if there are circular dependencies with the objects' toString methods (we had the problem in the past). Might be safer to just print the names.

This comment has been minimized.

@sbrossie

sbrossie Mar 13, 2019

Author Member

Yes, will fix, and print the name only.


@Override
public int compareTo(final SubscriptionBillingEvent o) {
if (!getEffectiveDate().equals(o.getEffectiveDate())) {

This comment has been minimized.

@pierre

pierre Mar 12, 2019

Member

compareTo?

This comment has been minimized.

@sbrossie
@@ -524,7 +527,7 @@ public long getLastEventOrderedId() {
return it.hasNext() ? ((SubscriptionBaseTransitionData) it.next()).getTotalOrdering() : -1L;
}

public List<SubscriptionBillingEvent> getBillingTransitions() {
public List<SubscriptionBillingEvent> getBillingTransitions(final Catalog catalog) throws CatalogApiException {

This comment has been minimized.

@pierre

pierre Mar 12, 2019

Member

Worth adding small unit tests just for this (since it's the core of the change and the logic is... subtle 😅)?

This comment has been minimized.

@sbrossie
@pierre

pierre approved these changes Mar 14, 2019

@@ -79,12 +76,24 @@ public Integer getBcdLocal() {
public String toString() {
return "DefaultSubscriptionBillingEvent{" +
"type=" + type +
", planName='" + planName + '\'' +
", planPhaseName='" + planPhaseName + '\'' +
", plan='" + plan.getName() + '\'' +

This comment has been minimized.

@pierre

pierre Mar 14, 2019

Member

Do we need a null check here (e.g. for cancellations)?

This comment has been minimized.

@sbrossie

sbrossie Mar 14, 2019

Author Member

From construction, plan and planPhase should never be null -- in case of cancel we take the prev. transition plan

@sbrossie sbrossie merged commit 2eaddaf into work-for-release-0.21.x Mar 14, 2019

1 check failed

ci/circleci: build Your tests failed on CircleCI
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.