{
    "fields": {
        "name": {
            "type": "varchar",
            "required": true,
            "pattern": "$noBadCharacters"
        },
        "status": {
            "type": "enum",
            "options": [
                "Planned",
                "Held",
                "Not Held"
            ],
            "default": "Planned",
            "style": {
                "Held": "success",
                "Not Held": "info"
            },
            "displayAsLabel": true,
            "labelType": "state",
            "audited": true
        },
        "dateStart": {
            "type": "datetimeOptional",
            "view": "crm:views/meeting/fields/date-start",
            "required": true,
            "default": "javascript: return this.dateTime.getNow(15);",
            "audited": true
        },
        "dateEnd": {
            "type": "datetimeOptional",
            "view": "crm:views/meeting/fields/date-end",
            "required": true,
            "after": "dateStart",
            "suppressValidationList": ["required"]
        },
        "isAllDay": {
            "type": "bool",
            "layoutListDisabled": true,
            "layoutDetailDisabled": true,
            "layoutMassUpdateDisabled": true
        },
        "duration": {
            "type": "duration",
            "start": "dateStart",
            "end": "dateEnd",
            "options": [300, 600, 900, 1800, 2700, 3600, 7200, 10800],
            "default": 300,
            "notStorable": true,
            "select": {
                "select": "TIMESTAMPDIFF_SECOND:(dateStart, dateEnd)"
            },
            "order": {
                "order": [
                    ["TIMESTAMPDIFF_SECOND:(dateStart, dateEnd)", "{direction}"]
                ]
            }
        },
        "parent": {
            "type": "linkParent",
            "entityList": ["Account", "Lead", "Contact"]
        },
        "description": {
            "type": "text"
        },
        "reminders": {
            "type": "jsonArray",
            "notStorable": true,
            "orderDisabled": true,
            "view": "crm:views/meeting/fields/reminders",
            "layoutListDisabled": true,
            "validatorClassNameList": [
                "Espo\\Modules\\Crm\\Classes\\FieldValidators\\Event\\Reminders\\Valid",
                "Espo\\Modules\\Crm\\Classes\\FieldValidators\\Event\\Reminders\\MaxCount"
            ],
            "dynamicLogicDisabled": true,
            "duplicateIgnore": true
        },
        "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": false,
            "view": "views/fields/assigned-user"
        },
        "teams": {
            "type": "linkMultiple",
            "view": "views/fields/teams"
        }
    },
    "links": {
        "parent": {
            "type": "belongsToParent",
            "foreign": "{entityTypeLowerFirst}Children"
        },
        "createdBy": {
            "type": "belongsTo",
            "entity": "User"
        },
        "modifiedBy": {
            "type": "belongsTo",
            "entity": "User"
        },
        "assignedUser": {
            "type": "belongsTo",
            "entity": "User"
        },
        "teams": {
            "type": "hasMany",
            "entity": "Team",
            "relationName": "entityTeam",
            "layoutRelationshipsDisabled": true
        }
    },
    "collection": {
        "orderBy": "dateStart",
        "order": "desc"
    },
    "indexes": {
        "dateStartStatus": {
            "columns": ["dateStart", "status"]
        },
        "dateStart": {
            "columns": ["dateStart", "deleted"]
        },
        "status": {
            "columns": ["status", "deleted"]
        },
        "assignedUser": {
            "columns": ["assignedUserId", "deleted"]
        },
        "assignedUserStatus": {
            "columns": ["assignedUserId", "status"]
        },
        "createdAt": {
            "columns": ["createdAt"]
        },
        "createdAtId": {
            "unique": true,
            "columns": ["createdAt", "id"]
        }
    }
}
