{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aka.ms/sslz/schemas/workload-profile-plan.schema.json",
  "title": "SSLZ workload profile plan",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "profileVersion",
    "status",
    "computeProfile",
    "profileExtensions",
    "aksIngress",
    "rationale",
    "assumptions",
    "requiredChecks",
    "unresolvedDecisions",
    "costAssumptions",
    "architectureReview",
    "iacGenerated",
    "azureOperations"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0.0"
    },
    "profileVersion": {
      "const": "1.0.0"
    },
    "status": {
      "enum": ["ready", "blocked", "architecture-review"]
    },
    "computeProfile": {
      "enum": ["container-apps", "aks", null]
    },
    "profileExtensions": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "enum": ["postgresql", "foundry", "gpu"]
      }
    },
    "aksIngress": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object"
        }
      ]
    },
    "rationale": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["decision", "reason", "sourceRequirements"],
        "properties": {
          "decision": {
            "type": "string",
            "minLength": 1
          },
          "reason": {
            "type": "string",
            "minLength": 1
          },
          "sourceRequirements": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    },
    "assumptions": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "requiredChecks": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9]+([.-][a-z0-9]+)+$"
      }
    },
    "unresolvedDecisions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "severity", "question", "reason"],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+([.-][a-z0-9]+)+$"
          },
          "severity": {
            "enum": ["blocking", "advisory"]
          },
          "question": {
            "type": "string",
            "minLength": 1
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "costAssumptions": {
      "type": "object",
      "additionalProperties": false,
      "required": ["currency", "monthlyPlatformMaximum", "items"],
      "properties": {
        "currency": {
          "const": "USD"
        },
        "monthlyPlatformMaximum": {
          "type": "number",
          "minimum": 0
        },
        "items": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "architectureReview": {
      "type": "object",
      "additionalProperties": false,
      "required": ["required", "reasons"],
      "properties": {
        "required": {
          "type": "boolean"
        },
        "reasons": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "iacGenerated": {
      "const": false
    },
    "azureOperations": {
      "const": "none"
    }
  }
}
