{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "EbolaCallCentreUser",
    "description": "An Ebola call centre CouchDB user",
    "type": "object",
    "properties": {
        "_id": {
            "type": "string"
        },
        "_rev": {
            "type": "string"
        },
        "password_scheme": {
            "type": "string"
        },
        "iterations": {
            "type": "integer"
        },
        "name": {
            "type": "string"
        },
        "roles": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "details": {
            "fullName": {
                "type": "string"
            },
            "role": {
                "type": "string"
            },
            "app": {
                "type": "string"
            }
        },
        "type": {
            "type": "string"
        },
        "doc_type": {
            "type": "string"
        },
        "derived_key": {
            "type": "string"
        },
        "salt": {
            "type": "string"
        },
        "locations": {
            "$ref": "#/definitions/locations"
        }
    },
    "definitions": {
        "locations": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "level": {
                        "type": "integer"
                    },
                    "default": {
                        "type": "boolean"
                    }
                }
            }
        }
    },
    "required": [
        "_id",
        "password_scheme",
        "name",
        "type",
        "doc_type",
        "derived_key",
        "salt"
    ]
}