Skip to content
This repository
  • 1,062 commits
  • 301 files changed
  • 0 comments
  • 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 github.com:ning/killbill cbd368f
Pierre-Alexandre Meyer jaxrs: rename refund_id to refundId in RefundJson
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
19dc751
Add payment config property to disable ALL incoming payments 84cb528
Merge branch 'master' of github.com:ning/killbill 331260e
Pierre-Alexandre Meyer jaxrs: rename refundAmount to amount in RefundJson
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
ab76f6a
Pierre-Alexandre Meyer Merge branch 'master' of github.com:ning/killbill ee4d713
Pierre-Alexandre Meyer jaxrs: add linkedInvoiceItemId to InvoiceItemJsonSimple
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
dbf1b5b
FIX NPE in payment code when system is configured off 3cf7e77
Merge branch 'master' of github.com:ning/killbill e157ae4
Pierre-Alexandre Meyer jaxrs: add resource to retrieve a payment by id
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
ced1d93
Pierre-Alexandre Meyer server: fix test flakiness
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
4693c6d
Pierre-Alexandre Meyer jaxrs: fix copyright header date in AccountJsonWithBalance
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
9e5f9cf
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
4e9c97f
Merge branch 'master' of github.com:ning/killbill 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
4ef2435
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 <pierre@ning.com>
8177b46
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@ning.com>
1437424
Pierre-Alexandre Meyer Merge branch 'master' of github.com:ning/killbill 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@ning.com>
81ba6b4
Pierre-Alexandre Meyer jaxrs: add Analytics resource
The new endpoint only returns the number of accounts created per day for
now.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
fd26a9e
Additional checking for overdue beatrix testBasicOverdueState d81eb99
Merge branch 'master' of github.com:ning/killbill a9ff495
Pierre-Alexandre Meyer beatrix: add more checks in TestOverdueIntegration
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
f410e69
Refactoring for test testCancelBPWithAOTheSameDay. Fix issue with she…
…ll invoice on the Bus
559e632
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@ning.com>
6971c05
Pierre-Alexandre Meyer jaxrs: add catalog name to CatalogJsonSimple
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
58dfe9f
Rework for integration beatrix tests 9f22de6
Pierre-Alexandre Meyer invoice: remove debug functions
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
191b919
Rework of beatrix test testBasePlanComplete (Added CTD check)
Fix EntitlementBilling api to use LocalDate instead of DateTime
63c97c4
Merge branch 'master' of github.com:ning/killbill 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…
…onTransitionSqlDao

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
160732a
Pierre-Alexandre Meyer entitlement: make sure to set the CTD in UTC
This fixes entitlement tests.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
e68b38a
Pierre-Alexandre Meyer Merge branch 'master' of github.com:ning/killbill 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
anyways.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
bd0151c
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@ning.com>
e97fa0d
Pierre-Alexandre Meyer junction: remove unused MergeEvent
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
90e403e
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@ning.com>
d2e6ce7
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@ning.com>
7988087
Pierre-Alexandre Meyer junction: fix typo in sql statements
Order events in asc order, not desc.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
45a2b14
Pierre-Alexandre Meyer junction: fix test failure in TestBillingApi
Rename blocking states.

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

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
57e74de
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@ning.com>
e1afd8a
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@ning.com>
82fe4d4
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
(TestOverdueIntegration#testBasicOverdueState).

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
c1c32dd
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@ning.com>
49dc575
Pierre-Alexandre Meyer junction: remove unused MockPrice in TestBillingApi
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
676c92b
Pierre-Alexandre Meyer invoice: optimize imports in DefaultInvoiceGenerator
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
c9cd1e9
Pierre-Alexandre Meyer junction: cleanup TestBillingApi
* Refactor tests to avoid duplicated setup code
* Make disabled tests pass

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
06ccc90
Pierre-Alexandre Meyer beatrix: fix indentation in TestIntegration
No functional change.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
489a59c
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@ning.com>
c95bc9f
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@ning.com>
2215d27
Pierre-Alexandre Meyer beatrix: fix comments in TestOverdueIntegration
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
8f03597
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
attempts.

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

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
f8c50f9
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@ning.com>
475e1e6
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
band-aid.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
39df2ff
Pierre-Alexandre Meyer analytics: fix potential NPE in BusinessInvoiceItemBinder
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
7782a37
Pierre-Alexandre Meyer analytics: use getUUID helper in BusinessInvoiceItemMapper
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
f1dfcf4
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
any).

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
9a80396
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@ning.com>
5274849
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@ning.com>
744f182
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@ning.com>
0c8ea97
Pierre-Alexandre Meyer invoice: fix mock setup in test
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
9cebdea
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.
56070f2
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.
d99ab55
Prevent to have MIGRATE_BILLING if the subscription was cancelled pri…
…or to that event.
31eb558
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
1390e2d
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@ning.com>
5eeba3c
Pierre-Alexandre Meyer Merge branch 'overdue' of github.com:ning/killbill 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
c67a12d
Sep 18, 2012
Pierre-Alexandre Meyer api, beatrix: fix date in copyright headers
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
f449f34
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@ning.com>
45602b9
Pierre-Alexandre Meyer Merge branch 'master' of github.com:ning/killbill 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@ning.com>
f48f0f3
Pierre-Alexandre Meyer invoice: fix Locale parsing
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
615b6b5
Pierre-Alexandre Meyer invoice: fix test failure
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
a9ae4a3
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@ning.com>
0f68b94
Pierre-Alexandre Meyer invoice: reformat DefaultInvoiceGenerator
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
a30a00e
Pierre-Alexandre Meyer invoice: implement soft delete of CBA
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
583c697
Pierre-Alexandre Meyer jaxrs: fix typo in DELETE cba endpoint
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
75a4dd9
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 <pierre@ning.com>
6974e71
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 <pierre@ning.com>
6979c7a
Remove use of available CBA when doing a refund c4e268f
Merge branch 'master' of github.com:ning/killbill 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@ning.com>
fe5472b
Pierre-Alexandre Meyer overdue: reformat OverdueStateApplicator
No functional change.

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

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
bb536ab
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 <pierre@ning.com>
c494c0f
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@ning.com>
7de298a
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@ning.com>
10a7e9f
Pierre-Alexandre Meyer invoice: remove extra line in AuditedInvoiceDao
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
b84498b
Pierre-Alexandre Meyer invoice: add missing audit entries
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
521f6b5
Fix issue with erfund with item adjustment after a repair c0e8183
Merge branch 'master' of github.com:ning/killbill
Conflicts:
	invoice/src/main/java/com/ning/billing/invoice/dao/AuditedInvoiceDao.java
