{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Synergon messaging artifact, schema 1.0.0",
  "type": "object",
  "required": [
    "brand_id",
    "brand_release",
    "schema_version",
    "status",
    "automation_ready",
    "records"
  ],
  "additionalProperties": false,
  "properties": {
    "brand_id": {
      "const": "synergon-solutions"
    },
    "brand_release": {
      "type": "string",
      "minLength": 1
    },
    "schema_version": {
      "const": "1.0.0"
    },
    "status": {
      "const": "approved-reference"
    },
    "automation_ready": {
      "const": false
    },
    "records": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/message"
      }
    }
  },
  "$defs": {
    "identifier": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*$"
    },
    "message": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "message_id",
        "schema_version",
        "brand_release",
        "audience_id",
        "pillar_id",
        "component_type",
        "funnel_stage",
        "narrative_role",
        "copy",
        "tone",
        "claim_refs",
        "qualifications",
        "approval_status",
        "publication_status"
      ],
      "properties": {
        "message_id": {
          "$ref": "#/$defs/identifier"
        },
        "schema_version": {
          "const": "1.0.0"
        },
        "brand_release": {
          "type": "string",
          "minLength": 1
        },
        "audience_id": {
          "$ref": "#/$defs/identifier"
        },
        "pillar_id": {
          "$ref": "#/$defs/identifier"
        },
        "component_type": {
          "$ref": "#/$defs/identifier"
        },
        "funnel_stage": {
          "enum": [
            "awareness",
            "consideration",
            "decision",
            "retention"
          ]
        },
        "narrative_role": {
          "enum": [
            "problem",
            "empathy",
            "answer",
            "change",
            "end-result"
          ]
        },
        "copy": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^—]+$"
        },
        "tone": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "claim_refs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/identifier"
          },
          "uniqueItems": true
        },
        "qualifications": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "cta_id": {
          "$ref": "#/$defs/identifier"
        },
        "approval_status": {
          "enum": [
            "draft",
            "in-review",
            "approved-strategy",
            "approved",
            "retired"
          ]
        },
        "publication_status": {
          "enum": [
            "review-required",
            "retired"
          ]
        }
      }
    }
  }
}
