Order (Shared Schemas)
Shared order schema definitions used across menu orders and product orders. These schemas provide consistent customer and pricing structures.
Source: src/core/business-mgt/order.schema.ts
OrderCustomer​
Embedded customer information for orders.
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
customerId | string | No | — | References Customer ID if registered |
name | string | Yes | — | Customer's full name (minimum 1 character) |
phone | string | No | — | Contact phone for order updates |
email | string | No | — | Email for receipts and confirmations |
address | OrderAddress | No | — | Customer address for delivery/billing |
OrderAddress​
Extended address schema with delivery instructions.
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
street | string | Yes | — | Street address |
city | string | Yes | — | City name |
state | string | Yes | — | State or province |
postalCode | string | No | — | Postal or ZIP code |
country | string | Yes | — | Country |
deliveryInstructions | string | No | — | Special delivery instructions (gate code, building entrance, etc.) |
OrderPricing​
Complete pricing breakdown for orders.
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
subtotal | number | Yes | — | Sum of all item prices before tax and fees |
tax | number | No | 0 | Calculated tax amount |
tip | number | No | 0 | Gratuity amount for service staff |
shippingAmount | number | No | 0 | Shipping or delivery fee |
discount | number | No | 0 | Total discount applied |
total | number | Yes | — | Final amount due |
currency | string | No | USD | ISO 4217 currency code |
Example​
{
"customer": {
"customerId": "cust_abc123",
"name": "John Smith",
"phone": "+14155552671",
"email": "john@example.com",
"address": {
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postalCode": "94102",
"country": "USA",
"deliveryInstructions": "Ring doorbell twice"
}
},
"pricing": {
"subtotal": 45.00,
"tax": 3.60,
"tip": 9.00,
"shippingAmount": 5.00,
"discount": 0,
"total": 62.60,
"currency": "USD"
}
}