42 - Action Center
Overview
Architecture Diagram
┌──────────────────────────────────────────────────────────────────────────────┐
│ Action Center Architecture │
└──────────────────────────────────────────────────────────────────────────────┘
External Order Request
(TradingView, API, etc.)
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ Order Router Service │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ should_route_to_pending(api_key, api_type) │ │
│ │ │ │
│ │ Check 1: Is user in semi_auto mode? │ │
│ │ Check 2: Is this a restricted operation? │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────┴─────────────────────┐ │
│ │ │ │
│ Auto Mode Semi-Auto Mode │
│ or Restricted (Queue Order) │
│ │ │ │
│ ▼ ▼ │
│ Execute Immediately Create Pending Order │
│ with Broker in Action Center │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ Action Center UI │
│ /action-center │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ [Pending (3)] [Approved] [Rejected] [All Orders] │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Statistics │ │
│ │ Pending: 3 │ Buy: 2 │ Sell: 1 │ Approved: 15 │ Rejected: 2 │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Strategy │ Symbol │ Exchange │ Action │ Qty │ Price │ Actions │ │
│ ├─────────────────────────────────────────────────────────────────────┤ │
│ │ MyStrat │ SBIN │ NSE │ BUY │ 100 │ MKT │ ✓ Approve │ │
│ │ │ │ │ │ │ │ ✗ Reject │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ [Approve All Pending] │
└─────────────────────────────────────────────────────────────────────────────┘
│
User clicks Approve
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ Pending Order Execution Service │
│ │
│ 1. Mark order status = 'approved' │
│ 2. Execute order with broker API │
│ 3. Get broker order status │
│ 4. Update broker_order_id and broker_status │
│ 5. Emit SocketIO event │
└─────────────────────────────────────────────────────────────────────────────┘Order Mode Configuration
Setting Order Mode
Mode Toggle API
Semi-Auto Workflow
Database Schema
pending_orders Table
Indexes
Supported Order Types
API Type
Description
Restricted Operations
Operation
Reason
API Endpoints
Get Orders
Approve Order
Reject Order
Approve All
Delete Order
Get Pending Count
Real-Time Updates
SocketIO Events
Event
Trigger
Data
Frontend Handling
React Component Features
Tabbed Interface
Statistics Dashboard
Order Table Columns
Column
Content
Expandable Details
Service Implementation
Order Router
Queue Order
Execute Approved Order
Security & Compliance
Audit Trail
API Key Security
Analyzer Mode Restriction
Key Files Reference
File
Purpose
Last updated