datafoodconsortium / ontology

The DFC ontology is available as OWL and RDF.
https://datafoodconsortium.gitbook.io/dfc-standard-documentation/semantic-specifications
GNU Affero General Public License v3.0
18 stars 3 forks source link

Order Use Case #009 - Stock Limitations #67

Closed RaggedStaff closed 1 year ago

RaggedStaff commented 1 year ago

We have agreed previously that hubs will generate a single, consolidated order for a supplier, from multiple customer order.

However, when a customer order is generated, we need a method to ensure stock is reserved/held, so that the order can be fulfilled.

An example:

  1. Supplier Jean is selling carrots through 2 hubs - Hub A & Hub B
  2. Hub A has an order cycle that opens on Monday and closes on Friday
  3. HUb B has an order cycle that opens on Tuesday and closes on Thursday
  4. Jean has 10 kg of carrots to sell this week.
  5. Customer Ali orders 1kg carrots through Hub A on Monday
  6. Customer Paul orders 5 kg of carrots through Hub A on Tuesday
  7. Customer David orders 3 kg of carrots through Hub B on Wednesday
  8. Customer Michael orders 2 kg of carrots through Hub B on Thursday
  9. When Hub B's order cycle closes on Thursday, it orders 5 kg of carrots from Jean.
  10. WHen Hub A's order cycle closes on Friday, it orders 6 kg of carrots from Jean.
  11. Jean is 1 kg of carrots short. If Hub A can only get 5 kg of carrots, Paul or Ali (who ordered earlier than David & Michael) won't get their order fulfilled.

To fix this, we need a way to track stock levels as orders come in.

Proposals are either:

  1. We adjust a stock level as orders complete, to show remaining available stock. Then an order is submitted when the order cycle closed
  2. The supplier order is created when the first customer order completes, but is held in a pending state and updated as further customer orders come in.