The ordering mechanism
The process (in jibber-jabber)#
The clients select their items and the delivery method. According to that, the request is validated and charged appropriately. The order goes through a step process that potentially involves all the users of the system.
The business receives the order and has to respond to it. Once it's prepared, either the client picks it up themselves or a courier is selected to send it to them. Once it's delivered, either way, the order is completed.
The admins of the system can intervene at certain points during the process and cancel it if something goes wrong.
Delivery methods#
These are the options clients have in terms of order delivery. One of these must be selected.
Eat in#
The clients will eat their order at the place they ordered from. Only relevant for business of type restaurant.
Takeaway#
The clients will pick up their order by themselves without any extra cost.
Home delivery#
The clients will have their order delivered to them by a courier. This option has additional implications such as extra costs and validations that are detailed below.
The structure of an order request#
This section will detail how an order request is structured.
Items#
An array of 'items' objects with the following properties:
- Item EID
- Required
- Modifications
- Type
- Array of 'modification' objects with the following properties:
- Modification EID
- Selected options
- Array of Option EIDs
- Array of 'modification' objects with the following properties:
- Type
- Quantity
- Type
- Number
- Validation
- Required
- Minimum
- 1
- Default
- 1
- Type
Tip?#
TBD
Delivery method#
Mentioned above and selecting one is required. Delivery will add additional 20 NIS to the price of the order.
Order states#
Placed#
The initial state of all orders. From the moment of the creation, the business has a set amount of time to approve the order before it is automatically rejected due to inactivity.
Rejected#
Indicates that the order was rejected by the business.
Accepted#
Indicates that the order was accepted by the business and is in the process of being prepared.
Awaiting pickup#
Indicates that the order is ready to be delivered, Either to the client or to the courier depending on the delivery type that was selected.
In delivery#
This state indicates that the order is being delivered by the courier to the client, it is unique to home delivery orders.
Delivered#
The final state of order that are completed successfully.
Canceled by admin#
This is a special state that only occurs in special edge cases where the order must be cancelled.
Order sale states#
Authorized#
This state indicates that the payment has been authorized and is ready to be charged when the delivery is completed.
Captured#
This state indicates that the order sale has been fulfilled and the client has been charged successfully.
Resolved#
Indicates that the order sale has been resolved manually in cases where it failed and the admins had to intervene to resolve it.
The payment logic#
The payment related to the order it self goes to the business seller account.
- Each business will have its own seller?
18% if delivery 5% if not
Pika pays the couriers outside of the system.
- The courier payment proceeds are not processed by the system and will be the responsibility of Pika as an organization.
Order estimations#
- Rush hour estimation will be 10 mins extra to original estimation.
Active orders#
An order is an active order during the following states:
The importance of this generalized state is that certain functionalities become restricted for certain users that are involved in the order. These restrictions will be explicitly mentioned in the relevant functions. The importance is mostly semantic.
Validation of order placements#
The following validations must be performed before allowing the client to place the order.
- If the client selected home delivery
- The order address must be within delivery area of the business.
- The minimum price of the order must be at least 50 NIS, not including delivery.
- The business must be available.
- This function cannot be activated while the client has an active order.
- Each and every Item must not have been updated since the order was crafted.
Order rejection#
In case the business cannot fulfill the order, they can reject it with the following reasons.
- No response.
- This reason is automatically selected by the system in case the order was not accepted within 5 minutes and cannot be selected manually by businesses.
- Three rejections of this type in a row triggers the system to automatically set the business as unavailable in case something drastic happens.
- Closing soon.
- Item unavailable.
- Problem with comment.
- Other
- Requires a message for the client.