Skip to content

Available Policies

MIDDAG Account includes 10 configurable policies. Each policy controls a specific aspect of entitlement behavior. This page is the complete reference -- every field, every default, every option.

For how the override hierarchy works, see Policy Hierarchy. For step-by-step configuration, see Configuring Policies.


Renewal Policy

What it controls: Automatic renewal behavior, grace windows before expiration, and pricing on renewal.

When it matters: Every billing cycle, when an entitlement approaches its expiration date.

FieldDefaultOptions / RangeDescription
auto_renewtruetrue / falseAutomatically renew before expiration
grace_days_pre_expiry7Integer (days)Days before expiry to attempt the renewal charge
renewal_pricingsamesame / currentsame = original price; current = current catalog price
early_renewal_days30Integer (days)How early a customer can manually renew
renewal_reminder_days[30, 7, 1]List of integersDays before expiry to send renewal reminders
failed_renewal_retries3IntegerRetry attempts for a failed renewal charge
block_downgrade_at_renewalfalsetrue / falsePrevent plan downgrades during the renewal window

Example scenario: A service contract (SVC class) renews at the current catalog price instead of the original price, and downgrades are blocked during the renewal window. The SVC class overrides renewal_pricing: current and block_downgrade_at_renewal: true.


Payment Recovery Policy

What it controls: How the system responds to failed payments -- when to suspend, how long to wait before cancellation, and whether to auto-reactivate.

When it matters: When a credit card expires, a charge is declined, or a bank transfer fails.

FieldDefaultOptions / RangeDescription
triggerretry_exhaustedfirst_failure / retry_exhaustedWhen to suspend: on first failure or after all retries
anticipate_suspensionfalsetrue / falsePre-suspend customers with a history of payment issues
suspended_to_cancelled_days30Integer (days)Days in suspended state before automatic cancellation
auto_reactivate_on_paymenttruetrue / falseReactivate automatically when payment succeeds

Example scenario: Plugin entitlements (PLG class) use a shorter suspension window of 14 days because plugins are inexpensive and easily re-purchased. Environment entitlements (ENV class) use 15 days because a suspended hosting environment is urgent for the customer.


Cancellation Policy

What it controls: What happens after an entitlement expires -- portal visibility, automatic cancellation timing, and data retention.

When it matters: When an entitlement expires and is not renewed, or when a customer cancels.

FieldDefaultOptions / RangeDescription
portal_visibility_days90Integer (days)Days an expired entitlement stays visible in the portal
expired_to_cancelled_days30Integer (days)Days in expired state before automatic cancellation
data_retention_days365Integer (days)Days to keep operational data after cancellation
data_actionexport_and_deleteexport_and_delete / archive / retainWhat to do with customer data on cancellation
offer_data_exporttruetrue / falseOffer data export during the cancellation flow

Important: Tax and fiscal data follows legal retention periods (LGPD, tax law) and is NOT controlled by this policy. Only operational data is affected.

Example scenario: Plugin entitlements (PLG class) use archive instead of export_and_delete because license data is lightweight and customers may reactivate later. Data retention is set to 90 days instead of 365.


SLA Policy

What it controls: Service level targets for response times, resolution times, uptime, and escalation behavior. Uses a 4-tier model: Standard, Priority, Critical, and Dedicated.

When it matters: Every time a service request is created against an entitlement.

FieldDefaultOptions / RangeDescription
sla_levelstandardstandard / priority / critical / dedicatedWhich SLA tier applies (determines response targets)
response_time(tiered, see below)Object with per-level, per-priority targetsFirst response time targets
resolution_time(tiered, see below)Object with per-level, per-priority targetsResolution time targets
uptime_target99.5%Percentage stringUptime target (managed environments only)
support_hoursbusiness_hoursbusiness_hours / extended / 24x7Support availability window
escalation_enabledtruetrue / falseAuto-escalate when SLA breach is approaching
escalation_after_pct80Integer (percentage)Percentage of SLA time to trigger escalation
priority_levels[low, normal, high, urgent]List of prioritiesAvailable priority levels for service requests

