Skip to content
This repository
  • 1,062 commits
  • 301 files changed
  • 3 contributors
This comparison is big! We're only showing the most recent 250 commits
Aug 16, 2012
Pierre-Alexandre Meyer Merge branch 'master' of cbd368f
Pierre-Alexandre Meyer jaxrs: rename refund_id to refundId in RefundJson
Signed-off-by: Pierre-Alexandre Meyer <>
Add payment config property to disable ALL incoming payments 84cb528
Merge branch 'master' of 331260e
Pierre-Alexandre Meyer jaxrs: rename refundAmount to amount in RefundJson
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge branch 'master' of ee4d713
Pierre-Alexandre Meyer jaxrs: add linkedInvoiceItemId to InvoiceItemJsonSimple
Signed-off-by: Pierre-Alexandre Meyer <>
FIX NPE in payment code when system is configured off 3cf7e77
Merge branch 'master' of e157ae4
Pierre-Alexandre Meyer jaxrs: add resource to retrieve a payment by id
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer server: fix test flakiness
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer jaxrs: fix copyright header date in AccountJsonWithBalance
Signed-off-by: Pierre-Alexandre Meyer <>
Alena Dudzinskaya Renamed Dt to Date in payment json for consistency 3482c31
Aug 17, 2012
Fix getInvoicePayment to return a list of InvoicePayment and add new …
…API for returning the attempt only
Merge branch 'master' of f1dc20d
Add ability to migrate accounts with multiple contact emails 31f4c5e
Aug 20, 2012
Alena Dudzinskaya Fix to the api to get available base plans 66a3820
Add entitlement APIs to be able to also retrieve previous subscriptio…
…n info after subscription was cancelled
Add unit tests for lastActive entitlement APIs and fix minor issue 73b0039
Fix borken unit tests be24b22
[maven-release-plugin] prepare release killbill-0.1.29 4370594
[maven-release-plugin] prepare for next development iteration 02259fb
Aug 21, 2012
Pierre-Alexandre Meyer jaxrs: add isControlTag to TagDefinitionJson
Signed-off-by: Pierre-Alexandre Meyer <>
Alter table for reason code b87e2ba
Pierre-Alexandre Meyer tag: link system tags to application object types
Some system tags can only be applied to a set of object types, e.g.
WRITTEN_OFF only applies to invoices.
This is informational only and the tagging is not restricted on objects
yet (kaui will restrict it in the UI though).

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge branch 'master' of 41f92ea
Aug 22, 2012
Pierre-Alexandre Meyer analytics: initial import of the user api
As a proof of concept, implement the first dashboard query which returns
the number of accounts created per day. The running total will be
displayed in Kaui.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer jaxrs: add Analytics resource
The new endpoint only returns the number of accounts created per day for

Signed-off-by: Pierre-Alexandre Meyer <>
Additional checking for overdue beatrix testBasicOverdueState d81eb99
Merge branch 'master' of a9ff495
Pierre-Alexandre Meyer beatrix: add more checks in TestOverdueIntegration
Signed-off-by: Pierre-Alexandre Meyer <>
Refactoring for test testCancelBPWithAOTheSameDay. Fix issue with she…
…ll invoice on the Bus
Aug 23, 2012
Pierre-Alexandre Meyer analytics: add API to retrieve the number of subscriptions created ov…
…er time

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer jaxrs: add catalog name to CatalogJsonSimple
Signed-off-by: Pierre-Alexandre Meyer <>
Rework for integration beatrix tests 9f22de6
Pierre-Alexandre Meyer invoice: remove debug functions
Signed-off-by: Pierre-Alexandre Meyer <>
Rework of beatrix test testBasePlanComplete (Added CTD check)
Fix EntitlementBilling api to use LocalDate instead of DateTime
Merge branch 'master' of 9c0add2
Yet another pass of simplification of beatrix tests... a7f7f37
Add missing file 5293b20
Disable last part of overdue as it is failing and needs attention c5d999d
Aug 24, 2012
Pierre-Alexandre Meyer analytics: move getSubscriptionsCreatedOverTime to BusinessSubscripti…

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer entitlement: make sure to set the CTD in UTC
This fixes entitlement tests.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge branch 'master' of 22e58ff
Pierre-Alexandre Meyer junction: switch from SortedSet to List for blocking states
Let the database order the states for us - the comparator was buggy

