{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "additionalProperties": false,
    "definitions": {
        "IDType": {
            "pattern": "^\\d{10}$",
            "type": "string"
        },
        "ISO8601-Date": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
        },
        "ISO8601-Timestamp": {
            "pattern": "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(([+-]\\d{2}(:\\d{2})?)|Z)",
            "type": "string"
        },
        "LISAManagerReferenceNumberType": {
            "pattern": "^Z\\d{6}$",
            "type": "string"
        },
        "financialPeriodType": {
            "properties": {
                "endDate": {
                    "$ref": "#/definitions/ISO8601-Date"
                },
                "startDate": {
                    "$ref": "#/definitions/ISO8601-Date"
                }
            },
            "type": "object"
        }
    },
    "properties": {
        "LISAManagerReferenceNumber": {
            "$ref": "#/definitions/LISAManagerReferenceNumberType"
        },
        "_links": {
            "type": "object"
        },
        "accountID": {
            "type": "string"
        },
        "closeDate": {
            "$ref": "#/definitions/ISO8601-Date"
        },
        "deathNotification": {
            "additionalProperties": false,
            "properties": {
                "DoD": {
                    "$ref": "#/definitions/ISO8601-Date"
                },
                "notifiedDate": {
                    "$ref": "#/definitions/ISO8601-Timestamp"
                }
            },
            "required": [
                "notifiedDate",
                "DoD"
            ],
            "type": "object"
        },
        "financialPeriods": {
            "items": {
                "properties": {
                    "_links": {
                        "type": "object"
                    },
                    "financialPeriod": {
                        "$ref": "#/definitions/financialPeriodType"
                    },
                    "firstSubscribed": {
                        "$ref": "#/definitions/ISO8601-Timestamp"
                    }
                },
                "required": [
                    "financialPeriod",
                    "_links"
                ],
                "type": "object"
            },
            "minItems": 1,
            "type": "array",
            "_uniqueItems": true
        },
        "healthStatus": {
            "enum": [
                "default",
                "dead",
                "terminally-ill"
            ],
            "type": "string"
        },
        "investorID": {
            "$ref": "#/definitions/IDType"
        },
        "openDate": {
            "$ref": "#/definitions/ISO8601-Date"
        },
        "status": {
            "enum": [
                "open",
                "closed",
                "transferred-out"
            ],
            "type": "string"
        },
        "terminalIllnessNotification": {
            "properties": {
                "notifiedDate": {
                    "$ref": "#/definitions/ISO8601-Timestamp"
                }
            },
            "required": [
                "notifiedDate"
            ],
            "type": "object"
        }
    },
    "required": [
        "accountID",
        "LISAManagerReferenceNumber",
        "investorID",
        "status",
        "openDate"
    ],
    "type": "object"
}