Skip to content
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

Zero amount invoices & debit notes #1037

Merged
merged 6 commits into from
Feb 15, 2021

Conversation

pnowosie
Copy link
Contributor

@pnowosie pnowosie commented Feb 10, 2021

PAY-182

I've modified invoice_flow example [LINK],
debit_note_flow modified accordingly.

Result of the db query

 sqlite3 payment.db
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
sqlite> SELECT id, role, status FROM pay_invoice ;
579a9f81-5fe1-4e56-abb0-e6d2674bbad0|P|SETTLED
579a9f81-5fe1-4e56-abb0-e6d2674bbad0|R|SETTLED
sqlite> SELECT id, role, status, total_amount_due FROM pay_debit_note ;
860a887f-5b0c-4dfe-a4c8-c743cbddf87c|P|SETTLED|0
860a887f-5b0c-4dfe-a4c8-c743cbddf87c|R|SETTLED|0
(...)

sqlite> SELECT * FROM pay_debit_note_event ;
860a887f-5b0c-4dfe-a4c8-c743cbddf87c|0x77bcd35db905a9c52ab17fe43dc4d91a5bdccbe0|RECEIVED|2021-02-11 14:07:45.198|
860a887f-5b0c-4dfe-a4c8-c743cbddf87c|0xbc3424be7e8e5e7f1df62ce70984a54376889b6b|ACCEPTED|2021-02-11 14:07:46.181|
860a887f-5b0c-4dfe-a4c8-c743cbddf87c|0xbc3424be7e8e5e7f1df62ce70984a54376889b6b|SETTLED|2021-02-11 14:07:46.181|
(...)

@pnowosie pnowosie marked this pull request as ready for review February 11, 2021 14:13
@pnowosie pnowosie requested a review from a team February 11, 2021 14:13
@pnowosie pnowosie force-pushed the pnowosie/pay-182-zero-amount-invoices branch from 693880b to 91c4792 Compare February 11, 2021 14:16
Copy link
Contributor

@maaktweluit maaktweluit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Tested all examples and they are working, except for debit_note_flow on dummy.
Guess that was already broken so we can fix that in a separate PR.

Your gist also has a small error now:

curl https://gist.githubusercontent.com/pnowosie/6553be29d2cfd58c2ef5947334d719d7/raw/1276966f6cb6d7efc34b6878207a3015d353e89d/invoice_flow_example.patch | git apply -v

Arbiter::spawn(async move {
std::thread::sleep(Duration::from_millis(100));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit: would not import this at the top of the file or only 1 use

Suggested change
std::thread::sleep(Duration::from_millis(100));
std::thread::sleep(actix::clock::Duration::from_millis(100));
Suggested change
std::thread::sleep(Duration::from_millis(100));
std::thread::sleep(Duration::from_millis(100));

Copy link

@Wiezzel Wiezzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest commenting the crucial lines in the code, otherwise alright.

core/payment/src/dao/debit_note.rs Show resolved Hide resolved
core/payment/src/dao/invoice.rs Show resolved Hide resolved
@pnowosie pnowosie merged commit 2da9b3b into payments/beta-1 Feb 15, 2021
@pnowosie pnowosie deleted the pnowosie/pay-182-zero-amount-invoices branch February 15, 2021 17:04
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.

3 participants