# Decide which servers have this plugin enabled
enable-plugin:
- not:
  - feature-flag: cpanel-360Monitoring-prerelease-disabled
  - feature-flag: cpanel-360Monitoring-disabled
  - feature-flag: cpanel.360-monitoring.plugin.local.disable
- or:
  - feature-flag: cpanel-360Monitoring-enabled
  - feature-flag: cpanel.360-monitoring.plugin.local.enable
  # Enable select companies 118 - *
  - and:
    - company-id:
      - 7     # cpanel employees, dns only
      - 265   # cpanel direct
      - 2869  # siteocity
      - 4393  # plesk test
    - compare-version:
        operator: ">="
        version: "11.118"
  # Enable everyone on EDGE or CURRENT tier on 128+
  # This limits the number of servers initially to the ones
  # that already installed it on EDGE or CURRENT
  - and:
    - compare-version:
        operator: ">="
        version: "11.128"
    - tiers:
      - EDGE
      - CURRENT

# Decide which servers have the miniapp enabled by default
auto-enable-miniapp:
- or:
  # Enable select companies 118 - 126
  - and:
    - company-id:
      - 7     # cpanel employees, dns only
      - 265   # cpanel direct
      - 2869  # siteocity
      - 4393  # plesk test
    - compare-version:
        operator: ">="
        version: "11.118"
  - and:
    - compare-version:
        operator: ">="
        version: "11.128"
    - tiers:
      - EDGE
      - CURRENT

# this rule tells us what needs to be left enabled after the licenses...
# we will start using yaml anchors & aliases to avoid duplication
update-plugin:
- not:
  - feature-flag: cpanel-360Monitoring-prerelease-disabled
  - feature-flag: cpanel-360Monitoring-disabled
  - feature-flag: cpanel.360-monitoring.plugin.local.disable
  - company-id:
    - 7     # cpanel employees, dns only
    - 265   # cpanel direct
    - 2869  # siteocity
    - 4393  # plesk test
show-miniapp:
- personalization:
    store: 'cpanel.360-monitoring.plugin'
    name: 'homepage-app-enabled'
    app: 'whostmgr'
    operator: 'boolean'
    default: false
