{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/citeladder-com/json-schema/citeladder-com-business-map-schema.json",
  "title": "BusinessMap",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citeladder-com-business-map-api-openapi.yml#/components/schemas/BusinessMap",
  "type": "object",
  "properties": {
    "offerings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OfferingMap"
      }
    },
    "available_offerings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "offerings",
    "available_offerings"
  ],
  "additionalProperties": false,
  "$defs": {
    "BusinessMapEntry": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string"
        },
        "origin": {
          "type": "string",
          "enum": [
            "manual",
            "model"
          ]
        },
        "review_state": {
          "type": "string",
          "enum": [
            "suggested",
            "confirmed"
          ]
        },
        "reviewed_by": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "reviewed_at": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "default": {},
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        }
      },
      "required": [
        "value",
        "origin",
        "review_state",
        "reviewed_by",
        "reviewed_at",
        "source"
      ],
      "additionalProperties": false
    },
    "OfferingMap": {
      "type": "object",
      "properties": {
        "offering": {
          "type": "string"
        },
        "attributes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BusinessMapEntry"
          }
        },
        "situations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BusinessMapEntry"
          }
        },
        "audiences": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BusinessMapEntry"
          }
        },
        "exclusions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "first": {
                "type": "string"
              },
              "second": {
                "type": "string"
              }
            },
            "required": [
              "first",
              "second"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "offering",
        "attributes",
        "situations",
        "audiences",
        "exclusions"
      ],
      "additionalProperties": false
    }
  }
}