-
Notifications
You must be signed in to change notification settings - Fork 69
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
Calculate next deposit date rather than relying on estimated deposits #7648
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +2 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
PHP tests are currently failing which is unrelated to this PR. |
@brucealdridge This looks like one PR that we had planned for 6.8 that can safely be merged. |
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 tests well @brucealdridge and the code and tests written are clear and easy to follow. 🙌 I've also tested this in context within the new UI in PR https://github.com/Automattic/woocommerce-payments/pull/7656/files#diff-4c94aa3bacf97fd4b7e483719d334e36d72734af83e88b83cd1fc528e88347f9R29, so you can checkout that branch to see it in action.
Since this is not used by any existing logic, this is safe to merge for a 6.8 release.
I've left some code quality suggestions that (assuming you agree) we can resolve now or in a follow-up PR.
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.
Ignore my last comment! The bug was introduced downstream. 🙃
Co-authored-by: Eric Jinks <3147296+Jinksi@users.noreply.github.com>
Fixes #7628
Changes proposed in this Pull Request
Adds
getNextDepositDate
function toclient/deposits/utils/index.ts
. This function will be used as part of #7646This was originally considered as part of a server change. Due to complications with timezones, it made more sense to implement on the client as this is the only place we anticipate this logic being used.
When funds are dispatched and when they are received can vary and there are some very complex rules involved. One such rule is deposits are usually dispatched in UTC unless the account is created in the APAC region (docs)
Rather than trying to adapt the code to cover every possible situation, the changes in #7646 will use wording to convey that this is only an estimate.
... with your next scheduled deposit estimated for [date]
.Testing instructions
As this code is not used anywhere it is covered in unit tests.
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge