Skip to main content
Version: 🚧 Canary

🛒 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

View Order Schemas →

🔧 Blocks

Pure business logic functions for order operations:

  • findOrders: Retrieve orders with filtering and pagination

View Order Blocks →

⚙️ Handlers

Core business logic for order operations:

  • createOrder: Order creation with validation
  • findOrders: Order search and filtering
  • findOrdersByOrganizationId: Organization-scoped order retrieval

View Order Handlers →

🛣️ Routes

HTTP endpoint definitions for order operations:

  • createOrderRoute: POST /orders with creation handler
  • findOrdersRoute: GET /orders with search and pagination
  • findOrdersByOrganizationIdRoute: GET /orders/organizations/:organizationId with organization role validation

View Order Routes →

🚀 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

View Order Features →

Validators

Validation functions for order operations:

  • ownsOrder: Validates order ownership by the authenticated identity

View Order Validators →