{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://dirac-uxi.local/schemas/site-intent.schema.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "siteKey",
    "basePath",
    "siteName",
    "siteTagline",
    "articleBffUrl",
    "productBffUrl",
    "contactBffUrl",
    "devPort",
    "packageName",
    "productCollections",
    "articleCollections",
    "routes",
    "uiCopy",
    "navigation",
    "pages"
  ],
  "properties": {
    "siteKey": { "type": "string", "minLength": 1 },
    "basePath": { "type": "string", "minLength": 0 },
    "siteName": { "type": "string", "minLength": 1 },
    "siteTagline": { "type": "string", "minLength": 1 },
    "articleBffUrl": { "type": "string", "minLength": 1 },
    "productBffUrl": { "type": "string", "minLength": 1 },
    "contactBffUrl": { "type": "string", "minLength": 1 },
    "devPort": { "type": "integer", "minimum": 1 },
    "packageName": { "type": "string", "minLength": 1 },
    "titleSuffix": { "type": "boolean" },
    "footerWidget1": { "type": "string" },
    "productCollections": {
      "type": "array",
      "items": { "type": "string", "minLength": 1 }
    },
    "articleCollections": {
      "type": "array",
      "items": { "type": "string", "minLength": 1 },
      "minItems": 1
    },
    "themeLayoutIntent": {
      "type": "object",
      "additionalProperties": false,
      "required": ["spacing"],
      "properties": {
        "spacing": {
          "type": "object",
          "additionalProperties": false,
          "required": ["sectionPadYBase", "sectionPadYSm", "blockGapY"],
          "properties": {
            "sectionPadYBase": { "type": "integer", "minimum": 0 },
            "heroPadYBase": { "type": "integer", "minimum": 0 },
            "heroPadYSm": { "type": "integer", "minimum": 0 },
            "sectionPadYSm": { "type": "integer", "minimum": 0 },
            "blockGapY": { "type": "integer", "minimum": 0 }
          }
        }
      }
    },
    "decorationIntent": {
      "type": "object",
      "additionalProperties": false,
      "required": ["backgroundRailsEnabled", "separatorWidthPx", "separatorColorRgb", "separatorBorderAlpha", "separatorFillAlpha", "separatorHatchAlpha"],
      "properties": {
        "backgroundRailsEnabled": { "type": "boolean" },
        "separatorWidthPx": { "type": "integer", "minimum": 8 },
        "separatorColorRgb": { "type": "string", "minLength": 1 },
        "separatorBorderAlpha": { "type": "number", "minimum": 0, "maximum": 1 },
        "separatorFillAlpha": { "type": "number", "minimum": 0, "maximum": 1 },
        "separatorHatchAlpha": { "type": "number", "minimum": 0, "maximum": 1 }
      }
    },
    "productsDisplayIntent": {
      "type": "object",
      "additionalProperties": false,
      "required": ["imageBackgroundWhiteOpacity", "detailImageBackgroundWhiteOpacity"],
      "properties": {
        "imageBackgroundWhiteOpacity": { "type": "number", "minimum": 0, "maximum": 1 },
        "detailImageBackgroundWhiteOpacity": { "type": "number", "minimum": 0, "maximum": 1 },
        "galleryLayout": {
          "type": "string",
          "enum": ["carousel", "grid"]
        }
      }
    },
    "hiddenProductKeys": {
      "type": "array",
      "items": { "type": "string", "minLength": 1 }
    },
    "productOrderOverrides": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": { "type": "string", "minLength": 1 }
      }
    },
    "productNameOverrides": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name"],
        "properties": {
          "name": { "type": "string", "minLength": 1 }
        }
      }
    },
    "productImageOverrides": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "required": ["mainMedia"],
        "properties": {
          "mainMedia": { "type": "string", "minLength": 1 }
        }
      }
    },
    "routes": {
      "type": "object",
      "additionalProperties": false,
      "required": ["home", "products", "articles"],
      "properties": {
        "home": { "type": "string", "minLength": 1 },
        "products": { "type": "string", "minLength": 1 },
        "articles": { "type": "string", "minLength": 1 },
        "contact": { "type": "string", "minLength": 1 }
      }
    },
    "uiCopy": {
      "type": "object",
      "additionalProperties": false,
      "required": ["shared"],
      "properties": {
        "shared": {
          "type": "object",
          "additionalProperties": false,
          "required": ["homeLabel", "allRightsReservedSuffix", "defaultAuthorName", "defaultAuthorRole"],
          "properties": {
            "homeLabel": { "type": "string" },
            "allRightsReservedSuffix": { "type": "string" },
            "defaultAuthorName": { "type": "string" },
            "defaultAuthorRole": { "type": "string" }
          }
        }
      }
    },
    "navigation": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "href"],
        "properties": {
          "name": { "type": "string", "minLength": 1 },
          "href": { "type": "string", "minLength": 1 }
        }
      }
    },
    "pages": {
      "type": "object",
      "additionalProperties": false,
      "required": ["home", "products", "productDetail", "articles", "articleDetail"],
      "properties": {
        "home": {
          "type": "object",
          "additionalProperties": false,
          "required": ["theme", "props"],
          "properties": {
            "theme": { "type": "string", "enum": ["CompanyLandingPage", "RedirectPage"] },
            "props": { "type": "object" }
          }
        },
        "products": {
          "type": "object",
          "additionalProperties": false,
          "required": ["theme", "props"],
          "properties": {
            "theme": { "type": "string", "enum": ["CollectionCatalogPage"] },
            "props": { "type": "object" }
          }
        },
        "productDetail": {
          "type": "object",
          "additionalProperties": false,
          "required": ["theme", "props"],
          "properties": {
            "theme": { "type": "string", "enum": ["ProductDetailPage"] },
            "props": { "type": "object" }
          }
        },
        "articles": {
          "type": "object",
          "additionalProperties": false,
          "required": ["theme", "props"],
          "properties": {
            "theme": { "type": "string", "enum": ["ArticleCollectionPage"] },
            "props": { "type": "object" }
          }
        },
        "articleDetail": {
          "type": "object",
          "additionalProperties": false,
          "required": ["theme", "props"],
          "properties": {
            "theme": { "type": "string", "enum": ["ArticleDetailPage"] },
            "props": { "type": "object" }
          }
        },
        "contact": {
          "type": "object",
          "additionalProperties": false,
          "required": ["theme", "props"],
          "properties": {
            "theme": { "type": "string", "enum": ["BlockStackPage"] },
            "props": { "type": "object" }
          }
        }
      }
    }
  }
}

