Making a new workflow

My requirements are unusual, but the questions around the stability of the API are concerning to say the least.
Can anyone provide a best guess, or working model of the data that will remain stable in the API calls?

I’m working through an alternative workflow that seems so far from a non-trivial change to the OFN code that I can’t see a way to neatly slot it into the existing structures and so I’m looking at leaning on the API to hack together an alternative. Time is a factor, I’m not a quick coder.
Essentially, the vast bulk of our farmers and volunteers are so assertively non-technical that only one or two volunteers are left to do all the data entry and manipulation, currently on spreadsheets and the current OFN workflows are too onerous for this concentration of effort. So functions like auto-filling customer boxes according to an algorithm rather than picking an item at a time, re-evaluating the picking lists halfway through distribution (and printing to paper, email and app) are my hard requirements. I can make all that work, but the Rails code simply doesn’t seem to support it and I don’t think my changes would fit well, nor would they be needed in core.
Additional soft requirements are coping with other things such as farmers handing over their produce an hour before distribution, which means super fast data entry and again, re-evaluating picking lists quickly and efficiently.

Hi @dave-dave

There is an issue that has been prioritised and will be done soon that will clarify use and increase stability of the orders endpoint - https://github.com/openfoodfoundation/openfoodnetwork/issues/3770

there is also more documentation of the api at https://app.swaggerhub.com/apis/haseleyi/ofn-staging/0.1

There are a couple of other threads that might also be of interest, discovery on packing / reporting and how we improve it is starting shortly

Some of the issues you are raising are of great interest to the community and keen to hear how this progresses, also really happy to share / promote what you’re doing if it is open source and can be used by others too

@luisramos0 @lin_d_hop can you update / correct if I have the wrong end of the stick?

@Kirsten latest API doc is this one: https://app.swaggerhub.com/apis/luisramos0/the-open_food_network/0.1

“auto-filling customer boxes according to an algorithm rather than picking an item at a time”
@dave-dave Is this not something subscriptions could help? I’d be very interested in learning more about this requirement?

“the data that will remain stable in the API calls”
@dave-dave I’d say if you need it there, we need to make sure it stays there. I cant see why we would not make mandatory a field that you need for a real use case.
We dont have a formal process yet to flag data in API as mandatory (data we need to keep there “forever”) but we do want to start one, just let us know what do you need.

So the enterprise in question is a CSA style multi farm box scheme limited by geography and so the customers essentially get to pick what they can’t have, what they want and don’t want.
The result is that 10 - 20 different units (up to 40 different products) from up to 20 farms fill roughly 100 boxes, with the picking list varying according to season. A big ask for 1 - 2 volunteers.

I’m going to use something like a defragmentation algorithm to do an auto place with repect to customer requests.

The subscription list is essentially a white list, whereas I need a black, grey and wish list that can cope with inexact matches.

ah, interesting, I am glad I asked. That is the box scheme type of feature which is not OFN subscriptions: customer preferences (like preferred products, undesired products) that will guide weekly packing. And then you want to run an algorithm to make the packing, nice!

Customer preferences would be a wonderful OFN feature associated with the customer management functionality OFN has. On their account, for a given hub, they could select their likes/deslikes. This is a nice CSA type feature for OFN.

Then, based on products and quantities available in a given Order Cycle, you could run an algorithm to cross these with customer preferences to get your packing sheet. I assume this last bit is what you want to get from OFN, so the endpoints you need will be related to accessing the shopfront and the products/stock available?

Yes, that is correct. I would happily do this within OFN, and I’ve done the weighted packing list in Ruby before (packing VMs into physical hosts) but Rails is new to me and at least initially the preferences will be very manually done as the driver for all this is the packing lists themselves.
The other feature I want make is to bring a human back into the loop and to be able to show all/many of the virtual produce boxes and then let them modify manually as I doubt the auto placement will be perfect. In my mind, this would look like a taxononomy layer of available produce in one side as differently sized blocks according to availability, with all or some boxes on the right side.

1 Like