3aa5cca
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 <pierre@ning.com>
8f0ddd7
[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 <pierre@ning.com>
20a6c2d
Sep 28, 2012
Add ability to issue w refund after payment method was deleted (provi…
…ded plugin supports it)
e0a9d81
Oct 01, 2012
Fix logging for error logs
Fix NPE for updatePaymentMethods
eba5522
Update amount precision in payment subsystem to be consistent with th…
…e rest of the system
944d25a
[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).

Notes:

* 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@ning.com>
241dfd8
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@ning.com>
1130217
Pierre-Alexandre Meyer Merge remote-tracking branch 'origin/master' into multitenancy
Conflicts:
	invoice/src/main/java/com/ning/billing/invoice/InvoiceDispatcher.java

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
2a98e4b
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@ning.com>
e3f17c0
Pierre-Alexandre Meyer ddl: add indexes for tenant and account record id
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
9aa1969
[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 <pierre@ning.com>
cf60c74
Oct 05, 2012
Pierre-Alexandre Meyer util: populate account_record_id in DefaultTagUserApi
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
737e206
Pierre-Alexandre Meyer util: populate account_record_id in DefaultCustomFieldUserApi
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
42a5347
Pierre-Alexandre Meyer overdue: populate account_record_id in refresh call
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
25af1d6
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@ning.com>
404df10
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@ning.com>
698a6c1
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 <pierre@ning.com>
12806d9
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 <pierre@ning.com>
6014158
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
Conflicts:
	entitlement/src/main/java/com/ning/billing/entitlement/api/billing/DefaultChargeThruApi.java
	invoice/src/main/java/com/ning/billing/invoice/api/user/DefaultInvoiceUserApi.java
	invoice/src/main/java/com/ning/billing/invoice/dao/AuditedInvoiceDao.java
	invoice/src/test/java/com/ning/billing/invoice/dao/TestDefaultInvoiceDao.java
	invoice/src/test/java/com/ning/billing/invoice/dao/TestInvoiceDao.java
	junction/src/main/java/com/ning/billing/junction/api/blocking/DefaultBlockingApi.java
	overdue/src/main/java/com/ning/billing/overdue/api/DefaultOverdueUserApi.java
	overdue/src/test/java/com/ning/billing/overdue/applicator/TestOverdueStateApplicator.java
abff2c7
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
Conflicts:
	entitlement/src/main/java/com/ning/billing/entitlement/api/billing/DefaultChargeThruApi.java
8f2c83e
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@ning.com>
d3c73ff
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@ning.com>
86f3cc6
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@ning.com>
f0e3a01
Pierre-Alexandre Meyer junction: fix DateTime truncation issue in BlockingState mapper
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
a0fdf43
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 <pierre@ning.com>
6d03324
Add default implementation for internal APIs c08a623
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
Conflicts:
	invoice/src/main/java/com/ning/billing/invoice/InvoiceDispatcher.java
	invoice/src/main/java/com/ning/billing/invoice/api/user/DefaultInvoiceUserApi.java
	invoice/src/main/java/com/ning/billing/invoice/dao/AuditedInvoiceDao.java
	invoice/src/test/java/com/ning/billing/invoice/api/invoice/TestDefaultInvoicePaymentApi.java
	invoice/src/test/java/com/ning/billing/invoice/dao/InvoiceDaoTestBase.java
	invoice/src/test/java/com/ning/billing/invoice/dao/TestDefaultInvoiceDao.java
	invoice/src/test/java/com/ning/billing/invoice/tests/TestChargeBacks.java
	junction/src/test/java/com/ning/billing/junction/api/blocking/TestDefaultBlockingApi.java
	overdue/src/main/java/com/ning/billing/overdue/applicator/OverdueStateApplicator.java
	payment/src/main/java/com/ning/billing/payment/core/PaymentMethodProcessor.java
	payment/src/main/java/com/ning/billing/payment/core/PaymentProcessor.java
	payment/src/main/java/com/ning/billing/payment/core/ProcessorBase.java
	payment/src/main/java/com/ning/billing/payment/core/RefundProcessor.java
	payment/src/test/java/com/ning/billing/payment/core/TestPaymentMethodProcessor.java
1a5fd8e
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 <pierre@ning.com>
6316841
Partial checkin to merge from svcapi 40387d0
Pierre-Alexandre Meyer util: refactor InternalCallContextFactory
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
57d1d55
Partial checkin to merge from svcapi 7b14247
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
Conflicts:
	invoice/src/main/java/com/ning/billing/invoice/notification/EmailInvoiceNotifier.java
	junction/src/main/java/com/ning/billing/junction/plumbing/api/BlockingEntitlementUserApi.java
	util/src/test/java/com/ning/billing/dbi/MysqlTestingHelper.java
47472c4
Pierre-Alexandre Meyer invoice: fix test setup
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
82ca1c0
Fixing issues with tenants 5c0ad52
Merge remote-tracking branch 'origin/svcsapi' into svcapi-progress
Conflicts:
	invoice/src/test/java/com/ning/billing/invoice/MockModule.java
	invoice/src/test/java/com/ning/billing/invoice/TestInvoiceDispatcher.java
d2c8bbe
More test fix for Intermal API move 1ad4e2b
Pierre-Alexandre Meyer util: make sure to not drop context information in InternalCallContex…
…tFactory

This is important for audits.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
bd64c88
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@ning.com>
2ec7114
Pierre-Alexandre Meyer analytics: add MIGRATE event in BST
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
614f80e
[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@ning.com>
39cd7af
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@ning.com>
0b838d7
Pierre-Alexandre Meyer analytics: rename BusinessInvoicePaymentRecorder -> BusinessInvoicePa…
…ymentDao

Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
68076ca
Pierre-Alexandre Meyer analytics: rename BusinessAccountRecorder -> BusinessAccountDao
Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
a8376c9
Pierre-Alexandre Meyer analytics: rename BusinessOverdueStatusRecorder -> BusinessOverdueSta…
…tusDao

Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
b71322c
Pierre-Alexandre Meyer analytics: rename BusinessSubscriptionTransitionRecorder -> BusinessS…
…ubscriptionTransitionDao

Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
d077089
Pierre-Alexandre Meyer analytics: rename BusinessTagRecorder -> BusinessTagDao
Follow conventions.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
20ca70e
Oct 09, 2012
Pierre-Alexandre Meyer analytics: switch to internal APIs where possible
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
15a165c
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 <pierre@ning.com>
50e52dc
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@ning.com>
c50c2b2
Pierre-Alexandre Meyer analytics: rewrite deleteInvoiceItemsForAccount
Make the join more explicit by using an IN clause.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
71aeae6
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@ning.com>
06f3a24
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 <pierre@ning.com>
803cba2
more Internal API changes 8890ec6
Change migration code to create subscription with the startDate of th…
…e first migrationCase effectiveDate
9534247
Merge branch 'master' of github.com:ning/killbill 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 <pierre@ning.com>
c1a2aea
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 <pierre@ning.com>
ff6f3ff
Fix issue with nextBillingDate notification for annual plans (missing…
… specific test case)
12d50de
Merge branch 'master' of github.com:ning/killbill 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 http://127.0.0.1:8080/1.0/kb/export/<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
today.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
bf58381
Pierre-Alexandre Meyer junction: add missing toString method in BillCycleDayCalculator
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
7e10c2a
Pierre-Alexandre Meyer Merge branch 'master' of github.com:ning/killbill 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 <pierre@ning.com>
a747227
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
error).

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

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
120c12b
Pierre-Alexandre Meyer util: export: fix datetime handling
Export datetime as strings, as mysqlimport won't handle timestamps
directly.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
01332ae
Fix NPEs in overdue and entitlements when basePlan does not exist (fo…
…r e.g STANDALONE) or when ADD_ON was cancellled
3c1d9c8
Merge branch 'master' of github.com:ning/killbill 26ff442
Pierre-Alexandre Meyer util: fix export tests with local db
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
3caf45f
Merge branch 'master' of github.com:ning/killbill 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
Conflicts:
	analytics/src/main/java/com/ning/billing/analytics/BusinessOverdueStatusDao.java
f0d3853
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@ning.com>
c93d7eb
Pierre-Alexandre Meyer util: increase the lock timeout to 10s
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
4e65085
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@ning.com>
0282697
Pierre-Alexandre Meyer server: upgrade skeleton to 0.1.6
This adds JDBI support for transaction restarts.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
8947194
Pierre-Alexandre Meyer payment: don't hold the account lock while fetching payment methods
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
6e15bbc
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@ning.com>
ae4ca02
Pierre-Alexandre Meyer server: bump skeleton to 0.1.7
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
704633f
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@mouraf.org>
976fe14
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 <pierre@ning.com>
896aef2
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 <pierre@ning.com>
752be1d
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.
42f551e
Oct 24, 2012
Intermediary check-in for changs in BusEvent 0d50885
Fix broken unit tests 4fee752
Merge remote-tracking branch 'origin/master' into svcsapi
Conflicts:
	analytics/src/main/java/com/ning/billing/analytics/AnalyticsListener.java
68591fa
Fix broken bus handler so they use event accountRecordId, tenantRecor…
…dId to create their internal context
212e89d
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@ning.com>
53801ca
Pierre-Alexandre Meyer Merge branch 'master' of github.com:killbill/killbill 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
bundle.
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,
etc.).

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
d39d45c
Pierre-Alexandre Meyer Merge branch 'master' of github.com:killbill/killbill 756620c
Add private accountAPI to retrieve account by recordId
Fix push notification to include accountId
Harden TestPushNotification
fe10f93
Merge branch 'master' of github.com:killbill/killbill 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@ning.com>
f582df3
Pierre-Alexandre Meyer Merge branch 'master' of github.com:killbill/killbill 8866f42
[maven-release-plugin] prepare release killbill-0.1.41 b64b0c5
[maven-release-plugin] prepare for next development iteration 9acd2ea