SLA tiers -- Standard response time targets:

PriorityResponseResolution
P18h2 days
P21 day3 days
P32 days5 days
P43 days7 days
P55 days10 days

SLA tiers -- Priority response time targets:

PriorityResponseResolution
P14h1 day
P28h2 days
P31 day3 days
P42 days5 days
P53 days7 days

SLA tiers -- Critical response time targets:

PriorityResponseResolution
P12h8h
P24h1 day
P38h2 days
P41 day3 days
P52 days5 days

SLA tiers -- Dedicated response time targets:

PriorityResponseResolution
P130 min2h
P21h4h
P32h8h
P44h1 day
P58h2 days

All times are in business hours (9:00-18:00 BRT, Mon-Fri) unless support_hours is set to extended or 24x7.

Example scenario: Service entitlements (SVC class) default to Priority SLA with extended support hours and earlier escalation (at 70% of SLA time instead of 80%). Environment entitlements (ENV class) use Standard SLA but with a higher uptime target of 99.9%.


Credit Policy

What it controls: How service credits (UST) behave -- expiration, grace periods, consumption order, and overdraft limits.

When it matters: For entitlements that include a credit balance, typically service contracts (SVC class).

FieldDefaultOptions / RangeDescription
expiration_months12Integer (months)Months until plan-included credits expire
grace_before_days0Integer (days)Grace days before expiration
grace_after_days30Integer (days)Grace days after expiration before credits are lost
block_on_limit_exceededfalsetrue / falseBlock new service requests when balance is negative
limit_threshold0Integer (credits)Negative credit balance allowed before blocking (0 = none)
avulso_expiration_months6Integer (months)Expiration for credits purchased as one-off top-ups
consumption_orderfifofifo / lifofifo = oldest credits used first; lifo = newest first

Example scenario: An enterprise organization negotiates 24-month credit expiration instead of the standard 12 months. This is set as an organization-level override: expiration_months: 24.


Provisioning Policy

What it controls: Whether access is set up automatically after purchase, or requires manual admin approval. Also controls webhook notifications and deprovisioning on cancellation.

When it matters: Immediately after a successful payment, when the entitlement is created.

FieldDefaultOptions / RangeDescription
autotruetrue / falseAuto-provision on payment, or require manual approval
require_approvalnonenone / admin / bothWho must approve when provisioning is manual
webhook_enabledfalsetrue / falseNotify an external system after provisioning
retry_on_failuretruetrue / falseRetry provisioning if it fails
max_retries3IntegerMax retry attempts before permanent failure
timeout_minutes30Integer (minutes)Minutes before marking provisioning as failed
notify_admin_on_manualtruetrue / falseSend admin notification when manual provisioning needed
deprovision_on_cancelfalsetrue / falseAutomatically remove resources when entitlement cancelled

Example scenario: Plugin entitlements (PLG class) are fully automatic -- purchase triggers instant license generation. Service entitlements (SVC class) override to manual provisioning (auto: false, require_approval: admin) because contracts require human validation and Jira workspace setup. Environment entitlements (ENV class) enable deprovision_on_cancel: true to shut down hosting environments when cancelled.


Trial Policy

What it controls: Free trial availability, duration, auto-conversion to paid, and abuse prevention.

When it matters: When a prospective customer wants to try a product before committing.

FieldDefaultOptions / RangeDescription
enabledfalsetrue / falseWhether trials are available at this level
duration_days14Integer (days)Trial length
auto_converttruetrue / falseAuto-convert to paid subscription when trial ends
require_payment_methodfalsetrue / falseRequire a credit card to start the trial
max_trials_per_org1IntegerMax trials per organization (prevents abuse)
extend_allowedfalsetrue / falseAllow an admin to extend a trial manually
notification_days_before_end[3, 1]List of integersDays before trial end to notify the customer

