{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "nationchains/schema/tribes",
  "title": "Tribes",
  "description": "A tribe belonging to a town",
  "type": "object",
  "properties": {
    "tribeId":{
      "type":"string",
      "pattern":"^[a-z0-9]*$"
    },
    "townId": {
      "type": "string",
      "$apxenumkey": "nationchains/towns/idx/lst_townId.json"
    },
    "nationId": {
      "type": "string",
      "$apxenumkey": "nationchains/nations/idx/lst_nationId.json"
    },
    "owner": {
      "type": "string",
      "$apxenumkey": "nationchains/pagans/idx/lst_alias.json"
    },
    "dns": {
      "type": "array",
      "items":{"type":"string"}
    }
  },
  "required": ["townId", "status", "nationId", "dns"],
  "apxid":"tribeId",
  "apxuniquekey": ["tribeId"],
  "apxidx": [
    { "name":"lst_tribeId", "keyval": "tribeId" },
    { "name":"all_tribeId", "keyval": "tribeId" },
    { "name":"druidId_tribeId", "keyval": "druidId","objkey":["tribeId"] },
    { "name":"dns_tribeId", "keyval": "dns","objkey":["tribeId"]  }
  ],
  "apxacceesrights":{
    "owner":{"D":[],"U":["owner","dns"]},
    "mayor":{"C":[],"R":[]},
    "pagan":{"R":[]}
  }
}
