# LeoCRM — Current Status **Phase**: Fix Branch — P1-4 Complete **Last update**: 2026-07-25 19:17 **Branch**: main (leocrm-fix) ## P1-4: Transactional Outbox — COMPLETE - Migration 0040_outbox.py created (down_revision=0039_contact_normalize) - event_outbox table: id, tenant_id, event_name, payload JSONB, status, attempts, max_attempts, next_retry_at, timestamps - app/core/outbox.py: enqueue_outbox_event() + process_outbox_batch() with FOR UPDATE SKIP LOCKED, exponential backoff retry - app/core/event_bus.py: added publish_with_results() for error-aware publishing; docstring note about outbox - app/core/worker.py: process_outbox_job cron (every 5s, Redis distributed lock) - app/services/contact_service.py: contact.created, lead.created, contact.updated → enqueue_outbox_event - app/models/outbox.py: SQLAlchemy ORM model for event_outbox - tests/test_outbox.py: 6 tests, all passing - py_compile: OK, alembic heads: single head 0040_outbox ## Previous: P2-1: Unified Contact Model normalisieren — COMPLETE - Migration 0039_contact_normalize.py (down_revision=0038_dms_content_hash) ## Next Step - Continue with next fix task from FIX-PLAN.md