# ADR 0007. Versioned/Snapshotted Campaign Configuration

## Status
Accepted.

Spec §38 uses `campaign_rule_version_id` on ledger uniqueness. The snapshot
principle is unchanged. See [docs/loyalty.md](../loyalty.md).

## Context
Campaigns and promotion rules will be edited over time. If a
`reward_event` only references a mutable `campaign` row, past reward
decisions become inexplicable once the campaign is later edited. You
can no longer answer "why was this reward given" accurately.

## Decision
Introduce `campaign_version` as an explicit, immutable snapshot of a
campaign's configuration at a point in time (`valid_from`/`valid_to`).
`reward_event` references a specific `campaign_version_id`, never the
mutable `campaign` directly.

## Consequences
- Past reward decisions remain fully explainable/auditable regardless of
  later campaign edits.
- Requires versioning discipline in the campaign-authoring tooling
  (every meaningful edit creates a new version rather than mutating in
  place).
- The same engine/schema shape works for both gameplay-triggered and
  commerce-triggered rules (e.g. `wager >= 10 EUR` vs.
  `purchase.total >= 100 EUR`). The domain model is intentionally
  generic, not casino-specific.
