Stock != Availability?

Hi,

trying to solve an e-commerce problem. Here is a small subproblem of this:

as given:

  1. a product can have multiple storage locations
  2. a product has a fallback-storage-location
  3. an order is only delivered from one storage location
  4. if ordered amount is higher than stock on single storage location, fallback-storage-location is used for delivery and shipment is split between current available amount and additional delivery for reordered rest

Example:

Location A; Stock 10pcs
Location B; Stock 5 pcs; Fallback-storage

Customer orders:

<=5 pcs             -> delivery from A or B
>5pcs  but <=10pcs  -> delivery from A
> 10 pcs            -> delivery from B; 5 right away; the rest as additonal delivery

What availability (number) should the customer see? And why?

Thx