{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "app/activity-modules/manifest.schema.json",
  "title": "Activity Module Manifest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "statusVariant",
    "labelKey",
    "fallbackLabel",
    "icon",
    "limit",
    "order",
    "primaryReferenceOrder",
    "timestampConfig"
  ],
  "properties": {
    "statusVariant": {
      "type": "string",
      "minLength": 1,
      "enum": [
        "default",
        "primary",
        "secondary",
        "info",
        "warning",
        "success",
        "dark"
      ]
    },
    "labelKey": {
      "type": "string",
      "minLength": 1
    },
    "fallbackLabel": {
      "type": "string",
      "minLength": 1
    },
    "icon": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "theme"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "theme": {
          "type": "string",
          "minLength": 1,
          "enum": [
            "default",
            "primary",
            "secondary",
            "info",
            "warning",
            "success",
            "dark"
          ]
        }
      }
    },
    "limit": {
      "type": "integer",
      "minimum": 1
    },
    "order": {
      "type": "integer",
      "minimum": 0
    },
    "primaryReferenceOrder": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "timestampConfig": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "payloadFields",
        "recordTimestampFields"
      ],
      "properties": {
        "payloadFields": {
          "type": "array",
          "minItems": 0,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "recordTimestampFields": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  }
}
