{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/exchangerate-dev/json-schema/exchangerate-dev-gain-loss-schema.json",
  "title": "GainLoss",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/exchangerate-dev-official-api-openapi.yml#/components/schemas/GainLoss",
  "properties": {
    "currency": {
      "type": "string",
      "title": "Currency"
    },
    "amount": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
        }
      ],
      "title": "Amount"
    },
    "booked_on": {
      "type": "string",
      "title": "Booked On"
    },
    "settled_on": {
      "type": "string",
      "title": "Settled On"
    },
    "kind": {
      "type": "string",
      "title": "Kind",
      "default": "receivable"
    }
  },
  "type": "object",
  "required": [
    "currency",
    "amount",
    "booked_on",
    "settled_on"
  ]
}