{
    "schemes": [],
    "swagger": "2.0",
    "info": {
        "description": "Algotrade service API",
        "title": "CodeKriti Algotrade API",
        "contact": {},
        "version": "1.0"
    },
    "host": "",
    "basePath": "",
    "paths": {
        "/v1/account-balances": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "account-balances"
                ],
                "summary": "List account-balances",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountBalanceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "account-balances"
                ],
                "summary": "Create account-balance",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountBalanceCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountBalanceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/account-balances/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "account-balances"
                ],
                "summary": "Get account-balance",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountBalanceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "account-balances"
                ],
                "summary": "Update account-balance",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountBalanceUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountBalanceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "account-balances"
                ],
                "summary": "Delete account-balance",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "account-balances"
                ],
                "summary": "Patch account-balances",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountBalancePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountBalanceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/accounts": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "accounts"
                ],
                "summary": "List accounts",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "accounts"
                ],
                "summary": "Create account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/accounts/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "accounts"
                ],
                "summary": "Get account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "accounts"
                ],
                "summary": "Update account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "accounts"
                ],
                "summary": "Delete account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "accounts"
                ],
                "summary": "Patch accounts",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/strategy-drafts": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-copilot"
                ],
                "summary": "Generate AI strategy draft",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires ai.strategy_generate",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyDraftRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyDraftResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/alert-deliveries": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-deliveries"
                ],
                "summary": "List alert-deliveries",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "alert_event_id",
                                "alert_rule_id",
                                "attempt_count",
                                "channel",
                                "created_at",
                                "data",
                                "deleted_at",
                                "delivered_at",
                                "failure_reason",
                                "id",
                                "provider",
                                "provider_ref",
                                "queued_at",
                                "sent_at",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: alert_event_id, alert_rule_id, attempt_count, channel, delivered_at, failure_reason, provider, provider_ref, queued_at, sent_at, status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertDeliveryListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-deliveries"
                ],
                "summary": "Create alert-delivery",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertDeliveryCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertDeliveryResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/alert-deliveries/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-deliveries"
                ],
                "summary": "Get alert-delivery",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertDeliveryResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-deliveries"
                ],
                "summary": "Update alert-delivery",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertDeliveryUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertDeliveryResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-deliveries"
                ],
                "summary": "Delete alert-delivery",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-deliveries"
                ],
                "summary": "Patch alert-deliveries",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertDeliveryPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertDeliveryResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/alert-deliveries/{id}/retry": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alerts"
                ],
                "summary": "Retry alert delivery",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires alert.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.AlertDeliveryRetryRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.AlertDeliveryResult"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/alert-events": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-events"
                ],
                "summary": "List alert-events",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "acknowledged_at",
                                "alert_rule_id",
                                "created_at",
                                "data",
                                "deleted_at",
                                "event_type",
                                "id",
                                "message",
                                "occurred_at",
                                "severity",
                                "source_id",
                                "source_type",
                                "status",
                                "strategy_id",
                                "strategy_run_id",
                                "title",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, acknowledged_at, alert_rule_id, event_type, message, occurred_at, severity, source_id, source_type, status, strategy_id, strategy_run_id, tenant_id, title",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertEventListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-events"
                ],
                "summary": "Create alert-event",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertEventCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertEventResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/alert-events/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-events"
                ],
                "summary": "Get alert-event",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertEventResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-events"
                ],
                "summary": "Update alert-event",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertEventUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertEventResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-events"
                ],
                "summary": "Delete alert-event",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-events"
                ],
                "summary": "Patch alert-events",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertEventPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertEventResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/alert-rules": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-rules"
                ],
                "summary": "List alert-rules",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "channel",
                                "created_at",
                                "data",
                                "deleted_at",
                                "destination_verification_status",
                                "destination_verified",
                                "event_type",
                                "filters",
                                "id",
                                "last_triggered_at",
                                "name",
                                "status",
                                "strategy_id",
                                "updated_at",
                                "user_id"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, channel, destination_verification_status, destination_verified, event_type, last_triggered_at, name, status, strategy_id, tenant_id, user_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertRuleListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-rules"
                ],
                "summary": "Create alert-rule",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertRuleCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertRuleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/alert-rules/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-rules"
                ],
                "summary": "Get alert-rule",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertRuleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-rules"
                ],
                "summary": "Update alert-rule",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertRuleUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertRuleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-rules"
                ],
                "summary": "Delete alert-rule",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alert-rules"
                ],
                "summary": "Patch alert-rules",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertRulePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AlertRuleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/alerts/test-delivery": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "alerts"
                ],
                "summary": "Test alert delivery",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires alert.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.AlertTestDeliveryRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.AlertPublishResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/audit-logs": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "audit-logs"
                ],
                "summary": "List audit-logs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AuditLogListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "audit-logs"
                ],
                "summary": "Create audit-log",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AuditLogCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AuditLogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/audit-logs/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "audit-logs"
                ],
                "summary": "Get audit-log",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AuditLogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "audit-logs"
                ],
                "summary": "Update audit-log",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AuditLogUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AuditLogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "audit-logs"
                ],
                "summary": "Delete audit-log",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "audit-logs"
                ],
                "summary": "Patch audit-logs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AuditLogPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AuditLogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/backtest-positions": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-positions"
                ],
                "summary": "List backtest-positions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "avg_entry_price",
                                "backtest_run_id",
                                "closed_at",
                                "created_at",
                                "data",
                                "deleted_at",
                                "exit_price",
                                "id",
                                "instrument_id",
                                "opened_at",
                                "quantity",
                                "realized_pnl",
                                "side",
                                "status",
                                "strategy_id",
                                "strategy_leg_id",
                                "strategy_version_id",
                                "unrealized_pnl",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: avg_entry_price, backtest_run_id, closed_at, exit_price, instrument_id, opened_at, quantity, realized_pnl, side, status, strategy_id, strategy_leg_id, strategy_version_id, tenant_id, unrealized_pnl",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestPositionListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-positions"
                ],
                "summary": "Create backtest-position",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestPositionCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestPositionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/backtest-positions/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-positions"
                ],
                "summary": "Get backtest-position",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestPositionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-positions"
                ],
                "summary": "Update backtest-position",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestPositionUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestPositionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-positions"
                ],
                "summary": "Delete backtest-position",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-positions"
                ],
                "summary": "Patch backtest-positions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestPositionPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestPositionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/backtest-runs": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-runs"
                ],
                "summary": "List backtest-runs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "assumptions",
                                "brokerage_bps",
                                "completed_at",
                                "created_at",
                                "data",
                                "date_from",
                                "date_to",
                                "deleted_at",
                                "error_code",
                                "error_message",
                                "id",
                                "initial_capital",
                                "slippage_bps",
                                "started_at",
                                "status",
                                "strategy_id",
                                "strategy_version_id",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: brokerage_bps, completed_at, date_from, date_to, error_code, error_message, initial_capital, slippage_bps, started_at, status, strategy_id, strategy_version_id, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestRunListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-runs"
                ],
                "summary": "Create backtest-run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestRunCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestRunResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/backtest-runs/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-runs"
                ],
                "summary": "Get backtest-run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestRunResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-runs"
                ],
                "summary": "Update backtest-run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestRunUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestRunResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-runs"
                ],
                "summary": "Delete backtest-run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-runs"
                ],
                "summary": "Patch backtest-runs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestRunPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestRunResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/backtest-trades": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-trades"
                ],
                "summary": "List backtest-trades",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "backtest_run_id",
                                "bar_time",
                                "created_at",
                                "data",
                                "deleted_at",
                                "executed_at",
                                "fees",
                                "id",
                                "instrument_id",
                                "notional",
                                "price",
                                "quantity",
                                "realized_pnl",
                                "side",
                                "slippage",
                                "strategy_id",
                                "strategy_leg_id",
                                "strategy_version_id",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: backtest_run_id, bar_time, executed_at, fees, instrument_id, notional, price, quantity, realized_pnl, side, slippage, strategy_id, strategy_leg_id, strategy_version_id, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestTradeListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-trades"
                ],
                "summary": "Create backtest-trade",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestTradeCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestTradeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/backtest-trades/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-trades"
                ],
                "summary": "Get backtest-trade",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestTradeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-trades"
                ],
                "summary": "Update backtest-trade",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestTradeUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestTradeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-trades"
                ],
                "summary": "Delete backtest-trade",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtest-trades"
                ],
                "summary": "Patch backtest-trades",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestTradePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BacktestTradeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/backtests": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtests"
                ],
                "summary": "Start backtest",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires backtest.run",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.BacktestStartRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.BacktestStartResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/backtests/compare": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtests"
                ],
                "summary": "Compare backtests",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires backtest.run",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.BacktestCompareRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.BacktestCompareResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/backtests/export": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "backtests"
                ],
                "summary": "Export backtest",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires report.export",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.BacktestExportRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.BacktestExportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/broker-accounts": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-accounts"
                ],
                "summary": "List broker-accounts",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "broker",
                                "broker_account_ref",
                                "created_at",
                                "data",
                                "deleted_at",
                                "display_name",
                                "environment",
                                "id",
                                "is_paper",
                                "status",
                                "updated_at",
                                "verified_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, broker, broker_account_ref, display_name, environment, is_paper, status, tenant_id, verified_at",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerAccountListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-accounts"
                ],
                "summary": "Create broker-account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerAccountCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerAccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/broker-accounts/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-accounts"
                ],
                "summary": "Get broker-account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerAccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-accounts"
                ],
                "summary": "Update broker-account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerAccountUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerAccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-accounts"
                ],
                "summary": "Delete broker-account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-accounts"
                ],
                "summary": "Patch broker-accounts",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerAccountPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerAccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/broker-credentials": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-credentials"
                ],
                "summary": "List broker-credentials",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "broker",
                                "broker_account_id",
                                "created_at",
                                "credential_type",
                                "data",
                                "deleted_at",
                                "environment",
                                "expires_at",
                                "id",
                                "last_verified_at",
                                "secret_ref",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, broker, broker_account_id, credential_type, environment, expires_at, last_verified_at, status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerCredentialListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Secret-safe broker credential write boundary. credential_material is write-only and persisted only through BrokerSecretStore.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-credentials"
                ],
                "summary": "Create broker-credential",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Request payload with write-only credential_material",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerCredentialWriteRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerCredentialSecretResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/broker-credentials/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-credentials"
                ],
                "summary": "Get broker-credential",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerCredentialResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Secret-safe broker credential write boundary. credential_material is write-only and persisted only through BrokerSecretStore.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-credentials"
                ],
                "summary": "Update broker-credential",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Request payload with write-only credential_material",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerCredentialWriteRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerCredentialSecretResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-credentials"
                ],
                "summary": "Delete broker-credential",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Secret-safe broker credential write boundary. credential_material is write-only and persisted only through BrokerSecretStore.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-credentials"
                ],
                "summary": "Patch broker-credentials",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Request payload with write-only credential_material",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerCredentialWriteRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.BrokerCredentialSecretResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/broker-credentials/{id}/test": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "broker-credentials"
                ],
                "summary": "Test broker credential",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires broker.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.BrokerCredentialTestRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.BrokerCredentialTestResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/candles": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "candles"
                ],
                "summary": "List candles",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "close",
                                "created_at",
                                "data",
                                "deleted_at",
                                "end_time",
                                "exchange_code",
                                "high",
                                "id",
                                "instrument.asset_class",
                                "instrument.base_asset",
                                "instrument.created_at",
                                "instrument.data",
                                "instrument.deleted_at",
                                "instrument.exchange_code",
                                "instrument.exchange_id",
                                "instrument.expiry",
                                "instrument.id",
                                "instrument.instrument_type",
                                "instrument.lot_size",
                                "instrument.metadata",
                                "instrument.name",
                                "instrument.option_type",
                                "instrument.provider",
                                "instrument.provider_attributes",
                                "instrument.provider_instrument_id",
                                "instrument.quote_asset",
                                "instrument.status",
                                "instrument.strike",
                                "instrument.symbol",
                                "instrument.tick_size",
                                "instrument.tradable",
                                "instrument.trading_symbol",
                                "instrument.updated_at",
                                "instrument_id",
                                "low",
                                "open",
                                "provider",
                                "provider_instrument_id",
                                "provider_payload",
                                "start_time",
                                "status",
                                "symbol",
                                "timeframe",
                                "turnover",
                                "updated_at",
                                "volume"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "instrument"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Include relations",
                        "name": "include",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: close, end_time, exchange_code, high, instrument_id, low, open, provider, provider_instrument_id, start_time, status, symbol, tenant_id, timeframe, turnover, volume, instrument.asset_class, instrument.base_asset, instrument.exchange_code, instrument.exchange_id, instrument.expiry, instrument.instrument_type, instrument.lot_size, instrument.name, instrument.option_type, instrument.provider, instrument.provider_instrument_id, instrument.quote_asset, instrument.status, instrument.strike, instrument.symbol, instrument.tenant_id, instrument.tick_size, instrument.tradable, instrument.trading_symbol",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CandleListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "candles"
                ],
                "summary": "Create candle",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CandleCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.CandleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/candles/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "candles"
                ],
                "summary": "Get candle",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CandleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "candles"
                ],
                "summary": "Update candle",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CandleUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CandleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "candles"
                ],
                "summary": "Delete candle",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "candles"
                ],
                "summary": "Patch candles",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CandlePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CandleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/debug-price-overrides": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-price-overrides"
                ],
                "summary": "List debug-price-overrides",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "ask",
                                "bid",
                                "created_at",
                                "data",
                                "debug_session_id",
                                "deleted_at",
                                "effective_at",
                                "expires_at",
                                "id",
                                "instrument_id",
                                "last",
                                "reason",
                                "spread",
                                "status",
                                "strategy_run_id",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: ask, bid, debug_session_id, effective_at, expires_at, instrument_id, last, reason, spread, status, strategy_run_id, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugPriceOverrideListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-price-overrides"
                ],
                "summary": "Create debug-price-override",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugPriceOverrideCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugPriceOverrideResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/debug-price-overrides/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-price-overrides"
                ],
                "summary": "Get debug-price-override",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugPriceOverrideResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-price-overrides"
                ],
                "summary": "Update debug-price-override",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugPriceOverrideUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugPriceOverrideResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-price-overrides"
                ],
                "summary": "Delete debug-price-override",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-price-overrides"
                ],
                "summary": "Patch debug-price-overrides",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugPriceOverridePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugPriceOverrideResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/debug-sessions": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-sessions"
                ],
                "summary": "List debug-sessions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "ended_at",
                                "expires_at",
                                "id",
                                "mode",
                                "started_at",
                                "status",
                                "strategy_id",
                                "strategy_run_id",
                                "strategy_version_id",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: ended_at, expires_at, mode, started_at, status, strategy_id, strategy_run_id, strategy_version_id, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugSessionListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-sessions"
                ],
                "summary": "Create debug-session",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugSessionCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugSessionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/debug-sessions/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-sessions"
                ],
                "summary": "Get debug-session",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugSessionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-sessions"
                ],
                "summary": "Update debug-session",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugSessionUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugSessionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-sessions"
                ],
                "summary": "Delete debug-session",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug-sessions"
                ],
                "summary": "Patch debug-sessions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugSessionPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.DebugSessionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/debug/price-overrides": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug"
                ],
                "summary": "Create debug price override",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.debug",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.DebugPriceOverrideRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.DebugPriceOverrideResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/debug/strategy-runs/{id}/cycle": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "debug"
                ],
                "summary": "Run debug strategy cycle",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.debug",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.DebugCycleRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.DebugCycleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/exchanges": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "exchanges"
                ],
                "summary": "List exchanges",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "country",
                                "created_at",
                                "data",
                                "deleted_at",
                                "exchange_code",
                                "id",
                                "instruments.asset_class",
                                "instruments.base_asset",
                                "instruments.created_at",
                                "instruments.data",
                                "instruments.deleted_at",
                                "instruments.exchange_code",
                                "instruments.exchange_id",
                                "instruments.expiry",
                                "instruments.id",
                                "instruments.instrument_type",
                                "instruments.lot_size",
                                "instruments.metadata",
                                "instruments.name",
                                "instruments.option_type",
                                "instruments.provider",
                                "instruments.provider_attributes",
                                "instruments.provider_instrument_id",
                                "instruments.quote_asset",
                                "instruments.status",
                                "instruments.strike",
                                "instruments.symbol",
                                "instruments.tick_size",
                                "instruments.tradable",
                                "instruments.trading_symbol",
                                "instruments.updated_at",
                                "metadata",
                                "mic",
                                "name",
                                "provider",
                                "status",
                                "timezone",
                                "trading_calendar",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "instruments"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Include relations",
                        "name": "include",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: country, exchange_code, mic, name, provider, status, tenant_id, timezone, instruments.asset_class, instruments.base_asset, instruments.exchange_code, instruments.exchange_id, instruments.expiry, instruments.instrument_type, instruments.lot_size, instruments.name, instruments.option_type, instruments.provider, instruments.provider_instrument_id, instruments.quote_asset, instruments.status, instruments.strike, instruments.symbol, instruments.tenant_id, instruments.tick_size, instruments.tradable, instruments.trading_symbol",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExchangeListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "exchanges"
                ],
                "summary": "Create exchange",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ExchangeCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExchangeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/exchanges/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "exchanges"
                ],
                "summary": "Get exchange",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExchangeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "exchanges"
                ],
                "summary": "Update exchange",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ExchangeUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExchangeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "exchanges"
                ],
                "summary": "Delete exchange",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "exchanges"
                ],
                "summary": "Patch exchanges",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ExchangePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExchangeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/execution-logs": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "execution-logs"
                ],
                "summary": "List execution-logs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExecutionLogListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "execution-logs"
                ],
                "summary": "Create execution-log",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ExecutionLogCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExecutionLogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/execution-logs/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "execution-logs"
                ],
                "summary": "Get execution-log",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExecutionLogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "execution-logs"
                ],
                "summary": "Update execution-log",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ExecutionLogUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExecutionLogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "execution-logs"
                ],
                "summary": "Delete execution-log",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "execution-logs"
                ],
                "summary": "Patch execution-logs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ExecutionLogPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExecutionLogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/external-sync-states": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "external-sync-states"
                ],
                "summary": "List external-sync-states",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExternalSyncStateListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "external-sync-states"
                ],
                "summary": "Create external-sync-state",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ExternalSyncStateCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExternalSyncStateResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/external-sync-states/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "external-sync-states"
                ],
                "summary": "Get external-sync-state",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExternalSyncStateResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "external-sync-states"
                ],
                "summary": "Update external-sync-state",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ExternalSyncStateUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExternalSyncStateResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "external-sync-states"
                ],
                "summary": "Delete external-sync-state",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "external-sync-states"
                ],
                "summary": "Patch external-sync-states",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ExternalSyncStatePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ExternalSyncStateResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/instruments": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "instruments"
                ],
                "summary": "List instruments",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "asset_class",
                                "base_asset",
                                "candles.close",
                                "candles.created_at",
                                "candles.data",
                                "candles.deleted_at",
                                "candles.end_time",
                                "candles.exchange_code",
                                "candles.high",
                                "candles.id",
                                "candles.instrument_id",
                                "candles.low",
                                "candles.open",
                                "candles.provider",
                                "candles.provider_instrument_id",
                                "candles.provider_payload",
                                "candles.start_time",
                                "candles.status",
                                "candles.symbol",
                                "candles.timeframe",
                                "candles.turnover",
                                "candles.updated_at",
                                "candles.volume",
                                "created_at",
                                "data",
                                "deleted_at",
                                "exchange.country",
                                "exchange.created_at",
                                "exchange.data",
                                "exchange.deleted_at",
                                "exchange.exchange_code",
                                "exchange.id",
                                "exchange.metadata",
                                "exchange.mic",
                                "exchange.name",
                                "exchange.provider",
                                "exchange.status",
                                "exchange.timezone",
                                "exchange.trading_calendar",
                                "exchange.updated_at",
                                "exchange_code",
                                "exchange_id",
                                "expiry",
                                "id",
                                "instrument_type",
                                "lot_size",
                                "metadata",
                                "name",
                                "option_type",
                                "orderbook_snapshots.asks",
                                "orderbook_snapshots.best_ask",
                                "orderbook_snapshots.best_bid",
                                "orderbook_snapshots.bids",
                                "orderbook_snapshots.created_at",
                                "orderbook_snapshots.data",
                                "orderbook_snapshots.deleted_at",
                                "orderbook_snapshots.depth",
                                "orderbook_snapshots.event_time",
                                "orderbook_snapshots.exchange_code",
                                "orderbook_snapshots.id",
                                "orderbook_snapshots.instrument_id",
                                "orderbook_snapshots.provider",
                                "orderbook_snapshots.provider_instrument_id",
                                "orderbook_snapshots.provider_payload",
                                "orderbook_snapshots.received_at",
                                "orderbook_snapshots.status",
                                "orderbook_snapshots.symbol",
                                "orderbook_snapshots.updated_at",
                                "provider",
                                "provider_attributes",
                                "provider_instrument_id",
                                "quote_asset",
                                "status",
                                "strike",
                                "symbol",
                                "tick_size",
                                "ticks.ask",
                                "ticks.ask_size",
                                "ticks.bid",
                                "ticks.bid_size",
                                "ticks.created_at",
                                "ticks.data",
                                "ticks.deleted_at",
                                "ticks.event_time",
                                "ticks.exchange_code",
                                "ticks.id",
                                "ticks.instrument_id",
                                "ticks.last_price",
                                "ticks.provider",
                                "ticks.provider_instrument_id",
                                "ticks.provider_payload",
                                "ticks.received_at",
                                "ticks.status",
                                "ticks.symbol",
                                "ticks.updated_at",
                                "ticks.volume",
                                "tradable",
                                "trading_symbol",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "candles",
                                "exchange",
                                "orderbook_snapshots",
                                "ticks"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Include relations",
                        "name": "include",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: asset_class, base_asset, exchange_code, exchange_id, expiry, instrument_type, lot_size, name, option_type, provider, provider_instrument_id, quote_asset, status, strike, symbol, tenant_id, tick_size, tradable, trading_symbol, exchange.country, exchange.exchange_code, exchange.mic, exchange.name, exchange.provider, exchange.status, exchange.tenant_id, exchange.timezone, orderbook_snapshots.best_ask, orderbook_snapshots.best_bid, orderbook_snapshots.depth, orderbook_snapshots.event_time, orderbook_snapshots.exchange_code, orderbook_snapshots.instrument_id, orderbook_snapshots.provider, orderbook_snapshots.provider_instrument_id, orderbook_snapshots.received_at, orderbook_snapshots.status, orderbook_snapshots.symbol, orderbook_snapshots.tenant_id, ticks.ask, ticks.ask_size, ticks.bid, ticks.bid_size, ticks.event_time, ticks.exchange_code, ticks.instrument_id, ticks.last_price, ticks.provider, ticks.provider_instrument_id, ticks.received_at, ticks.status, ticks.symbol, ticks.tenant_id, ticks.volume, candles.close, candles.end_time, candles.exchange_code, candles.high, candles.instrument_id, candles.low, candles.open, candles.provider, candles.provider_instrument_id, candles.start_time, candles.status, candles.symbol, candles.tenant_id, candles.timeframe, candles.turnover, candles.volume",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InstrumentListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "instruments"
                ],
                "summary": "Create instrument",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.InstrumentCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.InstrumentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/instruments/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "instruments"
                ],
                "summary": "Get instrument",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InstrumentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "instruments"
                ],
                "summary": "Update instrument",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.InstrumentUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InstrumentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "instruments"
                ],
                "summary": "Delete instrument",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "instruments"
                ],
                "summary": "Patch instruments",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.InstrumentPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.InstrumentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/market-data/ingestion/status": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-data"
                ],
                "summary": "Market data ingestion status",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires market_data.read or market_data.write",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "type": "string",
                        "description": "Provider code; defaults to polymarket",
                        "name": "provider",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.MarketDataIngestionStatusResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/market-data/ticks/validate": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-data"
                ],
                "summary": "Validate market data tick payload",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires market_data.write",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.ProviderTickPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.MarketTickValidateResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/market-feeds": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-feeds"
                ],
                "summary": "List market-feeds",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketFeedListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-feeds"
                ],
                "summary": "Create market-feed",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketFeedCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketFeedResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/market-feeds/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-feeds"
                ],
                "summary": "Get market-feed",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketFeedResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-feeds"
                ],
                "summary": "Update market-feed",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketFeedUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketFeedResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-feeds"
                ],
                "summary": "Delete market-feed",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-feeds"
                ],
                "summary": "Patch market-feeds",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketFeedPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketFeedResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/market-ticks": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-ticks"
                ],
                "summary": "List market-ticks",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "ask",
                                "ask_size",
                                "bid",
                                "bid_size",
                                "created_at",
                                "data",
                                "deleted_at",
                                "event_time",
                                "exchange_code",
                                "id",
                                "instrument.asset_class",
                                "instrument.base_asset",
                                "instrument.created_at",
                                "instrument.data",
                                "instrument.deleted_at",
                                "instrument.exchange_code",
                                "instrument.exchange_id",
                                "instrument.expiry",
                                "instrument.id",
                                "instrument.instrument_type",
                                "instrument.lot_size",
                                "instrument.metadata",
                                "instrument.name",
                                "instrument.option_type",
                                "instrument.provider",
                                "instrument.provider_attributes",
                                "instrument.provider_instrument_id",
                                "instrument.quote_asset",
                                "instrument.status",
                                "instrument.strike",
                                "instrument.symbol",
                                "instrument.tick_size",
                                "instrument.tradable",
                                "instrument.trading_symbol",
                                "instrument.updated_at",
                                "instrument_id",
                                "last_price",
                                "provider",
                                "provider_instrument_id",
                                "provider_payload",
                                "received_at",
                                "status",
                                "symbol",
                                "updated_at",
                                "volume"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "instrument"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Include relations",
                        "name": "include",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: ask, ask_size, bid, bid_size, event_time, exchange_code, instrument_id, last_price, provider, provider_instrument_id, received_at, status, symbol, tenant_id, volume, instrument.asset_class, instrument.base_asset, instrument.exchange_code, instrument.exchange_id, instrument.expiry, instrument.instrument_type, instrument.lot_size, instrument.name, instrument.option_type, instrument.provider, instrument.provider_instrument_id, instrument.quote_asset, instrument.status, instrument.strike, instrument.symbol, instrument.tenant_id, instrument.tick_size, instrument.tradable, instrument.trading_symbol",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketTickListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-ticks"
                ],
                "summary": "Create market-tick",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketTickCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketTickResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/market-ticks/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-ticks"
                ],
                "summary": "Get market-tick",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketTickResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-ticks"
                ],
                "summary": "Update market-tick",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketTickUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketTickResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-ticks"
                ],
                "summary": "Delete market-tick",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-ticks"
                ],
                "summary": "Patch market-ticks",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketTickPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MarketTickResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/metadata/resources": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "metadata"
                ],
                "summary": "List resource metadata",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ops/failed-jobs": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "operations"
                ],
                "summary": "View failed jobs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires risk.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "type": "integer",
                        "description": "Maximum failed jobs returned; defaults to 50 and caps at 100",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorFailedJobsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ops/leases": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "operations"
                ],
                "summary": "Inspect runner leases",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires risk.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "type": "integer",
                        "description": "Maximum leases returned; defaults to 50 and caps at 100",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorLeaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ops/market-data/resync": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "operations"
                ],
                "summary": "Resync market data",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires risk.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorMarketDataResyncRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorActionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ops/readiness": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "operations"
                ],
                "summary": "Operational readiness",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires report.read or risk.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperationalReadinessResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ops/reconcile": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "operations"
                ],
                "summary": "Request force reconcile",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires risk.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorReconcileRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorActionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ops/runner/drain": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "operations"
                ],
                "summary": "Drain strategy runner",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires risk.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorControlRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorActionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ops/runner/pause": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "operations"
                ],
                "summary": "Pause strategy runner",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires risk.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorControlRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorActionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ops/runner/resume": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "operations"
                ],
                "summary": "Resume strategy runner",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires risk.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorControlRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.OperatorActionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/order-events": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "order-events"
                ],
                "summary": "List order-events",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderEventListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "order-events"
                ],
                "summary": "Create order-event",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderEventCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderEventResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/order-events/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "order-events"
                ],
                "summary": "Get order-event",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderEventResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "order-events"
                ],
                "summary": "Update order-event",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderEventUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderEventResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "order-events"
                ],
                "summary": "Delete order-event",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "order-events"
                ],
                "summary": "Patch order-events",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderEventPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderEventResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/orderbook-snapshots": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orderbook-snapshots"
                ],
                "summary": "List orderbook-snapshots",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "asks",
                                "best_ask",
                                "best_bid",
                                "bids",
                                "created_at",
                                "data",
                                "deleted_at",
                                "depth",
                                "event_time",
                                "exchange_code",
                                "id",
                                "instrument.asset_class",
                                "instrument.base_asset",
                                "instrument.created_at",
                                "instrument.data",
                                "instrument.deleted_at",
                                "instrument.exchange_code",
                                "instrument.exchange_id",
                                "instrument.expiry",
                                "instrument.id",
                                "instrument.instrument_type",
                                "instrument.lot_size",
                                "instrument.metadata",
                                "instrument.name",
                                "instrument.option_type",
                                "instrument.provider",
                                "instrument.provider_attributes",
                                "instrument.provider_instrument_id",
                                "instrument.quote_asset",
                                "instrument.status",
                                "instrument.strike",
                                "instrument.symbol",
                                "instrument.tick_size",
                                "instrument.tradable",
                                "instrument.trading_symbol",
                                "instrument.updated_at",
                                "instrument_id",
                                "provider",
                                "provider_instrument_id",
                                "provider_payload",
                                "received_at",
                                "status",
                                "symbol",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "instrument"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Include relations",
                        "name": "include",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: best_ask, best_bid, depth, event_time, exchange_code, instrument_id, provider, provider_instrument_id, received_at, status, symbol, tenant_id, instrument.asset_class, instrument.base_asset, instrument.exchange_code, instrument.exchange_id, instrument.expiry, instrument.instrument_type, instrument.lot_size, instrument.name, instrument.option_type, instrument.provider, instrument.provider_instrument_id, instrument.quote_asset, instrument.status, instrument.strike, instrument.symbol, instrument.tenant_id, instrument.tick_size, instrument.tradable, instrument.trading_symbol",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderBookSnapshotListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orderbook-snapshots"
                ],
                "summary": "Create orderbook-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderBookSnapshotCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderBookSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/orderbook-snapshots/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orderbook-snapshots"
                ],
                "summary": "Get orderbook-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderBookSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orderbook-snapshots"
                ],
                "summary": "Update orderbook-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderBookSnapshotUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderBookSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orderbook-snapshots"
                ],
                "summary": "Delete orderbook-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orderbook-snapshots"
                ],
                "summary": "Patch orderbook-snapshots",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderBookSnapshotPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderBookSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/orders": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "List orders",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "avg_fill_price",
                                "broker_account_id",
                                "broker_order_id",
                                "client_order_id",
                                "created_at",
                                "data",
                                "deleted_at",
                                "filled_at",
                                "filled_quantity",
                                "id",
                                "idempotency_key",
                                "instrument_id",
                                "order_type",
                                "price",
                                "quantity",
                                "side",
                                "status",
                                "strategy_id",
                                "strategy_leg_id",
                                "strategy_run_id",
                                "submitted_at",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, avg_fill_price, broker_account_id, broker_order_id, client_order_id, filled_at, filled_quantity, idempotency_key, instrument_id, order_type, price, quantity, side, status, strategy_id, strategy_leg_id, strategy_run_id, submitted_at, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Create order",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/orders/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Get order",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Update order",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Delete order",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Patch orders",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.OrderResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/paper/strategy-runs": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "paper-trading"
                ],
                "summary": "Start paper strategy run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.run.paper",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.PaperRunRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.PaperRunResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/performance-metrics": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance-metrics"
                ],
                "summary": "List performance-metrics",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "backtest_run_id",
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "losing_trades",
                                "max_drawdown",
                                "metric_date",
                                "metric_type",
                                "realized_pnl",
                                "sharpe",
                                "strategy_id",
                                "strategy_version_id",
                                "total_pnl",
                                "trade_count",
                                "unrealized_pnl",
                                "updated_at",
                                "win_rate",
                                "winning_trades"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, backtest_run_id, losing_trades, max_drawdown, metric_date, metric_type, realized_pnl, sharpe, strategy_id, strategy_version_id, tenant_id, total_pnl, trade_count, unrealized_pnl, win_rate, winning_trades",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PerformanceMetricListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance-metrics"
                ],
                "summary": "Create performance-metric",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PerformanceMetricCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.PerformanceMetricResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/performance-metrics/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance-metrics"
                ],
                "summary": "Get performance-metric",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PerformanceMetricResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance-metrics"
                ],
                "summary": "Update performance-metric",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PerformanceMetricUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PerformanceMetricResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance-metrics"
                ],
                "summary": "Delete performance-metric",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "performance-metrics"
                ],
                "summary": "Patch performance-metrics",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PerformanceMetricPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PerformanceMetricResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/pnl-snapshots": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "pnl-snapshots"
                ],
                "summary": "List pnl-snapshots",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PnLSnapshotListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "pnl-snapshots"
                ],
                "summary": "Create pnl-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PnLSnapshotCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.PnLSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/pnl-snapshots/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "pnl-snapshots"
                ],
                "summary": "Get pnl-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PnLSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "pnl-snapshots"
                ],
                "summary": "Update pnl-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PnLSnapshotUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PnLSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "pnl-snapshots"
                ],
                "summary": "Delete pnl-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "pnl-snapshots"
                ],
                "summary": "Patch pnl-snapshots",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PnLSnapshotPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PnLSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/polymarket/sync-instruments": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "market-data"
                ],
                "summary": "Sync Polymarket instruments",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires risk.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "enum": [
                            "all",
                            "sports",
                            "crypto",
                            "crypto_updown_24h"
                        ],
                        "type": "string",
                        "description": "Local segment filter applied after fetching Polymarket Gamma events; not forwarded to provider",
                        "name": "segment",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Polymarket Gamma active filter; defaults to true",
                        "name": "active",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Polymarket Gamma closed filter; defaults to false",
                        "name": "closed",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Polymarket Gamma event page size; defaults to 100 and is capped at 100 by the provider",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Polymarket Gamma event page offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Optional Polymarket Gamma tag filter",
                        "name": "tag_id",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.PolymarketSyncResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/portfolio-accounts": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-accounts"
                ],
                "summary": "List portfolio-accounts",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "allocation_pct",
                                "broker_account_id",
                                "capital_limit",
                                "created_at",
                                "current_exposure",
                                "data",
                                "deleted_at",
                                "id",
                                "portfolio_id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, allocation_pct, broker_account_id, capital_limit, current_exposure, portfolio_id, status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAccountListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-accounts"
                ],
                "summary": "Create portfolio-account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAccountCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/portfolio-accounts/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-accounts"
                ],
                "summary": "Get portfolio-account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-accounts"
                ],
                "summary": "Update portfolio-account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAccountUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-accounts"
                ],
                "summary": "Delete portfolio-account",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-accounts"
                ],
                "summary": "Patch portfolio-accounts",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAccountPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAccountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/portfolio-allocation-targets": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-allocation-targets"
                ],
                "summary": "List portfolio-allocation-targets",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "created_at",
                                "data",
                                "deleted_at",
                                "effective_from",
                                "effective_to",
                                "id",
                                "instrument_id",
                                "max_allocation",
                                "min_allocation",
                                "portfolio_id",
                                "status",
                                "strategy_id",
                                "target_allocation",
                                "target_exposure",
                                "target_type",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, effective_from, effective_to, instrument_id, max_allocation, min_allocation, portfolio_id, status, strategy_id, target_allocation, target_exposure, target_type, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAllocationTargetListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-allocation-targets"
                ],
                "summary": "Create portfolio-allocation-target",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAllocationTargetCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAllocationTargetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/portfolio-allocation-targets/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-allocation-targets"
                ],
                "summary": "Get portfolio-allocation-target",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAllocationTargetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-allocation-targets"
                ],
                "summary": "Update portfolio-allocation-target",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAllocationTargetUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAllocationTargetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-allocation-targets"
                ],
                "summary": "Delete portfolio-allocation-target",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-allocation-targets"
                ],
                "summary": "Patch portfolio-allocation-targets",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAllocationTargetPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioAllocationTargetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/portfolio-snapshots": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-snapshots"
                ],
                "summary": "List portfolio-snapshots",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "actual_allocation",
                                "allocation_drift",
                                "cash_value",
                                "created_at",
                                "data",
                                "deleted_at",
                                "gross_exposure",
                                "id",
                                "net_exposure",
                                "portfolio_id",
                                "position_count",
                                "realized_pnl",
                                "snapshot_at",
                                "snapshot_date",
                                "strategy_id",
                                "target_allocation",
                                "total_value",
                                "unrealized_pnl",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, actual_allocation, allocation_drift, cash_value, gross_exposure, net_exposure, portfolio_id, position_count, realized_pnl, snapshot_at, snapshot_date, strategy_id, target_allocation, tenant_id, total_value, unrealized_pnl",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioSnapshotListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-snapshots"
                ],
                "summary": "Create portfolio-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioSnapshotCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/portfolio-snapshots/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-snapshots"
                ],
                "summary": "Get portfolio-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-snapshots"
                ],
                "summary": "Update portfolio-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioSnapshotUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-snapshots"
                ],
                "summary": "Delete portfolio-snapshot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio-snapshots"
                ],
                "summary": "Patch portfolio-snapshots",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioSnapshotPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioSnapshotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/portfolio/dashboard": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolio"
                ],
                "summary": "Portfolio dashboard",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires portfolio.read",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "type": "string",
                        "description": "Account scope. Required when portfolio_id is omitted.",
                        "name": "account_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Portfolio scope. When provided, account_id must match the portfolio account.",
                        "name": "portfolio_id",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.PortfolioDashboardResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/portfolios": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolios"
                ],
                "summary": "List portfolios",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "base_currency",
                                "created_at",
                                "current_exposure",
                                "data",
                                "deleted_at",
                                "description",
                                "id",
                                "last_snapshot_at",
                                "max_exposure",
                                "name",
                                "realized_pnl",
                                "status",
                                "target_capital",
                                "unrealized_pnl",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, base_currency, current_exposure, description, last_snapshot_at, max_exposure, name, realized_pnl, status, target_capital, tenant_id, unrealized_pnl",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolios"
                ],
                "summary": "Create portfolio",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/portfolios/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolios"
                ],
                "summary": "Get portfolio",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolios"
                ],
                "summary": "Update portfolio",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolios"
                ],
                "summary": "Delete portfolio",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "portfolios"
                ],
                "summary": "Patch portfolios",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PortfolioResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/positions": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "positions"
                ],
                "summary": "List positions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "avg_entry_price",
                                "broker_account_id",
                                "closed_at",
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "instrument_id",
                                "last_trade_id",
                                "mark_price",
                                "opened_at",
                                "quantity",
                                "realized_pnl",
                                "side",
                                "status",
                                "strategy_id",
                                "strategy_leg_id",
                                "strategy_run_id",
                                "unrealized_pnl",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, avg_entry_price, broker_account_id, closed_at, instrument_id, last_trade_id, mark_price, opened_at, quantity, realized_pnl, side, status, strategy_id, strategy_leg_id, strategy_run_id, tenant_id, unrealized_pnl",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PositionListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "positions"
                ],
                "summary": "Create position",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PositionCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.PositionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/positions/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "positions"
                ],
                "summary": "Get position",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PositionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "positions"
                ],
                "summary": "Update position",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PositionUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PositionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "positions"
                ],
                "summary": "Delete position",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "positions"
                ],
                "summary": "Patch positions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.PositionPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.PositionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/report-exports": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "report-exports"
                ],
                "summary": "List report-exports",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ReportExportListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "report-exports"
                ],
                "summary": "Create report-export",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ReportExportCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.ReportExportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/report-exports/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "report-exports"
                ],
                "summary": "Get report-export",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ReportExportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "report-exports"
                ],
                "summary": "Update report-export",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ReportExportUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ReportExportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "report-exports"
                ],
                "summary": "Delete report-export",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "report-exports"
                ],
                "summary": "Patch report-exports",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ReportExportPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ReportExportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/reports/daily-pnl": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Read-only algotrade reporting endpoint with tenant/account scope and bounded date range.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "reports"
                ],
                "summary": "Daily PnL report",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires report.read",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "type": "string",
                        "description": "Account scope",
                        "name": "account_id",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Start date in YYYY-MM-DD format",
                        "name": "from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "End date in YYYY-MM-DD format",
                        "name": "to",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ReportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/reports/exports": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "reports"
                ],
                "summary": "Create report export",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires report.export",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.ReportExportRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ReportExportSnapshot"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/reports/monthly-pnl": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Read-only algotrade reporting endpoint with tenant/account scope and bounded date range.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "reports"
                ],
                "summary": "Monthly PnL report",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires report.read",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "type": "string",
                        "description": "Account scope",
                        "name": "account_id",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Start date in YYYY-MM-DD format",
                        "name": "from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "End date in YYYY-MM-DD format",
                        "name": "to",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ReportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/reports/order-lifecycle-audit": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Read-only algotrade reporting endpoint with tenant/account scope and bounded date range.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "reports"
                ],
                "summary": "Order lifecycle audit report",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires report.read",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "type": "string",
                        "description": "Account scope",
                        "name": "account_id",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Start date in YYYY-MM-DD format",
                        "name": "from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "End date in YYYY-MM-DD format",
                        "name": "to",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ReportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/reports/risk-breaches": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Read-only algotrade reporting endpoint with tenant/account scope and bounded date range.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "reports"
                ],
                "summary": "Risk breach report",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires report.read",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "type": "string",
                        "description": "Account scope",
                        "name": "account_id",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Start date in YYYY-MM-DD format",
                        "name": "from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "End date in YYYY-MM-DD format",
                        "name": "to",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ReportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/reports/schedules": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "reports"
                ],
                "summary": "Schedule report export",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires report.export",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.ReportScheduleRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ReportExportSnapshot"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/reports/strategy-performance": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Read-only algotrade reporting endpoint with tenant/account scope and bounded date range.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "reports"
                ],
                "summary": "Strategy performance report",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires report.read",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "type": "string",
                        "description": "Account scope",
                        "name": "account_id",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Start date in YYYY-MM-DD format",
                        "name": "from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "End date in YYYY-MM-DD format",
                        "name": "to",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ReportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/resource-leases": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "resource-leases"
                ],
                "summary": "List resource-leases",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ResourceLeaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "resource-leases"
                ],
                "summary": "Create resource-lease",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ResourceLeaseCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.ResourceLeaseResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/resource-leases/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "resource-leases"
                ],
                "summary": "Get resource-lease",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ResourceLeaseResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "resource-leases"
                ],
                "summary": "Update resource-lease",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ResourceLeaseUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ResourceLeaseResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "resource-leases"
                ],
                "summary": "Delete resource-lease",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "resource-leases"
                ],
                "summary": "Patch resource-leases",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ResourceLeasePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ResourceLeaseResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/risk-limits": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "risk-limits"
                ],
                "summary": "List risk-limits",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "action",
                                "active_from",
                                "active_to",
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "limit_type",
                                "priority",
                                "review_required",
                                "review_status",
                                "scope",
                                "status",
                                "strategy_id",
                                "strategy_run_id",
                                "threshold_unit",
                                "threshold_value",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, action, active_from, active_to, limit_type, priority, review_required, review_status, scope, status, strategy_id, strategy_run_id, tenant_id, threshold_unit, threshold_value",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RiskLimitListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "risk-limits"
                ],
                "summary": "Create risk-limit",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RiskLimitCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.RiskLimitResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/risk-limits/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "risk-limits"
                ],
                "summary": "Get risk-limit",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RiskLimitResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "risk-limits"
                ],
                "summary": "Update risk-limit",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RiskLimitUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RiskLimitResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "risk-limits"
                ],
                "summary": "Delete risk-limit",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "risk-limits"
                ],
                "summary": "Patch risk-limits",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RiskLimitPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RiskLimitResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/rule-breaches": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-breaches"
                ],
                "summary": "List rule-breaches",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "action",
                                "breach_type",
                                "created_at",
                                "data",
                                "deleted_at",
                                "detected_at",
                                "excess_value",
                                "id",
                                "observed_value",
                                "order_id",
                                "resolved_at",
                                "review_note",
                                "risk_limit_id",
                                "severity",
                                "status",
                                "strategy_id",
                                "strategy_run_id",
                                "threshold_value",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, action, breach_type, detected_at, excess_value, observed_value, order_id, resolved_at, review_note, risk_limit_id, severity, status, strategy_id, strategy_run_id, tenant_id, threshold_value",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleBreachListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-breaches"
                ],
                "summary": "Create rule-breache",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleBreachCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleBreachResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/rule-breaches/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-breaches"
                ],
                "summary": "Get rule-breache",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleBreachResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-breaches"
                ],
                "summary": "Update rule-breache",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleBreachUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleBreachResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-breaches"
                ],
                "summary": "Delete rule-breache",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-breaches"
                ],
                "summary": "Patch rule-breaches",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleBreachPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleBreachResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/rule-execution-traces": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-execution-traces"
                ],
                "summary": "List rule-execution-traces",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "completed_at",
                                "cpu_ms",
                                "created_at",
                                "decision",
                                "deleted_at",
                                "error_code",
                                "error_message",
                                "id",
                                "input",
                                "memory_mb",
                                "mode",
                                "network_attempted",
                                "order_placement_attempted",
                                "output",
                                "rule_id",
                                "rule_version_id",
                                "started_at",
                                "status",
                                "strategy_id",
                                "strategy_run_id",
                                "trace",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: completed_at, cpu_ms, decision, error_code, error_message, memory_mb, mode, network_attempted, order_placement_attempted, rule_id, rule_version_id, started_at, status, strategy_id, strategy_run_id, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleExecutionTraceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-execution-traces"
                ],
                "summary": "Create rule-execution-trace",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleExecutionTraceCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleExecutionTraceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/rule-execution-traces/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-execution-traces"
                ],
                "summary": "Get rule-execution-trace",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleExecutionTraceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-execution-traces"
                ],
                "summary": "Update rule-execution-trace",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleExecutionTraceUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleExecutionTraceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-execution-traces"
                ],
                "summary": "Delete rule-execution-trace",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "rule-execution-traces"
                ],
                "summary": "Patch rule-execution-traces",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleExecutionTracePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.RuleExecutionTraceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategies": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Phase 1 strategy list contract. Supports only accepted filters and returns the items/page cursor envelope.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategies"
                ],
                "summary": "List strategies",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Case-insensitive name search",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "draft",
                            "active",
                            "paused",
                            "archived"
                        ],
                        "type": "string",
                        "description": "Strategy status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "multi_leg"
                        ],
                        "type": "string",
                        "description": "Phase 1 strategy kind",
                        "name": "strategy_kind",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Updated-at lower bound in YYYY-MM-DD format",
                        "name": "updated_from",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Updated-at upper bound in YYYY-MM-DD format",
                        "name": "updated_to",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Sort as updated_at|created_at|name|status followed by :asc or :desc",
                        "name": "sort",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page size, maximum 100",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor returned as page.next_cursor",
                        "name": "cursor",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategies"
                ],
                "summary": "Create strategy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategies/operand-catalog": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategies"
                ],
                "summary": "Strategy operand catalog",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.read or strategy.write or strategy.view",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyOperandCatalogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategies/validate": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategies"
                ],
                "summary": "Validate strategy config",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.write",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyValidateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyValidateResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategies/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategies"
                ],
                "summary": "Get strategy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategies"
                ],
                "summary": "Update strategy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategies"
                ],
                "summary": "Delete strategy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategies"
                ],
                "summary": "Patch strategies",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategies/{id}/versions": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategies"
                ],
                "summary": "Create strategy version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.write",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyVersionCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyVersionCreateResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-deployments": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-deployments"
                ],
                "summary": "List strategy-deployments",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyDeploymentListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-deployments"
                ],
                "summary": "Create strategy-deployment",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyDeploymentCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyDeploymentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-deployments/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-deployments"
                ],
                "summary": "Get strategy-deployment",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyDeploymentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-deployments"
                ],
                "summary": "Update strategy-deployment",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyDeploymentUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyDeploymentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-deployments"
                ],
                "summary": "Delete strategy-deployment",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-deployments"
                ],
                "summary": "Patch strategy-deployments",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyDeploymentPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyDeploymentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-runs": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "List strategy-runs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "status",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyRunListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Create strategy-run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyRunCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyRunResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-runs/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Get strategy-run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyRunResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Update strategy-run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyRunUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyRunResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Delete strategy-run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Patch strategy-runs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyRunPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyRunResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-runs/{id}/emergency-stop": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Emergency-stop strategy run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires order.manage",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunStopRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunLifecycleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-runs/{id}/monitor": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Strategy run monitor",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.run.read",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunMonitorResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-runs/{id}/pause": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Pause strategy run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.run.stop",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunPauseRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunLifecycleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-runs/{id}/resume": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Resume strategy run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.run",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunResumeRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunLifecycleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-runs/{id}/start": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Start strategy run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires ",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunStartRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunLifecycleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-runs/{id}/stop": {
            "post": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Custom algotrade workflow boundary.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-runs"
                ],
                "summary": "Stop strategy run",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID; production requests must match JWT tenant_id",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Dev/test-only comma-separated permissions; production uses bearer JWT permissions/scope and requires strategy.run.stop",
                        "name": "X-PERMISSIONS",
                        "in": "header"
                    },
                    {
                        "description": "Request payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunStopRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/httpapi.StrategyRunLifecycleResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpapi.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-versions": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-versions"
                ],
                "summary": "List strategy-versions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "change_note",
                                "config",
                                "created_at",
                                "data",
                                "deleted_at",
                                "id",
                                "schema",
                                "status",
                                "strategy.created_at",
                                "strategy.data",
                                "strategy.deleted_at",
                                "strategy.description",
                                "strategy.id",
                                "strategy.labels",
                                "strategy.metadata",
                                "strategy.name",
                                "strategy.owner_user_id",
                                "strategy.status",
                                "strategy.strategy_kind",
                                "strategy.updated_at",
                                "strategy_id",
                                "strategy_kind",
                                "updated_at",
                                "validation_errors",
                                "validation_status",
                                "version"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "strategy"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Include relations",
                        "name": "include",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: change_note, schema, status, strategy_id, strategy_kind, tenant_id, validation_status, version, strategy.description, strategy.name, strategy.owner_user_id, strategy.status, strategy.strategy_kind, strategy.tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyVersionListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-versions"
                ],
                "summary": "Create strategy-version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyVersionCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyVersionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/strategy-versions/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-versions"
                ],
                "summary": "Get strategy-version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyVersionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-versions"
                ],
                "summary": "Update strategy-version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyVersionUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyVersionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-versions"
                ],
                "summary": "Delete strategy-version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "strategy-versions"
                ],
                "summary": "Patch strategy-versions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyVersionPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.StrategyVersionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/trades": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "trades"
                ],
                "summary": "List trades",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "account_id",
                                "broker_account_id",
                                "broker_trade_id",
                                "created_at",
                                "data",
                                "deleted_at",
                                "executed_at",
                                "fees",
                                "id",
                                "instrument_id",
                                "liquidity",
                                "notional",
                                "order_id",
                                "position_effect",
                                "price",
                                "provider_payload_id",
                                "quantity",
                                "settlement_status",
                                "side",
                                "strategy_id",
                                "strategy_leg_id",
                                "strategy_run_id",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: account_id, broker_account_id, broker_trade_id, executed_at, fees, instrument_id, liquidity, notional, order_id, position_effect, price, provider_payload_id, quantity, settlement_status, side, strategy_id, strategy_leg_id, strategy_run_id, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TradeListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "trades"
                ],
                "summary": "Create trade",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TradeCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.TradeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/trades/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "trades"
                ],
                "summary": "Get trade",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TradeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "trades"
                ],
                "summary": "Update trade",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TradeUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TradeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "trades"
                ],
                "summary": "Delete trade",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "trades"
                ],
                "summary": "Patch trades",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.TradePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.TradeResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "handlers.AccountBalanceCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AccountBalanceListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AccountBalanceResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AccountBalancePatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AccountBalanceResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AccountBalanceUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AccountCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AccountListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AccountResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AccountPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AccountResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AccountUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AlertDeliveryCreateRequest": {
            "type": "object",
            "required": [
                "alert_event_id",
                "attempt_count",
                "channel",
                "destination",
                "status"
            ],
            "properties": {
                "alert_event_id": {
                    "type": "string"
                },
                "attempt_count": {
                    "type": "integer"
                },
                "channel": {
                    "type": "string",
                    "enum": [
                        "push",
                        "email",
                        "sms",
                        "telegram",
                        "whatsapp"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "destination": {
                    "type": "string"
                },
                "failure_reason": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_ref": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "queued",
                        "sending",
                        "delivered",
                        "failed",
                        "canceled"
                    ]
                }
            }
        },
        "handlers.AlertDeliveryListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AlertDeliveryResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AlertDeliveryPatchRequest": {
            "type": "object",
            "properties": {
                "alert_event_id": {
                    "type": "string"
                },
                "attempt_count": {
                    "type": "integer"
                },
                "channel": {
                    "type": "string",
                    "enum": [
                        "push",
                        "email",
                        "sms",
                        "telegram",
                        "whatsapp"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "destination": {
                    "type": "string"
                },
                "failure_reason": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_ref": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "queued",
                        "sending",
                        "delivered",
                        "failed",
                        "canceled"
                    ]
                }
            }
        },
        "handlers.AlertDeliveryResponse": {
            "type": "object",
            "properties": {
                "alert_event_id": {
                    "type": "string"
                },
                "alert_rule_id": {
                    "type": "string"
                },
                "attempt_count": {
                    "type": "integer"
                },
                "channel": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "delivered_at": {
                    "type": "string"
                },
                "failure_reason": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_ref": {
                    "type": "string"
                },
                "queued_at": {
                    "type": "string"
                },
                "sent_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AlertDeliveryUpdateRequest": {
            "type": "object",
            "properties": {
                "alert_event_id": {
                    "type": "string"
                },
                "attempt_count": {
                    "type": "integer"
                },
                "channel": {
                    "type": "string",
                    "enum": [
                        "push",
                        "email",
                        "sms",
                        "telegram",
                        "whatsapp"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "destination": {
                    "type": "string"
                },
                "failure_reason": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_ref": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "queued",
                        "sending",
                        "delivered",
                        "failed",
                        "canceled"
                    ]
                }
            }
        },
        "handlers.AlertEventCreateRequest": {
            "type": "object",
            "required": [
                "event_type",
                "message",
                "severity",
                "status",
                "title"
            ],
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "event_type": {
                    "type": "string",
                    "enum": [
                        "order_submitted",
                        "order_filled",
                        "order_rejected",
                        "position_opened",
                        "position_closed",
                        "risk_breached",
                        "strategy_halted",
                        "backtest_completed",
                        "broker_disconnected",
                        "kill_switch_triggered"
                    ]
                },
                "message": {
                    "type": "string"
                },
                "severity": {
                    "type": "string",
                    "enum": [
                        "info",
                        "warning",
                        "critical"
                    ]
                },
                "source_id": {
                    "type": "string"
                },
                "source_type": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "created",
                        "queued",
                        "delivered",
                        "failed",
                        "acknowledged"
                    ]
                },
                "title": {
                    "type": "string"
                }
            }
        },
        "handlers.AlertEventListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AlertEventResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AlertEventPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "event_type": {
                    "type": "string",
                    "enum": [
                        "order_submitted",
                        "order_filled",
                        "order_rejected",
                        "position_opened",
                        "position_closed",
                        "risk_breached",
                        "strategy_halted",
                        "backtest_completed",
                        "broker_disconnected",
                        "kill_switch_triggered"
                    ]
                },
                "message": {
                    "type": "string"
                },
                "severity": {
                    "type": "string",
                    "enum": [
                        "info",
                        "warning",
                        "critical"
                    ]
                },
                "source_id": {
                    "type": "string"
                },
                "source_type": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "created",
                        "queued",
                        "delivered",
                        "failed",
                        "acknowledged"
                    ]
                },
                "title": {
                    "type": "string"
                }
            }
        },
        "handlers.AlertEventResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "acknowledged_at": {
                    "type": "string"
                },
                "alert_rule_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "event_type": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "occurred_at": {
                    "type": "string"
                },
                "severity": {
                    "type": "string"
                },
                "source_id": {
                    "type": "string"
                },
                "source_type": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AlertEventUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "event_type": {
                    "type": "string",
                    "enum": [
                        "order_submitted",
                        "order_filled",
                        "order_rejected",
                        "position_opened",
                        "position_closed",
                        "risk_breached",
                        "strategy_halted",
                        "backtest_completed",
                        "broker_disconnected",
                        "kill_switch_triggered"
                    ]
                },
                "message": {
                    "type": "string"
                },
                "severity": {
                    "type": "string",
                    "enum": [
                        "info",
                        "warning",
                        "critical"
                    ]
                },
                "source_id": {
                    "type": "string"
                },
                "source_type": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "created",
                        "queued",
                        "delivered",
                        "failed",
                        "acknowledged"
                    ]
                },
                "title": {
                    "type": "string"
                }
            }
        },
        "handlers.AlertRuleCreateRequest": {
            "type": "object",
            "required": [
                "channel",
                "destination",
                "destination_verification_status",
                "event_type",
                "name",
                "status"
            ],
            "properties": {
                "channel": {
                    "type": "string",
                    "enum": [
                        "push",
                        "email",
                        "sms",
                        "telegram",
                        "whatsapp"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "destination": {
                    "type": "string"
                },
                "destination_verification_status": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "verified",
                        "failed"
                    ]
                },
                "destination_verified": {
                    "type": "boolean"
                },
                "event_type": {
                    "type": "string",
                    "enum": [
                        "order_submitted",
                        "order_filled",
                        "order_rejected",
                        "position_opened",
                        "position_closed",
                        "risk_breached",
                        "strategy_halted",
                        "backtest_completed",
                        "broker_disconnected",
                        "kill_switch_triggered"
                    ]
                },
                "filters": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "handlers.AlertRuleListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AlertRuleResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AlertRulePatchRequest": {
            "type": "object",
            "properties": {
                "channel": {
                    "type": "string",
                    "enum": [
                        "push",
                        "email",
                        "sms",
                        "telegram",
                        "whatsapp"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "destination": {
                    "type": "string"
                },
                "destination_verification_status": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "verified",
                        "failed"
                    ]
                },
                "destination_verified": {
                    "type": "boolean"
                },
                "event_type": {
                    "type": "string",
                    "enum": [
                        "order_submitted",
                        "order_filled",
                        "order_rejected",
                        "position_opened",
                        "position_closed",
                        "risk_breached",
                        "strategy_halted",
                        "backtest_completed",
                        "broker_disconnected",
                        "kill_switch_triggered"
                    ]
                },
                "filters": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "handlers.AlertRuleResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "channel": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "destination_verification_status": {
                    "type": "string"
                },
                "destination_verified": {
                    "type": "boolean"
                },
                "event_type": {
                    "type": "string"
                },
                "filters": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "id": {
                    "type": "string"
                },
                "last_triggered_at": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "handlers.AlertRuleUpdateRequest": {
            "type": "object",
            "properties": {
                "channel": {
                    "type": "string",
                    "enum": [
                        "push",
                        "email",
                        "sms",
                        "telegram",
                        "whatsapp"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "destination": {
                    "type": "string"
                },
                "destination_verification_status": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "verified",
                        "failed"
                    ]
                },
                "destination_verified": {
                    "type": "boolean"
                },
                "event_type": {
                    "type": "string",
                    "enum": [
                        "order_submitted",
                        "order_filled",
                        "order_rejected",
                        "position_opened",
                        "position_closed",
                        "risk_breached",
                        "strategy_halted",
                        "backtest_completed",
                        "broker_disconnected",
                        "kill_switch_triggered"
                    ]
                },
                "filters": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "handlers.AuditLogCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AuditLogListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AuditLogResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AuditLogPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AuditLogResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AuditLogUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.BacktestPositionCreateRequest": {
            "type": "object",
            "required": [
                "avg_entry_price",
                "backtest_run_id",
                "instrument_id",
                "quantity",
                "realized_pnl",
                "side",
                "status",
                "strategy_id",
                "strategy_version_id",
                "unrealized_pnl"
            ],
            "properties": {
                "avg_entry_price": {
                    "type": "number"
                },
                "backtest_run_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "exit_price": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "long",
                        "short",
                        "flat"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "closed"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.BacktestPositionListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.BacktestPositionResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.BacktestPositionPatchRequest": {
            "type": "object",
            "properties": {
                "avg_entry_price": {
                    "type": "number"
                },
                "backtest_run_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "exit_price": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "long",
                        "short",
                        "flat"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "closed"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.BacktestPositionResponse": {
            "type": "object",
            "properties": {
                "avg_entry_price": {
                    "type": "number"
                },
                "backtest_run_id": {
                    "type": "string"
                },
                "closed_at": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "exit_price": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "opened_at": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "unrealized_pnl": {
                    "type": "number"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.BacktestPositionUpdateRequest": {
            "type": "object",
            "properties": {
                "avg_entry_price": {
                    "type": "number"
                },
                "backtest_run_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "exit_price": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "long",
                        "short",
                        "flat"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "closed"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.BacktestRunCreateRequest": {
            "type": "object",
            "required": [
                "brokerage_bps",
                "date_from",
                "date_to",
                "initial_capital",
                "slippage_bps",
                "status",
                "strategy_id",
                "strategy_version_id"
            ],
            "properties": {
                "assumptions": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "brokerage_bps": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "date_from": {
                    "type": "string"
                },
                "date_to": {
                    "type": "string"
                },
                "error_code": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "initial_capital": {
                    "type": "number"
                },
                "slippage_bps": {
                    "type": "number"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "queued",
                        "running",
                        "completed",
                        "failed",
                        "canceled"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "handlers.BacktestRunListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.BacktestRunResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.BacktestRunPatchRequest": {
            "type": "object",
            "properties": {
                "assumptions": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "brokerage_bps": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "date_from": {
                    "type": "string"
                },
                "date_to": {
                    "type": "string"
                },
                "error_code": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "initial_capital": {
                    "type": "number"
                },
                "slippage_bps": {
                    "type": "number"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "queued",
                        "running",
                        "completed",
                        "failed",
                        "canceled"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "handlers.BacktestRunResponse": {
            "type": "object",
            "properties": {
                "assumptions": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "brokerage_bps": {
                    "type": "number"
                },
                "completed_at": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "date_from": {
                    "type": "string"
                },
                "date_to": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "error_code": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "initial_capital": {
                    "type": "number"
                },
                "slippage_bps": {
                    "type": "number"
                },
                "started_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.BacktestRunUpdateRequest": {
            "type": "object",
            "properties": {
                "assumptions": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "brokerage_bps": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "date_from": {
                    "type": "string"
                },
                "date_to": {
                    "type": "string"
                },
                "error_code": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "initial_capital": {
                    "type": "number"
                },
                "slippage_bps": {
                    "type": "number"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "queued",
                        "running",
                        "completed",
                        "failed",
                        "canceled"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "handlers.BacktestTradeCreateRequest": {
            "type": "object",
            "required": [
                "backtest_run_id",
                "fees",
                "instrument_id",
                "notional",
                "price",
                "quantity",
                "realized_pnl",
                "side",
                "slippage",
                "strategy_id",
                "strategy_version_id"
            ],
            "properties": {
                "backtest_run_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "fees": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "notional": {
                    "type": "number"
                },
                "price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "buy",
                        "sell"
                    ]
                },
                "slippage": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "handlers.BacktestTradeListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.BacktestTradeResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.BacktestTradePatchRequest": {
            "type": "object",
            "properties": {
                "backtest_run_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "fees": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "notional": {
                    "type": "number"
                },
                "price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "buy",
                        "sell"
                    ]
                },
                "slippage": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "handlers.BacktestTradeResponse": {
            "type": "object",
            "properties": {
                "backtest_run_id": {
                    "type": "string"
                },
                "bar_time": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "executed_at": {
                    "type": "string"
                },
                "fees": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "notional": {
                    "type": "number"
                },
                "price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string"
                },
                "slippage": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.BacktestTradeUpdateRequest": {
            "type": "object",
            "properties": {
                "backtest_run_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "fees": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "notional": {
                    "type": "number"
                },
                "price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "buy",
                        "sell"
                    ]
                },
                "slippage": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "handlers.BrokerAccountCreateRequest": {
            "type": "object",
            "required": [
                "account_id",
                "broker",
                "broker_account_ref",
                "environment",
                "status"
            ],
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "broker": {
                    "type": "string"
                },
                "broker_account_ref": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "display_name": {
                    "type": "string"
                },
                "environment": {
                    "type": "string",
                    "enum": [
                        "paper",
                        "sandbox",
                        "live"
                    ]
                },
                "is_paper": {
                    "type": "boolean"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "disabled",
                        "suspended",
                        "archived"
                    ]
                }
            }
        },
        "handlers.BrokerAccountListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.BrokerAccountResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.BrokerAccountPatchRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "broker": {
                    "type": "string"
                },
                "broker_account_ref": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "display_name": {
                    "type": "string"
                },
                "environment": {
                    "type": "string",
                    "enum": [
                        "paper",
                        "sandbox",
                        "live"
                    ]
                },
                "is_paper": {
                    "type": "boolean"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "disabled",
                        "suspended",
                        "archived"
                    ]
                }
            }
        },
        "handlers.BrokerAccountResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "broker": {
                    "type": "string"
                },
                "broker_account_ref": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "environment": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "is_paper": {
                    "type": "boolean"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "verified_at": {
                    "type": "string"
                }
            }
        },
        "handlers.BrokerAccountUpdateRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "broker": {
                    "type": "string"
                },
                "broker_account_ref": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "display_name": {
                    "type": "string"
                },
                "environment": {
                    "type": "string",
                    "enum": [
                        "paper",
                        "sandbox",
                        "live"
                    ]
                },
                "is_paper": {
                    "type": "boolean"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "disabled",
                        "suspended",
                        "archived"
                    ]
                }
            }
        },
        "handlers.BrokerCredentialListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.BrokerCredentialResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.BrokerCredentialMaterial": {
            "type": "object",
            "additionalProperties": {
                "type": "string"
            }
        },
        "handlers.BrokerCredentialResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "broker": {
                    "type": "string"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "credential_type": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "environment": {
                    "type": "string"
                },
                "expires_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "last_verified_at": {
                    "type": "string"
                },
                "secret_ref": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.BrokerCredentialSecretResponse": {
            "type": "object",
            "properties": {
                "broker_account_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "credential_type": {
                    "type": "string"
                },
                "enabled": {
                    "type": "boolean"
                },
                "id": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "secret_ref": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.BrokerCredentialWriteRequest": {
            "type": "object",
            "properties": {
                "broker_account_id": {
                    "type": "string"
                },
                "credential_material": {
                    "$ref": "#/definitions/handlers.BrokerCredentialMaterial"
                },
                "credential_type": {
                    "type": "string"
                },
                "enabled": {
                    "type": "boolean"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "handlers.CandleCreateRequest": {
            "type": "object",
            "required": [
                "close",
                "end_time",
                "exchange_code",
                "high",
                "instrument_id",
                "low",
                "open",
                "provider",
                "provider_instrument_id",
                "start_time",
                "symbol",
                "timeframe"
            ],
            "properties": {
                "close": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "end_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "high": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "low": {
                    "type": "number"
                },
                "open": {
                    "type": "number"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "start_time": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "timeframe": {
                    "type": "string",
                    "enum": [
                        "1m",
                        "3m",
                        "5m",
                        "15m",
                        "30m",
                        "1h",
                        "1d",
                        "1w"
                    ]
                },
                "turnover": {
                    "type": "number"
                },
                "volume": {
                    "type": "number"
                }
            }
        },
        "handlers.CandleListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.CandleResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.CandlePatchRequest": {
            "type": "object",
            "properties": {
                "close": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "end_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "high": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "low": {
                    "type": "number"
                },
                "open": {
                    "type": "number"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "start_time": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "timeframe": {
                    "type": "string",
                    "enum": [
                        "1m",
                        "3m",
                        "5m",
                        "15m",
                        "30m",
                        "1h",
                        "1d",
                        "1w"
                    ]
                },
                "turnover": {
                    "type": "number"
                },
                "volume": {
                    "type": "number"
                }
            }
        },
        "handlers.CandleResponse": {
            "type": "object",
            "properties": {
                "close": {
                    "type": "number"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "end_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "high": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "low": {
                    "type": "number"
                },
                "open": {
                    "type": "number"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "start_time": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "timeframe": {
                    "type": "string"
                },
                "turnover": {
                    "type": "number"
                },
                "updated_at": {
                    "type": "string"
                },
                "volume": {
                    "type": "number"
                }
            }
        },
        "handlers.CandleUpdateRequest": {
            "type": "object",
            "properties": {
                "close": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "end_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "high": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "low": {
                    "type": "number"
                },
                "open": {
                    "type": "number"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "start_time": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "timeframe": {
                    "type": "string",
                    "enum": [
                        "1m",
                        "3m",
                        "5m",
                        "15m",
                        "30m",
                        "1h",
                        "1d",
                        "1w"
                    ]
                },
                "turnover": {
                    "type": "number"
                },
                "volume": {
                    "type": "number"
                }
            }
        },
        "handlers.DebugPriceOverrideCreateRequest": {
            "type": "object",
            "required": [
                "debug_session_id",
                "instrument_id",
                "status"
            ],
            "properties": {
                "ask": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "debug_session_id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last": {
                    "type": "number"
                },
                "reason": {
                    "type": "string"
                },
                "spread": {
                    "type": "number"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "expired",
                        "canceled"
                    ]
                }
            }
        },
        "handlers.DebugPriceOverrideListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.DebugPriceOverrideResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.DebugPriceOverridePatchRequest": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "debug_session_id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last": {
                    "type": "number"
                },
                "reason": {
                    "type": "string"
                },
                "spread": {
                    "type": "number"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "expired",
                        "canceled"
                    ]
                }
            }
        },
        "handlers.DebugPriceOverrideResponse": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "debug_session_id": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "effective_at": {
                    "type": "string"
                },
                "expires_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last": {
                    "type": "number"
                },
                "reason": {
                    "type": "string"
                },
                "spread": {
                    "type": "number"
                },
                "status": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.DebugPriceOverrideUpdateRequest": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "debug_session_id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last": {
                    "type": "number"
                },
                "reason": {
                    "type": "string"
                },
                "spread": {
                    "type": "number"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "expired",
                        "canceled"
                    ]
                }
            }
        },
        "handlers.DebugSessionCreateRequest": {
            "type": "object",
            "required": [
                "mode",
                "status",
                "strategy_id",
                "strategy_version_id"
            ],
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "mode": {
                    "type": "string",
                    "enum": [
                        "dry_cycle",
                        "condition_trace",
                        "price_override"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "completed",
                        "expired",
                        "canceled"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "handlers.DebugSessionListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.DebugSessionResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.DebugSessionPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "mode": {
                    "type": "string",
                    "enum": [
                        "dry_cycle",
                        "condition_trace",
                        "price_override"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "completed",
                        "expired",
                        "canceled"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "handlers.DebugSessionResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "ended_at": {
                    "type": "string"
                },
                "expires_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "mode": {
                    "type": "string"
                },
                "started_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.DebugSessionUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "mode": {
                    "type": "string",
                    "enum": [
                        "dry_cycle",
                        "condition_trace",
                        "price_override"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "completed",
                        "expired",
                        "canceled"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "handlers.ErrorBody": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "details": {},
                "message": {
                    "type": "string"
                },
                "request_id": {
                    "type": "string"
                }
            }
        },
        "handlers.ExchangeCreateRequest": {
            "type": "object",
            "required": [
                "exchange_code",
                "name",
                "provider",
                "timezone"
            ],
            "properties": {
                "country": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "exchange_code": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "mic": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "timezone": {
                    "type": "string"
                },
                "trading_calendar": {
                    "type": "object",
                    "additionalProperties": {}
                }
            }
        },
        "handlers.ExchangeListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ExchangeResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.ExchangePatchRequest": {
            "type": "object",
            "properties": {
                "country": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "exchange_code": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "mic": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "timezone": {
                    "type": "string"
                },
                "trading_calendar": {
                    "type": "object",
                    "additionalProperties": {}
                }
            }
        },
        "handlers.ExchangeResponse": {
            "type": "object",
            "properties": {
                "country": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "mic": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "timezone": {
                    "type": "string"
                },
                "trading_calendar": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.ExchangeUpdateRequest": {
            "type": "object",
            "properties": {
                "country": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "exchange_code": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "mic": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "timezone": {
                    "type": "string"
                },
                "trading_calendar": {
                    "type": "object",
                    "additionalProperties": {}
                }
            }
        },
        "handlers.ExecutionLogCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ExecutionLogListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ExecutionLogResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.ExecutionLogPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ExecutionLogResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.ExecutionLogUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ExternalSyncStateCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ExternalSyncStateListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ExternalSyncStateResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.ExternalSyncStatePatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ExternalSyncStateResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.ExternalSyncStateUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.InstrumentCreateRequest": {
            "type": "object",
            "required": [
                "asset_class",
                "exchange_code",
                "exchange_id",
                "name",
                "provider",
                "provider_instrument_id",
                "symbol",
                "trading_symbol"
            ],
            "properties": {
                "asset_class": {
                    "type": "string",
                    "enum": [
                        "equity",
                        "option",
                        "future",
                        "crypto",
                        "forex",
                        "commodity",
                        "prediction_market"
                    ]
                },
                "base_asset": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "exchange_code": {
                    "type": "string"
                },
                "exchange_id": {
                    "type": "string"
                },
                "expiry": {
                    "type": "string"
                },
                "instrument_type": {
                    "type": "string"
                },
                "lot_size": {
                    "type": "number"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "option_type": {
                    "type": "string",
                    "enum": [
                        "call",
                        "put"
                    ]
                },
                "provider": {
                    "type": "string"
                },
                "provider_attributes": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "quote_asset": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strike": {
                    "type": "number"
                },
                "symbol": {
                    "type": "string"
                },
                "tick_size": {
                    "type": "number"
                },
                "tradable": {
                    "type": "boolean"
                },
                "trading_symbol": {
                    "type": "string"
                }
            }
        },
        "handlers.InstrumentListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.InstrumentResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.InstrumentPatchRequest": {
            "type": "object",
            "properties": {
                "asset_class": {
                    "type": "string",
                    "enum": [
                        "equity",
                        "option",
                        "future",
                        "crypto",
                        "forex",
                        "commodity",
                        "prediction_market"
                    ]
                },
                "base_asset": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "exchange_code": {
                    "type": "string"
                },
                "exchange_id": {
                    "type": "string"
                },
                "expiry": {
                    "type": "string"
                },
                "instrument_type": {
                    "type": "string"
                },
                "lot_size": {
                    "type": "number"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "option_type": {
                    "type": "string",
                    "enum": [
                        "call",
                        "put"
                    ]
                },
                "provider": {
                    "type": "string"
                },
                "provider_attributes": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "quote_asset": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strike": {
                    "type": "number"
                },
                "symbol": {
                    "type": "string"
                },
                "tick_size": {
                    "type": "number"
                },
                "tradable": {
                    "type": "boolean"
                },
                "trading_symbol": {
                    "type": "string"
                }
            }
        },
        "handlers.InstrumentResponse": {
            "type": "object",
            "properties": {
                "asset_class": {
                    "type": "string"
                },
                "base_asset": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "exchange_id": {
                    "type": "string"
                },
                "expiry": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "instrument_type": {
                    "type": "string"
                },
                "lot_size": {
                    "type": "number"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "option_type": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_attributes": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "quote_asset": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strike": {
                    "type": "number"
                },
                "symbol": {
                    "type": "string"
                },
                "tick_size": {
                    "type": "number"
                },
                "tradable": {
                    "type": "boolean"
                },
                "trading_symbol": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.InstrumentUpdateRequest": {
            "type": "object",
            "properties": {
                "asset_class": {
                    "type": "string",
                    "enum": [
                        "equity",
                        "option",
                        "future",
                        "crypto",
                        "forex",
                        "commodity",
                        "prediction_market"
                    ]
                },
                "base_asset": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "exchange_code": {
                    "type": "string"
                },
                "exchange_id": {
                    "type": "string"
                },
                "expiry": {
                    "type": "string"
                },
                "instrument_type": {
                    "type": "string"
                },
                "lot_size": {
                    "type": "number"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "option_type": {
                    "type": "string",
                    "enum": [
                        "call",
                        "put"
                    ]
                },
                "provider": {
                    "type": "string"
                },
                "provider_attributes": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "quote_asset": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strike": {
                    "type": "number"
                },
                "symbol": {
                    "type": "string"
                },
                "tick_size": {
                    "type": "number"
                },
                "tradable": {
                    "type": "boolean"
                },
                "trading_symbol": {
                    "type": "string"
                }
            }
        },
        "handlers.MarketFeedCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.MarketFeedListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.MarketFeedResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.MarketFeedPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.MarketFeedResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.MarketFeedUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.MarketTickCreateRequest": {
            "type": "object",
            "required": [
                "event_time",
                "exchange_code",
                "instrument_id",
                "last_price",
                "provider",
                "provider_instrument_id",
                "symbol"
            ],
            "properties": {
                "ask": {
                    "type": "number"
                },
                "ask_size": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "bid_size": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "event_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last_price": {
                    "type": "number"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "received_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "volume": {
                    "type": "number"
                }
            }
        },
        "handlers.MarketTickListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.MarketTickResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.MarketTickPatchRequest": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "ask_size": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "bid_size": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "event_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last_price": {
                    "type": "number"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "received_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "volume": {
                    "type": "number"
                }
            }
        },
        "handlers.MarketTickResponse": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "ask_size": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "bid_size": {
                    "type": "number"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "event_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last_price": {
                    "type": "number"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "received_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "volume": {
                    "type": "number"
                }
            }
        },
        "handlers.MarketTickUpdateRequest": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "ask_size": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "bid_size": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "event_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last_price": {
                    "type": "number"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "received_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "volume": {
                    "type": "number"
                }
            }
        },
        "handlers.OrderBookSnapshotCreateRequest": {
            "type": "object",
            "required": [
                "asks",
                "bids",
                "event_time",
                "exchange_code",
                "instrument_id",
                "provider",
                "provider_instrument_id",
                "symbol"
            ],
            "properties": {
                "asks": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "best_ask": {
                    "type": "number"
                },
                "best_bid": {
                    "type": "number"
                },
                "bids": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "depth": {
                    "type": "integer"
                },
                "event_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "received_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderBookSnapshotListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.OrderBookSnapshotResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.OrderBookSnapshotPatchRequest": {
            "type": "object",
            "properties": {
                "asks": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "best_ask": {
                    "type": "number"
                },
                "best_bid": {
                    "type": "number"
                },
                "bids": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "depth": {
                    "type": "integer"
                },
                "event_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "received_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderBookSnapshotResponse": {
            "type": "object",
            "properties": {
                "asks": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "best_ask": {
                    "type": "number"
                },
                "best_bid": {
                    "type": "number"
                },
                "bids": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "depth": {
                    "type": "integer"
                },
                "event_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "received_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderBookSnapshotUpdateRequest": {
            "type": "object",
            "properties": {
                "asks": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "best_ask": {
                    "type": "number"
                },
                "best_bid": {
                    "type": "number"
                },
                "bids": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "depth": {
                    "type": "integer"
                },
                "event_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "provider_payload": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "received_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderCreateRequest": {
            "type": "object",
            "required": [
                "account_id",
                "broker_account_id",
                "filled_quantity",
                "idempotency_key",
                "instrument_id",
                "order_type",
                "quantity",
                "side",
                "status",
                "strategy_id",
                "strategy_run_id"
            ],
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "avg_fill_price": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "broker_order_id": {
                    "type": "string"
                },
                "client_order_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "filled_quantity": {
                    "type": "number"
                },
                "idempotency_key": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "order_type": {
                    "type": "string",
                    "enum": [
                        "market",
                        "limit",
                        "stop",
                        "stop_limit"
                    ]
                },
                "price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "buy",
                        "sell"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "pending",
                        "submitted",
                        "open",
                        "partially_filled",
                        "filled",
                        "canceled",
                        "expired",
                        "rejected",
                        "failed"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderEventCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderEventListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.OrderEventResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.OrderEventPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderEventResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderEventUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.OrderResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.OrderPatchRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "avg_fill_price": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "broker_order_id": {
                    "type": "string"
                },
                "client_order_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "filled_quantity": {
                    "type": "number"
                },
                "idempotency_key": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "order_type": {
                    "type": "string",
                    "enum": [
                        "market",
                        "limit",
                        "stop",
                        "stop_limit"
                    ]
                },
                "price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "buy",
                        "sell"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "pending",
                        "submitted",
                        "open",
                        "partially_filled",
                        "filled",
                        "canceled",
                        "expired",
                        "rejected",
                        "failed"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "avg_fill_price": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "broker_order_id": {
                    "type": "string"
                },
                "client_order_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "filled_at": {
                    "type": "string"
                },
                "filled_quantity": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "idempotency_key": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "order_type": {
                    "type": "string"
                },
                "price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "side": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "submitted_at": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.OrderUpdateRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "avg_fill_price": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "broker_order_id": {
                    "type": "string"
                },
                "client_order_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "filled_quantity": {
                    "type": "number"
                },
                "idempotency_key": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "order_type": {
                    "type": "string",
                    "enum": [
                        "market",
                        "limit",
                        "stop",
                        "stop_limit"
                    ]
                },
                "price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "buy",
                        "sell"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "pending",
                        "submitted",
                        "open",
                        "partially_filled",
                        "filled",
                        "canceled",
                        "expired",
                        "rejected",
                        "failed"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                }
            }
        },
        "handlers.PerformanceMetricCreateRequest": {
            "type": "object",
            "required": [
                "backtest_run_id",
                "losing_trades",
                "max_drawdown",
                "metric_type",
                "realized_pnl",
                "strategy_id",
                "strategy_version_id",
                "total_pnl",
                "trade_count",
                "unrealized_pnl",
                "win_rate",
                "winning_trades"
            ],
            "properties": {
                "backtest_run_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "losing_trades": {
                    "type": "integer"
                },
                "max_drawdown": {
                    "type": "number"
                },
                "metric_date": {
                    "type": "string"
                },
                "metric_type": {
                    "type": "string",
                    "enum": [
                        "summary",
                        "daily",
                        "monthly"
                    ]
                },
                "realized_pnl": {
                    "type": "number"
                },
                "sharpe": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "total_pnl": {
                    "type": "number"
                },
                "trade_count": {
                    "type": "integer"
                },
                "unrealized_pnl": {
                    "type": "number"
                },
                "win_rate": {
                    "type": "number"
                },
                "winning_trades": {
                    "type": "integer"
                }
            }
        },
        "handlers.PerformanceMetricListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.PerformanceMetricResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.PerformanceMetricPatchRequest": {
            "type": "object",
            "properties": {
                "backtest_run_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "losing_trades": {
                    "type": "integer"
                },
                "max_drawdown": {
                    "type": "number"
                },
                "metric_date": {
                    "type": "string"
                },
                "metric_type": {
                    "type": "string",
                    "enum": [
                        "summary",
                        "daily",
                        "monthly"
                    ]
                },
                "realized_pnl": {
                    "type": "number"
                },
                "sharpe": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "total_pnl": {
                    "type": "number"
                },
                "trade_count": {
                    "type": "integer"
                },
                "unrealized_pnl": {
                    "type": "number"
                },
                "win_rate": {
                    "type": "number"
                },
                "winning_trades": {
                    "type": "integer"
                }
            }
        },
        "handlers.PerformanceMetricResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "backtest_run_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "losing_trades": {
                    "type": "integer"
                },
                "max_drawdown": {
                    "type": "number"
                },
                "metric_date": {
                    "type": "string"
                },
                "metric_type": {
                    "type": "string"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "sharpe": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "total_pnl": {
                    "type": "number"
                },
                "trade_count": {
                    "type": "integer"
                },
                "unrealized_pnl": {
                    "type": "number"
                },
                "updated_at": {
                    "type": "string"
                },
                "win_rate": {
                    "type": "number"
                },
                "winning_trades": {
                    "type": "integer"
                }
            }
        },
        "handlers.PerformanceMetricUpdateRequest": {
            "type": "object",
            "properties": {
                "backtest_run_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "losing_trades": {
                    "type": "integer"
                },
                "max_drawdown": {
                    "type": "number"
                },
                "metric_date": {
                    "type": "string"
                },
                "metric_type": {
                    "type": "string",
                    "enum": [
                        "summary",
                        "daily",
                        "monthly"
                    ]
                },
                "realized_pnl": {
                    "type": "number"
                },
                "sharpe": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "total_pnl": {
                    "type": "number"
                },
                "trade_count": {
                    "type": "integer"
                },
                "unrealized_pnl": {
                    "type": "number"
                },
                "win_rate": {
                    "type": "number"
                },
                "winning_trades": {
                    "type": "integer"
                }
            }
        },
        "handlers.PnLSnapshotCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.PnLSnapshotListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.PnLSnapshotResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.PnLSnapshotPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.PnLSnapshotResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.PnLSnapshotUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.PortfolioAccountCreateRequest": {
            "type": "object",
            "required": [
                "account_id",
                "allocation_pct",
                "capital_limit",
                "current_exposure",
                "portfolio_id",
                "status"
            ],
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "allocation_pct": {
                    "type": "number"
                },
                "capital_limit": {
                    "type": "number"
                },
                "current_exposure": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "portfolio_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "removed"
                    ]
                }
            }
        },
        "handlers.PortfolioAccountListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.PortfolioAccountResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.PortfolioAccountPatchRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "allocation_pct": {
                    "type": "number"
                },
                "capital_limit": {
                    "type": "number"
                },
                "current_exposure": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "portfolio_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "removed"
                    ]
                }
            }
        },
        "handlers.PortfolioAccountResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "allocation_pct": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "capital_limit": {
                    "type": "number"
                },
                "created_at": {
                    "type": "string"
                },
                "current_exposure": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.PortfolioAccountUpdateRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "allocation_pct": {
                    "type": "number"
                },
                "capital_limit": {
                    "type": "number"
                },
                "current_exposure": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "portfolio_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "removed"
                    ]
                }
            }
        },
        "handlers.PortfolioAllocationTargetCreateRequest": {
            "type": "object",
            "required": [
                "max_allocation",
                "min_allocation",
                "portfolio_id",
                "status",
                "target_allocation",
                "target_exposure",
                "target_type"
            ],
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "effective_from": {
                    "type": "string"
                },
                "effective_to": {
                    "type": "string"
                },
                "max_allocation": {
                    "type": "number"
                },
                "min_allocation": {
                    "type": "number"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "target_allocation": {
                    "type": "number"
                },
                "target_exposure": {
                    "type": "number"
                },
                "target_type": {
                    "type": "string",
                    "enum": [
                        "account",
                        "strategy",
                        "instrument",
                        "cash"
                    ]
                }
            }
        },
        "handlers.PortfolioAllocationTargetListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.PortfolioAllocationTargetResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.PortfolioAllocationTargetPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "effective_from": {
                    "type": "string"
                },
                "effective_to": {
                    "type": "string"
                },
                "max_allocation": {
                    "type": "number"
                },
                "min_allocation": {
                    "type": "number"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "target_allocation": {
                    "type": "number"
                },
                "target_exposure": {
                    "type": "number"
                },
                "target_type": {
                    "type": "string",
                    "enum": [
                        "account",
                        "strategy",
                        "instrument",
                        "cash"
                    ]
                }
            }
        },
        "handlers.PortfolioAllocationTargetResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "effective_from": {
                    "type": "string"
                },
                "effective_to": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "max_allocation": {
                    "type": "number"
                },
                "min_allocation": {
                    "type": "number"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "target_allocation": {
                    "type": "number"
                },
                "target_exposure": {
                    "type": "number"
                },
                "target_type": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.PortfolioAllocationTargetUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "effective_from": {
                    "type": "string"
                },
                "effective_to": {
                    "type": "string"
                },
                "max_allocation": {
                    "type": "number"
                },
                "min_allocation": {
                    "type": "number"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "target_allocation": {
                    "type": "number"
                },
                "target_exposure": {
                    "type": "number"
                },
                "target_type": {
                    "type": "string",
                    "enum": [
                        "account",
                        "strategy",
                        "instrument",
                        "cash"
                    ]
                }
            }
        },
        "handlers.PortfolioCreateRequest": {
            "type": "object",
            "required": [
                "account_id",
                "base_currency",
                "current_exposure",
                "max_exposure",
                "name",
                "realized_pnl",
                "status",
                "target_capital",
                "unrealized_pnl"
            ],
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "base_currency": {
                    "type": "string"
                },
                "current_exposure": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "description": {
                    "type": "string"
                },
                "max_exposure": {
                    "type": "number"
                },
                "name": {
                    "type": "string"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "target_capital": {
                    "type": "number"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.PortfolioListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.PortfolioResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.PortfolioPatchRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "base_currency": {
                    "type": "string"
                },
                "current_exposure": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "description": {
                    "type": "string"
                },
                "max_exposure": {
                    "type": "number"
                },
                "name": {
                    "type": "string"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "target_capital": {
                    "type": "number"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.PortfolioResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "base_currency": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "current_exposure": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "last_snapshot_at": {
                    "type": "string"
                },
                "max_exposure": {
                    "type": "number"
                },
                "name": {
                    "type": "string"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "status": {
                    "type": "string"
                },
                "target_capital": {
                    "type": "number"
                },
                "unrealized_pnl": {
                    "type": "number"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.PortfolioSnapshotCreateRequest": {
            "type": "object",
            "required": [
                "cash_value",
                "gross_exposure",
                "net_exposure",
                "portfolio_id",
                "position_count",
                "realized_pnl",
                "snapshot_date",
                "total_value",
                "unrealized_pnl"
            ],
            "properties": {
                "actual_allocation": {
                    "type": "number"
                },
                "allocation_drift": {
                    "type": "number"
                },
                "cash_value": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "gross_exposure": {
                    "type": "number"
                },
                "net_exposure": {
                    "type": "number"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "position_count": {
                    "type": "integer"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "snapshot_date": {
                    "type": "string"
                },
                "target_allocation": {
                    "type": "number"
                },
                "total_value": {
                    "type": "number"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.PortfolioSnapshotListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.PortfolioSnapshotResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.PortfolioSnapshotPatchRequest": {
            "type": "object",
            "properties": {
                "actual_allocation": {
                    "type": "number"
                },
                "allocation_drift": {
                    "type": "number"
                },
                "cash_value": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "gross_exposure": {
                    "type": "number"
                },
                "net_exposure": {
                    "type": "number"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "position_count": {
                    "type": "integer"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "snapshot_date": {
                    "type": "string"
                },
                "target_allocation": {
                    "type": "number"
                },
                "total_value": {
                    "type": "number"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.PortfolioSnapshotResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "actual_allocation": {
                    "type": "number"
                },
                "allocation_drift": {
                    "type": "number"
                },
                "cash_value": {
                    "type": "number"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "gross_exposure": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "net_exposure": {
                    "type": "number"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "position_count": {
                    "type": "integer"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "snapshot_at": {
                    "type": "string"
                },
                "snapshot_date": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "target_allocation": {
                    "type": "number"
                },
                "total_value": {
                    "type": "number"
                },
                "unrealized_pnl": {
                    "type": "number"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.PortfolioSnapshotUpdateRequest": {
            "type": "object",
            "properties": {
                "actual_allocation": {
                    "type": "number"
                },
                "allocation_drift": {
                    "type": "number"
                },
                "cash_value": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "gross_exposure": {
                    "type": "number"
                },
                "net_exposure": {
                    "type": "number"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "position_count": {
                    "type": "integer"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "snapshot_date": {
                    "type": "string"
                },
                "target_allocation": {
                    "type": "number"
                },
                "total_value": {
                    "type": "number"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.PortfolioUpdateRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "base_currency": {
                    "type": "string"
                },
                "current_exposure": {
                    "type": "number"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "description": {
                    "type": "string"
                },
                "max_exposure": {
                    "type": "number"
                },
                "name": {
                    "type": "string"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "target_capital": {
                    "type": "number"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.PositionCreateRequest": {
            "type": "object",
            "required": [
                "account_id",
                "avg_entry_price",
                "broker_account_id",
                "instrument_id",
                "quantity",
                "realized_pnl",
                "side",
                "status",
                "unrealized_pnl"
            ],
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "avg_entry_price": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "instrument_id": {
                    "type": "string"
                },
                "mark_price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "long",
                        "short",
                        "flat"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "closed",
                        "reconciling"
                    ]
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.PositionListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.PositionResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.PositionPatchRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "avg_entry_price": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "instrument_id": {
                    "type": "string"
                },
                "mark_price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "long",
                        "short",
                        "flat"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "closed",
                        "reconciling"
                    ]
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.PositionResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "avg_entry_price": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "closed_at": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last_trade_id": {
                    "type": "string"
                },
                "mark_price": {
                    "type": "number"
                },
                "opened_at": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "unrealized_pnl": {
                    "type": "number"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.PositionUpdateRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "avg_entry_price": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "instrument_id": {
                    "type": "string"
                },
                "mark_price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "long",
                        "short",
                        "flat"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "closed",
                        "reconciling"
                    ]
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "handlers.ReportExportCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ReportExportListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ReportExportResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.ReportExportPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ReportExportResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.ReportExportUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ResourceLeaseCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ResourceLeaseListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ResourceLeaseResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.ResourceLeasePatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.ResourceLeaseResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.ResourceLeaseUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.RiskLimitCreateRequest": {
            "type": "object",
            "required": [
                "account_id",
                "action",
                "limit_type",
                "priority",
                "review_status",
                "scope",
                "status",
                "threshold_unit",
                "threshold_value"
            ],
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "action": {
                    "type": "string",
                    "enum": [
                        "warn",
                        "block",
                        "halt",
                        "kill_switch",
                        "reduce_only"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "limit_type": {
                    "type": "string",
                    "enum": [
                        "max_loss",
                        "max_drawdown",
                        "max_order_value",
                        "max_position_value",
                        "max_exposure",
                        "max_daily_trades",
                        "max_daily_loss",
                        "kill_switch",
                        "custom"
                    ]
                },
                "priority": {
                    "type": "integer"
                },
                "review_required": {
                    "type": "boolean"
                },
                "review_status": {
                    "type": "string",
                    "enum": [
                        "not_required",
                        "pending",
                        "approved",
                        "rejected"
                    ]
                },
                "scope": {
                    "type": "string",
                    "enum": [
                        "global",
                        "account",
                        "strategy",
                        "run",
                        "portfolio"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "threshold_unit": {
                    "type": "string",
                    "enum": [
                        "amount",
                        "percent",
                        "count",
                        "boolean"
                    ]
                },
                "threshold_value": {
                    "type": "number"
                }
            }
        },
        "handlers.RiskLimitListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.RiskLimitResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.RiskLimitPatchRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "action": {
                    "type": "string",
                    "enum": [
                        "warn",
                        "block",
                        "halt",
                        "kill_switch",
                        "reduce_only"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "limit_type": {
                    "type": "string",
                    "enum": [
                        "max_loss",
                        "max_drawdown",
                        "max_order_value",
                        "max_position_value",
                        "max_exposure",
                        "max_daily_trades",
                        "max_daily_loss",
                        "kill_switch",
                        "custom"
                    ]
                },
                "priority": {
                    "type": "integer"
                },
                "review_required": {
                    "type": "boolean"
                },
                "review_status": {
                    "type": "string",
                    "enum": [
                        "not_required",
                        "pending",
                        "approved",
                        "rejected"
                    ]
                },
                "scope": {
                    "type": "string",
                    "enum": [
                        "global",
                        "account",
                        "strategy",
                        "run",
                        "portfolio"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "threshold_unit": {
                    "type": "string",
                    "enum": [
                        "amount",
                        "percent",
                        "count",
                        "boolean"
                    ]
                },
                "threshold_value": {
                    "type": "number"
                }
            }
        },
        "handlers.RiskLimitResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "action": {
                    "type": "string"
                },
                "active_from": {
                    "type": "string"
                },
                "active_to": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "limit_type": {
                    "type": "string"
                },
                "priority": {
                    "type": "integer"
                },
                "review_required": {
                    "type": "boolean"
                },
                "review_status": {
                    "type": "string"
                },
                "scope": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "threshold_unit": {
                    "type": "string"
                },
                "threshold_value": {
                    "type": "number"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.RiskLimitUpdateRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "action": {
                    "type": "string",
                    "enum": [
                        "warn",
                        "block",
                        "halt",
                        "kill_switch",
                        "reduce_only"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "limit_type": {
                    "type": "string",
                    "enum": [
                        "max_loss",
                        "max_drawdown",
                        "max_order_value",
                        "max_position_value",
                        "max_exposure",
                        "max_daily_trades",
                        "max_daily_loss",
                        "kill_switch",
                        "custom"
                    ]
                },
                "priority": {
                    "type": "integer"
                },
                "review_required": {
                    "type": "boolean"
                },
                "review_status": {
                    "type": "string",
                    "enum": [
                        "not_required",
                        "pending",
                        "approved",
                        "rejected"
                    ]
                },
                "scope": {
                    "type": "string",
                    "enum": [
                        "global",
                        "account",
                        "strategy",
                        "run",
                        "portfolio"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "paused",
                        "archived"
                    ]
                },
                "threshold_unit": {
                    "type": "string",
                    "enum": [
                        "amount",
                        "percent",
                        "count",
                        "boolean"
                    ]
                },
                "threshold_value": {
                    "type": "number"
                }
            }
        },
        "handlers.RuleBreachCreateRequest": {
            "type": "object",
            "required": [
                "account_id",
                "action",
                "breach_type",
                "observed_value",
                "risk_limit_id",
                "severity",
                "status",
                "threshold_value"
            ],
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "action": {
                    "type": "string",
                    "enum": [
                        "warn",
                        "block",
                        "halt",
                        "kill_switch",
                        "reduce_only"
                    ]
                },
                "breach_type": {
                    "type": "string",
                    "enum": [
                        "max_loss",
                        "max_drawdown",
                        "max_order_value",
                        "max_position_value",
                        "max_exposure",
                        "max_daily_trades",
                        "max_daily_loss",
                        "kill_switch",
                        "custom"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "excess_value": {
                    "type": "number"
                },
                "observed_value": {
                    "type": "number"
                },
                "review_note": {
                    "type": "string"
                },
                "reviewed_by": {
                    "type": "string"
                },
                "risk_limit_id": {
                    "type": "string"
                },
                "severity": {
                    "type": "string",
                    "enum": [
                        "info",
                        "warning",
                        "critical"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "reviewing",
                        "resolved",
                        "ignored"
                    ]
                },
                "threshold_value": {
                    "type": "number"
                }
            }
        },
        "handlers.RuleBreachListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.RuleBreachResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.RuleBreachPatchRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "action": {
                    "type": "string",
                    "enum": [
                        "warn",
                        "block",
                        "halt",
                        "kill_switch",
                        "reduce_only"
                    ]
                },
                "breach_type": {
                    "type": "string",
                    "enum": [
                        "max_loss",
                        "max_drawdown",
                        "max_order_value",
                        "max_position_value",
                        "max_exposure",
                        "max_daily_trades",
                        "max_daily_loss",
                        "kill_switch",
                        "custom"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "excess_value": {
                    "type": "number"
                },
                "observed_value": {
                    "type": "number"
                },
                "review_note": {
                    "type": "string"
                },
                "reviewed_by": {
                    "type": "string"
                },
                "risk_limit_id": {
                    "type": "string"
                },
                "severity": {
                    "type": "string",
                    "enum": [
                        "info",
                        "warning",
                        "critical"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "reviewing",
                        "resolved",
                        "ignored"
                    ]
                },
                "threshold_value": {
                    "type": "number"
                }
            }
        },
        "handlers.RuleBreachResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "action": {
                    "type": "string"
                },
                "breach_type": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "detected_at": {
                    "type": "string"
                },
                "excess_value": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "observed_value": {
                    "type": "number"
                },
                "order_id": {
                    "type": "string"
                },
                "resolved_at": {
                    "type": "string"
                },
                "review_note": {
                    "type": "string"
                },
                "risk_limit_id": {
                    "type": "string"
                },
                "severity": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "threshold_value": {
                    "type": "number"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.RuleBreachUpdateRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "action": {
                    "type": "string",
                    "enum": [
                        "warn",
                        "block",
                        "halt",
                        "kill_switch",
                        "reduce_only"
                    ]
                },
                "breach_type": {
                    "type": "string",
                    "enum": [
                        "max_loss",
                        "max_drawdown",
                        "max_order_value",
                        "max_position_value",
                        "max_exposure",
                        "max_daily_trades",
                        "max_daily_loss",
                        "kill_switch",
                        "custom"
                    ]
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "excess_value": {
                    "type": "number"
                },
                "observed_value": {
                    "type": "number"
                },
                "review_note": {
                    "type": "string"
                },
                "reviewed_by": {
                    "type": "string"
                },
                "risk_limit_id": {
                    "type": "string"
                },
                "severity": {
                    "type": "string",
                    "enum": [
                        "info",
                        "warning",
                        "critical"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "reviewing",
                        "resolved",
                        "ignored"
                    ]
                },
                "threshold_value": {
                    "type": "number"
                }
            }
        },
        "handlers.RuleExecutionTraceCreateRequest": {
            "type": "object",
            "required": [
                "cpu_ms",
                "decision",
                "memory_mb",
                "mode",
                "rule_id",
                "rule_version_id",
                "status"
            ],
            "properties": {
                "cpu_ms": {
                    "type": "integer"
                },
                "decision": {
                    "type": "string",
                    "enum": [
                        "no_action",
                        "emit_intent",
                        "block",
                        "error"
                    ]
                },
                "error_code": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "input": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "memory_mb": {
                    "type": "integer"
                },
                "mode": {
                    "type": "string",
                    "enum": [
                        "validate",
                        "test",
                        "paper",
                        "live"
                    ]
                },
                "network_attempted": {
                    "type": "boolean"
                },
                "order_placement_attempted": {
                    "type": "boolean"
                },
                "output": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "rule_id": {
                    "type": "string"
                },
                "rule_version_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "passed",
                        "failed",
                        "timeout",
                        "blocked"
                    ]
                },
                "trace": {
                    "type": "object",
                    "additionalProperties": {}
                }
            }
        },
        "handlers.RuleExecutionTraceListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.RuleExecutionTraceResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.RuleExecutionTracePatchRequest": {
            "type": "object",
            "properties": {
                "cpu_ms": {
                    "type": "integer"
                },
                "decision": {
                    "type": "string",
                    "enum": [
                        "no_action",
                        "emit_intent",
                        "block",
                        "error"
                    ]
                },
                "error_code": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "input": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "memory_mb": {
                    "type": "integer"
                },
                "mode": {
                    "type": "string",
                    "enum": [
                        "validate",
                        "test",
                        "paper",
                        "live"
                    ]
                },
                "network_attempted": {
                    "type": "boolean"
                },
                "order_placement_attempted": {
                    "type": "boolean"
                },
                "output": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "rule_id": {
                    "type": "string"
                },
                "rule_version_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "passed",
                        "failed",
                        "timeout",
                        "blocked"
                    ]
                },
                "trace": {
                    "type": "object",
                    "additionalProperties": {}
                }
            }
        },
        "handlers.RuleExecutionTraceResponse": {
            "type": "object",
            "properties": {
                "completed_at": {
                    "type": "string"
                },
                "cpu_ms": {
                    "type": "integer"
                },
                "created_at": {
                    "type": "string"
                },
                "decision": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "error_code": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "input": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "memory_mb": {
                    "type": "integer"
                },
                "mode": {
                    "type": "string"
                },
                "network_attempted": {
                    "type": "boolean"
                },
                "order_placement_attempted": {
                    "type": "boolean"
                },
                "output": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "rule_id": {
                    "type": "string"
                },
                "rule_version_id": {
                    "type": "string"
                },
                "started_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "trace": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.RuleExecutionTraceUpdateRequest": {
            "type": "object",
            "properties": {
                "cpu_ms": {
                    "type": "integer"
                },
                "decision": {
                    "type": "string",
                    "enum": [
                        "no_action",
                        "emit_intent",
                        "block",
                        "error"
                    ]
                },
                "error_code": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "input": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "memory_mb": {
                    "type": "integer"
                },
                "mode": {
                    "type": "string",
                    "enum": [
                        "validate",
                        "test",
                        "paper",
                        "live"
                    ]
                },
                "network_attempted": {
                    "type": "boolean"
                },
                "order_placement_attempted": {
                    "type": "boolean"
                },
                "output": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "rule_id": {
                    "type": "string"
                },
                "rule_version_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "passed",
                        "failed",
                        "timeout",
                        "blocked"
                    ]
                },
                "trace": {
                    "type": "object",
                    "additionalProperties": {}
                }
            }
        },
        "handlers.StrategyCreateRequest": {
            "type": "object",
            "required": [
                "name",
                "strategy_kind"
            ],
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "description": {
                    "type": "string"
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "owner_user_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string",
                    "enum": [
                        "multi_leg"
                    ]
                }
            }
        },
        "handlers.StrategyDeploymentCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyDeploymentListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.StrategyDeploymentResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.StrategyDeploymentPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyDeploymentResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyDeploymentUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyListItem": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyListPage": {
            "type": "object",
            "properties": {
                "has_more": {
                    "type": "boolean"
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.StrategyListItem"
                    }
                },
                "page": {
                    "$ref": "#/definitions/handlers.StrategyListPage"
                }
            }
        },
        "handlers.StrategyPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "description": {
                    "type": "string"
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "owner_user_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string",
                    "enum": [
                        "multi_leg"
                    ]
                }
            }
        },
        "handlers.StrategyResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "owner_user_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyRunCreateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyRunListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.StrategyRunResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.StrategyRunPatchRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyRunResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyRunUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.StrategyUpdateRequest": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "description": {
                    "type": "string"
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "owner_user_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string",
                    "enum": [
                        "multi_leg"
                    ]
                }
            }
        },
        "handlers.StrategyVersionCreateRequest": {
            "type": "object",
            "required": [
                "config",
                "schema",
                "strategy_id",
                "strategy_kind",
                "version"
            ],
            "properties": {
                "change_note": {
                    "type": "string"
                },
                "config": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "schema": {
                    "type": "string",
                    "enum": [
                        "multi_leg_v1"
                    ]
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string",
                    "enum": [
                        "multi_leg"
                    ]
                },
                "validation_errors": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "validation_status": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "valid",
                        "invalid"
                    ]
                },
                "version": {
                    "type": "integer"
                }
            }
        },
        "handlers.StrategyVersionListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.StrategyVersionResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.StrategyVersionPatchRequest": {
            "type": "object",
            "properties": {
                "change_note": {
                    "type": "string"
                },
                "config": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "schema": {
                    "type": "string",
                    "enum": [
                        "multi_leg_v1"
                    ]
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string",
                    "enum": [
                        "multi_leg"
                    ]
                },
                "validation_errors": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "validation_status": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "valid",
                        "invalid"
                    ]
                },
                "version": {
                    "type": "integer"
                }
            }
        },
        "handlers.StrategyVersionResponse": {
            "type": "object",
            "properties": {
                "change_note": {
                    "type": "string"
                },
                "config": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "schema": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "validation_errors": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "validation_status": {
                    "type": "string"
                },
                "version": {
                    "type": "integer"
                }
            }
        },
        "handlers.StrategyVersionUpdateRequest": {
            "type": "object",
            "properties": {
                "change_note": {
                    "type": "string"
                },
                "config": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "schema": {
                    "type": "string",
                    "enum": [
                        "multi_leg_v1"
                    ]
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string",
                    "enum": [
                        "multi_leg"
                    ]
                },
                "validation_errors": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "validation_status": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "valid",
                        "invalid"
                    ]
                },
                "version": {
                    "type": "integer"
                }
            }
        },
        "handlers.TradeCreateRequest": {
            "type": "object",
            "required": [
                "account_id",
                "broker_account_id",
                "fees",
                "instrument_id",
                "notional",
                "order_id",
                "price",
                "quantity",
                "side",
                "strategy_id",
                "strategy_run_id"
            ],
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "broker_trade_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "fees": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "notional": {
                    "type": "number"
                },
                "order_id": {
                    "type": "string"
                },
                "price": {
                    "type": "number"
                },
                "provider_payload_id": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "buy",
                        "sell"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                }
            }
        },
        "handlers.TradeListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.TradeResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.TradePatchRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "broker_trade_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "fees": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "notional": {
                    "type": "number"
                },
                "order_id": {
                    "type": "string"
                },
                "price": {
                    "type": "number"
                },
                "provider_payload_id": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "buy",
                        "sell"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                }
            }
        },
        "handlers.TradeResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "broker_trade_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "deleted_at": {
                    "type": "string"
                },
                "executed_at": {
                    "type": "string"
                },
                "fees": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "liquidity": {
                    "type": "string"
                },
                "notional": {
                    "type": "number"
                },
                "order_id": {
                    "type": "string"
                },
                "position_effect": {
                    "type": "string"
                },
                "price": {
                    "type": "number"
                },
                "provider_payload_id": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "settlement_status": {
                    "type": "string"
                },
                "side": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.TradeUpdateRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "broker_trade_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "fees": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "notional": {
                    "type": "number"
                },
                "order_id": {
                    "type": "string"
                },
                "price": {
                    "type": "number"
                },
                "provider_payload_id": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "side": {
                    "type": "string",
                    "enum": [
                        "buy",
                        "sell"
                    ]
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_leg_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.AlertDeliveryResult": {
            "type": "object",
            "properties": {
                "alert_rule_id": {
                    "type": "string"
                },
                "attempt_count": {
                    "type": "integer"
                },
                "channel": {
                    "type": "string"
                },
                "delivery_id": {
                    "type": "string"
                },
                "destination": {
                    "type": "string"
                },
                "failure_reason": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "provider_ref": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "httpapi.AlertDeliveryRetryRequest": {
            "type": "object",
            "properties": {
                "reason": {
                    "type": "string"
                }
            }
        },
        "httpapi.AlertPublishResponse": {
            "type": "object",
            "properties": {
                "deliveries": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.AlertDeliveryResult"
                    }
                },
                "event_id": {
                    "type": "string"
                },
                "matched_rules": {
                    "type": "integer"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "httpapi.AlertTestDeliveryRequest": {
            "type": "object",
            "properties": {
                "channel": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "destination": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "severity": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                }
            }
        },
        "httpapi.BacktestCompareRequest": {
            "type": "object",
            "properties": {
                "run_ids": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "httpapi.BacktestCompareResponse": {
            "type": "object",
            "properties": {
                "rows": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.BacktestCompareRow"
                    }
                }
            }
        },
        "httpapi.BacktestCompareRow": {
            "type": "object",
            "properties": {
                "date_from": {
                    "type": "string"
                },
                "date_to": {
                    "type": "string"
                },
                "initial_capital": {
                    "type": "number"
                },
                "metrics": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "run_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.BacktestExportRequest": {
            "type": "object",
            "properties": {
                "format": {
                    "type": "string"
                },
                "run_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.BacktestExportResponse": {
            "type": "object",
            "properties": {
                "content": {
                    "type": "string"
                },
                "content_type": {
                    "type": "string"
                },
                "format": {
                    "type": "string"
                },
                "run_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.BacktestIssue": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "path": {
                    "type": "string"
                }
            }
        },
        "httpapi.BacktestRunSnapshot": {
            "type": "object",
            "properties": {
                "assumptions": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "brokerage_bps": {
                    "type": "number"
                },
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "date_from": {
                    "type": "string"
                },
                "date_to": {
                    "type": "string"
                },
                "error_code": {
                    "type": "string"
                },
                "error_message": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "initial_capital": {
                    "type": "number"
                },
                "slippage_bps": {
                    "type": "number"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.BacktestStartRequest": {
            "type": "object",
            "properties": {
                "assumptions": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "brokerage_bps": {
                    "type": "number"
                },
                "date_from": {
                    "type": "string"
                },
                "date_to": {
                    "type": "string"
                },
                "from": {
                    "type": "string"
                },
                "initial_capital": {
                    "type": "number"
                },
                "slippage_bps": {
                    "type": "number"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "to": {
                    "type": "string"
                }
            }
        },
        "httpapi.BacktestStartResponse": {
            "type": "object",
            "properties": {
                "errors": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.BacktestIssue"
                    }
                },
                "metrics": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "performance_rows": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "run": {
                    "$ref": "#/definitions/httpapi.BacktestRunSnapshot"
                }
            }
        },
        "httpapi.BrokerCredentialMaterial": {
            "type": "object",
            "additionalProperties": {
                "type": "string"
            }
        },
        "httpapi.BrokerCredentialTestRequest": {
            "type": "object",
            "properties": {
                "credential_material": {
                    "$ref": "#/definitions/httpapi.BrokerCredentialMaterial"
                },
                "scope": {
                    "type": "string"
                }
            }
        },
        "httpapi.BrokerCredentialTestResponse": {
            "type": "object",
            "properties": {
                "broker": {
                    "type": "string"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "checked_at": {
                    "type": "string"
                },
                "credential_id": {
                    "type": "string"
                },
                "environment": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "ok": {
                    "type": "boolean"
                }
            }
        },
        "httpapi.DebugCyclePriceOverride": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last": {
                    "type": "number"
                },
                "spread": {
                    "type": "number"
                }
            }
        },
        "httpapi.DebugCycleRequest": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last": {
                    "type": "number"
                },
                "mode": {
                    "type": "string"
                },
                "options": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "overrides": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "price_overrides": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.DebugCyclePriceOverride"
                    }
                },
                "spread": {
                    "type": "number"
                },
                "strategy_config": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "strategy_run_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.DebugCycleResponse": {
            "type": "object",
            "properties": {
                "after_state": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "before_state": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "errors": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "fills": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "generated_intents": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "intents": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "logs": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "matched_rules": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "mode": {
                    "type": "string"
                },
                "mutates_broker_execution": {
                    "type": "boolean"
                },
                "mutates_live_market_data": {
                    "type": "boolean"
                },
                "orders": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "rule_trace": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "run_id": {
                    "type": "string"
                },
                "steps": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.DebugStepResult"
                    }
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "trace": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.DebugTraceStep"
                    }
                },
                "warnings": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "httpapi.DebugPriceOverrideRequest": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "last": {
                    "type": "number"
                },
                "mode": {
                    "type": "string"
                },
                "reason": {
                    "type": "string"
                },
                "spread": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.DebugPriceOverrideResponse": {
            "type": "object",
            "properties": {
                "live_broker_submit_enabled": {
                    "type": "boolean"
                },
                "mutates_broker_execution": {
                    "type": "boolean"
                },
                "mutates_live_market_data": {
                    "type": "boolean"
                },
                "override_id": {
                    "type": "string"
                },
                "session_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.DebugStepResult": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "instrument_id": {
                    "type": "string"
                },
                "matched_rules": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "rule_trace": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "step": {
                    "type": "integer"
                },
                "time": {
                    "type": "string"
                }
            }
        },
        "httpapi.DebugTraceStep": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "message": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "httpapi.ErrorBody": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "details": {},
                "message": {
                    "type": "string"
                },
                "request_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.MarketDataFeedStatus": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "feed": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "httpapi.MarketDataIngestionStatusResponse": {
            "type": "object",
            "properties": {
                "active_instrument_count": {
                    "type": "integer"
                },
                "feeds": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.MarketDataFeedStatus"
                    }
                },
                "latest_candle": {
                    "$ref": "#/definitions/httpapi.MarketDataLatestCandleStatus"
                },
                "provider": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "sync_jobs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.MarketDataSyncJobStatus"
                    }
                },
                "unhealthy_reasons": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "httpapi.MarketDataLatestCandleStatus": {
            "type": "object",
            "properties": {
                "age_seconds": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "start_time": {
                    "type": "string"
                },
                "timeframe": {
                    "type": "string"
                }
            }
        },
        "httpapi.MarketDataSyncJobStatus": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "id": {
                    "type": "string"
                },
                "job": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "httpapi.MarketTickValidateResponse": {
            "type": "object",
            "properties": {
                "instrument_id": {
                    "type": "string"
                },
                "valid": {
                    "type": "boolean"
                }
            }
        },
        "httpapi.MonitorOrderSummary": {
            "type": "object",
            "properties": {
                "broker_order_id": {
                    "type": "string"
                },
                "filled_quantity": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "order_type": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "side": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "httpapi.MonitorPositionSummary": {
            "type": "object",
            "properties": {
                "avg_entry_price": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "side": {
                    "type": "string"
                }
            }
        },
        "httpapi.OperationalReadinessCheck": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "message": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "httpapi.OperationalReadinessMetrics": {
            "type": "object",
            "properties": {
                "active_broker_accounts": {
                    "type": "integer"
                },
                "active_broker_credentials": {
                    "type": "integer"
                },
                "active_resource_leases": {
                    "type": "integer"
                },
                "active_strategy_runs": {
                    "type": "integer"
                },
                "failed_alert_deliveries_24h": {
                    "type": "integer"
                },
                "latest_market_feed_age_secs": {
                    "type": "number"
                },
                "latest_market_feed_status": {
                    "type": "string"
                }
            }
        },
        "httpapi.OperationalReadinessResponse": {
            "type": "object",
            "properties": {
                "checks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.OperationalReadinessCheck"
                    }
                },
                "degraded_reasons": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "generated_at": {
                    "type": "string"
                },
                "metrics": {
                    "$ref": "#/definitions/httpapi.OperationalReadinessMetrics"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.OperatorActionResponse": {
            "type": "object",
            "properties": {
                "action": {
                    "type": "string"
                },
                "action_id": {
                    "type": "string"
                },
                "audit_log_id": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "job_id": {
                    "type": "string"
                },
                "runner_state": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "httpapi.OperatorControlRequest": {
            "type": "object",
            "properties": {
                "drain_timeout_seconds": {
                    "type": "integer"
                },
                "reason": {
                    "type": "string"
                }
            }
        },
        "httpapi.OperatorFailedJobSnapshot": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "failure_reason": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "httpapi.OperatorFailedJobsResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.OperatorFailedJobSnapshot"
                    }
                }
            }
        },
        "httpapi.OperatorLeaseListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.OperatorLeaseSnapshot"
                    }
                }
            }
        },
        "httpapi.OperatorLeaseSnapshot": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "httpapi.OperatorMarketDataResyncRequest": {
            "type": "object",
            "properties": {
                "active": {
                    "type": "boolean"
                },
                "closed": {
                    "type": "boolean"
                },
                "limit": {
                    "type": "integer"
                },
                "provider": {
                    "type": "string"
                },
                "segment": {
                    "type": "string"
                },
                "tag_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.OperatorReconcileRequest": {
            "type": "object",
            "properties": {
                "broker_account_id": {
                    "type": "string"
                },
                "reason": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.PaperRunRequest": {
            "type": "object",
            "properties": {
                "idempotency_key": {
                    "type": "string"
                },
                "mode": {
                    "type": "string"
                },
                "risk_profile_id": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                },
                "tick_interval_ms": {
                    "type": "integer"
                }
            }
        },
        "httpapi.PaperRunResponse": {
            "type": "object",
            "properties": {
                "live_broker_called": {
                    "type": "boolean"
                },
                "mode": {
                    "type": "string"
                },
                "run": {
                    "$ref": "#/definitions/httpapi.StrategyRunSnapshot"
                },
                "run_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_version_id": {
                    "type": "string"
                }
            }
        },
        "httpapi.PolymarketSyncResponse": {
            "type": "object",
            "properties": {
                "events_fetched": {
                    "type": "integer"
                },
                "instruments_created": {
                    "type": "integer"
                },
                "instruments_updated": {
                    "type": "integer"
                },
                "markets": {
                    "type": "integer"
                },
                "outcomes_skipped": {
                    "type": "integer"
                },
                "pages_fetched": {
                    "type": "integer"
                },
                "segment": {
                    "type": "string"
                }
            }
        },
        "httpapi.PortfolioDashboardAccountAllocation": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "allocation_pct": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "capital_limit": {
                    "type": "number"
                },
                "current_exposure": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "httpapi.PortfolioDashboardAllocationTarget": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "actual_allocation": {
                    "type": "number"
                },
                "actual_exposure": {
                    "type": "number"
                },
                "allocation_drift": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "max_allocation": {
                    "type": "number"
                },
                "min_allocation": {
                    "type": "number"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "target_allocation": {
                    "type": "number"
                },
                "target_exposure": {
                    "type": "number"
                },
                "target_type": {
                    "type": "string"
                }
            }
        },
        "httpapi.PortfolioDashboardBalance": {
            "type": "object",
            "properties": {
                "broker_account_id": {
                    "type": "string"
                },
                "cash": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "number",
                        "format": "float64"
                    }
                },
                "id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "httpapi.PortfolioDashboardPosition": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "avg_entry_price": {
                    "type": "number"
                },
                "broker_account_id": {
                    "type": "string"
                },
                "exposure": {
                    "type": "number"
                },
                "id": {
                    "type": "string"
                },
                "instrument_id": {
                    "type": "string"
                },
                "mark_price": {
                    "type": "number"
                },
                "quantity": {
                    "type": "number"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "side": {
                    "type": "string"
                },
                "signed_exposure": {
                    "type": "number"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_run_id": {
                    "type": "string"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "httpapi.PortfolioDashboardResponse": {
            "type": "object",
            "properties": {
                "account_allocations": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.PortfolioDashboardAccountAllocation"
                    }
                },
                "account_id": {
                    "type": "string"
                },
                "allocation_targets": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.PortfolioDashboardAllocationTarget"
                    }
                },
                "balances": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.PortfolioDashboardBalance"
                    }
                },
                "generated_at": {
                    "type": "string"
                },
                "portfolio_id": {
                    "type": "string"
                },
                "positions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.PortfolioDashboardPosition"
                    }
                },
                "status": {
                    "type": "string"
                },
                "totals": {
                    "$ref": "#/definitions/httpapi.PortfolioDashboardTotals"
                }
            }
        },
        "httpapi.PortfolioDashboardTotals": {
            "type": "object",
            "properties": {
                "cash_by_currency": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "number",
                        "format": "float64"
                    }
                },
                "cash_value": {
                    "type": "number"
                },
                "gross_exposure": {
                    "type": "number"
                },
                "net_exposure": {
                    "type": "number"
                },
                "portfolio_count": {
                    "type": "integer"
                },
                "position_count": {
                    "type": "integer"
                },
                "realized_pnl": {
                    "type": "number"
                },
                "total_value": {
                    "type": "number"
                },
                "unrealized_pnl": {
                    "type": "number"
                }
            }
        },
        "httpapi.ProviderTickPayload": {
            "type": "object",
            "properties": {
                "ask": {
                    "type": "number"
                },
                "ask_size": {
                    "type": "number"
                },
                "bid": {
                    "type": "number"
                },
                "bid_size": {
                    "type": "number"
                },
                "event_time": {
                    "type": "string"
                },
                "exchange_code": {
                    "type": "string"
                },
                "last_price": {
                    "type": "number"
                },
                "provider": {
                    "type": "string"
                },
                "provider_instrument_id": {
                    "type": "string"
                },
                "symbol": {
                    "type": "string"
                },
                "volume": {
                    "type": "number"
                }
            }
        },
        "httpapi.ReportExportRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "delivery": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "format": {
                    "type": "string"
                },
                "from": {
                    "type": "string"
                },
                "idempotency_key": {
                    "type": "string"
                },
                "include_rows": {
                    "type": "boolean"
                },
                "max_rows": {
                    "type": "integer"
                },
                "report": {
                    "type": "string"
                },
                "saved_view": {
                    "type": "string"
                },
                "to": {
                    "type": "string"
                }
            }
        },
        "httpapi.ReportExportSnapshot": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "content": {
                    "type": "string"
                },
                "content_type": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "file_name": {
                    "type": "string"
                },
                "format": {
                    "type": "string"
                },
                "from": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "report": {
                    "type": "string"
                },
                "row_count": {
                    "type": "integer"
                },
                "saved_view": {
                    "type": "string"
                },
                "schedule": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                },
                "to": {
                    "type": "string"
                }
            }
        },
        "httpapi.ReportResponse": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "data_sources": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "from": {
                    "type": "string"
                },
                "items": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "report": {
                    "type": "string"
                },
                "rows": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "tenant_id": {
                    "type": "string"
                },
                "to": {
                    "type": "string"
                }
            }
        },
        "httpapi.ReportScheduleRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "cron": {
                    "type": "string"
                },
                "delivery": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "format": {
                    "type": "string"
                },
                "from": {
                    "type": "string"
                },
                "idempotency_key": {
                    "type": "string"
                },
                "include_rows": {
                    "type": "boolean"
                },
                "max_rows": {
                    "type": "integer"
                },
                "report": {
                    "type": "string"
                },
                "saved_view": {
                    "type": "string"
                },
                "schedule_name": {
                    "type": "string"
                },
                "timezone": {
                    "type": "string"
                },
                "to": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyDraftRequest": {
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string"
                },
                "context": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "prompt": {
                    "type": "string"
                },
                "symbols": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "httpapi.StrategyDraftResponse": {
            "type": "object",
            "properties": {
                "assumptions": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "auto_deploy": {
                    "type": "boolean"
                },
                "draft": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "draft_config": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "explanation": {
                    "type": "string"
                },
                "policy_checks": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "prompt_log": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "provider": {
                    "type": "string"
                },
                "requires_review": {
                    "type": "boolean"
                },
                "status": {
                    "type": "string"
                },
                "validation_result": {
                    "$ref": "#/definitions/httpapi.StrategyValidateResponse"
                }
            }
        },
        "httpapi.StrategyIssue": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "path": {
                    "type": "string"
                },
                "severity": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyOperandCatalogResponse": {
            "type": "object",
            "properties": {
                "description": {
                    "type": "string"
                },
                "namespaces": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.StrategyOperandNamespace"
                    }
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyOperandField": {
            "type": "object",
            "properties": {
                "default_output": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "field": {
                    "type": "string"
                },
                "label": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "min_lookback": {
                    "type": "integer"
                },
                "outputs": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "params_schema": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.StrategyOperandParam"
                    }
                },
                "usable_in": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "boolean"
                    }
                },
                "value_type": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyOperandNamespace": {
            "type": "object",
            "properties": {
                "description": {
                    "type": "string"
                },
                "fields": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.StrategyOperandField"
                    }
                },
                "label": {
                    "type": "string"
                },
                "ns": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyOperandParam": {
            "type": "object",
            "properties": {
                "default": {},
                "description": {
                    "type": "string"
                },
                "enum": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "min": {
                    "type": "number"
                },
                "name": {
                    "type": "string"
                },
                "required": {
                    "type": "boolean"
                },
                "type": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyRunLifecycleResponse": {
            "type": "object",
            "properties": {
                "run": {
                    "$ref": "#/definitions/httpapi.StrategyRunSnapshot"
                }
            }
        },
        "httpapi.StrategyRunMonitorResponse": {
            "type": "object",
            "properties": {
                "active_orders": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.MonitorOrderSummary"
                    }
                },
                "open_positions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.MonitorPositionSummary"
                    }
                },
                "orders_count": {
                    "type": "integer"
                },
                "positions_count": {
                    "type": "integer"
                },
                "risk_state": {},
                "run": {
                    "$ref": "#/definitions/httpapi.StrategyRunSnapshot"
                },
                "trades_count": {
                    "type": "integer"
                }
            }
        },
        "httpapi.StrategyRunPauseRequest": {
            "type": "object",
            "properties": {
                "idempotency_key": {
                    "type": "string"
                },
                "reason": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyRunResumeRequest": {
            "type": "object",
            "properties": {
                "confirm_live": {
                    "type": "boolean"
                },
                "idempotency_key": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyRunSnapshot": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "data": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "id": {
                    "type": "string"
                },
                "mode": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyRunStartRequest": {
            "type": "object",
            "properties": {
                "broker_account_id": {
                    "type": "string"
                },
                "confirm_live": {
                    "type": "boolean"
                },
                "idempotency_key": {
                    "type": "string"
                },
                "mode": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyRunStopRequest": {
            "type": "object",
            "properties": {
                "cancel_open_orders": {
                    "type": "boolean"
                },
                "confirm_live": {
                    "type": "boolean"
                },
                "square_off": {
                    "type": "boolean"
                },
                "square_off_positions": {
                    "type": "boolean"
                },
                "stop_mode": {
                    "type": "string"
                }
            }
        },
        "httpapi.StrategyValidateRequest": {
            "type": "object",
            "required": [
                "config"
            ],
            "properties": {
                "config": {
                    "type": "object",
                    "additionalProperties": {}
                }
            }
        },
        "httpapi.StrategyValidateResponse": {
            "type": "object",
            "properties": {
                "errors": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.StrategyIssue"
                    }
                },
                "schema": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string"
                },
                "valid": {
                    "type": "boolean"
                },
                "warnings": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.StrategyIssue"
                    }
                }
            }
        },
        "httpapi.StrategyVersionCreateRequest": {
            "type": "object",
            "required": [
                "config"
            ],
            "properties": {
                "change_note": {
                    "type": "string"
                },
                "config": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "version": {
                    "type": "integer"
                }
            }
        },
        "httpapi.StrategyVersionCreateResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "schema": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "strategy_id": {
                    "type": "string"
                },
                "strategy_kind": {
                    "type": "string"
                },
                "validation": {
                    "$ref": "#/definitions/httpapi.StrategyValidateResponse"
                },
                "validation_errors": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/httpapi.StrategyIssue"
                    }
                },
                "validation_status": {
                    "type": "string"
                },
                "version": {
                    "type": "integer"
                },
                "version_id": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "BearerAuth": {
            "description": "Bearer token",
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    }
}