{
    "fields": {
        "name": {
            "type": "varchar",
            "required": true
        },
        "subject": {
            "type": "varchar"
        },
        "body": {
            "type": "text",
            "view": "Fields.Wysiwyg"
        },
        "isHtml": {
            "type": "bool",
            "default": true
        },
        "attachments": {
            "type": "linkMultiple",
            "view": "Fields.AttachmentMultiple"
        },
        "assignedUser": {
            "type": "link",
            "required": true
        },
        "teams": {
            "type": "linkMultiple"
        },
        "createdAt": {
            "type": "datetime",
            "readOnly": true
        },
        "modifiedAt": {
            "type": "datetime",
            "readOnly": true
        },
        "createdBy": {
            "type": "link",
            "readOnly": true
        },
        "modifiedBy": {
            "type": "link",
            "readOnly": true
        }
    },
    "links": {
        "attachments": {
            "type": "hasChildren",
            "entity": "Attachment",
            "foreign": "parent"
        },
        "teams": {
            "type": "hasMany",
            "entity": "Team",
            "relationName": "entityTeam"
        },
        "assignedUser": {
            "type": "belongsTo",
            "entity": "User"
        },
        "createdBy": {
            "type": "belongsTo",
            "entity": "User"
        },
        "modifiedBy": {
            "type": "belongsTo",
            "entity": "User"
        }
    },
    "collection": {
        "sortBy": "name",
        "asc": true
    }
}
