{
  "type": "object",
  "properties": {
    "base_currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "banks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "id",
          "aliases"
        ],
        "additionalProperties": false
      }
    },
    "accounts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "bank": {
            "type": "string",
            "minLength": 1
          },
          "currency": {
            "type": "string",
            "minLength": 1
          },
          "target_bank": {
            "type": "string",
            "minLength": 1
          },
          "target_portfolio": {
            "type": "string",
            "minLength": 1
          },
          "target_journal": {
            "type": "string",
            "minLength": 1
          },
          "ledger_account": {
            "type": "string",
            "minLength": 1
          },
          "trade_date_basis": {
            "type": "string",
            "minLength": 1
          },
          "cash_date_basis": {
            "type": "string",
            "minLength": 1
          },
          "account_aliases": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "portfolio_aliases": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "bob_inflow_side": {
            "enum": [
              "DEBIT",
              "CREDIT"
            ]
          }
        },
        "required": [
          "id",
          "bank",
          "currency",
          "account_aliases",
          "portfolio_aliases"
        ],
        "additionalProperties": false
      }
    },
    "rules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "priority": {
            "type": "integer"
          },
          "target": {
            "enum": [
              "denarius",
              "bob",
              "schedule"
            ]
          },
          "conditions": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "minLength": 1
              },
              "bank": {
                "type": "string",
                "minLength": 1
              },
              "description_contains": {
                "type": "string",
                "minLength": 1
              },
              "description_equals": {
                "type": "string",
                "minLength": 1
              },
              "instrument_class": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [],
            "additionalProperties": false
          },
          "effective_from": {
            "type": "string",
            "minLength": 1
          },
          "effective_to": {
            "type": "string",
            "minLength": 1
          },
          "account": {
            "type": "string",
            "minLength": 1
          },
          "acttype": {
            "type": "string",
            "minLength": 1
          },
          "remark_template": {
            "type": "string",
            "minLength": 1
          },
          "dividend_mode": {
            "type": "string",
            "minLength": 1
          },
          "internal_transfer": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "priority",
          "conditions",
          "target"
        ],
        "additionalProperties": false
      }
    },
    "capabilities": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "quantity_basis": {
            "type": "string",
            "minLength": 1
          },
          "multiplier": {
            "type": "string",
            "minLength": 1
          },
          "target_sign": {
            "enum": [
              "signed",
              "absolute"
            ]
          },
          "price_import_supported": {
            "type": "boolean"
          }
        },
        "required": [],
        "additionalProperties": false
      }
    },
    "instrument_overrides": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "security_id": {
            "type": "string",
            "minLength": 1
          },
          "quantity_basis": {
            "type": "string",
            "minLength": 1
          },
          "multiplier": {
            "type": "string",
            "minLength": 1
          },
          "target_sign": {
            "enum": [
              "signed",
              "absolute"
            ]
          },
          "price_import_supported": {
            "type": "boolean"
          }
        },
        "required": [
          "security_id"
        ],
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
