{
    "fields": {
        "post": {
            "type": "text",
            "rows": 100000,
            "view": "views/note/fields/post"
        },
        "data": {
            "type": "jsonObject",
            "readOnly": true
        },
        "type": {
            "type": "varchar",
            "readOnly": true,
            "view": "views/fields/enum",
            "options": ["Post"]
        },
        "targetType": {
            "type": "varchar"
        },
        "parent": {
            "type": "linkParent",
            "readOnly": true
        },
        "related": {
            "type": "linkParent",
            "readOnly": true
        },
        "attachments": {
            "type": "attachmentMultiple",
            "view": "views/stream/fields/attachment-multiple"
        },
        "number": {
            "type": "autoincrement",
            "index": true,
            "dbType": "bigint",
            "readOnly": true
        },
        "teams": {
            "type": "linkMultiple",
            "noLoad": true
        },
        "portals": {
            "type": "linkMultiple",
            "noLoad": true
        },
        "users": {
            "type": "linkMultiple",
            "noLoad": true
        },
        "isGlobal": {
            "type": "bool"
        },
        "createdByGender": {
            "type": "foreign",
            "link": "createdBy",
            "field": "gender"
        },
        "notifiedUserIdList": {
            "type": "jsonArray",
            "notStorable": true,
            "disabled": true
        },
        "isInternal": {
            "type": "bool"
        },
        "createdAt": {
            "type": "datetime",
            "readOnly": true
        },
        "modifiedAt": {
            "type": "datetime",
            "readOnly": true
        },
        "createdBy": {
            "type": "link",
            "readOnly": true
        },
        "modifiedBy": {
            "type": "link",
            "readOnly": true
        }
    },
    "links": {
        "createdBy": {
            "type": "belongsTo",
            "entity": "User"
        },
        "modifiedBy": {
            "type": "belongsTo",
            "entity": "User"
        },
        "attachments": {
            "type": "hasChildren",
            "entity": "Attachment",
            "relationName": "attachments",
            "foreign": "parent"
        },
        "parent": {
            "type": "belongsToParent",
            "foreign": "notes"
        },
        "superParent": {
            "type": "belongsToParent"
        },
        "related": {
            "type": "belongsToParent"
        },
        "teams": {
            "type": "hasMany",
            "entity": "Team",
            "foreign": "notes"
        },
        "portals": {
            "type": "hasMany",
            "entity": "Portal",
            "foreign": "notes"
        },
        "users": {
            "type": "hasMany",
            "entity": "User",
            "foreign": "notes"
        }
    },
    "collection": {
        "orderBy": "number",
        "order": "desc",
        "textFilterFields": ["post"]
    },
    "statusStyles": {
        "Lead": {
            "Assigned" : "primary",
            "In Process" : "primary"
        },
        "Case": {
            "Assigned" : "primary"
        },
        "Opportunity": {
            "Proposal": "primary",
            "Negotiation": "primary"
        },
        "Task": {
            "Started" : "primary",
            "Canceled" : "danger"
        }
    },
    "indexes": {
        "createdAt": {
            "type": "index",
            "columns": ["createdAt"]
        },
        "parent": {
            "type": "index",
            "columns": ["parentId", "parentType"]
        },
        "parentAndSuperParent": {
            "type": "index",
            "columns": ["parentId", "parentType", "superParentId", "superParentType"]
        },
        "createdByNumber": {
            "columns": ["createdById", "number"]
        }
    }
}
