{
  "page_ir": {
    "page_id": "buyer_orders",
    "page_goal": "Display buyer's order history with filterable status tabs, searchable order number, clickable rows for detail navigation, and pagination support",
    "style": {
      "tone": "professional",
      "theme": "light",
      "density": "comfortable",
      "color_intent": "neutral with colored status badges"
    },
    "accessibility": {
      "required_labels": [
        "search_input",
        "status_tabs",
        "orders_table",
        "pagination"
      ],
      "skip_navigation": true,
      "focus_management": true,
      "announce_changes": []
    },
    "responsive": {
      "breakpoints": {
        "sm": 576,
        "md": 768,
        "lg": 1024,
        "xl": 1200
      },
      "collapse_rules": [
        "table scrolls horizontally on small screens",
        "header stacks vertically on mobile"
      ],
      "hidden_on_small": [
        "items_thumbnails_column"
      ],
      "stack_on_small": []
    },
    "constraints": [
      "Must use appContext.currentUser.id as buyer_id for fetching orders",
      "Each row navigates to /account/orders/:orderId on click"
    ],
    "seo_title": null,
    "seo_description": null
  },
  "data_ir": {
    "types": {},
    "state": {
      "orders": {
        "type": "array",
        "initial": [],
        "required": true,
        "constraints": {},
        "item_type": null
      },
      "loading": {
        "type": "boolean",
        "initial": true,
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "activeStatusFilter": {
        "type": "string",
        "initial": "ALL",
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "searchOrderNumber": {
        "type": "string",
        "initial": "",
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "currentPage": {
        "type": "number",
        "initial": 1,
        "required": false,
        "constraints": {
          "min": 1
        },
        "item_type": null
      },
      "totalOrders": {
        "type": "number",
        "initial": 0,
        "required": false,
        "constraints": {},
        "item_type": null
      },
      "pageSize": {
        "type": "number",
        "initial": 20,
        "required": false,
        "constraints": {},
        "item_type": null
      }
    },
    "derived": {
      "offset": {
        "type": "number",
        "expr": "(state.currentPage - 1) * state.pageSize",
        "deps": []
      }
    }
  },
  "data_fetch_ir": {
    "endpoints": {
      "53450d43c5384ba281bcb92a894873a4": {
        "endpoint_id": "53450d43c5384ba281bcb92a894873a4",
        "module": "Orders",
        "endpoint": "/orders/",
        "method": "GET",
        "path_params": {},
        "query_params": {
          "buyer_id": "$appContext.currentUser.id",
          "limit": "$state.pageSize",
          "offset": "$derived.offset",
          "status": "$state.activeStatusFilter !== 'ALL' ? $state.activeStatusFilter : undefined",
          "order_number": "$state.searchOrderNumber || undefined"
        },
        "body": null,
        "fields": [
          "order_number",
          "order_items"
        ],
        "response_target": "orders",
        "response_transform": null,
        "trigger": "on_mount",
        "depends_on": [],
        "debounce_ms": null,
        "loading_field": null,
        "error_field": null
      }
    }
  },
  "data_model_ir": {
    "entities": {
      "order": {
        "name": "Order",
        "backend_module": "Orders",
        "fields": [
          "id",
          "order_number",
          "buyer_id",
          "seller_id",
          "status",
          "subtotal",
          "shipping_cost",
          "tax_amount",
          "platform_fee",
          "total_amount",
          "shipping_address_id",
          "billing_address_id",
          "notes",
          "cancelled_at",
          "cancellation_reason",
          "created_at",
          "updated_at",
          "order_items"
        ],
        "computed": [],
        "display_fields": [
          "order_number",
          "created_at",
          "seller_id",
          "order_items",
          "total_amount",
          "status"
        ],
        "search_fields": [
          "order_number"
        ],
        "filters": [
          "status",
          "order_number"
        ],
        "default_sort": null,
        "default_sort_dir": "asc"
      }
    },
    "relationships": []
  },
  "behaviour_ir": {
    "events": {
      "onStatusFilterChange": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.activeStatusFilter",
            "expr": "event.value"
          },
          {
            "target": "state.currentPage",
            "expr": "1"
          }
        ],
        "description": ""
      },
      "onSearchChange": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.searchOrderNumber",
            "expr": "event.value"
          },
          {
            "target": "state.currentPage",
            "expr": "1"
          }
        ],
        "description": ""
      },
      "onPageChange": {
        "type": "mutation",
        "updates": [
          {
            "target": "state.currentPage",
            "expr": "event.value"
          }
        ],
        "description": ""
      }
    },
    "actions": {
      "70ce3b77e11b4b91b6abaa517fbb5487": {
        "action_id": "70ce3b77e11b4b91b6abaa517fbb5487",
        "trigger": "form_submit",
        "target_component_id": "orders_table",
        "operation": "read",
        "description": "",
        "payload": {},
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [
          {
            "target": "state.loading",
            "expr": "true"
          }
        ],
        "api_endpoint": "53450d43c5384ba281bcb92a894873a4",
        "api_body": null,
        "side_effects": [],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "4a0b834a751a4b6d89d20747304abb34": {
        "action_id": "4a0b834a751a4b6d89d20747304abb34",
        "trigger": "row_click",
        "target_component_id": "orders_table",
        "operation": "custom",
        "description": "",
        "payload": {
          "orderId": "$row.id"
        },
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [],
        "api_endpoint": null,
        "api_body": null,
        "side_effects": [
          {
            "type": "navigate",
            "config": {
              "path": "/account/orders/${row.id}"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      },
      "ecef7117d39d4cbe88d8ac84c4658269": {
        "action_id": "ecef7117d39d4cbe88d8ac84c4658269",
        "trigger": "button_click",
        "target_component_id": "profile_link",
        "operation": "custom",
        "description": "",
        "payload": {},
        "guard": null,
        "requires_confirmation": false,
        "confirmation_message": null,
        "validation_rules": [],
        "validation_messages": {},
        "updates": [],
        "api_endpoint": null,
        "api_body": null,
        "side_effects": [
          {
            "type": "navigate",
            "config": {
              "path": "/account/profile"
            }
          }
        ],
        "then": null,
        "catch": null,
        "data_action": null
      }
    },
    "feedback": {
      "70ce3b77e11b4b91b6abaa517fbb5487": {
        "action_id": "70ce3b77e11b4b91b6abaa517fbb5487",
        "loading_indicator": "spinner",
        "loading_text": null,
        "success_message": null,
        "error_message": "Failed to load orders. Please try again.",
        "ui_updates": [
          "state.loading = false"
        ]
      },
      "4a0b834a751a4b6d89d20747304abb34": {
        "action_id": "4a0b834a751a4b6d89d20747304abb34",
        "loading_indicator": null,
        "loading_text": null,
        "success_message": null,
        "error_message": null,
        "ui_updates": []
      },
      "ecef7117d39d4cbe88d8ac84c4658269": {
        "action_id": "ecef7117d39d4cbe88d8ac84c4658269",
        "loading_indicator": null,
        "loading_text": null,
        "success_message": null,
        "error_message": null,
        "ui_updates": []
      }
    }
  },
  "component_ir": {
    "library": "antd",
    "theme": {
      "primaryColor": "#E3350D",
      "secondaryColor": "#1a1a2e",
      "successColor": null,
      "warningColor": null,
      "errorColor": null,
      "fontFamily": "sans-serif",
      "fontSize": null,
      "borderRadius": 8
    },
    "components": {
      "main_container": {
        "type": "div",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {
          "minHeight": "100vh",
          "width": "100%",
          "backgroundColor": "#f5f5f5",
          "padding": "24px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "content_wrapper": {
        "type": "div",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {
          "maxWidth": "1200px",
          "margin": "0 auto",
          "width": "100%"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "breadcrumb_nav": {
        "type": "Breadcrumb",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "items": [
            {
              "title": "Home",
              "href": "/"
            },
            {
              "title": "My Account",
              "href": "/account/profile"
            },
            {
              "title": "My Orders"
            }
          ]
        },
        "dynamic_props": {},
        "styles": {
          "marginBottom": "16px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "page_header": {
        "type": "div",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {
          "display": "flex",
          "justifyContent": "space-between",
          "alignItems": "center",
          "marginBottom": "24px",
          "flexWrap": "wrap",
          "gap": "12px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "page_title": {
        "type": "Typography.Title",
        "label": "My Orders",
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "level": 2
        },
        "dynamic_props": {},
        "styles": {
          "margin": 0
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "profile_link": {
        "type": "Button",
        "label": "My Account",
        "description": null,
        "bind": null,
        "onClick": "navigateToProfile",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "default",
          "icon": "UserOutlined"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "filters_card": {
        "type": "Card",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "bordered": false
        },
        "dynamic_props": {},
        "styles": {
          "marginBottom": "24px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "filters_row": {
        "type": "div",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {},
        "dynamic_props": {},
        "styles": {
          "display": "flex",
          "flexDirection": "column",
          "gap": "16px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "status_tabs": {
        "type": "Tabs",
        "label": "Filter by status",
        "description": null,
        "bind": "state.activeStatusFilter",
        "onClick": "onStatusFilterChange",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "card",
          "items": [
            {
              "key": "ALL",
              "label": "All Orders"
            },
            {
              "key": "PENDING",
              "label": "Pending"
            },
            {
              "key": "PAID",
              "label": "Paid"
            },
            {
              "key": "PROCESSING",
              "label": "Processing"
            },
            {
              "key": "SHIPPED",
              "label": "Shipped"
            },
            {
              "key": "DELIVERED",
              "label": "Delivered"
            },
            {
              "key": "CANCELLED",
              "label": "Cancelled"
            },
            {
              "key": "REFUNDED",
              "label": "Refunded"
            },
            {
              "key": "DISPUTED",
              "label": "Disputed"
            }
          ]
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "search_input": {
        "type": "Input.Search",
        "label": "Search by order number",
        "description": null,
        "bind": "state.searchOrderNumber",
        "onClick": "onSearchChange",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "placeholder": "Search by order number...",
          "allowClear": true,
          "enterButton": true,
          "size": "large"
        },
        "dynamic_props": {},
        "styles": {
          "maxWidth": "400px"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "table_card": {
        "type": "Card",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "bordered": false
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "orders_table": {
        "type": "Table",
        "label": "Orders list",
        "description": null,
        "bind": "state.orders",
        "onClick": "navigateToOrderDetail",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "rowKey": "id",
          "loading": "$state.loading",
          "onRow": "navigateToOrderDetail",
          "scroll": {
            "x": 900
          },
          "columns": [
            {
              "title": "Order Number",
              "dataIndex": "order_number",
              "key": "order_number",
              "width": 160,
              "fixed": "left",
              "render": "bold_text"
            },
            {
              "title": "Date",
              "dataIndex": "created_at",
              "key": "created_at",
              "width": 140,
              "render": "date_format",
              "sorter": true
            },
            {
              "title": "Items",
              "dataIndex": "order_items",
              "key": "order_items",
              "width": 200,
              "render": "order_items_summary"
            },
            {
              "title": "Total",
              "dataIndex": "total_amount",
              "key": "total_amount",
              "width": 120,
              "render": "currency_format",
              "sorter": true
            },
            {
              "title": "Status",
              "dataIndex": "status",
              "key": "status",
              "width": 140,
              "render": "status_badge"
            },
            {
              "title": "",
              "key": "action",
              "width": 50,
              "render": "right_arrow_icon"
            }
          ],
          "pagination": {
            "current": "$state.currentPage",
            "pageSize": "$state.pageSize",
            "total": "$state.totalOrders",
            "showSizeChanger": false,
            "showTotal": "total => `${total} orders`"
          },
          "locale": {
            "emptyText": "No orders found"
          }
        },
        "dynamic_props": {},
        "styles": {
          "cursor": "pointer"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "empty_state": {
        "type": "Empty",
        "label": null,
        "description": null,
        "bind": null,
        "onClick": null,
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "description": "You haven't placed any orders yet. Start browsing cards to find your next addition!",
          "image": "Empty.PRESENTED_IMAGE_SIMPLE"
        },
        "dynamic_props": {},
        "styles": {
          "padding": "48px 0"
        },
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      },
      "browse_cards_button": {
        "type": "Button",
        "label": "Browse Cards",
        "description": null,
        "bind": null,
        "onClick": "navigateToBrowse",
        "onChange": null,
        "onSubmit": null,
        "onHover": null,
        "onKeyPress": null,
        "props": {
          "type": "primary",
          "size": "large"
        },
        "dynamic_props": {},
        "styles": {},
        "dynamic_styles": {},
        "class_name": null,
        "dynamic_class": null,
        "transitions": [],
        "visible_when": null,
        "disabled_when": null,
        "repeat": null,
        "slots": {},
        "a11y_role": null,
        "a11y_label": null
      }
    }
  },
  "layout_ir": {
    "root": "main_container",
    "children": {
      "main_container": [
        "content_wrapper"
      ],
      "content_wrapper": [
        "breadcrumb_nav",
        "page_header",
        "filters_card",
        "table_card"
      ],
      "page_header": [
        "page_title",
        "profile_link"
      ],
      "filters_card": [
        "filters_row"
      ],
      "filters_row": [
        "status_tabs",
        "search_input"
      ],
      "table_card": [
        "orders_table"
      ],
      "empty_state": [
        "browse_cards_button"
      ]
    },
    "layout": {
      "main_container": {
        "type": "vertical",
        "gap": 0,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "content_wrapper": {
        "type": "vertical",
        "gap": 0,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "page_header": {
        "type": "horizontal",
        "gap": 12,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "filters_card": {
        "type": "vertical",
        "gap": 0,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "filters_row": {
        "type": "vertical",
        "gap": 16,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "table_card": {
        "type": "vertical",
        "gap": 0,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      },
      "empty_state": {
        "type": "vertical",
        "gap": 16,
        "padding": null,
        "columns": null,
        "column_template": null,
        "row_template": null,
        "align_items": null,
        "justify_content": null,
        "wrap": false,
        "min_height": null,
        "overflow": null
      }
    },
    "layout_zones": [
      {
        "zone_id": "main_zone",
        "component": "content_wrapper",
        "anchor": "center",
        "size_hint": "full-width",
        "z_layer": "base",
        "notes": "Main content area centered with max-width"
      }
    ],
    "responsive_overrides": []
  },
  "navigation_ir": {
    "tabs": [],
    "modals": {},
    "drawers": {},
    "routes": [],
    "breadcrumb": null,
    "default_tab": null
  },
  "realtime_ir": {
    "timers": {},
    "polling": {}
  },
  "metadata": {
    "ir_version": "3.5",
    "generated_at": "",
    "source_prompt": null,
    "schema_session_id": null,
    "warnings": []
  },
  "page_data_contract": null,
  "schema_ir": null
}
