How to build: place order
implemented
When the Front-facing checkout button fires, Middleware creates the order side-effects: load menu from Core, tray notification, email, push, optional payment redirect.
Triggered from Cart and checkout.
Middleware Backend · winner
Call this API
POST https://middleware-dev.nellalink.com/plugins/nellalink/nellalink-init/order
Also accepted: POST .../plugins/nellalink/nellalink-init/order/create
Required body (Joi in plugins/nellalink-init/dto.js): menu_uuid, payment_processor (paystack | bank_transfer | cash, default cash), amount (positive integer), cart_items[] (uuid, quantity; optional item_note), customer_email_address, delivery_data.delivery_identifier. customer_phone_number is optional in Joi.
Also sent by Front-facing faruq (accepted; used in notify):
{
"onpremise_data": {
"customer_onpremise_location_type": "",
"customer_onpremise_location_number": "",
"customer_onpremise_location": "_"
},
"customer_requested_order_email_copy": false
}On-premise location string on faruq is `${location}_${location_number}`.
What Middleware does (do not duplicate in the SPA):
GETCore.../entity/nellalink_business_menu/{menu_uuid}(servicex-api-keyfromPLUGIN_NELLALINK_INIT_CORE_BACKEND_*)- Resolve items, amounts, owner
- Tray notification on Core (notify owner), including on-premise suffix when present
- Email + OneSignal if those ENVs are set
- Schedule reminder
Core metadata read: menu extra_data (payments, branding, contact). Items unit_price_amount, category. Business parent uuid.
No JWT on this route today (guest checkout). Core public key must not allow writing another owner's notifications without the Middleware service key being scoped. IDOR.
Explorer swagger still lists payment_processor as paystack | bank_transfer only — Joi is the winner. Limitations.