{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ledger.abivia.com/api/json/domain.schema.json",
  "title": "Domain Request",
  "description": "Ledger Domain request",
  "type": "object",
  "properties": {
    "code": {
      "description": "A unique code that identifies the domain.",
      "type": "string",
      "pattern": "^[^ \t\r\n*]*$"
    },
    "currency": {
      "description": "The default currency to be used for this domain's transactions.",
      "type": "string",
      "pattern": "^[^ \\t\\r\\n*]*$"
    },
    "extra": {
      "description": "Arbitrary data for use by the application.",
      "type": "string"
    },
    "name": {
      "description": "The ledger name, language is assumed to be the current system locale.",
      "type": "string"
    },
    "names": {
      "description": "The ledger name in one or more languages.",
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "https://ledger.abivia.com/api/json/name.schema.json"
      }
    },
    "revision": {
      "description": "A revision hash code, required for update operations.",
      "type": "string"
    },
    "subJournals": {
      "description": "Set when the ledger can have sub-journals.",
      "type": "boolean"
    },
    "toCode": {
      "description": "The new domain identifier. Only useful on update.",
      "type": "string",
      "pattern": "^[^ \t\r\n*]*$"
    }
  },
  "required": ["code"]
}
