At the moment, there are some lot values which can't be specified when creating a lot: personal_note, public_note, bulk_qty, etc. Instead, they have to be specified by a separate /inventory/update query, which requires the previously created lot's lot_id.
So, we have to first create a lot, get the lot_id from the reply, and send an update with the full data.
I'm finding that system a little awkward when aiming for absolute robustness. Let's suppose we never get the reply to the /inventory/create query (poor internet connection, a power cut, whatever), it requires quite a bit of bookkeeping to later locate the partially specified lot and finish the job.
Could we just get an /inventory/create as complete as /inventory/update?
Thank you!
Comments
You could however build something into your code to deal with this. Once the lot id is retrieved and the second operation is attemted, you can store the lot id in memory, or a data file, execute the second operation, then remove it again. If something goes wrong and the procedure hasn't reached the end, the lot id will still be around and your program can have it deleted from your inventory.
If we have lots that have been created but not yet updated, then these lots have to be later located in the inventory to perform the appropriate updates (define fields comments, remarks, etc.). And, in the meantime, the lots themselves may have changed from incoming orders. All this can still be resolved gracefully, the lots can be located, *only* if multiple lots for identical items (BOID, color and condition) are forbidden.
Really, this gets messy.
Maybe I just don't know how to write non-robust software (my usual field is high performance computing software for clusters ).
But then.. maybe there's a possible scernario where it is created but the lot id isn't yet returned properly. Then.. yeah, that sucks
Obviously you're a way better programmer than I am, but anyway that's how I'd do it, with my toothpaste-and-rubber-bands programming skills
Otherwise, the issue could be mitigated by fully creating each item, one at a time... but then you lose HTTP 1.1 pipelining plus the whole TCP & SSL handshake has to be renegotiated for every item (bad stuff! ).