{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "players": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "createdAt",
          "name",
          "description"
        ]
      }
    },
    "games": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ruleset": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "createdAt",
          "name",
          "ruleset",
          "description",
          "color",
          "icon"
        ]
      }
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "memberIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "name",
          "createdAt",
          "description",
          "memberIds"
        ]
      }
    },
    "teams": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "memberIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "name",
          "createdAt",
          "memberIds"
        ]
      }
    },
    "matches": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "endedAt": {
            "type": ["string", "null"]
          },
          "gameId": {
            "type": "string"
          },
          "groupId": {
            "type": ["string", "null"]
          },
          "playerIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "createdAt",
          "gameId",
          "playerIds",
          "notes"
        ]
      }
    }
  },
  "required": [
    "players",
    "games",
    "groups",
    "teams",
    "matches"
  ]
}