{
  "$schema": "http://json-schema.org/draft-04/schema",
  "title": "TransferTemplate",
  "description": "A template for ledger-local transfer of funds that can be missing some transfer fields",
  "type": "object",
  "properties": {
    "id": {
      "description": "Resource identifier",
      "$ref": "Iri.json"
    },
    "ledger": {
      "description": "The ledger where the transfer will take place",
      "$ref": "Iri.json"
    },
    "state": {
      "description": "The current state of the transfer (informational only)",
      "$ref": "TransferState.json"
    },
    "rejection_reason": {
      "description": "The reason the transfer was rejected",
      "type": "string",
      "enum": ["cancelled", "expired"]
    },
    "execution_condition": {
      "description": "The condition for executing the transfer",
      "$ref": "Condition.json"
    },
    "cancellation_condition": {
      "description": "The condition for executing the transfer",
      "$ref": "Condition.json"
    },
    "expiry_duration": {
      "description": "Time in seconds between proposed_at and expires_at. Set in quotes from payment systems but not valid in actual transfers",
      "$ref": "NonNegativeDuration.json"
    },
    "expires_at": {
      "description": "The date when the transfer expires and will be rejected by the ledger",
      "$ref": "Date.json"
    },
    "timeline": {
      "description": "Timeline of the transfer's state transitions",
      "$ref": "Timeline.json"
    },
    "debits": {
      "description": "Funds that go into the transfer",
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "$ref": "FundsTemplate.json" }
    },
    "credits": {
      "description": "Funds that come out of the transfer",
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "$ref": "FundsTemplate.json" }
    },
    "additional_info": {
      "description": "Includes part_of_payment, case, etc.",
      "type": "object",
      "properties": {
        "cases": {
          "description": "References to the notary Cases",
          "type": "array",
          "items": { "$ref": "Iri.json" }
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": false
}
