Promotion
What It Models
A promotion describes a marketing benefit, claimed automatically or by code. It combines offer terms, qualification and stacking choices, dates, usage limits and lifecycle. Codes, generation batches, redemptions, allocation records and history belong to the same concept.
Identity and Attributes
Promotions have an internal key, displayed number and case-insensitive unique name. Codes are looked up by normalized workspace-wide keys. Redemptions retain the terms at placement and allocate the recorded discount to order lines.
Relationships
Pricing supplies the audience and Standard bases. Merchandise criteria select eligible product lines, and purchasing settings may exclude products from discounts. Recommendation actions can enter a code on a checkout.
Invariants
Offer shape, code kind and parent windows are validated. Protected terms lock on first use. Conditional counter updates enforce limits during placement, and commit checks tie discount totals to allocations. Release restores capacity while retaining the original monetary records.
How It Is Stored and Shared
Promotions owns campaigns, codes, batches, evaluations, history and redemptions. Orders calls its placement and release functions within order transactions; Accounting handles financial documents. Release also writes order history, without publishing an external event. No custom fields are declared.
Open Design Questions
The first code establishes a promotion-wide cancellation-release default, which can affect later codes of another kind. The reversed status has no writer. Only merchandise has a registered promotion-area provider.