{
    "fields": {
        "number": {
            "type": "autoincrement",
            "dbType": "bigint",
            "index": true
        },
        "data": {
            "type": "jsonObject"
        },
        "noteData": {
            "type": "jsonObject",
            "notStorable": true,
            "orderDisabled": true
        },
        "type": {
            "type": "varchar"
        },
        "read": {
            "type": "bool"
        },
        "emailIsProcessed": {
            "type": "bool"
        },
        "user": {
            "type": "link"
        },
        "createdAt": {
            "type": "datetime",
            "readOnly": true
        },
        "message": {
            "type": "text"
        },
        "related": {
            "type": "linkParent",
            "readOnly": true
        },
        "relatedParent": {
            "type": "linkParent",
            "readOnly": true
        },
        "actionId": {
            "type": "varchar",
            "maxLength": 36,
            "readOnly": true,
            "index": true
        },
        "isFeatured": {
            "type": "bool",
            "readOnly": true
        },
        "groupedCount": {
            "type": "int",
            "notStorable": true,
            "readOnly": true,
            "utility": true
        },
        "groupType": {
            "type": "enum",
            "notStorable": true,
            "readOnly": true,
            "utility": true,
            "options": [
                "",
                "Note",
                "EmailReceived"
            ]
        },
        "groupedUnreadCount": {
            "type": "int",
            "notStorable": true,
            "readOnly": true,
            "utility": true
        },
        "createdBy": {
            "type": "link",
            "readOnly": true,
            "view": "views/fields/user"
        }
    },
    "links": {
        "createdBy": {
            "type": "belongsTo",
            "entity": "User",
            "noJoin": true
        },
        "user": {
            "type": "belongsTo",
            "entity": "User"
        },
        "related": {
            "type": "belongsToParent"
        },
        "relatedParent": {
            "type": "belongsToParent"
        }
    },
    "collection": {
        "orderBy": "number",
        "order": "desc"
    },
    "indexes": {
        "createdAt": {
            "type": "index",
            "columns": ["createdAt"]
        },
        "user": {
            "type": "index",
            "columns": ["userId", "number"]
        },
        "userIdReadRelatedParentType": {
            "type": "index",
            "columns": ["userId", "deleted", "read", "relatedParentType"]
        }
    }
}
