{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://vclaw.dev/schemas/video/artifacts/cinema-generation-authorization.schema.json",
  "title": "CinemaGenerationAuthorizationArtifact",
  "type": "object",
  "required": ["schemaVersion", "authorizationId", "projectSlug", "quoteId", "quoteHash", "capabilitySnapshotId", "capabilitySnapshotHash", "routeId", "approvedAt", "expiresAt", "approverId", "decision", "authorizedJobIds", "maximumSpend", "complianceEvidenceIds", "contentHash"],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": { "const": 1 },
    "authorizationId": { "type": "string", "minLength": 1 },
    "projectSlug": { "type": "string", "minLength": 1 },
    "quoteId": { "type": "string", "minLength": 1 },
    "quoteHash": { "$ref": "#/definitions/Sha256" },
    "capabilitySnapshotId": { "type": "string", "minLength": 1 },
    "capabilitySnapshotHash": { "$ref": "#/definitions/Sha256" },
    "routeId": { "type": "string", "minLength": 1 },
    "approvedAt": { "type": "string", "format": "date-time" },
    "expiresAt": { "type": "string", "format": "date-time" },
    "approverId": { "type": "string", "minLength": 1 },
    "decision": { "const": "approved" },
    "authorizedJobIds": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
    "maximumSpend": { "$ref": "#/definitions/Money" },
    "complianceEvidenceIds": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
    "contentHash": { "$ref": "#/definitions/Sha256" }
  },
  "definitions": {
    "Sha256": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
    "Money": {
      "type": "object", "required": ["currency", "amount"], "additionalProperties": false,
      "properties": { "currency": { "type": "string", "minLength": 1 }, "amount": { "type": "number", "minimum": 0 } }
    }
  }
}
