{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/latamref-dev/json-schema/latamref-dev-settlement-date-answer-schema.json",
  "title": "SettlementDateAnswer",
  "description": "The settlement-date computation with its full evidence trail. Nothing here is asserted without a stated basis: the convention says whether it was cited from an instrument or supplied by the caller, and every skipped day names the calendar and reason that skipped it.",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/latamref-dev-openapi.json#/components/schemas/SettlementDateAnswer",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ok"
      ]
    },
    "confidence_label": {
      "type": "string",
      "enum": [
        "high",
        "medium",
        "low"
      ],
      "description": "Derived from source type, verification age, stale. Rules: /label-rules"
    },
    "coverage_label": {
      "type": "string",
      "enum": [
        "ready",
        "partial",
        "gap"
      ],
      "description": "ready=complete, partial=limited, gap=no number. Rules: /label-rules"
    },
    "label_basis": {
      "type": "object",
      "description": "Inputs and rule ids behind both labels"
    },
    "settlement_date": {
      "type": "string",
      "format": "date"
    },
    "settlement_weekday": {
      "type": "string"
    },
    "question": {
      "type": "object",
      "description": "The question as understood: trade date and weekday, business-day count applied, calendars intersected, market/instrument when supplied"
    },
    "convention_applied": {
      "type": "object",
      "description": "The T+n actually used and where it came from: 'cited_convention' (with the instrument, authority and whether it is compelled by law) or 'caller_supplied'. When both were given and differ, the cited cycle is shown beside the caller's."
    },
    "trail": {
      "type": "array",
      "description": "Per-day walk from trade date to settlement: each candidate day, whether it counted, and - when skipped - which calendar blocked it and why (weekend rule or a named public holiday)",
      "items": {
        "type": "object"
      }
    },
    "calendars": {
      "type": "array",
      "description": "Each calendar's basis (national statutory - NOT a CSD or venue calendar), weekend rule, covered period and official source, plus any known divergence worth flagging",
      "items": {
        "type": "object"
      }
    },
    "caveats": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Always worth reading: the specific limits of this answer"
    }
  },
  "required": [
    "status",
    "settlement_date",
    "question",
    "convention_applied"
  ]
}