{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://postflight.co/aeronautiql/planning/v1_1/edits/store.schema.json",
  "title": "Planning edit store 1.1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "storeVersion",
    "document",
    "context",
    "mappings",
    "results",
    "weatherId",
    "records"
  ],
  "properties": {
    "storeVersion": {
      "const": "1.1"
    },
    "document": {
      "$ref": "https://postflight.co/aeronautiql/planning/v1/intent/intent.schema.json"
    },
    "context": {
      "$ref": "mapping.schema.json#/$defs/context"
    },
    "mappings": {
      "type": "object",
      "additionalProperties": {
        "$ref": "mapping.schema.json"
      }
    },
    "results": {
      "type": "object",
      "additionalProperties": {
        "$ref": "../results/engine-result.schema.json"
      }
    },
    "weatherId": {
      "type": "string",
      "minLength": 1
    },
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "command",
          "receipt",
          "inverse",
          "undoneBy"
        ],
        "properties": {
          "command": {
            "$ref": "command.schema.json"
          },
          "receipt": {
            "$ref": "receipt.schema.json"
          },
          "inverse": {
            "oneOf": [
              {
                "$ref": "https://postflight.co/aeronautiql/planning/v1/edits/store.schema.json#/$defs/inverse"
              },
              {
                "type": "null"
              }
            ]
          },
          "undoneBy": {
            "oneOf": [
              {
                "$ref": "https://postflight.co/aeronautiql/planning/v1/edits/command.schema.json#/$defs/id"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    },
    "reuseSources": {
      "type": "array",
      "maxItems": 2000,
      "items": {
        "$ref": "https://postflight.co/aeronautiql/planning/v1_1/results/cache-reuse.schema.json#/$defs/source"
      }
    }
  }
}
