Orders
Once a Basket has been checkoud out, and payment successfully made, order processing kicks into gear.
Post payment, order processing happens asynchronously. Once a payment is made, the customer can be shown a message along the lines of "your order has been received and will be processed shortly".
In the mean time, the basket service has fires an event to let the system know that a basket has been successfully checked out, and the order services picks that up and starts communicating with all the providers in the basket.
The order structure follows a similar pattern as baskets. Where one basket can have one or more provider baskets, an order can have one or more provider orders contained within.
OneBasket tracks the processing state across the entire order to determine when processing and fulfilment has been completed across all disparate provider systems.
Order Post Purchase Events
OneBasket has a post purchase event system built in, allowing the system to react to a number of scenarios that occur throughout an order's lifecycle.
Processing Events
These events are used to track the state of the order as it's being created in the provider system. OneBasket tracks the following processing states:
- Sent: The order has been sent successfully to the provider system and is waiting to hear back.
- Confirmed: The provider has accepted the order, and fulfilment will begin shortly.
- Rejected: The provider has rejected the order, and compensating actions need to be taken, such as manually intervening or payment refunds.
Fulfilment Events
Once an order has been confirmed by the provider, fulfilment begins. Not all providers support two way communication with OneBasket. For those that do, product specific fulfilment events are available to allow OneBasket to react to these events.
As an example, in regard to consumable product orders that are using a "kiosk collection" delivery method, the following events can be sent back into OneBasket to continue the post purchase user experience.
- Received: The order has been received for fulfilment, but fulfilment has not yet started (the order is sitting on the KVS waiting to be started).
- In Progress: The order is being prepared (the kitchen is putting the products in the order together)
- Ready: The order is ready to be fulfilled (the customer can go and pick it up at the kiosk).
- Fulfilled: The order has been fulfilled (the customer has collected their order).