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

Show orders with line items + finalized orders #8222

Conversation

jibees
Copy link
Contributor

@jibees jibees commented Sep 23, 2021

What? Why?

Closes #8221

The aim of this PR is to return by the API (and then display in the /admin/orders interface) the following orders:

  • the ones that contains at least one line item (whatever theirs state)
  • the finalized orders. Ie. the orders with state : complete canceled resumed awaiting_return returned

What should we test?

  1. Create an order
  2. Delete all line items using BOM
  3. see the order does not appear anymore on /admin/orders

Order with no line items AND with state not finalized (ie. address, cart, payment) must not be display

Release notes

In the /admin/orders display all the finalized orders and the not empty orders.

Changelog Category: User facing changes

Thus, we display the orders that contains at least one line item (whatever its state) + the finalized orders

NB // Finalized state : complete canceled resumed awaiting_return returned
Those empty order but finalized must be returned by the API
@jibees jibees self-assigned this Sep 23, 2021
Copy link
Contributor

@andrewpbrett andrewpbrett left a comment

Choose a reason for hiding this comment

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

I think this can go to Test with one review given the severity

@filipefurtad0 filipefurtad0 self-assigned this Sep 24, 2021
@filipefurtad0 filipefurtad0 added the pr-staged-uk staging.openfoodnetwork.org.uk label Sep 24, 2021
@filipefurtad0
Copy link
Contributor

Hey @jibees ,

Indeed, after staging this PR complete orders, are displayed too, after removing the last item:
image

Cancelled orders are also shown:
image

Resumed orders appear as well:
image

Shipped orders and Returned orders are never empty - you can't ship an empty order and returned orders retain their initial line items on it.

Please note that these orders have the potential to break things:

But this is not introduced by this PR and relates rather to #8131.

Thanks for this fix @jibees - Ready to go.

@filipefurtad0 filipefurtad0 removed the pr-staged-uk staging.openfoodnetwork.org.uk label Sep 24, 2021
@andrewpbrett andrewpbrett merged commit 9e5bc9b into openfoodfoundation:master Sep 24, 2021
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.

Keep orders with "completed" status in the list of orders
3 participants