- Add SYNC_STRATEGY_ESPOCRM_BASED.md detailing the sync flows and status management.
- Create utilities for sync operations in services/beteiligte_sync_utils.py, including locking, timestamp comparison, conflict resolution, and notification handling.
- Implement entity mapping between EspoCRM and Advoware in services/espocrm_mapper.py.
- Develop a cron job for periodic sync checks in steps/vmh/beteiligte_sync_cron_step.py, emitting events for entities needing synchronization.
- Add get_redis_client() to calendar_sync_utils.py
- Add get_advoware_employees() to calendar_sync_utils.py
- Add set_employee_lock() and clear_employee_lock() to calendar_sync_utils.py
- Update all step files to use shared utility functions
- Remove duplicate code across calendar_sync_*.py files
- Created calendar_sync_utils.py with shared functions:
- log_operation: Centralized logging with context support
- connect_db: Database connection wrapper
- get_google_service: Google Calendar API initialization
- Updated imports in calendar_sync_event_step.py and audit_calendar_sync.py
- Removed duplicated function definitions
- Maintained function logic without changes
- Improved code maintainability and reduced duplications
- Add detailed documentation in README.md for all 10 audit commands
- Fix Advoware API parameter from 'frNr' to 'frnr' for proper filtering
- Fix subject field mapping from 'betreff' to 'text' in API responses
- Add verify-sync command for bidirectional sync verification
- Add query-frnr and query-event commands for individual record lookup
- Add management commands: find-duplicates, delete-duplicates, find-orphaned, cleanup-orphaned
- Improve error handling and output formatting
- Remove temporary test script
- parse_times erkennt jetzt recurring Events (dauertermin=1 + turnus/turnusArt > 0)
- Für recurring Events wird das Ende aus dem gleichen Tag wie Start berechnet
- datumBis wird nur noch für die RRULE-Serie verwendet, nicht für jeden Termin
- Fix für Termin 84389: Statt 15-Tage-Terminen jetzt korrekte 30-Minuten-Termine
- ensure_google_calendar prüft jetzt auch bei existierenden Kalendern die ACL-Regel
- Fügt fehlende ACL-Regel hinzu, falls sie nicht vorhanden ist
- Verhindert Sync-Abbruch bei unvollständigen Kalendern aus früheren Läufen
- Refaktorierung zu event-driven Ansatz ohne PostgreSQL Hub
- Fixes für mehrtägige Termine: korrekte Verwendung von datumBis, Entfernung 24h-Limit
- Per-Employee Locking mit Redis
- Logging via context.logger für Motia Workbench
- Neue Schritte: calendar_sync_all_step.py, calendar_sync_cron_step.py
- Aktualisiertes README.md mit aktueller Architektur
- Workbench-Gruppierung: advoware-calendar-sync
- Updated log_operation to use context.logger.warn for warnings
- Added context parameter to all functions with logging
- Replaced all direct logger calls with log_operation calls
- Ensured all logging goes through context.logger for workbench visibility
- Adjusted backoff base from 4 to 3 for faster retries
- Added debug kuerzel list support in cron step
- Remove unused share_google_calendar function
- Add centralized log_operation for consistent logging with context
- Add get_timestamps helper for Phase 4 timestamp handling
- Consolidate safe_* functions into generic safe_advoware_operation
- Optimize reload functions to handle initial fetches
- Split standardize_appointment_data into parse_times, adjust_times, build_notiz helpers
- Use state dict for better encapsulation in handler
- Fixed: For recurring appointments (dauertermin=1), end date now correctly uses 'datum' instead of 'datumBis'
- 'datumBis' is only for recurrence series end, not individual event duration
- Events now have correct duration instead of being capped at 24h unnecessarily
- Updated README with detailed explanation of the bug and fix
- Time breakdowns in descriptions are now accurate
- Fix Python syntax error: change 'true' to 'True' in config.py
- Limit recurring events to max 2 years to avoid Google Calendar API limits
- Add share_google_calendar function for manual calendar sharing
- Update README with calendar sync documentation
- Debug mode: limit sync to user AI only
- Use backoff library with 5s base, max 5 tries for HttpError 429/5xx
- Decorate Google functions: ensure_calendar, fetch_events, create/update/delete events
- Add backoff to requirements.txt