{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vicem-ai/json-schema/vicem-ai-answers-response-schema.json",
  "title": "AnswersResponse",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vicem-ai-openapi.json#/components/schemas/AnswersResponse",
  "type": "object",
  "properties": {
    "cards": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9_-]{1,24}$"
              },
              "source": {
                "type": "string",
                "maxLength": 200
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "type": {
                "type": "string",
                "const": "hours"
              },
              "weekly": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "enum": [
                    "mon",
                    "tue",
                    "wed",
                    "thu",
                    "fri",
                    "sat",
                    "sun"
                  ]
                },
                "additionalProperties": {
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "open": {
                        "type": "string",
                        "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                      },
                      "close": {
                        "type": "string",
                        "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                      }
                    },
                    "required": [
                      "open",
                      "close"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "holidays": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "closed": {
                      "type": "boolean"
                    },
                    "spans": {
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "open": {
                            "type": "string",
                            "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                          },
                          "close": {
                            "type": "string",
                            "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                          }
                        },
                        "required": [
                          "open",
                          "close"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "note": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 60
                    }
                  },
                  "required": [
                    "date"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9_-]{1,24}$"
              },
              "source": {
                "type": "string",
                "maxLength": 200
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "type": {
                "type": "string",
                "const": "area"
              },
              "places": {
                "minItems": 1,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                }
              }
            },
            "required": [
              "type",
              "places"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9_-]{1,24}$"
              },
              "source": {
                "type": "string",
                "maxLength": 200
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "type": {
                "type": "string",
                "const": "service"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "priceMin": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000
              },
              "priceMax": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "unit": {
                "type": "string",
                "minLength": 1,
                "maxLength": 24
              }
            },
            "required": [
              "type",
              "name"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9_-]{1,24}$"
              },
              "source": {
                "type": "string",
                "maxLength": 200
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "type": {
                "type": "string",
                "const": "address"
              },
              "address": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "parking": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              }
            },
            "required": [
              "type",
              "address"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9_-]{1,24}$"
              },
              "source": {
                "type": "string",
                "maxLength": 200
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "type": {
                "type": "string",
                "const": "payment"
              },
              "methods": {
                "minItems": 1,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 32
                }
              }
            },
            "required": [
              "type",
              "methods"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9_-]{1,24}$"
              },
              "source": {
                "type": "string",
                "maxLength": 200
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "type": {
                "type": "string",
                "const": "policy"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              }
            },
            "required": [
              "type",
              "title",
              "text"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9_-]{1,24}$"
              },
              "source": {
                "type": "string",
                "maxLength": 200
              },
              "note": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "type": {
                "type": "string",
                "const": "qa"
              },
              "question": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "answer": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              }
            },
            "required": [
              "type",
              "question",
              "answer"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "version": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "proposals": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/Id"
          },
          "source": {
            "type": "string"
          },
          "sourceLabel": {
            "type": "string"
          },
          "card": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9_-]{1,24}$"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "type": {
                    "type": "string",
                    "const": "hours"
                  },
                  "weekly": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": [
                        "mon",
                        "tue",
                        "wed",
                        "thu",
                        "fri",
                        "sat",
                        "sun"
                      ]
                    },
                    "additionalProperties": {
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "open": {
                            "type": "string",
                            "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                          },
                          "close": {
                            "type": "string",
                            "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                          }
                        },
                        "required": [
                          "open",
                          "close"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "holidays": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "date": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "closed": {
                          "type": "boolean"
                        },
                        "spans": {
                          "maxItems": 3,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "open": {
                                "type": "string",
                                "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                              },
                              "close": {
                                "type": "string",
                                "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                              }
                            },
                            "required": [
                              "open",
                              "close"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "note": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 60
                        }
                      },
                      "required": [
                        "date"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9_-]{1,24}$"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "type": {
                    "type": "string",
                    "const": "area"
                  },
                  "places": {
                    "minItems": 1,
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 60
                    }
                  }
                },
                "required": [
                  "type",
                  "places"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9_-]{1,24}$"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "type": {
                    "type": "string",
                    "const": "service"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "priceMin": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000
                  },
                  "priceMax": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "unit": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 24
                  }
                },
                "required": [
                  "type",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9_-]{1,24}$"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "type": {
                    "type": "string",
                    "const": "address"
                  },
                  "address": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "parking": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  }
                },
                "required": [
                  "type",
                  "address"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9_-]{1,24}$"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "type": {
                    "type": "string",
                    "const": "payment"
                  },
                  "methods": {
                    "minItems": 1,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 32
                    }
                  }
                },
                "required": [
                  "type",
                  "methods"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9_-]{1,24}$"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "type": {
                    "type": "string",
                    "const": "policy"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  }
                },
                "required": [
                  "type",
                  "title",
                  "text"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9_-]{1,24}$"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "type": {
                    "type": "string",
                    "const": "qa"
                  },
                  "question": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "answer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  }
                },
                "required": [
                  "type",
                  "question",
                  "answer"
                ],
                "additionalProperties": false
              }
            ]
          },
          "evidenceUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "replaces": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[a-z0-9_-]{1,24}$"
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "note": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "type": {
                        "type": "string",
                        "const": "hours"
                      },
                      "weekly": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "enum": [
                            "mon",
                            "tue",
                            "wed",
                            "thu",
                            "fri",
                            "sat",
                            "sun"
                          ]
                        },
                        "additionalProperties": {
                          "maxItems": 3,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "open": {
                                "type": "string",
                                "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                              },
                              "close": {
                                "type": "string",
                                "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                              }
                            },
                            "required": [
                              "open",
                              "close"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "holidays": {
                        "maxItems": 20,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "closed": {
                              "type": "boolean"
                            },
                            "spans": {
                              "maxItems": 3,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "open": {
                                    "type": "string",
                                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                                  },
                                  "close": {
                                    "type": "string",
                                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                                  }
                                },
                                "required": [
                                  "open",
                                  "close"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "note": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 60
                            }
                          },
                          "required": [
                            "date"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[a-z0-9_-]{1,24}$"
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "note": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "type": {
                        "type": "string",
                        "const": "area"
                      },
                      "places": {
                        "minItems": 1,
                        "maxItems": 20,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 60
                        }
                      }
                    },
                    "required": [
                      "type",
                      "places"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[a-z0-9_-]{1,24}$"
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "note": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "type": {
                        "type": "string",
                        "const": "service"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "priceMin": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1000000
                      },
                      "priceMax": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1000000
                      },
                      "currency": {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      "unit": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 24
                      }
                    },
                    "required": [
                      "type",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[a-z0-9_-]{1,24}$"
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "note": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "type": {
                        "type": "string",
                        "const": "address"
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "parking": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      }
                    },
                    "required": [
                      "type",
                      "address"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[a-z0-9_-]{1,24}$"
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "note": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "type": {
                        "type": "string",
                        "const": "payment"
                      },
                      "methods": {
                        "minItems": 1,
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 32
                        }
                      }
                    },
                    "required": [
                      "type",
                      "methods"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[a-z0-9_-]{1,24}$"
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "note": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "type": {
                        "type": "string",
                        "const": "policy"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 300
                      }
                    },
                    "required": [
                      "type",
                      "title",
                      "text"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[a-z0-9_-]{1,24}$"
                      },
                      "source": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "note": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "type": {
                        "type": "string",
                        "const": "qa"
                      },
                      "question": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "answer": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 300
                      }
                    },
                    "required": [
                      "type",
                      "question",
                      "answer"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/$defs/IsoDate"
          }
        },
        "required": [
          "id",
          "source",
          "sourceLabel",
          "card",
          "evidenceUrl",
          "createdAt"
        ],
        "additionalProperties": false
      }
    },
    "imports": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "website",
              "google",
              "file"
            ]
          },
          "input": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed",
              "forgotten"
            ]
          },
          "pages": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "proposals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "$ref": "#/$defs/IsoDate"
          }
        },
        "required": [
          "id",
          "kind",
          "input",
          "source",
          "status",
          "pages",
          "proposals",
          "error",
          "createdAt"
        ],
        "additionalProperties": false
      }
    },
    "gaps": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/Id"
          },
          "question": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "lastAskedAt": {
            "$ref": "#/$defs/IsoDate"
          },
          "interactionIds": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/Id"
            }
          }
        },
        "required": [
          "id",
          "question",
          "count",
          "lastAskedAt",
          "interactionIds"
        ],
        "additionalProperties": false
      }
    },
    "intake": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "template": {
              "type": "string",
              "enum": [
                "real_estate",
                "trades",
                "legal",
                "clinic",
                "custom",
                "recruiter"
              ]
            },
            "questions": {
              "minItems": 1,
              "maxItems": 8,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,23}$"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "ask": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "budget",
                      "timeline",
                      "emergency",
                      "other"
                    ]
                  }
                },
                "required": [
                  "key",
                  "label",
                  "ask"
                ],
                "additionalProperties": false
              }
            },
            "thresholds": {
              "type": "object",
              "properties": {
                "hot": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100
                },
                "warm": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 99
                }
              },
              "required": [
                "hot",
                "warm"
              ],
              "additionalProperties": false
            },
            "minBudget": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000
            },
            "minBudgetCurrency": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          "required": [
            "enabled",
            "template",
            "questions",
            "thresholds"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "templates": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string",
            "enum": [
              "real_estate",
              "trades",
              "legal",
              "clinic",
              "custom",
              "recruiter"
            ]
          },
          "label": {
            "type": "string"
          },
          "questions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,23}$"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "ask": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "budget",
                    "timeline",
                    "emergency",
                    "other"
                  ]
                }
              },
              "required": [
                "key",
                "label",
                "ask"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "template",
          "label",
          "questions"
        ],
        "additionalProperties": false
      }
    },
    "leads": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/Id"
          },
          "interactionId": {
            "$ref": "#/$defs/Id"
          },
          "at": {
            "$ref": "#/$defs/IsoDate"
          },
          "template": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "label",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "band": {
            "type": "string",
            "enum": [
              "hot",
              "warm",
              "cold"
            ]
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "interactionId",
          "at",
          "template",
          "fields",
          "score",
          "band",
          "reasons"
        ],
        "additionalProperties": false
      }
    },
    "googleAvailable": {
      "type": "boolean"
    }
  },
  "required": [
    "cards",
    "version",
    "proposals",
    "imports",
    "gaps",
    "intake",
    "templates",
    "leads",
    "googleAvailable"
  ],
  "additionalProperties": false,
  "$defs": {
    "Id": {
      "type": "string",
      "minLength": 3,
      "maxLength": 64
    },
    "IsoDate": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    }
  }
}