{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assetlab-ca/json-schema/assetlab-ca-asset-risk-history-schema.json",
  "title": "AssetRiskHistory",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/assetlab-ca-asset-risk-history-api-openapi.yml#/components/schemas/AssetRiskHistory",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "asset_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "risk_score": {
      "type": [
        "integer",
        "null"
      ]
    },
    "consequence_of_failure_score": {
      "type": [
        "integer",
        "null"
      ]
    },
    "likelihood_of_failure_score": {
      "type": [
        "integer",
        "null"
      ]
    },
    "condition_score": {
      "type": [
        "integer",
        "null"
      ]
    },
    "risk_factor": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "CRITICAL",
        "HIGH",
        "MEDIUM",
        "LOW"
      ]
    },
    "recorded_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "trigger_event": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "maintenance",
        "inspection",
        "manual_update",
        "scheduled"
      ]
    },
    "work_order_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "asset": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}