Sorry it has taken so long for me to get back to this issue. It was consuming a lot of time, and I had to get another project off my plate. Now, back to this.
Sorry this post is so long. Most of it is just me thinking out loud again. Do I come up with any solutions? Sadly, no. But I'm hoping for an epiphany.
I did set up a test server with a fresh, new installation of Drupal, a few modules (Ubercart, TinyMCE, IMCE), clean URLs...I think that's it. I killed the PayPal payment method so I can test an internally controlled payment method, such as Checks. Paying by check works. The inventory decrements upon final submission of the order. So, I understood Ryan's last post correctly.
Now, to decide whether or not that is the best time to decrement the inventory...by what Ryan and CpILL said, it looks like this has been on their minds too.
One test I performed...I initiated a purchase by putting a "one-of-a-kind" item in my cart, then started to checkout. But before clicking "Review", I logged into the back end database and manually decremented the stock level to 0. This should simulate another customer who put the same item in his cart, but the other guy "Submitted" his order before me. Then I went back and "Reviewed" and "Submitted" my order. Unfortunately but predictably, Ubercart allowed me to complete my purchase. Then I checked the database and found my stock level at -1. Again, this seems to be a symptom of "when do we check/change inventory level."
OK, so let's think about this...
Lets say I sell one-of-a-kind autographed t-shirts. I need to prevent two customers from putting the same t-shirt in their carts.
Let's say I had a brick-and-mortar store. Let's say Ryan takes an autographed ABBA t-shirt off the shelf, puts it in his cart, and continues shopping. (I didn't know Ryan was an ABBA fan, did you?
) If CpILL went to the shelf after Ryan, there would be no ABBA shirt for him to take. I guess CpILL would just have to go find a different t-shirt.
In Ubercart, could we/should we decrement the stock level when the item is actually placed in the cart?
Hmmm...let's keep going with the example.
Let's say Ryan changes his mind about buying the ABBA t-shirt. He leaves the cart in the back corner of the store somewhere and leaves. Several more customers go and check the shelf for that shirt, but it's still in Ryan's cart, so I miss several opportunities to sell it. Ok, this isn't good.
In my brick-and-mortar store, the shirt doesn't get put back on the shelf until I walk my around the store to clean up. But in Ubercart, couldn't we use "cart duration" to help us out? If the cart sits there with a t-shirt in it for more than 4 hours (or whatever duration), don't just delete the cart...instead, increment the stock levels first, then delete the cart (I think CpILL said that in his last post too, but I don't know how hard that would be to implement).
Using this method, you might still miss out on sales opportunities due to carts being abandoned all over the store, but at least the customer's perception of your inventory is accurate at the time they try to put something in their cart. Heh, it would really suck though if someone wrote a script to shop your entire store, putting ALL your inventory into carts, and then just left them there.
Another option would be to decrement stock levels when "Reviewing" the order, before "Submitting". That way, we get around the problem of NOT decrementing when using PayPal. But we still have the problem of carts lying around with inventory in them. We also still have the problem with multiple customers walking around with the same item in their carts. If the Ryan and CpILL both put that ABBA t-shirt in their carts, but CpILL "Reviews" his order first, what happens to the Ryan's shopping experience when he "Reviews" his order and learns that his ABBA t-shirt was bought out from under him. That's not good.
I think I'm leaning towards decrementing stock levels upon putting the item in the cart, and using cart duration and delete to put the items back into inventory.
One thing I might not understand is what CpILL meant when he said I decided that the API should be apart from the business logic as most shop setups will have their own rules they would like to implement. Is my example above too much "business logic"?
So what does everybody think so far?
EDIT: BTW, if the store had dozens of each shirt available, and I could still get more from my suppliers, then decrementing stock levels when the item is placed in the cart should not adversely affect the customer's shopping experience, nor should it affect the opportunity for the store to make the sales. It would only come into play when stock levels are low and NEED to be tracked accurately due to supply.

Joined: 08/22/2007