{
  "type": "object",
  "properties": {
    "safeName": {
      "description": "Product template reference (safe name) the form binds to.",
      "type": "string"
    },
    "id": {
      "description": "Product template db id (kept alongside safeName by the template dropdown).",
      "type": "number"
    },
    "htmlContent": {
      "description": "User-authored form HTML rendered inside the iframe.",
      "type": "string"
    },
    "displayMode": {
      "description": "\"table\": row list + form dialog; \"single\": always the first entry (project constants).",
      "enum": ["single", "table"],
      "type": "string"
    },
    "mapping": {
      "description": "Static field mapping: input id (data-dween-field) → template attribute referenceName.",
      "$ref": "#/definitions/Record<string,string>"
    },
    "rowGroups": {
      "description": "Dynamic row groups: group id (data-dween-rows) → { column id (data-dween-col) →\nMULTI_VALUE attribute referenceName }. Row i = values[i] across the group's attributes.",
      "$ref": "#/definitions/Record<string,Record<string,string>>"
    },
    "keyStrategy": {
      "description": "How the template's mandatory key column is produced on create.",
      "enum": ["AUTO_TIMESTAMP", "AUTO_UUID", "MAPPED_INPUT"],
      "type": "string"
    },
    "tableColumns": {
      "description": "Table mode: attribute referenceNames shown as columns (empty → all).",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "loadingOverrides": {
      "description": "Table mode: server-side loading overrides (loading type, and which date\ncolumns the window filters by). Same shape as the other template-driven\ncomponents.",
      "$ref": "#/definitions/ITemplateLoadingOverrides"
    },
    "windowConfig": {
      "description": "Table mode: the default date window (period/offset/truncation) the header\nopens with. Independent of the loading type — it only decides which dates\nare preselected.",
      "$ref": "#/definitions/IPeriodLoadingConfig"
    },
    "itemsPerPage": {
      "description": "Table mode: rows per page.",
      "type": "number"
    },
    "fillFormLabel": {
      "description": "Table mode: label of the create button (defaults to a translated \"Fill form...\").",
      "type": "string"
    },
    "hideHeader": {
      "type": "boolean"
    }
  },
  "definitions": {
    "Record<string,string>": {
      "type": "object"
    },
    "Record<string,Record<string,string>>": {
      "type": "object"
    },
    "ITemplateLoadingOverrides": {
      "description": "Server-side loading overrides for components reading product template\nentries with a date window. Each part is independent and falls back to the\ntemplate's own configuration when unset; sent as the loadingType /\nstartAttribute / stopAttribute query params.",
      "type": "object",
      "properties": {
        "loadingType": {
          "enum": [
            "EVERYTHING",
            "FIXED_PERIOD",
            "OVERLAP",
            "OVERLAP_OPEN_ENDED",
            "RANGE"
          ],
          "type": "string"
        },
        "startAttribute": {
          "description": "Temporal (DATETIME/INSTANT) attribute the window's start filters by.",
          "type": "string"
        },
        "stopAttribute": {
          "description": "Temporal (DATETIME/INSTANT) attribute the window's end filters by.",
          "type": "string"
        }
      }
    },
    "IPeriodLoadingConfig": {
      "type": "object",
      "properties": {
        "defaultConfigUnit": {
          "enum": [
            "DAYS",
            "HALFHOUR",
            "HOURS",
            "MILLIS",
            "MINUTES",
            "MONTHS",
            "SECONDS",
            "WEEKS",
            "YEARS"
          ],
          "type": "string"
        },
        "truncateStartUnit": {
          "enum": [
            "DAYS",
            "HALFHOUR",
            "HOURS",
            "MILLIS",
            "MINUTES",
            "MONTHS",
            "SECONDS",
            "WEEKS",
            "YEARS"
          ],
          "type": "string"
        },
        "periodUnit": {
          "enum": [
            "DAYS",
            "HALFHOUR",
            "HOURS",
            "MILLIS",
            "MINUTES",
            "MONTHS",
            "SECONDS",
            "WEEKS",
            "YEARS"
          ],
          "type": "string"
        },
        "period": {
          "type": "number"
        },
        "offsetUnit": {
          "enum": [
            "DAYS",
            "HALFHOUR",
            "HOURS",
            "MILLIS",
            "MINUTES",
            "MONTHS",
            "SECONDS",
            "WEEKS",
            "YEARS"
          ],
          "type": "string"
        },
        "offset": {
          "type": "number"
        }
      }
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
