{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/Sharathvc23/forgetproof/main/schemas/forget-me/v1/preview.schema.json",
  "title": "ForgetMe v1: Preview",
  "description": "What a preview answers: the item, who holds it (and whether each holder keeps anything at all), what will change, the exceptions the person decides, and the exact terms submit must echo. A preview has no side effects. Servers may add fields; clients ignore what they don't know.",
  "type": "object",
  "properties": {
    "namespace": {
      "$ref": "common.schema.json#/$defs/namespace"
    },
    "version": {
      "$ref": "common.schema.json#/$defs/version"
    },
    "scope": {
      "$ref": "common.schema.json#/$defs/scope"
    },
    "item": {
      "$ref": "common.schema.json#/$defs/item"
    },
    "holders": {
      "type": "array",
      "maxItems": 32,
      "items": {
        "$ref": "common.schema.json#/$defs/holder"
      }
    },
    "retention": {
      "description": "The item's retention over all holders: persistent if any holder keeps it, none if no holder keeps anything, unknown if some holder can't say. Unknown is not none.",
      "$ref": "common.schema.json#/$defs/retention"
    },
    "changes": {
      "type": "array",
      "maxItems": 32,
      "items": {
        "$ref": "common.schema.json#/$defs/text"
      }
    },
    "exceptions": {
      "description": "Other places the exact value lives that the person decides about: another live record of theirs, a recipient the host shared it with, a record a holder keeps under a disclosed retention (then the only option is keep). A recipient that speaks Poppy and states the exact terms it will perform carries them in `approval`; the person's confirmation with that recipient chosen is the approval of exactly that revision (phase 3).",
      "type": "array",
      "maxItems": 64,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "label": {
            "$ref": "common.schema.json#/$defs/label"
          },
          "text": {
            "$ref": "common.schema.json#/$defs/text"
          },
          "holders": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200
            }
          },
          "party": {
            "$ref": "common.schema.json#/$defs/label"
          },
          "default": {
            "$ref": "common.schema.json#/$defs/choice"
          },
          "options": {
            "type": "array",
            "minItems": 1,
            "maxItems": 2,
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "$ref": "common.schema.json#/$defs/choice"
                },
                "label": {
                  "$ref": "common.schema.json#/$defs/label"
                }
              },
              "required": [
                "value",
                "label"
              ],
              "additionalProperties": false
            }
          },
          "reason": {
            "$ref": "common.schema.json#/$defs/text"
          },
          "retained_until": {
            "$ref": "common.schema.json#/$defs/nullable-date-time"
          },
          "approval": {
            "$ref": "common.schema.json#/$defs/approval-offer"
          }
        },
        "required": [
          "id",
          "label",
          "default",
          "options"
        ]
      }
    },
    "terms": {
      "$ref": "common.schema.json#/$defs/terms"
    },
    "note": {
      "$ref": "common.schema.json#/$defs/text"
    }
  },
  "required": [
    "namespace",
    "version",
    "scope",
    "item",
    "holders",
    "retention",
    "changes",
    "exceptions",
    "terms"
  ],
  "additionalProperties": true
}
