TorbatYar/docs/phase-handover/phase-7-4.md
Mortezakoohjani 071c484530 Ship Loyalty phases 7.2-7.6 (points through wallet) with production deploy.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 21:27:22 +03:30

1.7 KiB

Phase Handover — Loyalty 7.4 Campaign Engine

Metadata

Field Value
Phase ID loyalty-7.4
Title Campaign Engine
Status Complete
Service(s) loyalty (loyalty-service, port 8004)
Version 0.7.4.0
Date 2026-07-26
ADR(s) ADR-001, ADR-003, ADR-006, ADR-011

Reusable Components

Component Location Reuse notes
CampaignEngineService app/services/campaign_engine.py Lifecycle + apply grants
CampaignApplication app/models/campaigns.py Application tracking pattern

Public APIs

Lifecycle + rules + apply + applications list under /api/v1/campaigns/{id}/…

Events

loyalty.campaign.scheduled|activated|paused|resumed|expired|rules_updated|applied

Extension Points

Extension point How to extend Forbidden uses
Rules JSON Extend validators + grant math Mutate balances directly
Referral bonuses Call CampaignEngine or PointEngine from 7.5 Bypass application tracking

Known Limitations

  • No scheduled auto-activate/expire worker
  • Rules are JSON document, not a visual rule builder

Migration Notes

Item Detail
Alembic 0005_phase_74_campaigns
Breaking None

Next Phase Entry

Field Value
Recommended next phase loyalty-7.5
Blockers None
Entry checklist Reuse PointEngine for referral rewards

Completion Sign-Off

  • Tests green (87)
  • Docs + snapshot + manifests
  • Quality gates