{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://llm.successionwills.com/schemas/will-fields.json",
  "title": "Succession Wills Will Builder Fields",
  "description": "Field dictionary for the LLM generate-will API. Names match the production document model.",
  "type": "object",
  "required": [
    "first_name",
    "last_name",
    "address_street",
    "address_city",
    "address_state",
    "address_country",
    "address_zip",
    "marital_status",
    "has_children",
    "executors",
    "residue_bens"
  ],
  "properties": {
    "first_name": { "type": "string" },
    "middle_name": { "type": "string" },
    "last_name": { "type": "string" },
    "aka_name": { "type": "string" },
    "address_street": { "type": "string" },
    "address_city": { "type": "string" },
    "address_state": { "type": "string" },
    "address_country": { "type": "string" },
    "address_zip": { "type": "string" },
    "marital_status": {
      "type": "integer",
      "enum": [1, 2, 3, 4],
      "description": "1 Married, 2 Not Married, 3 Getting Married Soon, 4 Common-Law"
    },
    "spouse_first_name": { "type": "string" },
    "spouse_middle_name": { "type": "string" },
    "spouse_last_name": { "type": "string" },
    "spouse_aka_name": { "type": "string" },
    "spouse_mirror": { "type": "boolean" },
    "has_children": { "type": "boolean" },
    "include_minors": { "type": "boolean" },
    "include_step_children": { "type": "boolean" },
    "children": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["first_name", "last_name"],
        "properties": {
          "first_name": { "type": "string" },
          "last_name": { "type": "string" },
          "name": { "type": "string" },
          "exclude": { "type": "boolean" },
          "exclude_issue": { "type": "boolean" },
          "order": { "type": "integer" }
        }
      }
    },
    "first_name_primary_guardian": { "type": "string" },
    "last_name_primary_guardian": { "type": "string" },
    "primary_guardian": { "type": "string" },
    "primary_guardian_relationship": { "type": "string" },
    "first_name_backup_guardian": { "type": "string" },
    "last_name_backup_guardian": { "type": "string" },
    "backup_guardian": { "type": "string" },
    "backup_guardian_relationship": { "type": "string" },
    "executors": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/personRole" }
    },
    "sub_executors": {
      "type": "array",
      "items": { "$ref": "#/$defs/personRole" }
    },
    "manner_of_sub": { "type": "string", "enum": ["sub", "fill"] },
    "residue_bens": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["selection", "place"],
        "properties": {
          "selection": { "type": "string", "enum": ["spouse", "children", "other"] },
          "place": { "type": "integer" },
          "others": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": { "type": "string", "enum": ["Person", "Charity"] },
                "name": { "type": "string" },
                "first_name": { "type": "string" },
                "last_name": { "type": "string" },
                "relationship": { "type": "string" },
                "percent": { "type": "number" },
                "consequence": { "type": "string", "enum": ["", "Lapse", "Gift to Issue"] }
              }
            }
          }
        }
      }
    },
    "burial_selection": {
      "type": "string",
      "enum": ["buried", "cremated", "executors_decide"]
    },
    "funeral_instructions": { "type": "string" },
    "has_pets": { "type": "boolean" },
    "pets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "first_name": { "type": "string", "description": "Pet name" },
          "last_name": { "type": "string", "description": "Type/breed" },
          "description": { "type": "string" }
        }
      }
    },
    "pet_guardian": { "type": "string" },
    "pet_guardian_relationship": { "type": "string" },
    "pet_fund": { "type": "boolean" },
    "pet_fund_amount": { "type": "number" },
    "cash_bens": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": { "type": "string", "enum": ["Person", "Charity"] },
          "first_name": { "type": "string" },
          "last_name": { "type": "string" },
          "name": { "type": "string" },
          "relationship": { "type": "string" },
          "amount": { "type": "number" },
          "consequence": { "type": "string" },
          "order": { "type": "integer" }
        }
      }
    },
    "bequests": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": { "type": "string", "enum": ["Person", "Charity"] },
          "first_name": { "type": "string" },
          "last_name": { "type": "string" },
          "name": { "type": "string" },
          "relationship": { "type": "string" },
          "description": { "type": "string" },
          "consequence": { "type": "string" }
        }
      }
    },
    "age_benchmarks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": { "age": { "type": "integer" } }
      }
    },
    "wedlock_requirement_enable": { "type": "boolean" },
    "wedlock_requirement": { "type": "string" },
    "attorneys": {
      "type": "array",
      "items": { "$ref": "#/$defs/personRole" }
    }
  },
  "$defs": {
    "personRole": {
      "type": "object",
      "required": ["first_name", "last_name"],
      "properties": {
        "first_name": { "type": "string" },
        "last_name": { "type": "string" },
        "name": { "type": "string" },
        "email": { "type": "string" },
        "relationship": { "type": "string" },
        "order": { "type": "integer" }
      }
    }
  }
}
