{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://fdc3.finos.org/schemas/2.1/context/transactionresult.schema.json",
  "type": "object",
  "title": "TransactionResult",
  "description": "A context type representing the result of a transaction initiated via FDC3, which SHOULD be returned as an `IntentResult` by intents that create, retrieve, update or delete content or records in another application. Its purpose is to provide a status and message (where needed) for the transaction and MAY wrap a returned context object.",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "type": {
          "const": "fdc3.transactionResult"
        },
        "status": {
          "type": "string",
          "enum": [
            "Created",
            "Deleted",
            "Updated",
            "Failed"
          ],
          "title": "Transaction Status",
          "description": "The status of the transaction being reported."
        },
        "context": {
          "$ref": "context.schema.json#",
          "title": "Transaction Result Context",
          "description": "A context object returned by the transaction, possibly with updated data."
        }
      },
      "message": {
        "type": "string",
        "title": "Transaction Message",
        "description": "A human readable message describing the outcome of the transaction."
      },
      "required": [
        "type",
        "status"
      ]
    },
    { "$ref": "context.schema.json#/definitions/BaseContext" }
  ],
  "examples": [
    {
      "type": "fdc3.transactionResult",
      "status": "Updated",
      "context": {
        "type": "fdc3.contact",
        "name": "Jane Doe",
        "id": {
          "email": "jane.doe@mail.com"
        }
      },
      "message": "record with id 'jane.doe@mail.com' was updated"
    }
  ]
}