{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User Schema",
    "type": "object",
    "properties": {
        "username": {
            "type": "string"
        },
        "id": {
            "type": "string"
        },
        "barcode": {
            "type": "string"
        },
        "active": {
            "type": "boolean"
        },
        "type": {
            "type": "string"
        },
        "patronGroup": {
            "type": "string"
        },
        "meta": {
            "type": "object"
        },
        "personal": {
            "type": "object",
            "properties": {
                "lastName": {
                    "type": "string"
                },
                "firstName": {
                    "type": "string"
                },
                "middleName": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "mobilePhone": {
                    "type": "string"
                },
                "dateOfBirth": {
                    "type": "string",
                    "format": "date-time"
                },
                "preferredContact": {
                    "type": "object",
                    "properties": {
                        "value": {
                            "type": "string",
                            "enum": [
                                "EMAIL",
                                "MAIL",
                                "TEXT",
                                "PHONE",
                                "MOBILE"
                            ]
                        },
                        "desc": {
                            "type": "string",
                            "enum": [
                                "Email",
                                "Mail (Primary Address)",
                                "Text message",
                                "Phone",
                                "Mobile phone"
                            ]
                        }
                    }
                }
            },
            "additionalProperties": false,
            "required": [
                "lastName"
            ]
        },
        "openDate": {
            "type": "string",
            "format": "date-time"
        },
        "enrollmentDate": {
            "type": "string",
            "format": "date-time"
        },
        "expirationDate": {
            "type": "string",
            "format": "date-time"
        },
        "lastUpdateDate": {
            "type": "string",
            "format": "date-time"
        }
    },
    "additionalProperties": false,
    "required": [
        "username",
        "id"
    ]
}