Skip to content

[Entitlement] Expose BCD_UPDATE and QUANTITY_UPDATE events in subscription event stream - #2254

Open
jutur wants to merge 2 commits into
killbill:masterfrom
jutur:fix-bcd-update-subscription-events
Open

[Entitlement] Expose BCD_UPDATE and QUANTITY_UPDATE events in subscription event stream#2254
jutur wants to merge 2 commits into
killbill:masterfrom
jutur:fix-bcd-update-subscription-events

Conversation

@jutur

@jutur jutur commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #2224.

SubscriptionEventOrdering.toEventTypes() fell through to the default (empty list) branch for BCD_CHANGE and QUANTITY_CHANGE transitions, so callers of Subscription.getSubscriptionEvents() never saw these events in the returned list — only PHASE, CHANGE, START_BILLING, and STOP_BILLING were mapped.

Add explicit case branches for BCD_CHANGE → BCD_UPDATE and QUANTITY_CHANGE → QUANTITY_UPDATE, and register both new types under ENT_BILLING_SERVICE_NAME in EntitlementOrderingBase.getServiceName(), consistent with PHASE and CHANGE.

Also explicitly lists UNDO_CHANGE in the ignored-event cases for clarity.

Depends on: killbill/killbill-api# (adds BCD_UPDATE and QUANTITY_UPDATE to SubscriptionEventType)

A test in TestDefaultSubscriptionApi verifies that a BCD_UPDATE event appears in the subscription event stream after calling updateBCD().

…ent stream

SubscriptionEventOrdering.toEventTypes() fell through to the default
(empty list) branch for BCD_CHANGE and QUANTITY_CHANGE transitions,
so callers of Subscription.getSubscriptionEvents() never saw these
events in the returned list — only PHASE, CHANGE, START_BILLING, and
STOP_BILLING were mapped.

Add explicit case branches for BCD_CHANGE -> BCD_UPDATE and
QUANTITY_CHANGE -> QUANTITY_UPDATE, and register both new types under
ENT_BILLING_SERVICE_NAME in EntitlementOrderingBase.getServiceName()
consistent with PHASE and CHANGE which also affect billing.

Also add UNDO_CHANGE to the explicit ignored-event list in the switch
to make the intent clearer rather than falling through to default.

Depends on killbill-api#<PR> which adds BCD_UPDATE and QUANTITY_UPDATE
to SubscriptionEventType.

Fixes killbill#2224
@jutur
jutur force-pushed the fix-bcd-update-subscription-events branch from 4eede85 to 12ba30e Compare June 17, 2026 03:51
@jutur

jutur commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

CI is failing because this PR depends on killbill-api #124, which adds BCD_UPDATE and QUANTITY_UPDATE to SubscriptionEventType. The pom.xml here pins killbill-api.version to 0.54.1-SNAPSHOT (the local dev build of that change) — once killbill-api #124 is merged and 0.54.1 is released, I'll update the version here and CI should pass.

…DATE types

killbill-api PR killbill#124 has merged; point at the published snapshot for
that commit instead of the stale local dev version.
@reshmabidikar

Copy link
Copy Markdown
Contributor

@jutur regarding this comment are you sure ci is failing due to #124? This seems like a very old ticket, and it is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BCD_UPDATE event does not seem to be returned from subscription events

2 participants