{
  "$defs": {
    "SeriesData": {
      "additionalProperties": false,
      "description": "Inline weekly data for the POC (small). Long jobs may pass ``dataset_ref`` instead.",
      "properties": {
        "controls": {
          "additionalProperties": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "title": "Controls",
          "type": "object"
        },
        "dates": {
          "items": {
            "type": "string"
          },
          "title": "Dates",
          "type": "array"
        },
        "geo": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Geo"
        },
        "kpi": {
          "items": {
            "type": "number"
          },
          "title": "Kpi",
          "type": "array"
        },
        "spend": {
          "additionalProperties": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "title": "Spend",
          "type": "object"
        }
      },
      "required": [
        "dates",
        "kpi",
        "spend"
      ],
      "title": "SeriesData",
      "type": "object"
    }
  },
  "$id": "https://schemas.ump.dev/v1/adapter-fit-request.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "async": {
      "default": false,
      "title": "Async",
      "type": "boolean"
    },
    "client_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Client Id"
    },
    "config": {
      "additionalProperties": true,
      "description": "Engine-specific settings.",
      "title": "Config",
      "type": "object"
    },
    "currency": {
      "default": "USD",
      "title": "Currency",
      "type": "string"
    },
    "data": {
      "anyOf": [
        {
          "$ref": "#/$defs/SeriesData"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "dataset_ref": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Dataset Ref"
    },
    "kpi": {
      "default": "revenue",
      "title": "Kpi",
      "type": "string"
    },
    "n_draws": {
      "default": 200,
      "maximum": 5000,
      "minimum": 1,
      "title": "N Draws",
      "type": "integer"
    },
    "retain_data": {
      "default": true,
      "description": "False when the client allows no copies of the rows (data catalogue copy_policy transient_only or aggregates_only). The adapter MAY hold the rows in memory for this fit but MUST NOT write them to disk; persisted fit state keeps curves, draws and aggregates only (POC DATA-CATALOGUE section 4).",
      "title": "Retain Data",
      "type": "boolean"
    },
    "seed": {
      "default": 0,
      "title": "Seed",
      "type": "integer"
    },
    "truth": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Known truth for identification checks.",
      "title": "Truth"
    }
  },
  "title": "FitRequest",
  "type": "object"
}
