📦 Order Blocks
Order blocks provide comprehensive functionality for order management in Nodeblocks applications. These blocks handle order lifecycle operations including creation, processing, tracking, and fulfillment.
🎯 Overview
Order blocks are designed to:
- Manage order processing with full CRUD operations
- Handle order status tracking and updates
- Provide order validation and business rules
- Support order fulfillment workflows
- Enable order administration with comprehensive tracking
📦 Block Types
🔍 Schemas
JSON Schema definitions for order data validation:
- orderSchema: Base order entity structure
- createOrderSchema: Order creation validation
- updateOrderSchema: Order update validation
- getOrderSchema: Order retrieval validation
- deleteOrderSchema: Order deletion validation
- findOrdersSchema: Order search with filtering and pagination
⚙️ Handlers
Core business logic for order operations:
- createOrder: Order creation
- getOrderById: Order data retrieval
- updateOrder: Order updates
- deleteOrder: Order deletion
- findOrders: Order search and filtering
🛣️ Routes
HTTP endpoint definitions for order operations:
- createOrderRoute: POST
/orders
with creation handler - getOrderRoute: GET
/orders/:orderId
with retrieval handler - findOrdersRoute: GET
/orders
with search and pagination - updateOrderRoute: PATCH
/orders/:orderId
with update handler - deleteOrderRoute: DELETE
/orders/:orderId
with deletion handler
🚀 Features
Complete order management features combining schemas, routes, and handlers:
- createOrderFeature: Order creation with validation and routing
- updateOrderFeature: Order updates with validation and access control
- getOrderFeature: Order retrieval with access control
- findOrdersFeature: Order search with filtering and pagination
- deleteOrderFeature: Order deletion with proper validation and cleanup
✅ Validators
Validation functions for order operations:
- ownsOrder: Validates order ownership by the authenticated identity
- validateOrderAccess (deprecated): Legacy access validator; replaced by
ownsOrder
🔗 Related Documentation
- Order Schema Blocks - Order data validation and contracts
- Order Handler Blocks - Order business logic functions
- Order Route Blocks - HTTP endpoint definitions
- Order Feature Blocks - Complete order management features
- Order Validator Blocks - Order validation functions