Promotions

promotions in @open-mercato/core

Rule-based promotions engine: condition-benefit trees, promotional codes, and cart effect resolution.

Ships with Open Mercato 0.10.1

Enable it

  1. yarn mercato module enable @open-mercato/core --module promotions

Then run yarn generate. Core is already installed, so nothing is downloaded.

Anatomy

ADDS 9 TABLES · 8 PERMISSIONS · EMITS 14 EVENTS

Data

  • promotions
  • promotion_rule_groups
  • promotion_rules
  • promotion_benefits
  • promotion_codes
  • promotion_generated_codes
  • promotion_code_reservations
  • promotion_code_usages
  • promotion_usages

API

Routes are not listed for built-in modules.

Security

promotions.

  • view
  • create
  • update
  • delete
  • codes.manage
  • evaluate
  • codes.redeem
  • usage.manage

Events

promotions.

  • emitspromotion.created
  • emitspromotion.updated
  • emitspromotion.deleted
  • emitscode.created
  • emitscode.updated
  • emitscode.deleted
  • emitscode.used
  • emitscode.exhausted
  • emitsgenerated_code.created
  • emitsusage.registered
  • emitsusage.reverted
  • emitspromotion.budget_exhausted
  • emitspromotion.expiring_soon
  • emitsevaluation.completed
  • subscribescode.created
  • subscribescode.deleted
  • subscribescode.updated
  • subscribespromotion.created
  • subscribespromotion.deleted
  • subscribespromotion.updated
  • subscribesusage.registered
  • subscribesusage.reverted

UI

  • 6 backend pages

Background

  • 2 workers

Not present: AI tools.

Not read: credentials and env, hosts (not in module-facts.v2.json).

From module-facts.v2.json in @open-mercato/cli 0.10.1. Read statically, not executed.