{
  "type": "object",
  "properties": {
    "transferId": {
      "type": "string",
      "pattern": "^trf-"
    },
    "archiveId": {
      "type": "string",
      "pattern": "^arc-"
    },
    "exportId": {
      "type": "string",
      "pattern": "^exp-"
    },
    "recipientId": {
      "type": "string"
    },
    "scope": {
      "type": "string",
      "minLength": 1
    },
    "state": {
      "type": "string",
      "enum": [
        "QUEUED",
        "TRANSFERRING",
        "AWAITING_ACKNOWLEDGEMENT",
        "ACKNOWLEDGED",
        "REJECTED",
        "FAILED"
      ]
    },
    "jobId": {
      "type": "string"
    },
    "packageDigest": {
      "$ref": "Digest.json"
    },
    "acknowledgementId": {
      "type": "string"
    },
    "acceptedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "transferId",
    "archiveId",
    "exportId",
    "recipientId",
    "scope",
    "state",
    "jobId",
    "packageDigest"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "transferId": "trf-test-001",
      "archiveId": "arc-test-001",
      "exportId": "exp-test-001",
      "recipientId": "recipient-test-001",
      "state": "AWAITING_ACKNOWLEDGEMENT",
      "scope": "Complete manifest inventory for exp-test-001; cryptographic verification outside this synthetic example",
      "jobId": "job-transfer-001",
      "packageDigest": {
        "algorithm": "SHA-256",
        "value": "5c34a84b064c4aa79bbc8f49cadeea9c55cfc9df10d655e9bc6f7a6af248e1c1"
      }
    }
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "state": {
            "const": "ACKNOWLEDGED"
          }
        },
        "required": [
          "state"
        ]
      },
      "then": {
        "required": [
          "acknowledgementId",
          "acceptedAt"
        ]
      }
    }
  ]
}
