{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://brainx.local/modules/manifest.schema.json",
  "title": "BrainX Module Manifest",
  "type": "object",
  "required": [
    "meta"
  ],
  "additionalProperties": false,
  "properties": {
    "meta": {
      "type": "object",
      "required": [
        "tableName",
        "routeModule",
        "translationScope"
      ],
      "additionalProperties": false,
      "properties": {
        "tableName": {
          "type": "string"
        },
        "routeModule": {
          "type": "string"
        },
        "translationScope": {
          "type": "string"
        }
      }
    },
    "edit": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "pageTitleKey": {
          "type": "string"
        }
      }
    },
    "info": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "pageTitleKey": {
          "type": "string"
        },
        "listModuleName": {
          "type": "string"
        }
      }
    },
    "new": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "pageTitleKey": {
          "type": "string"
        }
      }
    },
    "list": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "standard",
            "report"
          ]
        },
        "emptyTitleKey": {
          "type": "string"
        },
        "emptyDescriptionKey": {
          "type": "string"
        },
        "emptyActionKey": {
          "type": "string"
        },
        "sectionClass": {
          "type": "string"
        },
        "headerVariant": {
          "type": "string"
        },
        "headerLabelMode": {
          "type": "string"
        },
        "headerIsFirstMode": {
          "type": "string"
        },
        "navIcon": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "type": "string"
          }
        },
        "quickActions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "moduleDetail": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "blocks": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "links",
              "overview",
              "related"
            ]
          }
        },
        "paths": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "info": {
              "type": "string"
            },
            "secondary": {
              "type": "string"
            }
          }
        },
        "ui": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "error": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "titleKey": {
                  "type": "string"
                },
                "alertTestId": {
                  "type": "string"
                }
              }
            },
            "empty": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "titleKey": {
                  "type": "string"
                },
                "descriptionKey": {
                  "type": "string"
                }
              }
            },
            "page": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "titleKey": {
                  "type": "string"
                }
              }
            },
            "links": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "testId": {
                  "type": "string"
                },
                "className": {
                  "type": "string"
                },
                "info": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "testId": {
                      "type": "string"
                    },
                    "icon": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "minItems": 1
                        }
                      ]
                    },
                    "labelKey": {
                      "type": "string"
                    }
                  }
                },
                "comments": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "testId": {
                      "type": "string"
                    },
                    "icon": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "minItems": 1
                        }
                      ]
                    },
                    "labelKey": {
                      "type": "string"
                    }
                  }
                },
                "activity": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "testId": {
                      "type": "string"
                    },
                    "icon": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "minItems": 1
                        }
                      ]
                    },
                    "labelKey": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "related": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "className": {
                  "type": "string"
                },
                "emptyClassName": {
                  "type": "string"
                },
                "headingKey": {
                  "type": "string"
                },
                "headingTestId": {
                  "type": "string"
                },
                "linksTestId": {
                  "type": "string"
                },
                "emptyTextKey": {
                  "type": "string"
                },
                "linkTestPrefix": {
                  "type": "string"
                },
                "relationLabelKey": {
                  "type": "string"
                }
              }
            },
            "overview": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "titleKey": {
                  "type": "string"
                },
                "sectionTestId": {
                  "type": "string"
                },
                "headingTestId": {
                  "type": "string"
                },
                "organizationLabelKey": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "listStrategy": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "layout": {
          "type": "string",
          "enum": [
            "list",
            "card"
          ]
        },
        "pageTitleKey": {
          "type": "string"
        },
        "sync": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "detailLogic": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "comingSoonTranslationKey": {
          "type": "string"
        },
        "includeReferenceOverviewRow": {
          "type": "boolean"
        },
        "overviewFieldIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "listMatchAliases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "preloadTargets": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "highlightRelationModuleKey": {
          "type": "string"
        },
        "showRelatedWhenHeroLoaded": {
          "type": "boolean"
        },
        "showTopLinksWhenHeroLoaded": {
          "type": "boolean"
        },
        "supportsHeroQuickActions": {
          "type": "boolean"
        }
      }
    }
  }
}
