{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "recordType",
    "candidateId",
    "sourceCommit",
    "gitTree",
    "scopeSha256",
    "function",
    "roleId",
    "identityId",
    "organizationId",
    "channelId",
    "channelType",
    "testNonce",
    "sentAtUtc",
    "deliveredAtUtc",
    "acknowledgedAtUtc",
    "acknowledgmentSeconds",
    "deliveryConfirmed",
    "acknowledgmentConfirmed",
    "signerClass",
    "signedPayloadSha256",
    "signatureBase64"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0.0"
    },
    "recordType": {
      "const": "contact-control-receipt"
    },
    "candidateId": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "sourceCommit": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}$"
    },
    "gitTree": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}$"
    },
    "scopeSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "function": {
      "enum": [
        "change",
        "commercial",
        "incident",
        "partner-escalation",
        "privacy",
        "security",
        "support"
      ]
    },
    "roleId": {
      "enum": [
        "change-approver",
        "commercial-owner",
        "incident-commander",
        "partner-authorized-signatory",
        "privacy-reviewer",
        "security-contact",
        "support-owner"
      ]
    },
    "identityId": {
      "type": "string",
      "pattern": "^identity:[0-9a-f]{64}$"
    },
    "organizationId": {
      "type": "string",
      "pattern": "^organization:[0-9a-f]{64}$"
    },
    "channelId": {
      "type": "string",
      "pattern": "^channel:[0-9a-f]{64}$"
    },
    "channelType": {
      "enum": [
        "email-alias",
        "paging-route",
        "secure-portal",
        "ticket-queue"
      ]
    },
    "testNonce": {
      "type": "string",
      "pattern": "^contact-test:[0-9a-f]{64}$"
    },
    "sentAtUtc": {
      "type": "string",
      "format": "date-time"
    },
    "deliveredAtUtc": {
      "type": "string",
      "format": "date-time"
    },
    "acknowledgedAtUtc": {
      "type": "string",
      "format": "date-time"
    },
    "acknowledgmentSeconds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 3600
    },
    "deliveryConfirmed": {
      "const": true
    },
    "acknowledgmentConfirmed": {
      "const": true
    },
    "signerClass": {
      "const": "assigned-channel-controller"
    },
    "signedPayloadSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "signatureBase64": {
      "type": "string",
      "pattern": "^[A-Za-z0-9+/]{86}==$"
    }
  }
}
