bsiggel 014947e9e0 Migrate VMH Integration - Phase 3: Core sync handlers & utilities
- Added 5 core service modules:
  * services/notification_utils.py: NotificationManager for manual actions (412 lines)
  * services/advoware_service.py: Extended Advoware operations wrapper
  * services/espocrm_mapper.py: BeteiligteMapper for data transformation (198 lines)
  * services/bankverbindungen_mapper.py: BankverbindungenMapper (174 lines)
  * services/beteiligte_sync_utils.py: BeteiligteSync with complex logic (663 lines)
    - Distributed locking via Redis + syncStatus
    - rowId-based change detection (primary) + timestamp fallback
    - Retry with exponential backoff (1min, 5min, 15min, 1h, 4h)
    - Conflict resolution (EspoCRM wins)
    - Soft-delete handling & round-trip validation

- Added 2 event handler steps:
  * steps/vmh/beteiligte_sync_event_step.py: Handles vmh.beteiligte.* queue events
    - CREATE: New Beteiligte → POST to Advoware
    - UPDATE: Bi-directional sync with conflict resolution
    - DELETE: Not yet implemented
    - SYNC_CHECK: Periodic sync check via cron
  * steps/vmh/bankverbindungen_sync_event_step.py: Handles vmh.bankverbindungen.* events
    - CREATE: New Bankverbindung → POST to Advoware
    - UPDATE/DELETE: Send notification (API limitation - no PUT/DELETE support)

- Added pytz dependency to pyproject.toml (required for timezone handling)

System Status:
- 27 steps registered (14 VMH-specific)
- 8 queue subscriptions active (4 Beteiligte + 4 Bankverbindungen)
- All webhook endpoints operational and emitting queue events
- Sync handlers ready for processing

Note: Kommunikation sync (kommunikation_sync_utils.py) not yet migrated.
Complex bi-directional sync for Telefon/Email/Fax will be added in Phase 4.

Updated MIGRATION_STATUS.md
2026-03-01 22:19:36 +00:00

Motia III - BitByLaw Backend

Motia Backend-Anwendung powered by the iii engine.

Project Structure

bitbylaw/
├── steps/              # Motia Steps (Business Logic)
├── iii-config.yaml     # iii Engine Configuration
├── pyproject.toml      # Python Dependencies
└── .venv/              # Python Virtual Environment

Services

Systemd Services

  • motia.service - Backend Engine
  • iii-console.service - Observability Dashboard

Development

# Install dependencies
uv sync

# Start locally
iii -c iii-config.yaml

Production

Services run automatically via systemd on boot.

# Restart services
systemctl restart motia.service iii-console.service

# View logs
journalctl -u motia.service -f
journalctl -u iii-console.service -f

Deployment

Deployed on: motia.bitbylaw.com
Date: März 2026

Description
No description provided
Readme 1.6 MiB
Languages
Python 100%