{
  "$defs": {
    "ArchitectureModel": {
      "description": "Brand architecture model.",
      "enum": [
        "branded-house",
        "endorsed",
        "house-of-brands",
        "hybrid"
      ],
      "type": "string"
    },
    "BrandGovernance": {
      "description": "Brand governance rules.",
      "properties": {
        "approval_process": {
          "type": [
            "string",
            "null"
          ]
        },
        "owner": {
          "$ref": "#/$defs/PathRef"
        },
        "review_required_for": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "owner"
      ],
      "type": "object"
    },
    "BrandVersionEntry": {
      "description": "Brand version history entry.",
      "properties": {
        "approved_by": {
          "anyOf": [
            {
              "$ref": "#/$defs/PathRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "changes": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "date": {
          "$ref": "#/$defs/IsoDate"
        },
        "rationale": {
          "type": [
            "string",
            "null"
          ]
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "version",
        "date",
        "changes"
      ],
      "type": "object"
    },
    "CoBrandingRules": {
      "description": "Co-branding rules.",
      "properties": {
        "approved_arrangements": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "max_size_ratio": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "min_clear_space_px": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "prohibited_contexts": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "separator_style": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "NamingConvention": {
      "description": "Naming convention rules. Includes examples (D2: non-derivable).",
      "properties": {
        "examples": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "max_characters": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "pattern": {
          "type": "string"
        },
        "prohibited_patterns": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "pattern"
      ],
      "type": "object"
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    },
    "SubBrand": {
      "description": "Sub-brand within the architecture.",
      "properties": {
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "product_ref": {
          "anyOf": [
            {
              "$ref": "#/$defs/PathRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "relationship_type": {
          "$ref": "#/$defs/SubBrandRelationship"
        },
        "visual_independence_level": {
          "format": "int64",
          "maximum": 5,
          "minimum": 1,
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "relationship_type"
      ],
      "type": "object"
    },
    "SubBrandRelationship": {
      "description": "Sub-brand relationship type.",
      "enum": [
        "primary",
        "endorsed",
        "independent",
        "feature"
      ],
      "type": "string"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.7.1/brand-architecture.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Brand architecture definition.",
  "properties": {
    "co_branding": {
      "anyOf": [
        {
          "$ref": "#/$defs/CoBrandingRules"
        },
        {
          "type": "null"
        }
      ]
    },
    "governance": {
      "anyOf": [
        {
          "$ref": "#/$defs/BrandGovernance"
        },
        {
          "type": "null"
        }
      ]
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "master_brand": {
      "type": "string"
    },
    "model": {
      "$ref": "#/$defs/ArchitectureModel"
    },
    "naming_convention": {
      "anyOf": [
        {
          "$ref": "#/$defs/NamingConvention"
        },
        {
          "type": "null"
        }
      ]
    },
    "sub_brands": {
      "default": [],
      "items": {
        "$ref": "#/$defs/SubBrand"
      },
      "type": "array"
    },
    "version_history": {
      "default": [],
      "items": {
        "$ref": "#/$defs/BrandVersionEntry"
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "model",
    "master_brand"
  ],
  "title": "BrandArchitecture",
  "type": "object"
}