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.
All Submissions:
Changes proposed in this Pull Request:
When we generate orders we are able to generate them over a range of dates. This works correctly when setting the order creation date. However other dates will default to the current date.
So if we generate a set of orders for the Analytics reports the
date_paid
will all be at the time of when the order was generated. Which isn't very useful for populating some test data for these reports.This PR changes that behaviour and allows setting both the paid date as well as the order completed date. This is set based on the chosen status of the order. Paid date is set for both processing and completed. Completed date is set for only completed orders. The date is set by adding a random amount of 0 to 36 hours to the creation date.
How to test the changes in this Pull Request:
wp wc generate orders 10 --date-start=2024-01-01 --date-end=2024-01-31
Other information:
Changelog entry
FOR PR REVIEWER ONLY: