{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.connectsoft.ai/reference/schemas/blueprint-agentic-saas-product.schema.json",
  "title": "Agentic SaaS Product Blueprint (blueprint-agentic-saas-product-v1)",
  "description": "Descriptor document of the Agentic SaaS Product Blueprint kind (BC-02). Validated by BlueprintService; metadata per blueprint-common.schema.json; generation outputs and validation rules per model/blueprints.yaml.",
  "type": "object",
  "required": [
    "metadata",
    "visionBlueprintId",
    "editions",
    "meteringDimensions",
    "tenancy",
    "foundations",
    "productGateway",
    "offboarding"
  ],
  "additionalProperties": false,
  "properties": {
    "metadata": {
      "$ref": "blueprint-common.schema.json#/$defs/Metadata"
    },
    "visionBlueprintId": {
      "type": "string"
    },
    "editions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "entitlements"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "entitlements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "managedEdition": {
            "enum": [
              "SelfOperated",
              "Managed",
              "ManagedPlus"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "meteringDimensions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tenancy": {
      "type": "object",
      "required": [
        "isolation",
        "residency"
      ],
      "properties": {
        "isolation": {
          "enum": [
            "row-filter",
            "schema",
            "per-database"
          ]
        },
        "residency": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "foundations": {
      "type": "array",
      "items": {
        "enum": [
          "connectsoft-saas-tenants",
          "connectsoft-saas-products",
          "connectsoft-saas-entitlements",
          "connectsoft-saas-billing",
          "connectsoft-saas-metering"
        ]
      }
    },
    "productGateway": {
      "type": "object",
      "required": [
        "template",
        "role"
      ],
      "properties": {
        "template": {
          "enum": [
            "connectsoft-apigateway"
          ]
        },
        "role": {
          "enum": [
            "GW-07"
          ]
        }
      },
      "additionalProperties": false
    },
    "agents": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "offboarding": {
      "type": "object",
      "required": [
        "exportFormats",
        "deletionWindowDays"
      ],
      "properties": {
        "exportFormats": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "deletionWindowDays": {
          "type": "integer"
        }
      },
      "additionalProperties": false
    }
  }
}
