Skip to content

Products and Entitlement Classes

Every WooCommerce product in the MIDDAG ecosystem maps to an Entitlement Class. This mapping tells MIDDAG Account what type of access to grant when a customer purchases the product. One product maps to exactly one class.

The six Entitlement Classes

ClassNameWhat it representsWhat gets created on purchase
PLGPluginSoftware licenseEntitlement + License key + Download access
ENVEnvironmentManaged hosting instanceEntitlement + Environment instance
SVCServiceOngoing service or projectEntitlement + Service + Contract + Credit Balance
ORDOrderGeneral-purpose purchaseEntitlement (generic, linked to order)
AFLAffiliatePartner program membershipEntitlement + Affiliate tracking
EDUEducationTraining, mentoring, courseEntitlement + Course access

How mapping works

When you create or edit a WooCommerce product, a MIDDAG Account panel appears in the product editor. This panel contains:

  1. Entitlement Class -- Select one of the six classes above.
  2. Class-specific settings -- Fields that vary by class (license duration, environment tier, service category, etc.).
  3. Policy overrides -- Optional per-product overrides for renewal, refund, cancellation, and other policies.

Products without an entitlement class mapping are treated as standard WooCommerce products. No entitlement is created when they are purchased.

Product meta fields

The mapping is stored as WooCommerce product meta:

Meta keyTypeDescription
_middag_entitlement_classstringThe class code: PLG, ENV, SVC, ORD, AFL, EDU
_middag_provisioning_modestringauto (default) or manual
_middag_policy_overridesJSONPer-product policy overrides (optional)

Additional meta fields depend on the class. For example, PLG products have _middag_license_duration and _middag_activation_limit.

Product Registry [Planned]

The Product Registry is a planned admin screen (MIDDAG Account > Settings > Product Registry) that provides a centralized view of all WooCommerce products and their entitlement class mappings. From this screen you can:

  • See all products with their current class assignment
  • Bulk-assign or change classes
  • View products that have no mapping (and therefore will not create entitlements)
  • Filter by class, category, or status

Until the Product Registry is implemented, mappings are configured in the individual product editor.

Examples

Plugin product (PLG class)

A product like "MIDDAG for Moodle -- FULL" (SKU: PLG-MOODLE-FULL):

  • Entitlement Class: PLG
  • Billing type: Subscription (monthly or annual)
  • On purchase: Creates an entitlement with code like PLG-2026050042, generates a license key, enables download access
  • On renewal: Extends the entitlement expiration date, license key remains the same

Hosting plan (ENV class)

A product like "Managed Hosting -- Standard" (SKU: SVC-HOST-BASIC):

  • Entitlement Class: ENV
  • Billing type: Subscription (monthly)
  • On purchase: Creates an entitlement with code like ENV-2026050003, provisions an environment instance
  • On renewal: Extends the entitlement, environment stays active

Support plan (SVC class)

A product like "Monthly Support -- Business" (SKU: SVC-SUP-BUSINESS):

  • Entitlement Class: SVC
  • Billing type: Subscription (monthly or annual)
  • On purchase: Creates an entitlement, service record, contract, and initial credit balance
  • On renewal: Extends the entitlement, refreshes credit balance according to the plan

Training session (EDU class)

A product like "Training Session 1h" (SKU: EDU-BRIDGE-SESSION):

  • Entitlement Class: EDU
  • Billing type: One-time
  • On purchase: Creates an entitlement with access to the training session

Product-level policy overrides

Each product can override global and class-level policy values. The override hierarchy is:

Global defaults
  -> Class defaults (e.g., all PLG products)
    -> Organization overrides
      -> Product overrides        <-- configured here
        -> Individual entitlement overrides

Most specific wins. If a product does not define an override, the value is inherited from the level above.

Common product-level overrides:

PolicyOverride example
RefundShorter refund window for one-time products (7 days instead of 30)
RenewalRenewal at current catalog price instead of original purchase price
TrialEnable trial for specific ENV products (14 days)
SLAHigher SLA tier for premium hosting products

These overrides are configured in the product YAML definition (source of truth) and synced to WooCommerce product meta.

SKU format

Product SKUs follow a structured format:

{ENTITLEMENT_CLASS}-{LINE}[-{PRODUCT}][-{VARIATION}]

Examples:

SKUClassLineProductVariation
PLG-MOODLE-FULLPLGMOODLEFULL--
PLG-EXT-SMARTFORMSPLGEXTSMARTFORMS--
SVC-HOST-BASICSVCHOSTBASIC--
EDU-BRIDGE-SESSIONEDUBRIDGESESSION--

The entitlement class prefix in the SKU matches the class mapping, making it easy to identify a product's class at a glance.