Signed-off-by: Pierre-Alexandre Meyer <>
Aug 27, 2012
Pierre-Alexandre Meyer payment: fix error logging
* Make PaymentProcessor log errors at the WARN level
* Don't make InvoiceHandler log the full stack trace. The useful
  information will be in BillingExceptionBase#toString()

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: remove unused MergeEvent
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix ordering of DefaultBillingEvent
* Use custom transition type for entering/leaving an overdue period to
  differentiate these events with real (un)cancellations
* Fix ordering of billing events
* Enable tests (add missing group). Some are currently failing

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix two bugs in BlockingCalculator
* fix date comparison
* fix typo when looking for the bundleId in the backing map
* add a regression test for both bugs

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix typo in sql statements
Order events in asc order, not desc.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix test failure in TestBillingApi
Rename blocking states.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix testInsertBlockingEvents
The mock object wasn't setup properly.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix test issue with global total order
globaltotalOrder is static, causing tests to be flaky (ordering issue).
Applied a band-aid for now, but we probably want to get rid of it.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix ordering in getBlockingStateFor SQL
The history needs to be ordered, hence the asc. But to get the current
(latest) state, we need to order desc limit 1.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix BillingEvent for invoice
Make invoice ignore the START_BILLING_DISABLED event, by setting the
fixed price to null and setting the billing period to NO_BILLING_PERIOD.

Add an overdue test in TestInvoiceDispatcher to verify this works. The
(hardcoded) test scenario is similar to the one in beatrix

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer beatrix: fix TestOverdueIntegration
The test now passes. Add extra checks for invoice items (it's a bit
convoluted because of the extra credit generated).

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: remove unused MockPrice in TestBillingApi
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: optimize imports in DefaultInvoiceGenerator
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: cleanup TestBillingApi
* Refactor tests to avoid duplicated setup code
* Make disabled tests pass

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer beatrix: fix indentation in TestIntegration
No functional change.

Signed-off-by: Pierre-Alexandre Meyer <>
Aug 29, 2012
Pierre-Alexandre Meyer payment: post an event on the bus if there is no default payment method
If a payment cannot be processed because there is no default payment
method, we need to post an event on the bus for overdue to refresh the
overdue state.

Note that an event will be posted even if the invoice balance is zero.

Added a Beatrix test for this scenario.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer beatrix: test the overdue notification queue
The test was previously checking the overdue states by explicitly
calling refresh on the bundle (the configuration parameter
autoReevaluationInterval was so high, that the notification queue never
kicked in).

This wasn't fully testing overdue though. For instance, the test
testOverdueStateIfNoPaymentMethod() would pass even if we don't send
the payment errors on the bus when there is no default payment method
(because we were asking overdue to refresh its state manually).
Since there is no payment retry if the account doesn't have a default
payment method, overdue has to rely on the notification queue to refresh
its state (and make the bundle go through the various overdue stages
when we move the clock).

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer beatrix: fix comments in TestOverdueIntegration
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: fix potential NPE in AuditedPaymentDao
AuditedPaymentDao.getPayment(paymentId) throws NPE if paymentId is null.
We want to ignore these events in analytics anyways as they are not real

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: remove unique index on bos
We can now have duplicates due to bundle transfers.

Signed-off-by: Pierre-Alexandre Meyer <>
Aug 30, 2012
Pierre-Alexandre Meyer analytics: add linked_item_id in bii
We need this column for e.g. invoice item adjustments.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer account: fix jdbi exception in AuditedAccountEmailDao
AuditedCollectionDaoBase was failing to notice the difference between existing emails
and new ones because the underlying comparison is flawed (it expects the
same class). This was making server throw a 500 error when trying to
add an existing email address.

We really need to fix AuditedCollectionDaoBase eventually. For now, apply a

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: fix potential NPE in BusinessInvoiceItemBinder
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: use getUUID helper in BusinessInvoiceItemMapper
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer server: add first draft of overdue endpoint
I'm not sure yet how the overdue APIs should look like. They are
separate for now (/1.0/kb/overdue/...) but we might want to put them
under the blockable resources (e.g./1.0/kb/accounts/<accountId>/overdue).

