{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nevlo-io/json-schema/nevlo-io-transaction-schema.json",
  "title": "Transaction",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/nevlo-io-api-openapi.json#/components/schemas/Transaction",
  "type": "object",
  "required": [
    "id",
    "amount",
    "currency",
    "bookingDate",
    "bankAccount"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "amount": {
      "type": "number"
    },
    "currency": {
      "type": "string"
    },
    "bookingDate": {
      "type": "string",
      "format": "date-time"
    },
    "valueDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "merchantName": {
      "type": [
        "string",
        "null"
      ]
    },
    "counterpartName": {
      "type": [
        "string",
        "null"
      ]
    },
    "counterpartIban": {
      "type": [
        "string",
        "null"
      ]
    },
    "counterpartMandateReference": {
      "type": [
        "string",
        "null"
      ],
      "description": "SEPA direct debit mandate reference"
    },
    "type": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "direct_debit",
        "transfer",
        "standing_order",
        "cash_withdrawal",
        "cash_deposit",
        "card_payment",
        "interest",
        "fee",
        "salary",
        "other"
      ],
      "description": "Normalized transaction type"
    },
    "category": {
      "type": [
        "string",
        "null"
      ]
    },
    "purpose": {
      "type": [
        "string",
        "null"
      ]
    },
    "bankAccount": {
      "$ref": "#/$defs/BankAccountRef"
    }
  },
  "$defs": {
    "BankAccountRef": {
      "type": "object",
      "required": [
        "id",
        "bankConnection"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "iban": {
          "type": [
            "string",
            "null"
          ]
        },
        "accountName": {
          "type": [
            "string",
            "null"
          ]
        },
        "bankConnection": {
          "type": "object",
          "required": [
            "bankName"
          ],
          "properties": {
            "bankName": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}