{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/moment/json-schema/moment-transactions-page-schema.json",
  "title": "TransactionsPage",
  "description": "A paginated list of transactions.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/moment-transactions-api-openapi.yml#/components/schemas/TransactionsPage",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Transaction"
      },
      "description": "List of transactions in this page."
    },
    "count": {
      "type": "integer",
      "description": "Always -1. Retained for wire-shape compatibility; the value is no longer computed because no known consumer reads it and producing it required an extra full-history scan per request. Iterate `next` to enumerate the result set."
    },
    "next": {
      "type": [
        "string",
        "null"
      ],
      "description": "A hyperlink to the next page of results, requesting the same page size as the current request."
    },
    "prev": {
      "type": [
        "string",
        "null"
      ],
      "description": "Null. Paginating in reverse is not supported."
    }
  },
  "required": [
    "data",
    "count",
    "next",
    "prev"
  ],
  "$defs": {
    "Transaction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for this transaction."
        },
        "isin": {
          "type": "string",
          "description": "ISIN of the bond."
        },
        "quantity": {
          "type": "integer",
          "description": "The face value of the transaction."
        },
        "side": {
          "type": "string",
          "enum": [
            "BUY",
            "SELL"
          ],
          "description": "Whether this was a buy or sell transaction."
        },
        "price": {
          "type": "number",
          "description": "Percentage of par value.",
          "x-go-type": "decimal.Decimal",
          "x-go-type-import": {
            "path": "github.com/shopspring/decimal"
          }
        },
        "ytw": {
          "type": "number",
          "description": "Yield to worst.",
          "x-go-type": "decimal.NullDecimal",
          "x-go-type-import": {
            "path": "github.com/shopspring/decimal"
          }
        },
        "ytm": {
          "type": "number",
          "description": "Yield to maturity.",
          "x-go-type": "decimal.NullDecimal",
          "x-go-type-import": {
            "path": "github.com/shopspring/decimal"
          }
        },
        "spread": {
          "type": "number",
          "description": "Spread to benchmark in basis points.",
          "x-go-type": "decimal.NullDecimal",
          "x-go-type-import": {
            "path": "github.com/shopspring/decimal"
          }
        },
        "counterparty": {
          "type": "string",
          "enum": [
            "ATS",
            "CUSTOMER",
            "DEALER",
            "NON_MEMBER_AFFILIATE"
          ],
          "description": "Type of counterparty in the transaction."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "When the transaction occurred."
        }
      },
      "required": [
        "id",
        "isin",
        "quantity",
        "side",
        "price",
        "ytw",
        "ytm",
        "spread",
        "counterparty",
        "timestamp"
      ]
    }
  }
}