These resources are currently useful for overdue server tests that I
just added and for Kaui (to display e.g. the bundle overdue state, if

Signed-off-by: Pierre-Alexandre Meyer <>
Aug 31, 2012
Pierre-Alexandre Meyer invoice: send InvoiceAdjustmentEvent from InvoiceDao as needed
Each time we modify an invoice (adjustment, credit, chargeback, refund, ...),
send an InvoiceAdjustmentEvent on the bus.

This is needed for overdue to refresh its state and for Analytics.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer beatrix: make sure to reset the payment plugin between tests
To avoid relying on tests ordering, make sure to reset the payment
plugin between tests.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: listen to InvoiceAdjustmentEvent events
This is needed to pick up e.g. refunds and chargebacks.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: fix mock setup in test
Signed-off-by: Pierre-Alexandre Meyer <>
Sep 04, 2012
Specifically set date for server tests to avoid flakiness
Change testWithOverdueEvents to generate an invoicewith a target date of 2012-07-30 instead of 2012-07-31. With 2012-07-31, i get a fifth invoice item generated when run on command line but not when ran from IDEA. It seems the fifth invoice item makes sense though.
Sep 05, 2012
Fixing issues with future events when cancelling/ chnaging plans. Mos…
…tly when we have a network that was migrated, we want to make sure that any cancellation will invalidate penibg MIGRATE_BILLING events.
Prevent to have MIGRATE_BILLING if the subscription was cancelled pri…
…or to that event.
Sep 07, 2012
Fix issue in OverdueCode where we miss the first transition
Implement new cancellation action (with policies) in overdue and created specific beatrix test to verify it
Chnage Entitlmenet code to also have a API where we can pass the ActionPolicy on cancellation -- similar to chnagePlan
Sep 10, 2012
Pierre-Alexandre Meyer analytics: fix slug in bii
Don't look at the current plan and phase - look at the historic one.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge branch 'overdue' of into overdue 3cebe54
Only run fast tests for sonatype release ee81561
[maven-release-plugin] prepare release killbill-0.1.30 b102062
[maven-release-plugin] prepare for next development iteration 87df761
Sep 14, 2012
Fix issue with generated CBA upon invoice item adjustement and repair 2fdeb15
Fix issue with missing CBA use when creating CHARGE
Fix Invoice API to throw exception with invoice does not exist
Sep 18, 2012
Pierre-Alexandre Meyer api, beatrix: fix date in copyright headers
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer jaxrs: add endpoint to pay all unpaid invoices
This will be useful in Kaui to trigger payments for all invoices.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge branch 'master' of 3be400b
Sep 19, 2012
Pierre-Alexandre Meyer invoice: presentation tweaks
* Fix default invoice items descriptions
* Better amounts and currencies handling

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: fix Locale parsing
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: fix test failure
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: merge certain items on the HTML invoice
* Merge generated CBA
* Credit/Refund adj items are the same (invoice level adjustments)

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: reformat DefaultInvoiceGenerator
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: implement soft delete of CBA
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer jaxrs: fix typo in DELETE cba endpoint
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: small tweaks to CBA soft deletion
* Link to original CBA item - this is used in Kaui to avoid deleting the
same CBA multiple times
* Un-use the CBA starting with the most recent invoice to limit the
impact on overdue

Signed-off-by: Pierre-Alexandre Meyer <>
Sep 20, 2012
Pierre-Alexandre Meyer jaxrs: add option to return account CBA in AccountJson
Kaui will now display the account credit along with the balance.

Signed-off-by: Pierre-Alexandre Meyer <>
Remove use of available CBA when doing a refund c4e268f
Merge branch 'master' of fa66582
[maven-release-plugin] prepare release killbill-0.1.31 6fe9bfa
[maven-release-plugin] prepare for next development iteration b945d6d
Pierre-Alexandre Meyer overdue: reformat DefaultOverdueState
No functional change.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer overdue: reformat OverdueStateApplicator
No functional change.

Signed-off-by: Pierre-Alexandre Meyer <>
Sep 21, 2012
Pierre-Alexandre Meyer overdue: reformat DefaultOverdueModule
No functional change.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer overdue: allow email notifications
Add option to send emails when the overdue state change.
For now, these emails are not localized.

Signed-off-by: Pierre-Alexandre Meyer <>
Sep 24, 2012
Pierre-Alexandre Meyer invoice: don't delete a CBA if the resulting invoice balance is negative
In Killbill, an invoice balance should be positive or null.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: hide item adjustments of zero on invoice
Don't display zero dollar items on the invoice.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: remove extra line in AuditedInvoiceDao
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer invoice: add missing audit entries
Signed-off-by: Pierre-Alexandre Meyer <>
Fix issue with erfund with item adjustment after a repair c0e8183
Merge branch 'master' of
Sep 25, 2012
Remove erroneoous directory 346bf08
Sep 27, 2012
Pierre-Alexandre Meyer overdue: add formatter for BillingState
Prettify the amount in billing state.

Signed-off-by: Pierre-Alexandre Meyer <>
[maven-release-plugin] prepare release killbill-0.1.32 aa114d8
[maven-release-plugin] prepare for next development iteration b44b1eb
Pierre-Alexandre Meyer invoice: re-hydrate invoice before sending the email
The invoice number is the record id.

Signed-off-by: Pierre-Alexandre Meyer <>
Sep 28, 2012
Add ability to issue w refund after payment method was deleted (provi…
…ded plugin supports it)
Oct 01, 2012
Fix logging for error logs
Fix NPE for updatePaymentMethods
Update amount precision in payment subsystem to be consistent with th…
…e rest of the system
[maven-release-plugin] prepare release killbill-0.1.33 52f44bc
[maven-release-plugin] prepare for next development iteration d6203c5
Oct 02, 2012
Merge branch 'bugfixes' 74c9614
Oct 03, 2012
Fix broken unit tests b7a6e9e
Pierre-Alexandre Meyer tenant: add multitenant support
Api secret generation is done via Shiro. We store a hashed version of the api secret w/ salt.
We use SHA-2 (SHA-256) for now, but we reserve the right to change our minds.

shiro-web enforces Basic auth against most APIs (except tenants and healthcheck resources for now)
in server.

Single tenant mode is still supported: by disabling Shiro in server and/or passing null as tenant id
in API calls contexts, the DAO layer falls back to tenant record id 0.

Tenant information is passed through via TenantContext (r/o calls) and CallContext (r/w calls),
which are turned into InternalTenantContext and InternalCallContext at the DAO layer.

Internal APIs should use the internal versions of these objects but we can't at the moment
(need to extract the services APIs from the api module).


* more work is needed to populate account_record_id and tenant_record_id correctly in some places
* we don't have the infrastructure to run different queues (notification/persistent queues) per tenant for now.
* as part of the addition of account record id and tenant record id, we populated the end date in bii for fixed
  items for convenience.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix java.lang.ArrayIndexOutOfBoundsException
The lookup from code to ErrorCode is more complex (there are holes
between various ErrorCode types).

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge remote-tracking branch 'origin/master' into multitenancy

Signed-off-by: Pierre-Alexandre Meyer <>
Turn on off bus/notificationQ stickiness 57dbcd2
Pierre-Alexandre Meyer Merge remote-tracking branch 'origin/master' into multitenancy 8cd4ca9
Pierre-Alexandre Meyer invoice: fix bug in deleteCBA method
Use substract, not min.

Remove also the reverse on the invoice items - we don't care about their
order and we may not want to limit the impact on overdue after all.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer ddl: add indexes for tenant and account record id
Signed-off-by: Pierre-Alexandre Meyer <>
[maven-release-plugin] prepare release killbill-0.1.34 b18a4e2
[maven-release-plugin] prepare for next development iteration f4e40c5
Oct 04, 2012
Pierre-Alexandre Meyer invoice: refactor set/remove WRITTEN_OFF APIs
Move the call outside of the transaction (wasn't transactional anyways).

Signed-off-by: Pierre-Alexandre Meyer <>
Oct 05, 2012
Pierre-Alexandre Meyer util: populate account_record_id in DefaultTagUserApi
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer util: populate account_record_id in DefaultCustomFieldUserApi
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer overdue: populate account_record_id in refresh call
Signed-off-by: Pierre-Alexandre Meyer <>
Initial pass toi refactor internal/external APIs b66d291
Pierre-Alexandre Meyer junction: populate account_record_id in DefaultBlockingApi
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer util: always create placeholder tables for basic objects
Now that we do secondary lookups for account_record_id, we assume that
the basic tables are always present (e.g. bundles, subscriptions).

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer entitlement: invoice: don't create a call context if not needed
For r/o operations, create a tenant context only.

Signed-off-by: Pierre-Alexandre Meyer <>
Second pass on remove user api from killbill code a1e038c
Pierre-Alexandre Meyer context: populate missing account_record_id
Signed-off-by: Pierre-Alexandre Meyer <>
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
Pierre-Alexandre Meyer bus: move Bus and BusServer to util
We may want to split the classes later on. The post methods should be
internal only, but start/stop/register/unregister should be exposed to
the lifecycle.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer bus: pass the InternalCallContext when posting an event
This is to populate account_record_id and tenant_record_id in the
bus_events table.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer account: populate account_record_id when posting a AccountCreationEve…
…nt event

We need to rehydrate the context with the account_record_id since it
didn't exist at the time when the context was created.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: fix DateTime truncation issue in BlockingState mapper
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: fix tests failures after 5pm PDT
clock.getUTCToday() and new LocalDate() are off by one after 5pm PDT.

Signed-off-by: Pierre-Alexandre Meyer <>
Add default implementation for internal APIs c08a623
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
Pierre-Alexandre Meyer svcsapi: More account_record_id/tenant_record_id work
* Fix missing account_record_id in account audits
* Pass tenant_record_id and account_record_id to NotificationQueueHandlers
* Don't pass accountId when creating InternalTenantContexts - it's not needed
* Store account_record_id and tenant_record_id in db-backed queues

Signed-off-by: Pierre-Alexandre Meyer <>
Partial checkin to merge from svcapi 40387d0
Pierre-Alexandre Meyer util: refactor InternalCallContextFactory
Signed-off-by: Pierre-Alexandre Meyer <>
Partial checkin to merge from svcapi 7b14247
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
Pierre-Alexandre Meyer invoice: fix test setup
Signed-off-by: Pierre-Alexandre Meyer <>
Fixing issues with tenants 5c0ad52
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
More test fix for Intermal API move 1ad4e2b
Pierre-Alexandre Meyer util: make sure to not drop context information in InternalCallContex…

This is important for audits.

Signed-off-by: Pierre-Alexandre Meyer <>
Oct 06, 2012
Fixing tests after internal API change 0a40258
Fix broken test after API refactoring b2de81e
Re-enable test that has been fixed in other branch df9a896
Oct 07, 2012
Pierre-Alexandre Meyer Merge remote-tracking branch 'origin/svcapi-progress' into svcsapi 9889999
Pierre-Alexandre Meyer util: add missing tenant_record_id column in default accounts table
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: add MIGRATE event in BST
Signed-off-by: Pierre-Alexandre Meyer <>
[maven-release-plugin] prepare release killbill-0.1.35 7b3e947
[maven-release-plugin] prepare for next development iteration 04f293a
Oct 08, 2012
Pierre-Alexandre Meyer analytics: don't try to create a prev subscription for MIGRATE events
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer [maven-release-plugin] prepare release killbill-0.1.36 84a4630
Pierre-Alexandre Meyer [maven-release-plugin] prepare for next development iteration 8db3ef7
Pierre-Alexandre Meyer analytics: rework parts of the DAO
* Simplify invoices handling to limit the scope
of the transaction (to avoid MySQL deadlocks)
* Don't rebuild all invoices and items on payments - simply update
the corresponding bin row
* Rename Recorder -> Dao by convention
* Switch to internal APIs where possible

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: rename BusinessInvoicePaymentRecorder -> BusinessInvoicePa…

Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: rename BusinessAccountRecorder -> BusinessAccountDao
Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: rename BusinessOverdueStatusRecorder -> BusinessOverdueSta…

Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: rename BusinessSubscriptionTransitionRecorder -> BusinessS…

Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: rename BusinessTagRecorder -> BusinessTagDao
Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <>
Oct 09, 2012
Pierre-Alexandre Meyer analytics: switch to internal APIs where possible
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: re-work BAC DAO
The creation/update of the row wasn't transactional.
Changed the code to follow the same model as other DAOs (i.e. delete and
recreate in a transaction).

Signed-off-by: Pierre-Alexandre Meyer <>
Oct 10, 2012
Pierre-Alexandre Meyer analytics: add API to refresh the state for an account
This API call will rebuild most of the analytics tables.
Note: this is quite expensive (20 seconds measured on random accounts)
and will issue calls to the payment provider.

JAX-RS endpoint: PUT /1.0/kb/analytics/<accountId>

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: rewrite deleteInvoiceItemsForAccount
Make the join more explicit by using an IN clause.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer entity: expose createdDate and updatedDate
Expose createdDate and updatedDate in Entity (we need it for Analytics).
Most tables (bundles is the exception) already had both columns.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: respect createdDate and updatedDate from entities
In bac, bin and bii, the createdDate and updatedDate fields will now be
populated using the original values of the entities (we don't really
care when the analytics tables were populated).

Signed-off-by: Pierre-Alexandre Meyer <>
more Internal API changes 8890ec6
Change migration code to create subscription with the startDate of th…
…e first migrationCase effectiveDate
Merge branch 'master' of cfdd935
[maven-release-plugin] prepare release killbill-0.1.37 716debd
[maven-release-plugin] prepare for next development iteration 8ba3caf
Oct 11, 2012
Pierre-Alexandre Meyer jaxrs: fix NPE in AccountJson
Signed-off-by: Pierre-Alexandre Meyer <>
Oct 12, 2012
Pierre-Alexandre Meyer jdbi: restart transactions in case of deadlock
Upgrade jdbi to 2.39.1 to use the new SerializableTransactionRunner,
which will restart deadlock transactions up to 5 times (default).

This should hopefully reduce the issues seen under high load in Analytics.

Signed-off-by: Pierre-Alexandre Meyer <>
Fix issue with nextBillingDate notification for annual plans (missing…
… specific test case)
Merge branch 'master' of 27458d5
Pierre-Alexandre Meyer jaxrs: first pass at implementing an export endpoint
One can now download all data as CSV for a given account via:

  curl -v<accountId> -H'X-Killbill-CreatedBy: pierre'

See the import-account script in bin/ to import it in a MySQL database.

Note that some data is still missing, not all tables are being exported

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer junction: add missing toString method in BillCycleDayCalculator
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge branch 'master' of e0715e6
Oct 14, 2012
Pierre-Alexandre Meyer util: export: export the corresponding row in accounts table
The accounts table needs special treatment during the export since it
doesn't have an account_record_id column (it's the record_id).

Signed-off-by: Pierre-Alexandre Meyer <>
Fix broken test 05bd707
[maven-release-plugin] prepare release killbill-0.1.38 0674aa0
[maven-release-plugin] prepare for next development iteration 2695654
Oct 15, 2012
Pierre-Alexandre Meyer entitlement: fix NPE in AuditedEntitlementDao
buildSubscription() was throwing an NPE when the base plan for an ADD_ON couldn't be
found (this shouldn't happen, but returning null handles gracefully the

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer jaxrs: lower to info for 404 errors
No need to WARN for 404 errors.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer util: export: fix datetime handling
Export datetime as strings, as mysqlimport won't handle timestamps

Signed-off-by: Pierre-Alexandre Meyer <>
Fix NPEs in overdue and entitlements when basePlan does not exist (fo…
…r e.g STANDALONE) or when ADD_ON was cancellled
Merge branch 'master' of 26ff442
Pierre-Alexandre Meyer util: fix export tests with local db
Signed-off-by: Pierre-Alexandre Meyer <>
Merge branch 'master' of ed96228
[maven-release-plugin] prepare release killbill-0.1.39 e0f3fe8
[maven-release-plugin] prepare for next development iteration 958df7a
Oct 16, 2012
Merge branch 'master' into svcsapi
Oct 17, 2012
Pierre-Alexandre Meyer util: fix connection leak in MySqlGlobalLocker
We were leaking db connections when the MySQL lock couldn't be acquired.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer util: increase the lock timeout to 10s
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: acquire account lock during refreshes
Because we use read committed transactional level, we need to lock the
account before deleting and recreating the rows.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer server: upgrade skeleton to 0.1.6
This adds JDBI support for transaction restarts.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer payment: don't hold the account lock while fetching payment methods
Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer [maven-release-plugin] prepare release killbill-0.1.40 9e026e3
Pierre-Alexandre Meyer [maven-release-plugin] prepare for next development iteration 6ed5591
Oct 18, 2012
Pierre-Alexandre Meyer analytics: fix bug in SYSTEM_CANCEL event in BST
The time of the SYSTEM_CANCEL event is the effective time of the cancel
event from entitlement.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer server: bump skeleton to 0.1.7
Signed-off-by: Pierre-Alexandre Meyer <>
Oct 21, 2012
Intermediary commit in order to switch ab49d3d
Intermediary commit in order to switch 9e8344a
Oct 22, 2012
Pierre-Alexandre Meyer server: add jetty-console-maven-plugin in pom.xml
This will create an executable war.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer analytics: fix mrr computation
We need to look at the billing period to compute the mrr,
not the phase duration.

Signed-off-by: Pierre-Alexandre Meyer <>
Intermediary push for rework around account_record_id 2b9aba0
Intermediary push for rework around account_record_id b35d95b
Pierre-Alexandre Meyer entitlement: prevent transfers in the future
The entitlement code always assumes that the first event for a
subscription is in the past. This means we don't support transfers
happening in the future - make sure to reject the transfer in that case.

Signed-off-by: Pierre-Alexandre Meyer <>
Oct 23, 2012
Remove unused method for context 4dced98
Implement a fix for migration code to avoid having a MIGRATE_BILLING …
…date after a subscription transition

Fix Overdue code to handler STANDALONE subscriptions.
Oct 24, 2012
Intermediary check-in for changs in BusEvent 0d50885
Fix broken unit tests 4fee752
Merge remote-tracking branch 'origin/master' into svcsapi
Fix broken bus handler so they use event accountRecordId, tenantRecor…
…dId to create their internal context
Pierre-Alexandre Meyer analytics: fix bug in refresh call
The getTags method in the Tag API returns a mapping tag id -> tag, not
tag definition name -> tag. This caused an issue when refreshing
accounts, as we were storing tag definition ids in bac_tags, not tag
definition names.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge branch 'master' of 6087482
Initial implementation for public bus 0c366a4
Merge branch 'master' into svcsapi e27446f
Oct 25, 2012
Fix unit tests and startup sequence fd27341
Add missing files; and fix Lifecycle test 2049345
Merge remote-tracking branch 'origin/master' into svcsapi 2a65b82
Oct 26, 2012
Add Key-value table for tenant module along with User API to access it a59c08f
Initial implementation for Push Notification-- needs more love and test db05c85
Oct 27, 2012
Add test for push notification 592c529
Pierre-Alexandre Meyer entitlement: fix transfer issue with migrated bundles
For migrated bundles, the last event is likely to be a MIGRATE_BILLING
event, which is ignored in toEvents() when building the events for the transfered
This was causing errors when transferring bundles where the destination
subscription wouldn't have any event.

This patch does best effort to find at least one event by building
them as we go (the last non-null one would be used, in this case the one
associated with the MIGRATE_ENTITLEMENT event).

Another solution would be to create a dummy TRANSFER event by default
although this is a bit tricky to build (need to remember the last phase name,

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge branch 'master' of 756620c
Add private accountAPI to retrieve account by recordId
Fix push notification to include accountId
Harden TestPushNotification
Merge branch 'master' of 25e9520
Oct 28, 2012
Pierre-Alexandre Meyer Revert "entitlement: fix transfer issue with migrated bundles"
This reverts commit d39d45c.

Let's not tackle this issue for the 0.1.41 release, as we're still unclear
on what the fix should be.

Signed-off-by: Pierre-Alexandre Meyer <>
Pierre-Alexandre Meyer Merge branch 'master' of 8866f42
[maven-release-plugin] prepare release killbill-0.1.41 b64b0c5
[maven-release-plugin] prepare for next development iteration 9acd2ea