Skip to main content

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​

AttributeTypeRequiredDefaultDescription
customerIdstringNo—References Customer ID if registered
namestringYes—Customer's full name (minimum 1 character)
phonestringNo—Contact phone for order updates
emailstringNo—Email for receipts and confirmations
addressOrderAddressNo—Customer address for delivery/billing

OrderAddress​

Extended address schema with delivery instructions.

Attributes​

AttributeTypeRequiredDefaultDescription
streetstringYes—Street address
citystringYes—City name
statestringYes—State or province
postalCodestringNo—Postal or ZIP code
countrystringYes—Country
deliveryInstructionsstringNo—Special delivery instructions (gate code, building entrance, etc.)

OrderPricing​

Complete pricing breakdown for orders.

Attributes​

AttributeTypeRequiredDefaultDescription
subtotalnumberYes—Sum of all item prices before tax and fees
taxnumberNo0Calculated tax amount
tipnumberNo0Gratuity amount for service staff
shippingAmountnumberNo0Shipping or delivery fee
discountnumberNo0Total discount applied
totalnumberYes—Final amount due
currencystringNoUSDISO 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"
}
}