Order Variable Builder (No JSON Needed)
Non-technical users can create custom capture variables from simple form controls. Type variable name, select type, set required checkbox, and save. System auto-generates schema, required paths, and mapping.
Simple Dashboard Flow
- Open Dashboard -> Restaurants -> Open Settings.
- Find the card: Order Capture Variables.
- In Create New Variable, enter a name (example: customer_name).
- Select variable type (Text/Number/Phone/Date/Time/Yes-No/List/Object).
- Check Required if needed, then click Add Variable.
- Variable appears as a tag. Use edit or x to update/remove.
- Click Save Variable Schema.
Per restaurant setup: Every restaurant has its own variables. A restaurant will only validate/show data for variables assigned to it.
What Is Auto-Generated
- example_payload from your variable list
- required_paths from required checkboxes
- db_mapping to map captured data into dashboard/order table fields
Advanced JSON preview is shown in the dashboard as read-only reference.
Behavior
- System uses only your created variables for each restaurant.
- No hardcoded reservation/order variable template is used.
Orders and Reservations View
Orders and reservations pages show cards by restaurant. Each card displays only the data fields configured in that restaurant schema.
API Endpoints (Optional for Developers)
- GET /api/order-schema/restaurant/{restaurant_id} read one restaurant config
- PUT /api/order-schema/restaurant/{restaurant_id} update one restaurant config
- POST /api/order-schema/restaurant/{restaurant_id}/reset reset one restaurant config
- GET /api/order-schema/all fetch all accessible restaurants with config
- POST /api/order-schema/validate validate payload without saving
Default Template
No hardcoded variable template is preloaded now. New restaurants start with an empty schema and you define fields yourself from dashboard.
Global fallback config file path: backend/prompts/order_capture_config.json
Prompt Usage
Assistant should return final payload in this format:
ORDER_JSON: { ...your custom payload... }
Backend validates and stores data according to selected restaurant schema.