{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/common-catalog-data/_shared/latest--schema-0.3.0.json",
  "description": "Represents a Common Schema for any Catalog Data\nThis is used for a full relationship declaration in the menu service",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/howlowck/common-catalog-schema/main/json-schemas/schema-0.3.0.json",
    "sourceSha256": "72ec2bb0d7801196922132d25e9a499f74f438618ffd0626d3f18a1a5a5a00bd"
  },
  "type": "object",
  "properties": {
    "classifications": {
      "description": "Classification Data and how different classifications relates to one another",
      "items": {
        "$ref": "#/$defs/Classification"
      },
      "title": "classifications",
      "type": "array"
    },
    "concepts": {
      "description": "All abstract concepts that ties different concrete items or abstract values together\nthis is also used to create complex mappings between different concrete items",
      "items": {
        "$ref": "#/$defs/Concept"
      },
      "title": "concepts",
      "type": "array"
    },
    "items": {
      "description": "All concrete items in a catalog (usually each item tied to a specific sku)",
      "items": {
        "$ref": "#/$defs/ItemDefinition"
      },
      "title": "items",
      "type": "array"
    },
    "title": {
      "description": "Title of the data",
      "title": "title",
      "type": "string"
    }
  },
  "propertyOrder": [
    "title",
    "classifications",
    "items",
    "concepts"
  ],
  "$defs": {
    "AddOn": {
      "type": "object",
      "description": "Represents an AddOn in an Item Definition",
      "properties": {
        "attributes": {
          "items": {
            "$ref": "#/$defs/Attribute"
          },
          "title": "attributes",
          "type": "array"
        },
        "choiceType": {
          "$ref": "#/$defs/AddOnChoiceType",
          "title": "choiceType"
        },
        "itemId": {
          "description": "Id of the Item",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "itemId",
          "type": "string"
        },
        "option": {
          "anyOf": [
            {
              "$ref": "#/$defs/ConceptOption"
            },
            {
              "$ref": "#/$defs/RangeOption"
            }
          ],
          "title": "option"
        },
        "target": {
          "$ref": "#/$defs/Target",
          "title": "target"
        }
      },
      "propertyOrder": [
        "itemId",
        "target",
        "choiceType",
        "attributes",
        "option"
      ],
      "title": "AddOn",
      "additionalProperties": false
    },
    "AddOnChoiceType": {
      "enum": [
        "option",
        "range"
      ],
      "title": "AddOnChoiceType",
      "type": "string"
    },
    "Attribute": {
      "type": "object",
      "description": "Represents an Attribute",
      "properties": {
        "conceptId": {
          "description": "Id of the Concept",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "conceptId",
          "type": "string"
        },
        "isDefault": {
          "title": "isDefault",
          "type": "boolean"
        },
        "value": {
          "title": "value",
          "type": [
            "string",
            "number",
            "boolean"
          ]
        }
      },
      "propertyOrder": [
        "conceptId",
        "value",
        "isDefault"
      ],
      "title": "Attribute",
      "additionalProperties": false
    },
    "Choice": {
      "type": "object",
      "description": "Represents a Choice in a Item Definition",
      "properties": {
        "choiceValues": {
          "items": {
            "$ref": "#/$defs/ChoiceValue"
          },
          "title": "choiceValues",
          "type": "array"
        },
        "conceptId": {
          "description": "Id of the Concept",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "conceptId",
          "type": "string"
        },
        "defaultQuantity": {
          "title": "defaultQuantity",
          "type": "number"
        },
        "maxQuantity": {
          "title": "maxQuantity",
          "type": "number"
        },
        "minQuantity": {
          "title": "minQuantity",
          "type": "number"
        },
        "required": {
          "title": "required",
          "type": "boolean"
        },
        "selectType": {
          "$ref": "#/$defs/SelectType",
          "title": "selectType"
        },
        "target": {
          "$ref": "#/$defs/Target",
          "title": "target"
        }
      },
      "propertyOrder": [
        "conceptId",
        "required",
        "target",
        "selectType",
        "minQuantity",
        "defaultQuantity",
        "maxQuantity",
        "choiceValues"
      ],
      "title": "Choice",
      "additionalProperties": false
    },
    "ChoiceValue": {
      "type": "object",
      "properties": {
        "data": {
          "type": "object",
          "description": "This is a data object that is tied to the value, for the item",
          "propertyOrder": [],
          "title": "data",
          "additionalProperties": {
            "type": [
              "string",
              "number",
              "boolean"
            ]
          }
        },
        "value": {
          "description": "`value` is the associated value in the concept (pointed by the `conceptId`)",
          "title": "value",
          "type": "string"
        }
      },
      "propertyOrder": [
        "value",
        "data"
      ],
      "title": "ChoiceValue",
      "additionalProperties": false
    },
    "Classification": {
      "type": "object",
      "description": "Represents a specific classification",
      "properties": {
        "id": {
          "description": "An unique id for the classification",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "id",
          "type": "string"
        },
        "name": {
          "description": "Proper classification name",
          "title": "name",
          "type": "string"
        },
        "parent": {
          "description": "The Id of its parent classification\nIf parent is not present, that means the classification is a top-level classification",
          "title": "parent",
          "type": "string"
        },
        "synonyms": {
          "description": "A list of common names for this classification",
          "items": {
            "type": "string"
          },
          "title": "synonyms",
          "type": "array"
        }
      },
      "propertyOrder": [
        "id",
        "name",
        "parent",
        "synonyms"
      ],
      "title": "Classification",
      "additionalProperties": false
    },
    "ClassificationItem": {
      "type": "object",
      "properties": {
        "classificationId": {
          "description": "Id of the Classification",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "classificationId",
          "type": "string"
        }
      },
      "propertyOrder": [
        "classificationId"
      ],
      "title": "ClassificationItem",
      "additionalProperties": false
    },
    "Component": {
      "type": "object",
      "description": "Represents a Component\nA Component is a concrete item that makes up another concrete item",
      "properties": {
        "attribute": {
          "anyOf": [
            {
              "$ref": "#/$defs/QuantityAttribute"
            },
            {
              "$ref": "#/$defs/ConceptAttribute"
            }
          ],
          "title": "attribute"
        },
        "itemId": {
          "description": "Id of the Item",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "itemId",
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/ComponentType",
          "title": "type"
        }
      },
      "propertyOrder": [
        "itemId",
        "type",
        "attribute"
      ],
      "title": "Component",
      "additionalProperties": false
    },
    "ComponentType": {
      "enum": [
        "concept",
        "quantity"
      ],
      "title": "ComponentType",
      "type": "string"
    },
    "Concept": {
      "type": "object",
      "description": "Represents a Concept",
      "properties": {
        "displayName": {
          "description": "Proper name",
          "title": "displayName",
          "type": "string"
        },
        "id": {
          "description": "An unique id for the concept",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "id",
          "type": "string"
        },
        "quantity": {
          "$ref": "#/$defs/QuantityValue",
          "title": "quantity"
        },
        "type": {
          "$ref": "#/$defs/ConceptType",
          "description": "The type of concept values",
          "title": "type"
        },
        "values": {
          "description": "The list of values",
          "items": {
            "$ref": "#/$defs/DiscreteItem"
          },
          "title": "values",
          "type": "array"
        }
      },
      "propertyOrder": [
        "id",
        "displayName",
        "type",
        "values",
        "quantity"
      ],
      "title": "Concept",
      "additionalProperties": false
    },
    "ConceptAttribute": {
      "type": "object",
      "properties": {
        "conceptId": {
          "title": "conceptId",
          "type": "string"
        },
        "defaultValue": {
          "title": "defaultValue",
          "type": "string"
        }
      },
      "propertyOrder": [
        "conceptId",
        "defaultValue"
      ],
      "title": "ConceptAttribute",
      "additionalProperties": false
    },
    "ConceptOption": {
      "type": "object",
      "properties": {
        "conceptId": {
          "title": "conceptId",
          "type": "string"
        },
        "defaultValue": {
          "title": "defaultValue",
          "type": "string"
        },
        "optionValues": {
          "items": {
            "$ref": "#/$defs/OptionValue"
          },
          "title": "optionValues",
          "type": "array"
        }
      },
      "propertyOrder": [
        "conceptId",
        "defaultValue",
        "optionValues"
      ],
      "title": "ConceptOption",
      "additionalProperties": false
    },
    "ConceptType": {
      "enum": [
        "discrete",
        "discrete-ordered",
        "quantity"
      ],
      "title": "ConceptType",
      "type": "string"
    },
    "Customization": {
      "type": "object",
      "description": "Represents a Customization Option which points to a Concept\nCustomization changes the aspect (associated concept) of a Component or an AddOn",
      "properties": {
        "conceptId": {
          "description": "Id of the Concept",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "conceptId",
          "type": "string"
        },
        "defaultQuantity": {
          "title": "defaultQuantity",
          "type": "number"
        },
        "maxQuantity": {
          "title": "maxQuantity",
          "type": "number"
        },
        "minQuantity": {
          "title": "minQuantity",
          "type": "number"
        }
      },
      "propertyOrder": [
        "conceptId",
        "minQuantity",
        "defaultQuantity",
        "maxQuantity"
      ],
      "title": "Customization",
      "additionalProperties": false
    },
    "DiscreteItem": {
      "type": "object",
      "description": "Represents a Text Value in a Concept",
      "properties": {
        "associatedItemId": {
          "description": "An unique id for the item associated with the item",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "associatedItemId",
          "type": "string"
        },
        "synonyms": {
          "items": {
            "type": "string"
          },
          "title": "synonyms",
          "type": "array"
        },
        "value": {
          "title": "value",
          "type": "string"
        }
      },
      "propertyOrder": [
        "value",
        "synonyms",
        "associatedItemId"
      ],
      "title": "DiscreteItem",
      "additionalProperties": false
    },
    "ItemDefinition": {
      "type": "object",
      "description": "Represents a concrete item and all its attributes and relationships",
      "properties": {
        "addOns": {
          "items": {
            "$ref": "#/$defs/AddOn"
          },
          "title": "addOns",
          "type": "array"
        },
        "choices": {
          "items": {
            "$ref": "#/$defs/Choice"
          },
          "title": "choices",
          "type": "array"
        },
        "classifications": {
          "items": {
            "$ref": "#/$defs/ClassificationItem"
          },
          "title": "classifications",
          "type": "array"
        },
        "commonNames": {
          "items": {
            "type": "string"
          },
          "title": "commonNames",
          "type": "array"
        },
        "components": {
          "items": {
            "$ref": "#/$defs/Component"
          },
          "title": "components",
          "type": "array"
        },
        "customizations": {
          "items": {
            "$ref": "#/$defs/Customization"
          },
          "title": "customizations",
          "type": "array"
        },
        "disambiguationAttributes": {
          "items": {
            "$ref": "#/$defs/Attribute"
          },
          "title": "disambiguationAttributes",
          "type": "array"
        },
        "displayName": {
          "title": "displayName",
          "type": "string"
        },
        "id": {
          "description": "Id of the item",
          "pattern": "^[A-Za-z0-9_\\-]+$",
          "title": "id",
          "type": "string"
        },
        "metadata": {
          "items": {
            "$ref": "#/$defs/Metadata"
          },
          "title": "metadata",
          "type": "array"
        }
      },
      "propertyOrder": [
        "id",
        "displayName",
        "commonNames",
        "disambiguationAttributes",
        "classifications",
        "metadata",
        "components",
        "addOns",
        "customizations",
        "choices"
      ],
      "title": "ItemDefinition",
      "additionalProperties": false
    },
    "Metadata": {
      "type": "object",
      "properties": {
        "name": {
          "title": "name",
          "type": "string"
        },
        "value": {
          "title": "value",
          "type": [
            "string",
            "number",
            "boolean"
          ]
        }
      },
      "propertyOrder": [
        "name",
        "value"
      ],
      "title": "Metadata",
      "additionalProperties": false
    },
    "OptionValue": {
      "type": "object",
      "properties": {
        "data": {
          "type": "object",
          "propertyOrder": [],
          "title": "data",
          "additionalProperties": {
            "type": [
              "string",
              "number",
              "boolean"
            ]
          }
        },
        "value": {
          "title": "value",
          "type": "string"
        }
      },
      "propertyOrder": [
        "value",
        "data"
      ],
      "title": "OptionValue",
      "additionalProperties": false
    },
    "QuantityAttribute": {
      "type": "object",
      "properties": {
        "defaultQuantity": {
          "title": "defaultQuantity",
          "type": "number"
        },
        "maxQuantity": {
          "title": "maxQuantity",
          "type": "number"
        },
        "minQuantity": {
          "title": "minQuantity",
          "type": "number"
        }
      },
      "propertyOrder": [
        "defaultQuantity",
        "minQuantity",
        "maxQuantity"
      ],
      "title": "QuantityAttribute",
      "additionalProperties": false
    },
    "QuantityValue": {
      "type": "object",
      "properties": {
        "incrementBy": {
          "title": "incrementBy",
          "type": "number"
        },
        "maxQuantity": {
          "title": "maxQuantity",
          "type": "number"
        },
        "minQuantity": {
          "title": "minQuantity",
          "type": "number"
        }
      },
      "propertyOrder": [
        "minQuantity",
        "maxQuantity",
        "incrementBy"
      ],
      "title": "QuantityValue",
      "additionalProperties": false
    },
    "RangeOption": {
      "type": "object",
      "description": "Represents a Range Option",
      "properties": {
        "defaultQuantity": {
          "title": "defaultQuantity",
          "type": "number"
        },
        "incrementBy": {
          "title": "incrementBy",
          "type": "number"
        },
        "maxQuantity": {
          "title": "maxQuantity",
          "type": "number"
        },
        "minQuantity": {
          "title": "minQuantity",
          "type": "number"
        }
      },
      "propertyOrder": [
        "incrementBy",
        "minQuantity",
        "defaultQuantity",
        "maxQuantity"
      ],
      "title": "RangeOption",
      "additionalProperties": false
    },
    "SelectType": {
      "enum": [
        "multiple",
        "single"
      ],
      "title": "SelectType",
      "type": "string"
    },
    "Target": {
      "enum": [
        "replace",
        "supplement"
      ],
      "title": "Target",
      "type": "string"
    }
  },
  "additionalProperties": false
}
