🛒 Order Blocks
Order blocks provide comprehensive functionality for order management operations in Nodeblocks applications. These blocks handle order lifecycle operations including creation, retrieval, updates, and organization-scoped queries.
🎯 Overview
Order blocks are designed to:
- Manage order lifecycle with full CRUD operations
- Handle order queries with flexible filtering and pagination
- Support organization scoping for multi-tenant order management
- Provide type safety with comprehensive error handling
- Enable composition for building complex order features
📦 Block Types
🔍 Schemas
JSON Schema definitions for order data validation:
- orderSchema: Base order entity structure
- createOrderSchema: Order creation validation
- findOrdersSchema: Order search with filtering and pagination
- findOrdersByOrganizationIdSchema: Organization-scoped order retrieval validation
🔧 Blocks
Pure business logic functions for order operations:
- findOrders: Retrieve orders with filtering and pagination
⚙️ Handlers
Core business logic for order operations:
- createOrder: Order creation with validation
- findOrders: Order search and filtering
- findOrdersByOrganizationId: Organization-scoped order retrieval
🛣️ Routes
HTTP endpoint definitions for order operations:
- createOrderRoute: POST
/orderswith creation handler - findOrdersRoute: GET
/orderswith search and pagination - findOrdersByOrganizationIdRoute: GET
/orders/organizations/:organizationIdwith organization role validation
🚀 Features
Complete order management features combining schemas, routes, and handlers:
- createOrderFeature: Order creation with validation and routing
- findOrdersFeature: Order search with filtering and pagination
- findOrdersByOrganizationIdFeature: Organization-scoped order retrieval with role-based access control
✅ Validators
Validation functions for order operations:
- ownsOrder: Validates order ownership by the authenticated identity
🔗 Related Documentation
- Order Schemas - Order data validation and contracts
- Order Blocks - Order business logic functions
- Order Handlers - Order business logic handlers
- Order Routes - HTTP endpoint definitions
- Order Features - Complete order management features
- Order Validators - Order validation functions