{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "title": "Organisation",
    "description": "JSON schema for an organisation",
    "additionalProperties": false,
    "required": [
        "$schema",
        "pid",
        "name",
        "code",
        "default_currency"
    ],
    "properties": {
        "$schema": {
            "title": "Schema",
            "description": "Schema to validate organisation records against.",
            "type": "string",
            "minLength": 9,
            "default": "https://ils.rero.ch/schemas/organisations/organisation-v0.0.1.json"
        },
        "pid": {
            "title": "Organisation ID",
            "type": "string"
        },
        "name": {
            "title": "Name",
            "description": "Required. Name of the organisation.",
            "type": "string",
            "minLength": 1
        },
        "address": {
            "title": "Address",
            "description": "Address of the organisation.",
            "type": "string",
            "minLength": 1
        },
        "code": {
            "title": "Code",
            "description": "Code of the organisation.",
            "type": "string",
            "minLength": 2
        },
        "current_budget_pid": {
            "title": "Current ID of the budget",
            "description": "The ID of the current budget of the organisation",
            "type": "string"
        },
        "default_currency": {
            "title": "Default currency",
            "description": "The default currency of the organisation",
            "type": "string",
            "pattern": "^[A-Z]{3}$"
        },
        "online_harvested_source": {
            "title": "Online harvested source",
            "description": "Online harvested source as configured in ebooks server.",
            "type": "string"
        }
    }
}