Example scenario: Trials are disabled globally but enabled for the Environment class (ENV) to let schools test the Campus EAD hosting platform. The ENV class override sets enabled: true and require_payment_method: true to prevent abuse of cloud provisioning resources.


Refund Policy

What it controls: Refund eligibility window, automatic vs manual approval, thresholds, and what happens to the entitlement and credits after a refund.

When it matters: When a customer requests a refund after purchase.

FieldDefaultOptions / RangeDescription
refund_window_days30Integer (days)Days after purchase to request a refund
auto_refundfalsetrue / falseAuto-approve refunds within the window (up to max amount)
auto_refund_max100.00Decimal or multi-currency objectMaximum amount for auto-refund; above this needs admin
partial_allowedtruetrue / falseAllow partial refunds proportional to usage
approval_requiredadminnone / adminWho must approve refund requests
cancel_entitlementtruetrue / falseCancel the entitlement after a full refund
credits_on_refundforfeitforfeit / retain / proportionalWhat happens to unused credits on refund

Example scenario: Plugin entitlements (PLG class) enable auto-refund for purchases under R$500 BRL / $100 USD, because plugins are low-risk and generous refund policies reduce support overhead. Service entitlements (SVC class) set refund_window_days: 0 because annual contracts have no refund period, though an admin can still approve exceptions.


Tier Change Policy

What it controls: How upgrades and downgrades work -- immediate vs next billing cycle, cooldown between changes, approval requirements, and credit adjustment.

When it matters: When a customer wants to switch to a higher or lower plan tier.

FieldDefaultOptions / RangeDescription
effectimmediateimmediate / next_cycleWhen the tier change takes effect
downgrade_requires_approvalnonenone / admin / client / bothWho must approve a downgrade
cooldown_days0Integer (days)Minimum days between tier changes (0 = no limit)
credit_behaviornext_cycleimmediate / next_cycle / forfeitHow credits are adjusted on tier change

Example scenario: Service entitlements (SVC class) override to effect: next_cycle (changes apply at the next billing cycle), downgrade_requires_approval: admin, and cooldown_days: 90 to prevent frequent plan flipping on annual contracts.


Notification Policy

What it controls: Which notification channels are active, which events trigger notifications, reminder timing, and opt-out settings.

When it matters: Throughout the entitlement lifecycle -- expiry warnings, payment alerts, renewal reminders, and more.

FieldDefaultOptions / RangeDescription
channels[email]email, sms, whatsapp, portalActive notification channels
events(see below)List of event identifiersEvents that trigger notifications
expiry_warning_days[30, 7, 1]List of integersDays before expiry to send warnings
credit_low_threshold_pct20Integer (percentage)Credit balance percentage to trigger low-credit alert
allow_opt_outtruetrue / falseLet collaborators opt out of non-critical notifications

Default notification events: expiry_warning, credit_low, payment_failed, payment_success, suspension, cancellation, renewal.

Example scenario: Service entitlements (SVC class) use earlier expiry warnings -- [60, 30, 7] instead of [30, 7, 1] -- because contract renewals require more lead time. Environment entitlements (ENV class) add the 1 day warning back to the extended list: [60, 30, 7, 1], because a hosting environment going offline is urgent.


Quick reference: Class-level defaults

This table shows which policies each entitlement class overrides from the global defaults:

PolicyPLG (Plugin)ENV (Environment)SVC (Service)
Renewal----current pricing, block downgrade
Payment Recovery14d suspend15d suspend--
Cancellation30d visible, 14d expire, 90d retain, archive30d visible, 15d expire, 180d retain--
SLAStandard, no escalationStandard, 99.9% uptime, extended hoursPriority, extended hours, 70% escalation
Credit----Explicit FIFO, 30d grace
Provisioning--deprovision on cancelManual, admin approval, deprovision
Trial--Enabled, 14d, card required--
RefundAuto to R$500/$100--0d window, proportional credits
Tier Change----next_cycle, admin approval, 90d cooldown
Notification--60/30/7/1d warnings60/30/7d warnings

-- means the class inherits the global default with no override.