{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/anytax/json-schema/anytax-evaluate-eligibility-response-dto-schema.json",
  "title": "EvaluateEligibilityResponseDto",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anytax-openapi.json#/components/schemas/EvaluateEligibilityResponseDto",
  "type": "object",
  "properties": {
    "outcome": {
      "type": "string",
      "enum": [
        "supported",
        "unsupported",
        "pending"
      ],
      "description": "\"supported\" only once all 4 questions were present and clean in this call. \"unsupported\" as soon as any submitted question was disqualifying. \"pending\" otherwise — keep asking questions and calling evaluate() again."
    },
    "taxYear": {
      "type": "number",
      "description": "Echoes back the taxYear you sent."
    },
    "questionSetVersion": {
      "type": "string",
      "description": "Echoes back the questionSetVersion you sent — this is what was actually scored."
    },
    "triggeredBy": {
      "description": "Empty unless outcome is \"unsupported\". Which question(s)/option(s) disqualified this result — for your own visibility into what kinds of cases you're turning away. Never show this to the end user; show only the generic `message` below.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/TriggeredByEntryDto"
      }
    },
    "message": {
      "type": "string",
      "description": "Null unless outcome is \"unsupported\". The same generic rejection copy shown in the AnyTax player — render this to the end user verbatim, in the locale you requested. Do not pair it with anything from `triggeredBy`."
    },
    "notifyOffer": {
      "type": "boolean",
      "description": "True only when outcome is \"unsupported\". Show the end user a \"notify me when supported\" option when this is true, and call POST .../notify below if they opt in."
    }
  },
  "required": [
    "outcome",
    "taxYear",
    "questionSetVersion",
    "triggeredBy",
    "notifyOffer"
  ],
  "$defs": {
    "TriggeredByEntryDto": {
      "type": "object",
      "properties": {
        "questionId": {
          "type": "string",
          "description": "Which question was disqualifying — matches a questionId from GET .../questions."
        },
        "selectedOptionIds": {
          "description": "Exactly what the user/partner submitted for that question — kept for your own records.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "questionId",
        "selectedOptionIds"
      ]
    }
  }
}