{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "CurrencyTotals.json",
  "title": "Currency totals",
  "description": "Totals for one currency.",
  "type": "object",
  "properties": {
    "currency": {
      "type": "string",
      "enum": [
        "NGN",
        "USD",
        "CAD",
        "EUR",
        "GBP"
      ],
      "description": "ISO currency code."
    },
    "open": {
      "type": "number",
      "format": "decimal",
      "description": "Total of approved, unpaid invoices. Includes the overdue ones."
    },
    "overdue": {
      "type": "number",
      "format": "decimal",
      "description": "Total of open invoices past their due date."
    },
    "paid": {
      "type": "number",
      "format": "decimal",
      "description": "Total of paid invoices."
    },
    "openCount": {
      "type": "integer",
      "format": "int32",
      "description": "Number of open invoices."
    },
    "overdueCount": {
      "type": "integer",
      "format": "int32",
      "description": "Number of overdue invoices."
    },
    "paidCount": {
      "type": "integer",
      "format": "int32",
      "description": "Number of paid invoices."
    }
  },
  "required": [
    "currency",
    "open",
    "overdue",
    "paid",
    "openCount",
    "overdueCount",
    "paidCount"
  ]
}
