Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface OrderPipelineEvent

The order pipeline is the system which takes an order submitted from a customer to the PHDV orders endpoint and then processes that order to ultimately get a pizza into the hands of a customer, handling all the requisite steps to get to that point.

Overview of pipeline events

The exact functionality of the pipeline is likely to change and be somewhat customised for different markets. But in broad terms an order will flow through the following events:

An order entering the system is represented by an OrderSubmitted event. The first task is to submit that order to a POS, which will result in the either an OrderAccepted or OrderFailed event being emitted.

If the order was successful as indicated by having emitted OrderAccepted then its life will continue. And various events such as OrderPaymentCaptured, OrderDispatched and OrderDelivered will eventually be fired. If at any point in that lifecycle the store has to cancel the order then this will trigger an OrderCancelled event to be emitted.

Hierarchy

Implemented by

Index

Properties

context

context: OrderContext

The context is intended to hold high level attributes for an event in a simple key value map.

These attributes will be automatically:

  • published to all logging services along with each message sent by a service consuming them
  • attached as message attributes when published to SNS, allowing subscription filtering on them

These attributes fall into two categories:

  1. Lookup values, things like transactionId that you might want to search for in logs
  2. High level groupings, things like sector that you might need to build subscription filters around

eventName

eventName: EventNames

The identifying name for the event.

This property is useful in situations where an event processor handles multiple event types, where it can be used to decide how to handle the event.

payload

payload: Record<string, any>

The payload is then the body of the message and will contain the detail.

Generated using TypeDoc