{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/softsync-ai/json-schema/softsync-ai-update-group-dto-schema.json",
  "title": "UpdateGroupDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/softsync-ai-groups-views-api-openapi.yml#/components/schemas/UpdateGroupDto",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Group title"
    },
    "description": {
      "type": "string",
      "description": "Group description"
    },
    "order": {
      "type": "number",
      "description": "Display order"
    },
    "metadata": {
      "type": "object",
      "description": "Additional metadata"
    },
    "visibility": {
      "description": "Group visibility",
      "allOf": [
        {
          "$ref": "#/$defs/GroupVisibility"
        }
      ]
    },
    "charts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChartConfig"
      }
    }
  },
  "$defs": {
    "BucketOrder": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ]
    },
    "ChartCategoryOrder": {
      "type": "string",
      "enum": [
        "field_asc",
        "field_desc",
        "value_asc",
        "value_desc"
      ]
    },
    "ChartConfig": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "tableId": {
          "type": "string"
        },
        "charts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChartQueryDto"
          }
        }
      },
      "required": [
        "title",
        "id",
        "charts"
      ]
    },
    "ChartForecast": {
      "type": "object",
      "properties": {
        "method": {
          "allOf": [
            {
              "$ref": "#/$defs/ForecastMethod"
            }
          ]
        },
        "periods": {
          "type": "number"
        }
      },
      "required": [
        "method",
        "periods"
      ]
    },
    "ChartMetadata": {
      "type": "object",
      "properties": {
        "categoryOrder": {
          "allOf": [
            {
              "$ref": "#/$defs/ChartCategoryOrder"
            }
          ]
        },
        "presentation": {
          "allOf": [
            {
              "$ref": "#/$defs/ChartPresentation"
            }
          ]
        },
        "target": {
          "type": "number"
        },
        "topN": {
          "type": "number",
          "minimum": 3,
          "maximum": 50
        },
        "useViewByAlias": {
          "type": "boolean"
        },
        "useGroupByAlias": {
          "type": "boolean"
        },
        "timeBucket": {
          "allOf": [
            {
              "$ref": "#/$defs/TimeBucket"
            }
          ]
        },
        "bucketOrder": {
          "allOf": [
            {
              "$ref": "#/$defs/BucketOrder"
            }
          ]
        },
        "valueMode": {
          "allOf": [
            {
              "$ref": "#/$defs/ValueMode"
            }
          ]
        },
        "period": {
          "$ref": "#/$defs/ChartPeriod"
        },
        "compareTo": {
          "allOf": [
            {
              "$ref": "#/$defs/CompareTo"
            }
          ]
        },
        "forecast": {
          "$ref": "#/$defs/ChartForecast"
        },
        "trend": {
          "$ref": "#/$defs/ChartTrend"
        },
        "asOf": {
          "$ref": "#/$defs/ChartMoment"
        },
        "from": {
          "$ref": "#/$defs/ChartMoment"
        },
        "stacked": {
          "type": "boolean"
        }
      }
    },
    "ChartMoment": {
      "type": "object",
      "properties": {
        "mode": {
          "allOf": [
            {
              "$ref": "#/$defs/MomentMode"
            }
          ]
        },
        "unit": {
          "allOf": [
            {
              "$ref": "#/$defs/TimeBucket"
            }
          ]
        },
        "n": {
          "type": "number"
        },
        "date": {
          "type": "string"
        }
      },
      "required": [
        "mode"
      ]
    },
    "ChartPeriod": {
      "type": "object",
      "properties": {
        "preset": {
          "allOf": [
            {
              "$ref": "#/$defs/PeriodPreset"
            }
          ]
        },
        "unit": {
          "allOf": [
            {
              "$ref": "#/$defs/TimeBucket"
            }
          ]
        },
        "n": {
          "type": "number"
        },
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      },
      "required": [
        "preset"
      ]
    },
    "ChartPresentation": {
      "type": "string",
      "enum": [
        "bar",
        "horizontal_bar",
        "line",
        "area",
        "pie",
        "donut",
        "funnel",
        "table",
        "gauge",
        "leaderboard",
        "heatmap",
        "treemap",
        "segmented_bar",
        "radar",
        "radial_bar",
        "pareto",
        "nested_donut",
        "stacked_area"
      ]
    },
    "ChartQueryDto": {
      "type": "object",
      "properties": {
        "tableId": {
          "type": "string"
        },
        "groupId": {
          "type": "string"
        },
        "metadata": {
          "$ref": "#/$defs/ChartMetadata"
        },
        "chartId": {
          "type": "string"
        },
        "chartType": {
          "allOf": [
            {
              "$ref": "#/$defs/ChartType"
            }
          ]
        },
        "measure": {
          "allOf": [
            {
              "$ref": "#/$defs/MeasureType"
            }
          ]
        },
        "measureField": {
          "type": "string"
        },
        "ratioFieldValue": {
          "type": "string"
        },
        "groupByField": {
          "type": "string"
        },
        "viewByField": {
          "type": "string"
        },
        "filters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FieldQueryFilter"
          }
        },
        "series": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChartSeriesDto"
          }
        },
        "workspaces": {
          "description": "Which organizations to read: 'this' (default), 'managed' (every client organization of this one you are a member of), or a list of ids (this one and/or its client organizations). Across organizations, objects and fields are matched by API name, and each result carries its workspaceId.",
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "this",
                "managed"
              ]
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "tableId",
        "groupId",
        "chartType",
        "measure"
      ]
    },
    "ChartSeriesDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "tableId": {
          "type": "string"
        },
        "groupId": {
          "type": "string"
        },
        "measure": {
          "allOf": [
            {
              "$ref": "#/$defs/MeasureType"
            }
          ]
        },
        "measureField": {
          "type": "string"
        },
        "dateField": {
          "type": "string"
        },
        "snapshot": {
          "type": "boolean"
        },
        "render": {
          "allOf": [
            {
              "$ref": "#/$defs/SeriesRender"
            }
          ]
        },
        "color": {
          "type": "string"
        },
        "valueMode": {
          "allOf": [
            {
              "$ref": "#/$defs/ValueMode"
            }
          ]
        },
        "forecast": {
          "$ref": "#/$defs/ChartForecast"
        },
        "filters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FieldQueryFilter"
          }
        }
      },
      "required": [
        "id",
        "label",
        "tableId",
        "measure"
      ]
    },
    "ChartTrend": {
      "type": "object",
      "properties": {
        "unit": {
          "allOf": [
            {
              "$ref": "#/$defs/TimeBucket"
            }
          ]
        },
        "n": {
          "type": "number",
          "minimum": 3,
          "maximum": 24
        }
      },
      "required": [
        "unit",
        "n"
      ]
    },
    "ChartType": {
      "type": "string",
      "enum": [
        "bar",
        "grouped_bar",
        "stacked_bar",
        "pie",
        "metric",
        "combo",
        "bridge"
      ]
    },
    "CompareTo": {
      "type": "string",
      "enum": [
        "previous_period",
        "previous_year"
      ]
    },
    "FieldQueryFilter": {
      "type": "object",
      "properties": {
        "fieldId": {
          "description": "Field ID to filter on",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/SystemField"
            }
          ]
        },
        "operator": {
          "description": "Filter operator: eq (equals), ne (not equals), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal), contains (substring match), in (value exists in array), is_empty (field has no value), is_not_empty (field has value)",
          "allOf": [
            {
              "$ref": "#/$defs/FilterOperator"
            }
          ]
        },
        "value": {
          "description": "Value to compare against. Type should match the field type and operator requirements.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "array"
            }
          ]
        },
        "condition": {
          "description": "Logical condition to chain with the previous filter or group (AND/OR). Defaults to AND if not specified. The first filter in the array ignores this field. For grouped filters, this determines how the group connects to the previous filter/group.",
          "allOf": [
            {
              "$ref": "#/$defs/FilterCondition"
            }
          ]
        },
        "groupId": {
          "type": "string",
          "description": "Optional group identifier. Filters sharing the same groupId are wrapped in parentheses and evaluated together as a logical unit. Filters within a group are chained using their individual condition fields. Groups are connected to each other using the condition field of the first filter in each subsequent group. Use grouping to create complex expressions like: (A OR B) AND (C OR D)."
        }
      },
      "required": [
        "fieldId",
        "operator",
        "value"
      ]
    },
    "FilterCondition": {
      "type": "string",
      "enum": [
        "and",
        "or"
      ],
      "description": "Logical condition to chain with the previous filter or group (AND/OR). Defaults to AND if not specified. The first filter in the array ignores this field. For grouped filters, this determines how the group connects to the previous filter/group."
    },
    "FilterOperator": {
      "type": "string",
      "enum": [
        "eq",
        "ne",
        "gt",
        "gte",
        "lt",
        "lte",
        "contains",
        "in",
        "is_empty",
        "is_not_empty"
      ],
      "description": "Filter operator: eq (equals), ne (not equals), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal), contains (substring match), in (value exists in array), is_empty (field has no value), is_not_empty (field has value)"
    },
    "ForecastMethod": {
      "type": "string",
      "enum": [
        "linear",
        "moving_average",
        "seasonal"
      ]
    },
    "GroupVisibility": {
      "type": "string",
      "enum": [
        "PRIVATE",
        "WORKSPACE"
      ],
      "description": "Group visibility"
    },
    "MeasureType": {
      "type": "string",
      "enum": [
        "count",
        "sum",
        "average",
        "ratio",
        "min",
        "max",
        "median",
        "distinct_count",
        "days_in_value",
        "reached"
      ]
    },
    "MomentMode": {
      "type": "string",
      "enum": [
        "now",
        "start_of",
        "ago",
        "date"
      ]
    },
    "PeriodPreset": {
      "type": "string",
      "enum": [
        "this",
        "last",
        "next",
        "to_date",
        "last_n",
        "next_n",
        "custom"
      ]
    },
    "SeriesRender": {
      "type": "string",
      "enum": [
        "bar",
        "line",
        "area"
      ]
    },
    "SystemField": {
      "type": "string",
      "enum": [
        "__system_created_at",
        "__system_updated_at",
        "__system_created_by",
        "__system_last_interaction_at",
        "__system_last_sent_at",
        "__system_last_received_at"
      ]
    },
    "TimeBucket": {
      "type": "string",
      "enum": [
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ]
    },
    "ValueMode": {
      "type": "string",
      "enum": [
        "value",
        "cumulative",
        "percent_of_total"
      ]
    }
  }
}