{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://banziga.com/brief.schema.json",
  "title": "Banziga media brief v1",
  "description": "Draft media brief. Unknown facts use null. A brief requests a recommendation and does not authorise buying. Completeness counts client, objective, geography, budget+currency, timing, reply email.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "language",
    "status",
    "client",
    "contact_name",
    "contact_email",
    "website",
    "objective",
    "context",
    "audience",
    "geography",
    "budget",
    "currency",
    "start_date",
    "end_date",
    "timing_notes",
    "targeting_details",
    "exclusions",
    "assets",
    "measurement",
    "retargeting",
    "services",
    "targeting",
    "assumptions",
    "open_questions",
    "completeness"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "language": {
      "enum": [
        "fr",
        "en"
      ]
    },
    "status": {
      "const": "draft"
    },
    "client": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 250,
      "description": "Client / brand"
    },
    "contact_name": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 250,
      "description": "Your name / authorised contact"
    },
    "contact_email": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 250,
      "description": "Reply email",
      "format": "email"
    },
    "website": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 250,
      "description": "Website or landing page",
      "format": "uri"
    },
    "objective": {
      "enum": [
        null,
        "awareness",
        "traffic",
        "conversion",
        "retargeting",
        "launch",
        "local",
        "engagement"
      ]
    },
    "context": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000,
      "description": "The client’s need"
    },
    "audience": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000,
      "description": "Who do you want to reach?"
    },
    "geography": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 250,
      "description": "Target countries, cities or areas"
    },
    "budget": {
      "type": [
        "number",
        "null"
      ],
      "exclusiveMinimum": 0,
      "description": "Indicative budget"
    },
    "currency": {
      "enum": [
        null,
        "MAD",
        "EUR",
        "USD",
        "CHF",
        "AED"
      ]
    },
    "start_date": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 250,
      "description": "Preferred start",
      "format": "date"
    },
    "end_date": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 250,
      "description": "Preferred end",
      "format": "date"
    },
    "timing_notes": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 250,
      "description": "Timing notes / timezone"
    },
    "targeting_details": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000,
      "description": "Details for selected targeting"
    },
    "exclusions": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000,
      "description": "Exclusions and brand constraints"
    },
    "assets": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000,
      "description": "Available creative and links"
    },
    "measurement": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000,
      "description": "Measurement and intended metrics"
    },
    "retargeting": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000,
      "description": "Available retargeting audiences"
    },
    "services": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "enum": [
          "display",
          "video",
          "native_ads"
        ]
      }
    },
    "targeting": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "enum": [
          "context",
          "audience",
          "geography",
          "whitelist",
          "device",
          "retargeting",
          "schedule",
          "frequency",
          "exclusions"
        ]
      }
    },
    "assumptions": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 2000
      },
      "maxItems": 2000
    },
    "open_questions": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 2000
      },
      "maxItems": 2000
    },
    "completeness": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "provided",
        "total",
        "missing"
      ],
      "properties": {
        "provided": {
          "type": "integer",
          "minimum": 0,
          "maximum": 6
        },
        "total": {
          "const": 6
        },
        "missing": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 6
        }
      }
    }
  }
}
