{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/uktendercheck-co-uk/json-schema/uktendercheck-co-uk-renewal-radar-response-schema.json",
  "title": "RenewalRadarResponse",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/uktendercheck-co-uk-openapi.json#/components/schemas/RenewalRadarResponse",
  "type": "object",
  "required": [
    "data",
    "meta"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "selectedHorizonDays",
        "horizons",
        "count",
        "signals"
      ],
      "properties": {
        "selectedHorizonDays": {
          "type": "integer",
          "enum": [
            90,
            180,
            365
          ]
        },
        "horizons": {
          "type": "object",
          "required": [
            "90",
            "180",
            "365"
          ],
          "properties": {
            "90": {
              "type": "integer",
              "minimum": 0
            },
            "180": {
              "type": "integer",
              "minimum": 0
            },
            "365": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "signals": {
          "type": "array",
          "maxItems": 250,
          "items": {
            "type": "object",
            "required": [
              "tenderId",
              "source",
              "noticeId",
              "ocid",
              "title",
              "buyerName",
              "value",
              "statedEndAt",
              "maximumPotentialEndAt",
              "signalDate",
              "daysUntilSignal",
              "horizonDays",
              "basis",
              "confidence",
              "reasons",
              "gaps",
              "confirmedFutureTender",
              "evidence"
            ],
            "properties": {
              "tenderId": {
                "type": "string"
              },
              "source": {
                "type": "string",
                "enum": [
                  "find-a-tender",
                  "contracts-finder"
                ]
              },
              "noticeId": {
                "type": "string"
              },
              "ocid": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "buyerName": {
                "type": "string"
              },
              "value": {
                "$ref": "#/$defs/Money"
              },
              "statedEndAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "maximumPotentialEndAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "signalDate": {
                "type": "string",
                "format": "date-time"
              },
              "daysUntilSignal": {
                "type": "integer",
                "minimum": 0
              },
              "horizonDays": {
                "type": "integer",
                "enum": [
                  90,
                  180,
                  365
                ]
              },
              "basis": {
                "type": "string",
                "enum": [
                  "stated-contract-end",
                  "maximum-potential-term"
                ]
              },
              "confidence": {
                "type": "string",
                "enum": [
                  "high",
                  "medium",
                  "low"
                ],
                "description": "Strength and completeness of observable timing evidence, not the probability of a future tender."
              },
              "reasons": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "gaps": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "confirmedFutureTender": {
                "const": false
              },
              "evidence": {
                "$ref": "#/$defs/IntelligenceEvidence"
              }
            }
          }
        }
      }
    },
    "meta": {
      "$ref": "#/$defs/IntelligenceMeta"
    }
  },
  "$defs": {
    "IntelligenceCatalogueCoverage": {
      "type": "object",
      "required": [
        "source",
        "ready",
        "backfillComplete",
        "recordsIndexed",
        "lastSuccessAt",
        "coverageFrom",
        "coverageTo"
      ],
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "find-a-tender",
            "contracts-finder"
          ]
        },
        "ready": {
          "type": "boolean"
        },
        "backfillComplete": {
          "type": "boolean"
        },
        "recordsIndexed": {
          "type": "integer",
          "minimum": 0
        },
        "lastSuccessAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "coverageFrom": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "coverageTo": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "IntelligenceEvidence": {
      "type": "object",
      "required": [
        "tenderId",
        "source",
        "noticeId",
        "ocid",
        "title",
        "buyerName",
        "sourceUrl",
        "publishedAt",
        "sourceUpdatedAt",
        "retrievedAt",
        "licenceUrl"
      ],
      "properties": {
        "tenderId": {
          "type": "string"
        },
        "source": {
          "type": "string",
          "enum": [
            "find-a-tender",
            "contracts-finder"
          ]
        },
        "noticeId": {
          "type": "string"
        },
        "ocid": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "buyerName": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "publishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "sourceUpdatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "retrievedAt": {
          "type": "string",
          "format": "date-time"
        },
        "licenceUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "IntelligenceMeta": {
      "type": "object",
      "required": [
        "state",
        "confidence",
        "generatedAt",
        "rulesetVersion",
        "truncated",
        "sourceCoverage",
        "reasons",
        "disclaimer",
        "snapshotLabel",
        "attribution",
        "apiUnitsCharged"
      ],
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "ready",
            "partial",
            "insufficient-evidence"
          ]
        },
        "confidence": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low"
          ],
          "description": "Strength and completeness of observable historical evidence, not confidence in eligibility, a future tender or a win."
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "rulesetVersion": {
          "type": "string"
        },
        "truncated": {
          "type": "boolean"
        },
        "sourceCoverage": {
          "type": "object",
          "required": [
            "recordsCompared",
            "recordsWithValues",
            "earliestPublishedAt",
            "latestPublishedAt",
            "catalogues"
          ],
          "properties": {
            "recordsCompared": {
              "type": "integer",
              "minimum": 0
            },
            "recordsWithValues": {
              "type": "integer",
              "minimum": 0
            },
            "earliestPublishedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "latestPublishedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "catalogues": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/IntelligenceCatalogueCoverage"
              }
            }
          }
        },
        "reasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "disclaimer": {
          "type": "string"
        },
        "snapshotLabel": {
          "type": "string"
        },
        "attribution": {
          "type": "string"
        },
        "apiUnitsCharged": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "Money": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "amount",
        "currency"
      ],
      "properties": {
        "amount": {
          "type": "number",
          "minimum": 0
        },
        "currency": {
          "type": "string"
        }
      }
    }
  }
}