-
-
Notifications
You must be signed in to change notification settings - Fork 740
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
Introduce DRAFT Invoice (required for Hierarchical Account design) #457
Comments
Do you want to receive the new invoice state by parameter or just assume that calling the new method the invoice will move from DRAFT to COMMITTED? How the new api method will be called? Will be called automatically by a schedule job or manually by InvoiceResource? |
There are two scenarios:
|
Thanks, I added a new API in InvoiceResource. For first scenario I'll work on that when I work in #459. |
Adding this validation here prevents add a credit if the invoice status is COMMITTED, but there are two tests that fail: Is this the expected behaviour? Should I modify those tests and expect the exceptions? |
Interesting -- I'm actually unclear about it, I'll have to check with @sbrossie if we want to change this behavior when he is back. For now, let's keep the existing tests as-is. I'll keep this bug open so we can add validation later on if needed. |
Sure, thank you. |
Can you please provide us some guidance on this point? |
When receiving events from the invoice module, the PaymentBusEventHandler should disregard non Does that make sense? |
Excellent! That's what I was trying to find. I'll also run all existing payment unit tests and add some new ones. |
Sounds good! 🏆 |
PRs are created.
I also included some comments where I'm not sure if I implemented it properly. Pending:
|
…itInvoice method name and some tests updated.
I pushed more changes about PR review. |
@maguero I am bit confused on what is the current semantics with regard to
|
When we added Invoice Status concept we agreed on these options:
Not sure what do you mean.
Yes, If you retrieve the parent balance you will see the full amount. The parent invoice status does not matter. TestCase |
My question is about the invoice balance and account balance in case we have
Ok, assuming my understand from previous point (above) is correct, it means behavior is not symmetrical between children and parent, but probably this is OK. |
@maguero Was rerunning my HA integration suite and i am still seeing the issue i described above with regards to account balance: It seems like parent |
#457 : making balance = 0 when invoice status is DRAFT
Invoice 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
toCOMMITTED
. The invoice bus event will only be sent for invoices that are inCOMMITTED
status. When the transition fromDRAFT
toCOMMITTED
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.The text was updated successfully, but these errors were encountered: