{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "options-trade-plan-v1",
  "title": "Options Trade Plan",
  "type": "object",
  "required": [
    "schemaVersion",
    "createdAt",
    "thesis",
    "contract",
    "risk",
    "management",
    "evaluation"
  ],
  "properties": {
    "schemaVersion": {
      "const": "options-trade-plan-v1"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "thesis": {
      "type": "object",
      "required": [
        "direction",
        "stock",
        "target",
        "invalidation",
        "expectedDays"
      ],
      "properties": {
        "direction": {
          "enum": [
            "bullish",
            "bearish",
            "neutral"
          ]
        },
        "stock": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "target": {
          "type": "number",
          "minimum": 0
        },
        "invalidation": {
          "type": "number",
          "minimum": 0
        },
        "expectedDays": {
          "type": "integer",
          "minimum": 1
        },
        "eventRisk": {
          "type": "boolean"
        }
      }
    },
    "contract": {
      "type": "object",
      "required": [
        "strategy",
        "strike",
        "expirationDays",
        "quantity",
        "bid",
        "ask"
      ],
      "properties": {
        "strategy": {
          "type": "string"
        },
        "strike": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "secondStrike": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "expirationDays": {
          "type": "integer",
          "minimum": 1
        },
        "quantity": {
          "type": "integer",
          "minimum": 1
        },
        "bid": {
          "type": "number",
          "minimum": 0
        },
        "ask": {
          "type": "number",
          "minimum": 0
        },
        "netPrice": {
          "type": "number",
          "minimum": 0,
          "description": "Premium paid or received per share: a single option's premium, a debit spread's net debit, a credit spread's net credit."
        },
        "strategyLabel": {
          "type": "string"
        }
      }
    },
    "risk": {
      "type": "object",
      "properties": {
        "accountSize": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "riskBudgetPct": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "maximumLoss": {
          "type": "number",
          "minimum": 0
        },
        "breakeven": {
          "type": "number",
          "minimum": 0
        },
        "riskBudget": {
          "type": "number",
          "minimum": 0,
          "description": "accountSize × riskBudgetPct / 100."
        },
        "lossAtInvalidation": {
          "type": "number",
          "minimum": 0,
          "description": "Expiration loss if the underlying finishes at the thesis invalidation level. For covered calls and cash-secured puts this is the figure the budget check compares, as Trade Setup and Execution defines planned risk; maximumLoss is the stock-to-zero figure and is reported separately."
        },
        "plannedRisk": {
          "type": "number",
          "minimum": 0,
          "description": "The figure the risk-budget check compared with riskBudget: maximumLoss for defined-risk structures, lossAtInvalidation for share-backed ones."
        },
        "spreadPct": {
          "type": "number",
          "minimum": 0,
          "description": "(ask − bid) / midpoint × 100."
        },
        "targetPnl": {
          "type": "number",
          "description": "Expiration P/L at the thesis target."
        },
        "targetR": {
          "type": "number",
          "minimum": 0,
          "description": "targetPnl / plannedRisk, or 0 when the target does not pay."
        }
      }
    },
    "management": {
      "type": "object",
      "required": [
        "exitRule"
      ],
      "properties": {
        "exitRule": {
          "type": "string",
          "minLength": 1
        },
        "eventPlan": {
          "type": "string"
        }
      }
    },
    "evaluation": {
      "type": "object",
      "required": [
        "score",
        "decision"
      ],
      "properties": {
        "score": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "decision": {
          "enum": [
            "approved",
            "revise",
            "reject"
          ]
        },
        "checks": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "ok",
              "weight"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "ok": {
                "type": "boolean"
              },
              "detail": {
                "type": "string"
              },
              "weight": {
                "type": "number",
                "minimum": 0
              }
            }
          }
        },
        "grade": {
          "type": "string",
          "description": "The wording shown on the page for the decision."
        }
      }
    }
  },
  "description": "The document Options Trade Planning exports after scoring a plan. thesis is the Trade Thesis plan the plan expresses; contract is what would be traded; risk is the figures the checks compared; management is the exit and event handling; evaluation is the score, the decision it implies (approved at 90 or more, revise from 55, reject below) and every check with its weight."
}
