{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ghana-gds.github.io/ggds/ggds-site.schema.json",
  "title": "GGDS website settings (ggds-site.json)",
  "description": "An institution's settings for the GGDS agency website starter: made by the website builder and npx @ggds/create, which make the same website again from it.",
  "type": "object",
  "required": [
    "name",
    "short",
    "host",
    "email",
    "phone"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "ggds": {
      "type": "string",
      "description": "The GGDS version the website was made with"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "The institution's full name"
    },
    "short": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9&]{0,5}$",
      "description": "Its initials, in the badge and in reference numbers"
    },
    "purpose": {
      "type": "string",
      "description": "What it does, in one sentence"
    },
    "host": {
      "type": "string",
      "description": "The website's address, such as www.example.gov.gh"
    },
    "theme": {
      "type": "string",
      "description": "A ready-made theme, such as nca, or the institution's colour as #rrggbb"
    },
    "phone": {
      "type": "string"
    },
    "hours": {
      "type": "string",
      "description": "Opening hours, such as Monday to Friday, 8am to 5pm"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "offices": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "lines"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          }
        }
      }
    },
    "parts": {
      "type": "object",
      "properties": {
        "apply": {
          "type": "boolean",
          "description": "Apply online: For the service marked \"online\": a start page, a form, check your answers and a confirmation"
        },
        "fees": {
          "type": "boolean",
          "description": "Fees and charges: A table of what each service costs"
        },
        "complaint": {
          "type": "boolean",
          "description": "Complaints and feedback: A form and a confirmation"
        },
        "news": {
          "type": "boolean",
          "description": "News and notices: A list of news and an article"
        },
        "publications": {
          "type": "boolean",
          "description": "Documents to download: Rules, policies, plans and reports"
        },
        "jobs": {
          "type": "boolean",
          "description": "Jobs and tenders: Vacancies and tenders, with a warning about fees"
        }
      },
      "additionalProperties": false
    },
    "forms": {
      "type": "string",
      "description": "Where the forms send their answers, starting https://; empty: nowhere yet"
    },
    "live": {
      "type": "boolean",
      "description": "Whether search engines may find the website"
    },
    "logo": {
      "type": "string",
      "pattern": "^(assets/[\\w.-]+\\.(svg|png|jpe?g|webp))?$",
      "description": "The logo file in the website, such as assets/logo.svg"
    },
    "kind": {
      "enum": [
        "agency",
        "ministry",
        "assembly",
        "health",
        "education"
      ],
      "description": "The kind of institution: the words the website starts from"
    },
    "question": {
      "type": "string",
      "description": "The question at the top of the homepage"
    },
    "lede": {
      "type": "string",
      "description": "The line under it"
    },
    "services": {
      "type": "array",
      "description": "What people come to do: each service has its own page",
      "items": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "group": {
            "type": "string",
            "description": "Its heading on the Services page"
          },
          "task": {
            "type": "boolean",
            "description": "On the homepage as a common task"
          },
          "online": {
            "type": "boolean",
            "description": "Has the online application (one service at most)"
          },
          "who": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "need": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "time": {
            "type": "string"
          },
          "cost": {
            "type": "string"
          },
          "how": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What people choose on the online form"
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 2,
              "maxItems": 2
            },
            "description": "What happens after they apply: [what, when]"
          }
        }
      }
    },
    "fees": {
      "type": "object",
      "properties": {
        "caption": {
          "type": "string"
        },
        "lead": {
          "type": "string"
        },
        "columns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 4
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "news": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "body": {
            "type": "string",
            "description": "The first item's article: paragraphs separated by a blank line"
          }
        }
      }
    },
    "publications": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "date": {
            "type": "string"
          }
        }
      }
    },
    "jobs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "place": {
            "type": "string"
          },
          "terms": {
            "type": "string"
          },
          "closes": {
            "type": "string"
          }
        }
      }
    },
    "about": {
      "type": "object",
      "properties": {
        "what": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "who": {
          "type": "string"
        },
        "funded": {
          "type": "string"
        }
      }
    }
  }
}
