{
    "fields": {
        "name": {
            "type": "varchar",
            "required": true,
            "trim": true
        },
        "entryCount": {
            "type": "int",
            "readOnly": true,
            "notStorable": true
        },
        "description": {
            "type": "text"
        },
        "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",
            "view": "views/fields/assigned-user"
        },
        "teams": {
            "type": "linkMultiple",
            "view": "views/fields/teams"
        },
        "campaigns": {
            "type": "link"
        },
        "includingActionList": {
            "type": "multiEnum",
            "view": "crm:views/target-list/fields/including-action-list",
            "layoutDetailDisabled": true,
            "layoutFiltersDisabled": true,
            "layoutLinkDisabled": true,
            "notStorable": true,
            "required": true
        },
        "excludingActionList": {
            "type": "multiEnum",
            "view": "crm:views/target-list/fields/including-action-list",
            "layoutDetailDisabled": true,
            "layoutFiltersDisabled": true,
            "layoutLinkDisabled": true,
            "notStorable": true
        }
    },
    "links": {
        "createdBy": {
            "type": "belongsTo",
            "entity": "User"
        },
        "modifiedBy": {
            "type": "belongsTo",
            "entity": "User"
        },
        "assignedUser": {
            "type": "belongsTo",
            "entity": "User"
        },
        "teams": {
            "type": "hasMany",
            "entity": "Team",
            "relationName": "entityTeam",
            "layoutRelationshipsDisabled": true
        },
        "campaigns": {
            "type": "hasMany",
            "entity": "Campaign",
            "foreign": "targetLists"
        },
        "massEmails": {
            "type": "hasMany",
            "entity": "MassEmail",
            "foreign": "targetLists"
        },
        "campaignsExcluding": {
            "type": "hasMany",
            "entity": "Campaign",
            "foreign": "excludingTargetLists"
        },
        "massEmailsExcluding": {
            "type": "hasMany",
            "entity": "MassEmail",
            "foreign": "excludingTargetLists"
        },
        "accounts": {
            "type": "hasMany",
            "entity": "Account",
            "foreign": "targetLists",
            "additionalColumns": {
                "optedOut": {
                    "type": "bool"
                }
            }
        },
        "contacts": {
            "type": "hasMany",
            "entity": "Contact",
            "foreign": "targetLists",
            "additionalColumns": {
                "optedOut": {
                    "type": "bool"
                }
            }
        },
        "leads": {
            "type": "hasMany",
            "entity": "Lead",
            "foreign": "targetLists",
            "additionalColumns": {
                "optedOut": {
                    "type": "bool"
                }
            }
        },
        "users": {
            "type": "hasMany",
            "entity": "User",
            "foreign": "targetLists",
            "additionalColumns": {
                "optedOut": {
                    "type": "bool"
                }
            }
        }
    },
    "collection": {
        "sortBy": "createdAt",
        "asc": false
    },
    "indexes": {
        "createdAt": {
            "columns": ["createdAt", "deleted"]
        }
    }
}
