{
    "fields": {
        "name": {
            "type": "varchar",
            "required": true,
            "trim": true
        },
        "status": {
            "type": "enum",
            "options": ["Planned", "Held", "Not Held"],
            "default": "Planned",
            "view": "views/fields/enum-styled",
            "style": {
                "Held": "success"
            },
            "audited": true
        },
        "dateStart": {
            "type": "datetime",
            "required": true,
            "default": "javascript: return this.dateTime.getNow(15);",
            "audited": true
        },
        "dateEnd": {
            "type": "datetime",
            "required": true,
            "after": "dateStart"
        },
        "duration": {
            "type": "duration",
            "start": "dateStart",
            "end": "dateEnd",
            "options": [300, 600, 900, 1800, 2700, 3600, 7200],
            "default": 300,
            "notStorable": true
        },
        "reminders": {
            "type": "jsonArray",
            "notStorable": true,
            "view": "crm:views/meeting/fields/reminders"
        },
        "direction": {
            "type": "enum",
            "options": ["Outbound", "Inbound"],
            "default": "Outbound"
        },
        "description": {
            "type": "text"
        },
        "parent": {
            "type": "linkParent",
            "entityList": ["Account", "Lead", "Opportunity", "Case"]
        },
        "account": {
            "type": "link",
            "readOnly": true
        },
        "acceptanceStatus": {
            "type": "enum",
            "notStorable": true,
            "disabled": true,
            "options": ["None", "Accepted", "Tentative", "Declined"]
        },
        "users": {
            "type": "linkMultiple",
            "layoutDetailDisabled": true,
            "layoutListDisabled": true,
            "view": "crm:views/meeting/fields/users",
            "columns": {
                "status": "acceptanceStatus"
            }
        },
        "contacts": {
            "type": "linkMultiple",
            "layoutDetailDisabled": true,
            "layoutListDisabled": true,
            "view": "crm:views/meeting/fields/contacts",
            "columns": {
                "status": "acceptanceStatus"
            }
        },
        "leads": {
            "type": "linkMultiple",
            "layoutDetailDisabled": true,
            "layoutListDisabled": true,
            "view": "crm:views/meeting/fields/attendees",
            "columns": {
                "status": "acceptanceStatus"
            }
        },
        "createdAt": {
            "type": "datetime",
            "readOnly": true
        },
        "modifiedAt": {
            "type": "datetime",
            "readOnly": true
        },
        "createdBy": {
            "type": "link",
            "readOnly": true,
            "view": "views/fields/user"
        },
        "modifiedBy": {
            "type": "link",
            "readOnly": true,
            "view": "views/fields/user"
        },
        "assignedUser": {
            "type": "link",
            "required": true,
            "view": "views/fields/assigned-user"
        },
        "teams": {
            "type": "linkMultiple",
            "view": "views/fields/teams"
        }
    },
    "links": {
        "account": {
            "type": "belongsTo",
            "entity": "Account"
        },
        "createdBy": {
            "type": "belongsTo",
            "entity": "User"
        },
        "modifiedBy": {
            "type": "belongsTo",
            "entity": "User"
        },
        "assignedUser": {
            "type": "belongsTo",
            "entity": "User"
        },
        "teams": {
            "type": "hasMany",
            "entity": "Team",
            "relationName": "entityTeam",
            "layoutRelationshipsDisabled": true
        },
        "users": {
            "type": "hasMany",
            "entity": "User",
            "foreign": "calls",
            "additionalColumns": {
                "status": {
                    "type": "varchar",
                    "len": "36",
                    "default": "None"
                }
            }
        },
        "contacts": {
            "type": "hasMany",
            "entity": "Contact",
            "foreign": "calls",
            "additionalColumns": {
                "status": {
                    "type": "varchar",
                    "len": "36",
                    "default": "None"
                }
            }
        },
        "leads": {
            "type": "hasMany",
            "entity": "Lead",
            "foreign": "calls",
            "additionalColumns": {
                "status": {
                    "type": "varchar",
                    "len": "36",
                    "default": "None"
                }
            }
        },
        "parent": {
            "type": "belongsToParent",
            "foreign": "calls"
        }
    },
    "collection": {
        "sortBy": "dateStart",
        "asc": false
    },
    "indexes": {
        "dateStartStatus": {
            "columns": ["dateStart", "status"]
        },
        "dateStart": {
            "columns": ["dateStart", "deleted"]
        },
        "status": {
            "columns": ["status", "deleted"]
        },
        "assignedUser": {
            "columns": ["assignedUserId", "deleted"]
        },
        "assignedUserStatus": {
            "columns": ["assignedUserId", "status"]
        }
    }
}
