{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Mountain Man Plumbing water-heater installation knowledge record",
  "description": "Public editorial planning records. source_ids and checks reference IDs in the same document; each collection must have unique IDs.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "schema_version",
    "id",
    "version",
    "updated",
    "title",
    "summary",
    "page_path",
    "hub_path",
    "maintainer",
    "scope",
    "updates",
    "history",
    "sources",
    "equipment",
    "checks",
    "terms",
    "quote_items",
    "faqs"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "minLength": 1
    },
    "schema_version": {
      "const": "1.0"
    },
    "id": {
      "const": "water-heater-installation"
    },
    "version": {
      "type": "string",
      "minLength": 1
    },
    "updated": {
      "type": "string",
      "minLength": 1,
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "summary": {
      "type": "string",
      "minLength": 1
    },
    "page_path": {
      "type": "string",
      "minLength": 1
    },
    "hub_path": {
      "type": "string",
      "minLength": 1
    },
    "maintainer": {
      "type": "string",
      "minLength": 1
    },
    "scope": {
      "type": "string",
      "minLength": 1
    },
    "updates": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "knowledge",
        "projects",
        "formats"
      ],
      "properties": {
        "knowledge": {
          "type": "string",
          "minLength": 1
        },
        "projects": {
          "type": "string",
          "minLength": 1
        },
        "formats": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        }
      }
    },
    "history": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "date",
          "change"
        ],
        "properties": {
          "version": {
            "type": "string",
            "minLength": 1
          },
          "date": {
            "type": "string",
            "minLength": 1,
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "change": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "minItems": 1
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "url",
          "checked",
          "scope"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9-]*$"
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "pattern": "^https://"
          },
          "checked": {
            "type": "string",
            "minLength": 1,
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "scope": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "minItems": 1
    },
    "equipment": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "short",
          "explanation",
          "decision",
          "capacity",
          "checks",
          "questions",
          "source_ids",
          "learn"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9-]*$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "short": {
            "type": "string",
            "minLength": 1
          },
          "explanation": {
            "type": "string",
            "minLength": 1
          },
          "decision": {
            "type": "string",
            "minLength": 1
          },
          "capacity": {
            "type": "string",
            "minLength": 1
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "uniqueItems": true
          },
          "questions": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "uniqueItems": true
          },
          "learn": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "path",
              "label"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        }
      },
      "minItems": 1
    },
    "checks": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "why",
          "bring",
          "tech",
          "source_ids"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9-]*$"
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "why": {
            "type": "string",
            "minLength": 1
          },
          "bring": {
            "type": "string",
            "minLength": 1
          },
          "tech": {
            "type": "string",
            "minLength": 1
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "uniqueItems": true
          }
        }
      },
      "uniqueItems": true,
      "minItems": 1
    },
    "terms": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "meaning",
          "source_ids"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9-]*$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "meaning": {
            "type": "string",
            "minLength": 1
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "uniqueItems": true
          }
        }
      },
      "minItems": 1
    },
    "quote_items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "question"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9-]*$"
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "question": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "minItems": 1
    },
    "faqs": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "question",
          "answer",
          "source_ids"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9-]*$"
          },
          "question": {
            "type": "string",
            "minLength": 1
          },
          "answer": {
            "type": "string",
            "minLength": 1
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "uniqueItems": true
          }
        }
      },
      "minItems": 1
    }
  }
}
