What is the need / problem
When a hub’s order cycle is finished the producer is not notified that she needs to provide those products to that hub unless a hub manager clicks on the “NOTIFY ALL PRODUCERS” button on the order cycle page.
It’s very likely that either the hub manager doesn’t notice that button and if so, she forgets about it. The whole point of the order cycle having an end date is that it gets closed automatically and as such, it should also notify the producer.
Who does it impact
Mainly producers but also hub managers need to remember when an order cycle finishes and then push the “NOTIFY ALL PRODUCERS” button.
What is the current impact of this problem
This affects all hubs and producers. Moreover, the more hubs a producer sells to, the harder for her to keep track of all the order cycles.
What is the benefit in focusing on this
This will remove the manual intervention on order cycles avoiding both the producer to check when the order cycles finish and the hub manager to remember notifying the producer.
Links to more details
A hub manager in katuma sent us an email with the following content:
(…) The third thing is that l’Aresta doesn’t see our orders and I don’t know this is due to:
- I do something wrong
- They don’t do it well (the producer)
- I didn’t understand how it works
- Katuma does not work well
The fact is that I thought that they would see what we ordered to them, when the order cycle ends, and wouldn’t have to send the orders by email.
Potential solutions that will solve this problem
The solution involves scheduling a job to be executed at the time the order cycle closes. When executed, it will send the producer notification email.
To do this we need to add an entry in the
config/schedule.rb as done in https://github.com/openfoodfoundation/openfoodnetwork/blob/master/config/schedule.rb#L38. The background job executed should go through the finished order cycles and enqueuing a https://github.com/openfoodfoundation/openfoodnetwork/blob/master/app/jobs/order_cycle_notification_job.rb job for each of them.