Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Refactor
payIOU
#12739Refactor
payIOU
#12739Changes from 17 commits
24e9948
913ffbc
2ad8370
d3311f4
2b31e3f
5374b91
3f4a973
2bac5e7
1928a62
a3ffc0d
2c48c72
6e72edc
f6d293a
2776c3a
1c3a97b
3784707
4f16c9e
8bbd68c
53bff3f
ae4a358
927b86b
781f867
b27c956
dfcfb07
36d4382
0880140
6b483c6
6313845
cc3df11
8e425f1
e318467
ddbe821
05bfe3a
04af650
8272d1d
b457ad0
39d2884
2de2def
281d32b
7bba84b
4becf7f
01aa33d
3ec3625
1b15023
e7d78ba
eedccb1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youssef-lr This should be paymentMethodType, shouldnt it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the problem is that we generate the iouReportID before for the iouReport, but what we could still do is to add here the new generatated IOUTransactionID instead of passing in empty string. Then if it is type PAY and has transactionID defined it is sending money.
Just unsure if we should keep adding more optional parameters here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me give this a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that since
hasOutstandingIOU = false
, we should also cleariouReportID
since that report is closed and we need to create a newiouReport
when we send the the next IOU.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets also maybe merge this PR into this branch https://github.com/Expensify/App/pull/12759/files, we are waiting there for Web E deploy to production, but it could be handy here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only change left, what's the decision here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mountiny I can see that PR just got merged, but I'm not sure I need that logic in SendMoney and payMoneyRequest.
For SendMoney, we are always creating an IOUReport and then settling up. For payMoneyRequest, we always know we have an IOUReport to settle. What do you think?
@luacmartins clearing the
iouReportID
makes sense to me as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that that logic doesn't seem necessary here.
Yea, let's clear the
iouReportID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youssef-lr same here, we have paid this up and we included all the data about the iou report in here so we can use set can we not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should use merge if the IOUReport is already stored in Onyx. The difference between this and
sendMoney
is thatsendMoney
creates an IOUReport that doesn't yet exist in Onyx.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, here we already have an iouReport that we're settling up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.