{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.apps.smartmate.io/apps/items/table/table.props.schema.json",
  "$$target": "https://schemas.apps.smartmate.io/apps/items/table/table.props.schema.json",
  "title": "table props",
  "type": "object",
  "properties": {
    "columns": {
      "type": "array",
      "description": "Columns to display in the table page",
      "items": {
        "oneOf": [
          {
            "$ref": "https://schemas.apps.smartmate.io/patterns/nestedIdentification.schema.json"
          },
          {
            "$ref": "https://schemas.apps.smartmate.io/patterns/parentReference.schema.json"
          },
          {
            "$ref": "https://schemas.apps.smartmate.io/patterns/parentFieldReference.schema.json"
          },
          {
            "enum": ["_summary", "_pendingTasks"]
          }
        ]
      }
    },
    "sortBy": {
      "type": "array",
      "description": "How to sort the table data by default.",
      "items": {
        "type": "object",
        "propertyNames": {
          "oneOf": [
            {
              "$ref": "https://schemas.apps.smartmate.io/patterns/nestedIdentification.schema.json"
            },
            {
              "$ref": "https://schemas.apps.smartmate.io/patterns/parentFieldReference.schema.json"
            }
          ]
        },
        "patternProperties": {
          "": {
            "enum": ["asc", "desc"]
          }
        }
      }
    },
    "userFilters": {
      "description": "Filters to display the user to easily filter data in the table",
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "https://schemas.apps.smartmate.io/patterns/nestedIdentification.schema.json"
          },
          {
            "$ref": "https://schemas.apps.smartmate.io/patterns/parentReference.schema.json"
          },
          {
            "$ref": "https://schemas.apps.smartmate.io/patterns/parentFieldReference.schema.json"
          }
        ]
      }
    },
    "actions": {
      "description": "Name of the processes you want to display as buttons in the table page",
      "type": "array",
      "items": {
        "$ref": "https://schemas.apps.smartmate.io/patterns/identification.schema.json"
      }
    },
    "fixedColumns": {
      "description": "How many columns should be fixed.",
      "type": "integer"
    },
    "filter": {
      "description": "What data to display.",
      "$ref": "https://schemas.apps.smartmate.io/tables/filter/filter.schema.json"
    },
    "hideIfEmpty": {
      "description": "Hides the item menu if the table does not have records.",
      "type": "boolean"
    }
  }
}
