{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/softsync-ai/json-schema/softsync-ai-update-form-dto-schema.json",
  "title": "UpdateFormDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/softsync-ai-forms-api-openapi.yml#/components/schemas/UpdateFormDto",
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "enabled": {
      "type": "boolean"
    },
    "configuration": {
      "$ref": "#/$defs/FormConfigurationDto"
    },
    "groupId": {
      "type": "string",
      "description": "Move the form to another group, e.g. when its group was deleted. Admins only."
    }
  },
  "required": [
    "title",
    "description",
    "enabled",
    "configuration"
  ],
  "$defs": {
    "FormAutomaticDto": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "fieldId": {
          "type": "string"
        },
        "mode": {
          "type": "string",
          "enum": [
            "fixed",
            "template",
            "submitted_at",
            "booked_at"
          ]
        },
        "value": {
          "type": "string"
        },
        "parts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FormValuePartDto"
          }
        }
      },
      "required": [
        "fieldId",
        "mode"
      ]
    },
    "FormConfigurationDto": {
      "type": "object",
      "properties": {
        "destinations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FormDestinationDto"
          }
        },
        "fieldOrder": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "fields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FormFieldDto"
          }
        },
        "automatic": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FormAutomaticDto"
          }
        },
        "design": {
          "type": "string",
          "enum": [
            "minimal",
            "card",
            "split",
            "compact",
            "bold"
          ]
        },
        "successMessage": {
          "type": "string"
        },
        "redirectUrl": {
          "type": "string"
        },
        "notifyUserIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "fields",
        "design",
        "successMessage"
      ]
    },
    "FormDestinationDto": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        },
        "groupId": {
          "type": "string"
        }
      },
      "required": [
        "path",
        "groupId"
      ]
    },
    "FormFieldDto": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "fieldId": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "required": {
          "type": "boolean"
        },
        "where": {
          "description": "Link questions only: visitors pick from the linked records that match every condition.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/FormPickFilterDto"
          }
        },
        "fromLink": {
          "type": "boolean",
          "description": "Link questions only: no list is shown; the record comes from the form's link (e.g. a portal button), so visitors never see the others."
        }
      },
      "required": [
        "fieldId"
      ]
    },
    "FormPickFilterDto": {
      "type": "object",
      "properties": {
        "fieldId": {
          "type": "string"
        },
        "equals": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            }
          ]
        }
      },
      "required": [
        "fieldId",
        "equals"
      ]
    },
    "FormValuePartDto": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text",
            "answer",
            "date",
            "time",
            "datetime"
          ]
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    }
  }
}