{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thesoftwarelens.com/saacip/0.2/schemas/receipt.schema.json",
  "$comment": "SaaCIP 0.2 (https://thesoftwarelens.com/saacip/). Licensed under the Apache License 2.0.",
  "title": "SaaCIP 0.2 receipt",
  "description": "One signed, chained record of a step the capability took (section 7.3). Stored one per line as canonical JSON (JSON Lines).",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "ts",
    "kind",
    "purpose",
    "body",
    "prev",
    "public_key",
    "signature"
  ],
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "ts": {
      "$ref": "common.schema.json#/$defs/epochSeconds"
    },
    "kind": {
      "$ref": "common.schema.json#/$defs/receiptKind"
    },
    "purpose": {
      "type": "object",
      "description": "Why the step was taken: the hire, the work item or the action it belongs to."
    },
    "body": {
      "type": "object",
      "description": "What was done."
    },
    "prev": {
      "$ref": "common.schema.json#/$defs/sha256Hex"
    },
    "public_key": {
      "$ref": "common.schema.json#/$defs/base64"
    },
    "signature": {
      "$ref": "common.schema.json#/$defs/base64"
    }
  }
}
