{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://dashremix.com/spec/finance/2.3.0/finance@2.schema.json",
 "title": "finance@2 v2.3.0",
 "description": "One property per table (an array of rows). Generated from schema.sql by spec/build.py. Extension tables (x_<owner>_*) belong to forks and board-derived tables (d_*) to the board that rebuilds them; both are allowed as additional properties.",
 "type": "object",
 "properties": {
  "meta": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string"
     },
     "value": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "key"
    ],
    "additionalProperties": false
   }
  },
  "accounts": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "account_id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "institution": {
      "type": [
       "string",
       "null"
      ]
     },
     "group": {
      "type": "string",
      "enum": [
       "Cash",
       "Investments",
       "Credit & loans",
       "Property",
       "Other assets"
      ]
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "rate": {
      "type": [
       "number",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "last4": {
      "type": [
       "string",
       "null"
      ]
     },
     "book": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "open",
       "closed",
       null
      ]
     },
     "opened": {
      "type": [
       "string",
       "null"
      ]
     },
     "closed": {
      "type": [
       "string",
       "null"
      ]
     },
     "first_txn": {
      "type": [
       "string",
       "null"
      ]
     },
     "last_txn": {
      "type": [
       "string",
       "null"
      ]
     },
     "txn_count": {
      "type": [
       "integer",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "account_id",
     "name",
     "group",
     "currency"
    ],
    "additionalProperties": false
   }
  },
  "balances": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "account_id": {
      "type": "string"
     },
     "balance": {
      "type": "number"
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Z]{3}$"
     },
     "balance_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "basis": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "statement",
       "api",
       "manual",
       "derived",
       null
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "date",
     "account_id",
     "balance"
    ],
    "additionalProperties": false
   }
  },
  "transactions": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "txn_id": {
      "type": "string"
     },
     "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "account_id": {
      "type": "string"
     },
     "amount": {
      "type": "number"
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "flow_type": {
      "type": "string",
      "enum": [
       "income",
       "spend",
       "transfer",
       "investment",
       "other"
      ]
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "merchant": {
      "type": [
       "string",
       "null"
      ]
     },
     "category": {
      "type": [
       "string",
       "null"
      ]
     },
     "subcategory": {
      "type": [
       "string",
       "null"
      ]
     },
     "kind": {
      "type": [
       "string",
       "null"
      ]
     },
     "amount_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "income_base": {
      "type": "number"
     },
     "expense_base": {
      "type": "number"
     },
     "fx_source": {
      "type": [
       "string",
       "null"
      ]
     },
     "counterparty": {
      "type": [
       "string",
       "null"
      ]
     },
     "recurring_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "transfer_group_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "transfer_status": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "paired",
       "unpaired",
       "manual",
       null
      ]
     },
     "split_of": {
      "type": [
       "string",
       "null"
      ]
     },
     "book": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner": {
      "type": [
       "string",
       "null"
      ]
     },
     "property_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "entity_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     },
     "confidence": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "source",
       "rule",
       "default",
       "detected",
       "manual",
       "migrated",
       null
      ]
     },
     "rule_source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "pending",
       "posted",
       null
      ]
     },
     "receipt": {
      "type": [
       "integer",
       "null"
      ]
     },
     "asset_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "property_bucket": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "running",
       "maintenance",
       "improvement",
       null
      ]
     }
    },
    "required": [
     "txn_id",
     "date",
     "account_id",
     "amount",
     "currency",
     "flow_type",
     "income_base",
     "expense_base"
    ],
    "additionalProperties": false
   }
  },
  "categories": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "category": {
      "type": "string"
     },
     "type": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "income",
       "spend",
       "transfer",
       "investment",
       "other",
       null
      ]
     },
     "monthly_budget": {
      "type": [
       "number",
       "null"
      ]
     },
     "fixed": {
      "type": [
       "integer",
       "null"
      ]
     },
     "parent": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "category"
    ],
    "additionalProperties": false
   }
  },
  "recurring": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "recurring_id": {
      "type": "string"
     },
     "merchant": {
      "type": "string"
     },
     "category": {
      "type": [
       "string",
       "null"
      ]
     },
     "cadence": {
      "type": "string",
      "enum": [
       "weekly",
       "monthly",
       "quarterly",
       "yearly"
      ]
     },
     "flow_type": {
      "type": [
       "string",
       "null"
      ]
     },
     "amount_typical": {
      "type": [
       "number",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Z]{3}$"
     },
     "first_seen": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "last_seen": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "next_expected": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "status": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "active",
       "stopped",
       "cancelled",
       "trial",
       null
      ]
     },
     "confidence": {
      "type": [
       "string",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "n_charges": {
      "type": [
       "integer",
       "null"
      ]
     },
     "n_months": {
      "type": [
       "integer",
       "null"
      ]
     },
     "billing_day": {
      "type": [
       "integer",
       "null"
      ]
     },
     "trailing_12m_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "last_used": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "subtype": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "streaming",
       "software",
       "cloud",
       "health",
       "music",
       "news",
       "shopping",
       "other",
       null
      ]
     }
    },
    "required": [
     "recurring_id",
     "merchant",
     "cadence"
    ],
    "additionalProperties": false
   }
  },
  "recurring_prices": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "recurring_id": {
      "type": "string"
     },
     "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "amount": {
      "type": "number"
     },
     "currency": {
      "type": [
       "string",
       "null"
      ]
     },
     "txn_id": {
      "type": "string"
     }
    },
    "required": [
     "recurring_id",
     "date",
     "amount",
     "txn_id"
    ],
    "additionalProperties": false
   }
  },
  "subscriptions": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "name": {
      "type": [
       "string",
       "null"
      ]
     },
     "category": {
      "type": [
       "string",
       "null"
      ]
     },
     "price": {
      "type": [
       "number",
       "null"
      ]
     },
     "billing": {
      "type": [
       "string",
       "null"
      ]
     },
     "billing_day": {
      "type": [
       "integer",
       "null"
      ]
     },
     "account_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "last_used": {
      "type": [
       "string",
       "null"
      ]
     },
     "subscription_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "book": {
      "type": [
       "string",
       "null"
      ]
     },
     "observed_months": {
      "type": [
       "integer",
       "null"
      ]
     },
     "last_seen": {
      "type": [
       "string",
       "null"
      ]
     },
     "trailing_12m_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "confidence": {
      "type": [
       "string",
       "null"
      ]
     },
     "contract_confirmed": {
      "type": [
       "string",
       "null"
      ]
     },
     "next_charge_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "cancellation_savings_base": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [],
    "additionalProperties": false
   }
  },
  "debts": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "account_id": {
      "type": "string"
     },
     "apr": {
      "type": [
       "number",
       "null"
      ]
     },
     "min_payment": {
      "type": [
       "number",
       "null"
      ]
     },
     "due_day": {
      "type": [
       "integer",
       "null"
      ]
     },
     "promo_apr": {
      "type": [
       "number",
       "null"
      ]
     },
     "promo_end": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "payoff_strategy": {
      "type": [
       "string",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Z]{3}$"
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "kind": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "card",
       "loan",
       "student",
       "mortgage",
       "line",
       "other",
       null
      ]
     },
     "credit_limit": {
      "type": [
       "number",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "account_id"
    ],
    "additionalProperties": false
   }
  },
  "goals": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string"
     },
     "value": {
      "type": [
       "number",
       "null"
      ]
     },
     "note": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "key"
    ],
    "additionalProperties": false
   }
  },
  "holdings": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "account_id": {
      "type": "string"
     },
     "ticker": {
      "type": "string"
     },
     "name": {
      "type": [
       "string",
       "null"
      ]
     },
     "asset_class": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "stocks",
       "bonds",
       "cash",
       "crypto",
       "real_estate",
       "other",
       null
      ]
     },
     "units": {
      "type": [
       "number",
       "null"
      ]
     },
     "price": {
      "type": [
       "number",
       "null"
      ]
     },
     "cost_basis": {
      "type": [
       "number",
       "null"
      ]
     },
     "expense_ratio": {
      "type": [
       "number",
       "null"
      ]
     },
     "holding_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "venue": {
      "type": [
       "string",
       "null"
      ]
     },
     "value_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Z]{3}$"
     },
     "book": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "region": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "us",
       "developed",
       "emerging",
       "global",
       "other",
       null
      ]
     },
     "price_date": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     }
    },
    "required": [
     "date",
     "account_id",
     "ticker"
    ],
    "additionalProperties": false
   }
  },
  "allocation_targets": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "dimension": {
      "type": "string",
      "enum": [
       "asset_class",
       "region",
       "account"
      ]
     },
     "bucket": {
      "type": "string"
     },
     "target_share": {
      "type": "number"
     },
     "band": {
      "type": [
       "number",
       "null"
      ]
     },
     "note": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "dimension",
     "bucket",
     "target_share"
    ],
    "additionalProperties": false
   }
  },
  "private_investments": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "type": {
      "type": [
       "string",
       "null"
      ]
     },
     "committed": {
      "type": [
       "number",
       "null"
      ]
     },
     "called": {
      "type": [
       "number",
       "null"
      ]
     },
     "distributed": {
      "type": [
       "number",
       "null"
      ]
     },
     "nav": {
      "type": [
       "number",
       "null"
      ]
     },
     "nav_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "investment_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "book": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner": {
      "type": [
       "string",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ]
     },
     "purchase_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "disposed_on": {
      "type": [
       "string",
       "null"
      ]
     },
     "cost_basis_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "valuation_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "valuation_as_of": {
      "type": [
       "string",
       "null"
      ]
     },
     "valuation_basis": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "proceeds_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "written_off_on": {
      "type": [
       "string",
       "null"
      ]
     },
     "kind": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "venture_fund",
       "private_equity",
       "direct",
       "private_credit",
       "real_estate_lp",
       "other",
       null
      ]
     },
     "manager": {
      "type": [
       "string",
       "null"
      ]
     },
     "vintage": {
      "type": [
       "integer",
       "null"
      ]
     },
     "status_note": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "name"
    ],
    "additionalProperties": false
   }
  },
  "private_investment_events": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "event_id": {
      "type": "string"
     },
     "investment_id": {
      "type": "string"
     },
     "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "kind": {
      "type": "string",
      "enum": [
       "call",
       "distribution"
      ]
     },
     "amount": {
      "type": "number"
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Z]{3}$"
     },
     "amount_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "note": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "event_id",
     "investment_id",
     "date",
     "kind",
     "amount"
    ],
    "additionalProperties": false
   }
  },
  "properties": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "property_id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "use": {
      "type": [
       "string",
       "null"
      ]
     },
     "bought_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "purchase_price": {
      "type": [
       "number",
       "null"
      ]
     },
     "current_value": {
      "type": [
       "number",
       "null"
      ]
     },
     "value_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "mortgage_balance": {
      "type": [
       "number",
       "null"
      ]
     },
     "mortgage_rate": {
      "type": [
       "number",
       "null"
      ]
     },
     "monthly_payment": {
      "type": [
       "number",
       "null"
      ]
     },
     "monthly_rent": {
      "type": [
       "number",
       "null"
      ]
     },
     "lease_start": {
      "type": [
       "string",
       "null"
      ]
     },
     "lease_end": {
      "type": [
       "string",
       "null"
      ]
     },
     "sold_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "country": {
      "type": [
       "string",
       "null"
      ]
     },
     "owner": {
      "type": [
       "string",
       "null"
      ]
     },
     "legal_owner": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "book": {
      "type": [
       "string",
       "null"
      ]
     },
     "cost_basis_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "value_basis": {
      "type": [
       "string",
       "null"
      ]
     },
     "status_note": {
      "type": [
       "string",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "property_id",
     "name"
    ],
    "additionalProperties": false
   }
  },
  "taxes": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "date": {
      "type": "string"
     },
     "country": {
      "type": [
       "string",
       "null"
      ]
     },
     "type": {
      "type": [
       "string",
       "null"
      ]
     },
     "jurisdiction": {
      "type": [
       "string",
       "null"
      ]
     },
     "amount": {
      "type": "number"
     },
     "note": {
      "type": [
       "string",
       "null"
      ]
     },
     "property_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "txn_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "book": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ]
     },
     "amount_base": {
      "type": [
       "number",
       "null"
      ]
     }
    },
    "required": [
     "date",
     "amount"
    ],
    "additionalProperties": false
   }
  },
  "income_years": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "year": {
      "type": "integer"
     },
     "gross_income": {
      "type": [
       "number",
       "null"
      ]
     },
     "withheld": {
      "type": [
       "number",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "year"
    ],
    "additionalProperties": false
   }
  },
  "fx_rates": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "date": {
      "type": "string"
     },
     "ccy": {
      "type": "string"
     },
     "base_per_unit": {
      "type": [
       "number",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "date",
     "ccy"
    ],
    "additionalProperties": false
   }
  },
  "prices": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "date": {
      "type": "string"
     },
     "asset": {
      "type": "string"
     },
     "price_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "date",
     "asset"
    ],
    "additionalProperties": false
   }
  },
  "prices_daily": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "date": {
      "type": "string"
     },
     "asset": {
      "type": "string"
     },
     "price_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "date",
     "asset"
    ],
    "additionalProperties": false
   }
  },
  "valuations": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "asset_ref": {
      "type": "string"
     },
     "date": {
      "type": "string"
     },
     "value": {
      "type": [
       "number",
       "null"
      ]
     },
     "ccy": {
      "type": [
       "string",
       "null"
      ]
     },
     "value_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "basis": {
      "type": [
       "string",
       "null"
      ]
     },
     "evidence": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "asset_ref",
     "date"
    ],
    "additionalProperties": false
   }
  },
  "entities": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "entity_id": {
      "type": "string"
     },
     "name": {
      "type": [
       "string",
       "null"
      ]
     },
     "kind": {
      "type": [
       "string",
       "null"
      ]
     },
     "jurisdiction": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "entity_id"
    ],
    "additionalProperties": false
   }
  },
  "ownership": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "entity_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "asset_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "pct": {
      "type": [
       "number",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "confirmed": {
      "type": [
       "integer",
       "null"
      ]
     }
    },
    "required": [],
    "additionalProperties": false
   }
  },
  "assets": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "asset_id": {
      "type": "string"
     },
     "symbol": {
      "type": "string"
     },
     "name": {
      "type": [
       "string",
       "null"
      ]
     },
     "asset_class": {
      "type": [
       "string",
       "null"
      ]
     },
     "kind": {
      "type": [
       "string",
       "null"
      ]
     },
     "aliases": {
      "type": [
       "string",
       "null"
      ]
     },
     "priced_as": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "asset_id",
     "symbol"
    ],
    "additionalProperties": false
   }
  },
  "asset_trades": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "trade_id": {
      "type": "string"
     },
     "asset_id": {
      "type": "string"
     },
     "date": {
      "type": [
       "string",
       "null"
      ]
     },
     "ts": {
      "type": [
       "string",
       "null"
      ]
     },
     "venue": {
      "type": [
       "string",
       "null"
      ]
     },
     "account": {
      "type": [
       "string",
       "null"
      ]
     },
     "side": {
      "type": "string"
     },
     "quantity": {
      "type": "number"
     },
     "fill_price_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "fill_source": {
      "type": [
       "string",
       "null"
      ]
     },
     "cash_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "mark_price_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "mark_source": {
      "type": [
       "string",
       "null"
      ]
     },
     "fee_qty": {
      "type": [
       "number",
       "null"
      ]
     },
     "fee_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "fee_asset": {
      "type": [
       "string",
       "null"
      ]
     },
     "quote_asset": {
      "type": [
       "string",
       "null"
      ]
     },
     "pair": {
      "type": [
       "string",
       "null"
      ]
     },
     "txn_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "notes": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "trade_id",
     "asset_id",
     "side",
     "quantity"
    ],
    "additionalProperties": false
   }
  },
  "asset_snapshots": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "asset_id": {
      "type": "string"
     },
     "date": {
      "type": "string"
     },
     "venue": {
      "type": "string"
     },
     "account": {
      "type": "string"
     },
     "wallet": {
      "type": "string"
     },
     "quantity": {
      "type": [
       "number",
       "null"
      ]
     },
     "price_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "value_base": {
      "type": [
       "number",
       "null"
      ]
     },
     "price_source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "is_current": {
      "type": "integer"
     }
    },
    "required": [
     "asset_id",
     "date",
     "venue",
     "account",
     "wallet",
     "is_current"
    ],
    "additionalProperties": false
   }
  },
  "txn_id_aliases": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "old_id": {
      "type": "string"
     },
     "new_id": {
      "type": "string"
     },
     "scheme": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "old_id",
     "new_id"
    ],
    "additionalProperties": false
   }
  },
  "import_issues": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "issue_id": {
      "type": "string"
     },
     "severity": {
      "type": "string",
      "enum": [
       "info",
       "warn",
       "error"
      ]
     },
     "kind": {
      "type": "string"
     },
     "file": {
      "type": [
       "string",
       "null"
      ]
     },
     "line": {
      "type": [
       "integer",
       "null"
      ]
     },
     "detail": {
      "type": "string"
     },
     "handling": {
      "type": "string"
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "issue_id",
     "severity",
     "kind",
     "detail",
     "handling"
    ],
    "additionalProperties": false
   }
  },
  "overrides": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "override_id": {
      "type": "string"
     },
     "target": {
      "type": "string"
     },
     "field": {
      "type": [
       "string",
       "null"
      ]
     },
     "old_value": {
      "type": [
       "string",
       "null"
      ]
     },
     "new_value": {
      "type": [
       "string",
       "null"
      ]
     },
     "reason": {
      "type": "string"
     },
     "evidence": {
      "type": [
       "string",
       "null"
      ]
     },
     "author": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "override_id",
     "target",
     "reason"
    ],
    "additionalProperties": false
   }
  },
  "annotations": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "annotation_id": {
      "type": "string"
     },
     "target": {
      "type": "string"
     },
     "kind": {
      "type": "string"
     },
     "body": {
      "type": "string"
     },
     "author": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "data_hash": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "annotation_id",
     "target",
     "kind",
     "body"
    ],
    "additionalProperties": false
   }
  },
  "metric_registry": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "metric_id": {
      "type": "string"
     },
     "version": {
      "type": [
       "integer",
       "null"
      ]
     },
     "unit": {
      "type": [
       "string",
       "null"
      ]
     },
     "params": {
      "type": [
       "string",
       "null"
      ]
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "sql": {
      "type": [
       "string",
       "null"
      ]
     },
     "test": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "metric_id"
    ],
    "additionalProperties": false
   }
  }
 },
 "required": [
  "meta",
  "accounts",
  "transactions",
  "categories"
 ],
 "patternProperties": {
  "^x_[a-z0-9_]+$": {
   "type": "array"
  },
  "^d_[a-z0-9_]+$": {
   "type": "array"
  }
 },
 "additionalProperties": false
}
