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

Allow producer to edit their products on hubs' orders #13031

Open
RachL opened this issue Dec 11, 2024 · 7 comments
Open

Allow producer to edit their products on hubs' orders #13031

RachL opened this issue Dec 11, 2024 · 7 comments
Assignees
Milestone

Comments

@RachL
Copy link
Contributor

RachL commented Dec 11, 2024

⚠️ Please use clockify code #12476 Flower Farms

Description

- As a: producer supplying one or several hubs and who have the ability to edit their lineitems
- On page: /admin/orders and BOM /admin/orders/bulk_management
- I want to be able to do: see the hub orders containing my products in admin/orders and BOM /admin/orders/bulk_management and be able to edit them :

  • add my products only (the dropdown should not display products from other producers)
  • edit the quantity of my products only, delete my products only. Products from other producers (which I do not manage) are hidden on order details page and BOM. Producers can't change shipping option, tracking details or add notes.
  • Only "order details" tab is remaining available for the producer, all other tab are hidden. Ship button is hidden. Cancel and action button are hidden as well, as well as the right column and order total / bottom buttons

396259695-4e7b26fe-6ee5-42be-8b15-3026e5ebd99a

On BOM page, only items from the producer are displayed, so if the user has only access to one producer, the list is filtered on that user (same for hub and order cycle):

image

Only producers where the hub has given the ability to edit can do that. This ability would be given here in a new setting /admin/enterprises/ENTERPRISENAME/edit#/shop_preferences_panel

image

  • What's this? should display : Enable your suppliers to see orders containing their products, and edit quantity and weight for their own products only

Customer emails would remain hidden as currently. and if the setting "customer names in reports" is not set, we need to hide them

image

On an order, only the order detail tab should be made available to the producer.

Acceptance Criteria and Test

First thing: granting access

  • Check there is a new settings in /admin/enterprises/ENTERPRISENAME/edit#/shop_preferences_panel. See content in issue description

Scenario 1 : access is granted

  • Login as a producer supplying a hub and with access to order edition
  • See you can see ONLY orders containing the producer's product in /admin/orders and BOM. Other orders from the hub should not be available.
  • You can add, edit (change quantity and weight) and delete products.
  • You can't do actions on an order or cancel an order
  • You can't see other producer products in the add a product dropdown or on the order details page (unless you manage several producers).
  • check BOM is pre-filtered if only one producer available
  • If customer names in report are disabled, customer names should be hidden in orders and BOM lists

Scenario 2 : access is not granted

  • Check producer can't see order in admin/orders and BOM
  • If customer names in report are enables this should be able to work independently

Previous discussions

openfoodfoundation/wishlist#172
#12893

@RachL
Copy link
Contributor Author

RachL commented Dec 11, 2024

As this one is touchy, @filipefurtad0 or @drummer83 can you review issue's description before @chahmedejaz starts? (hence the block label)

ping @tschumilas if you have time as well.

@drummer83
Copy link
Contributor

Sure, my thoughts below.

For clarification:

  • Orders are displayed on /orders page.
  • Editing, adding and deleting items takes place on the /order/R123456789 page.

Can the supplier see products of other suppliers on the 'order details' page?

@RachL
Copy link
Contributor Author

RachL commented Dec 11, 2024

@drummer83 thanks ❤️

For clarification:

Orders are displayed on /orders page.
Editing, adding and deleting items takes place on the /order/R123456789 page.

Yes.

Can the supplier see products of other suppliers on the 'order details' page?

No. That's what I've meant by "Other products are hidden" but i see now this is not clear enough. I'm changing this

@filipefurtad0
Copy link
Contributor

Hey @RachL ,

Thank you for pinging, apologies I only got to this now. Great description, indeed this one is a bit tricky. Some open questions to me:

  • order total

Should the Producer be able to see the order total? I'm wondering if it is not sensitive or private information in this context. Even if not, it might just be confusing, that the total not reflect the sum of the displayed line items. What do you think?

  • cancelling an order

You can't do actions on an order or cancel an order

I think there might be an exception to consider, which is the case in which an order only has line items from a given Producer. In that case, with the possibility to edit its own line items, it should be possible to remove them all, which currently triggers a pop-up message asking about order cancellation. Should the Producer be allowed to cancel the order, via confirmation of removing the last line item of an order?

@RachL
Copy link
Contributor Author

RachL commented Dec 16, 2024

thanks @filipefurtad0 !

it might just be confusing, that the total not reflect the sum of the displayed line items

Indeed, you are right so perhaps let's just hide all the bottom section, even adjustments. I've also seen that I've forgotten the ship button.

So the whole page would look like this:
image

Should the Producer be allowed to cancel the order, via confirmation of removing the last line item of an order?

Good point! Thanks for raising this, I always forget this one 🤦‍♀️ I would say yes: it's a hub order, but if it concerns only the producer then it remains logic.

@tschumilas do you confirm this aligns with your community?

@tschumilas
Copy link

I agree - if it happens that a producer's product is the last or only one on a hub's order, then the producer should see and accept the confirmation to cancel the order. It will take some education for producers because this confirmation will likely make them nervous - but I don't think it will happen very often. I think ususally producers will be adding items to orders.

@RachL
Copy link
Contributor Author

RachL commented Dec 18, 2024

Great thanks for confirming @tschumilas

@chahmedejaz I've updated the issue description and removed the block label: all yours 💪

@RachL RachL removed the blocked label Dec 18, 2024
@sigmundpetersen sigmundpetersen moved this from Dev ready 👋 to In Progress ⚙ in OFN Delivery board Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress ⚙
Development

No branches or pull requests

5 participants