{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oxymot.fr/src/assets/contracts/marketing-draft.v1.schema.json",
  "title": "Oxymot public marketing draft interchange v1",
  "description": "User-initiated drafts only; content is not verified, authorized for publication, or automatically imported into Oxymotion.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "kind",
    "status",
    "origin",
    "content"
  ],
  "properties": {
    "schema_version": {
      "const": "oxymot.marketing.v1"
    },
    "kind": {
      "enum": [
        "value_proposition",
        "differentiation",
        "argument_evidence"
      ]
    },
    "status": {
      "const": "draft_unverified"
    },
    "origin": {
      "const": "oxymot-public-resources"
    },
    "content": {
      "type": "object"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "kind": {
            "const": "value_proposition"
          }
        }
      },
      "then": {
        "properties": {
          "content": {
            "$ref": "#/$defs/valueProposition"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "kind": {
            "const": "differentiation"
          }
        }
      },
      "then": {
        "properties": {
          "content": {
            "$ref": "#/$defs/differentiation"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "kind": {
            "const": "argument_evidence"
          }
        }
      },
      "then": {
        "properties": {
          "content": {
            "$ref": "#/$defs/evidenceMatrix"
          }
        }
      }
    }
  ],
  "$defs": {
    "valueProposition": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "cible",
        "situation",
        "capacite",
        "benefice",
        "preuve"
      ],
      "properties": {
        "cible": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "situation": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "capacite": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "benefice": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "preuve": {
          "type": "string",
          "maxLength": 320
        }
      }
    },
    "differentiation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "situation",
        "alternatives",
        "difference",
        "critere",
        "preuve"
      ],
      "properties": {
        "situation": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "alternatives": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "difference": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "critere": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "preuve": {
          "type": "string",
          "maxLength": 320
        }
      }
    },
    "evidenceEntry": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "argument",
        "question",
        "justificatif",
        "portee",
        "diffusion"
      ],
      "properties": {
        "argument": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "question": {
          "type": "string",
          "maxLength": 320,
          "minLength": 1
        },
        "justificatif": {
          "type": "string",
          "maxLength": 320
        },
        "portee": {
          "type": "string",
          "maxLength": 320
        },
        "diffusion": {
          "type": "string",
          "maxLength": 320
        }
      }
    },
    "evidenceMatrix": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "arguments"
      ],
      "properties": {
        "arguments": {
          "type": "array",
          "minItems": 1,
          "maxItems": 5,
          "items": {
            "$ref": "#/$defs/evidenceEntry"
          }
        }
      }
    }
  }
}
