Introduce DRAFT Invoice (required for Hierarchical Account design)
See original GitHub issueInvoice will now have a enum status
(DRAFT
, COMMITTED
).
Invoice DDL/DAO will need to be modified to reflect that new status.
By default all invoices will be created in COMMITTED
(current use case), with the exception of apis that:
insertExternalCharges
insertCredit
We need 2 new invoice apis to transition from DRAFT
to COMMITTED
. The invoice bus event will only be sent for invoices that are in COMMITTED
status. When the transition from DRAFT
to COMMITTED
occurs, this will send an invoice bus event.
For safety payment module should be modified to disregard non COMMITTED
invoices.
Adding a user credit or a user external charge on a COMMITTED
invoice should fail.
Clients libraries need to be updated as well (java + ruby)
Tests:
Invoice unit tests
Beatrix test to verify that a DRAFT
invoice with a positive balance does not get handled by payment system, and then make the transition and check payment occurs.
Issue Analytics
- State:
- Created 8 years ago
- Comments:18 (18 by maintainers)
@sbrossie You’re right. The invoice balance is computed for all invoices status. Tests confirm that. Based on your description we have to change it and only compute balance for COMMITTED invoices, right? In that case we’ll also change test asserts.
@sbrossie issue fixed and PR https://github.com/killbill/killbill/pull/582 created.