# Scripts Test- und Utility-Scripts für das Motia BitByLaw Projekt. ## Struktur ``` scripts/ ├── beteiligte_sync/ # Beteiligte (Stammdaten) Sync Tests │ ├── test_beteiligte_sync.py │ ├── compare_beteiligte.py │ └── README.md │ ├── kommunikation_sync/ # Kommunikation (Phone/Email) Sync Tests │ ├── test_kommunikation_api.py │ ├── test_kommunikation_sync_implementation.py │ ├── test_kommunikation_matching_strategy.py │ ├── test_kommunikation_kommkz_deep.py │ ├── test_kommunikation_readonly.py │ ├── test_kommart_values.py │ ├── verify_advoware_kommunikation_ids.py │ └── README.md │ ├── adressen_sync/ # Adressen Sync Tests (geplant) │ ├── test_adressen_api.py │ ├── test_adressen_sync.py │ ├── test_adressen_delete_matching.py │ ├── test_hauptadresse_*.py │ └── README.md │ ├── espocrm_tests/ # EspoCRM API Tests │ ├── test_espocrm_kommunikation.py │ ├── test_espocrm_phone_email_entities.py │ ├── test_espocrm_hidden_ids.py │ └── README.md │ ├── analysis/ # Debug & Analyse Scripts │ ├── analyze_beteiligte_endpoint.py │ ├── analyze_sync_issues_104860.py │ ├── compare_entities_104860.py │ └── README.md │ ├── calendar_sync/ # Calendar Sync Utilities │ ├── delete_all_calendars.py │ ├── delete_employee_locks.py │ └── README.md │ └── tools/ # Allgemeine Utilities ├── validate_code.py ├── test_notification.py ├── test_put_response_detail.py └── README.md ``` ## Kategorien ### 1. Beteiligte Sync ([beteiligte_sync/](beteiligte_sync/)) Tests für Stammdaten-Synchronisation zwischen EspoCRM und Advoware. - rowId-basierte Change Detection - CREATE/UPDATE/DELETE Operations - Timestamp-Vergleiche & Konflikt-Handling ### 2. Kommunikation Sync ([kommunikation_sync/](kommunikation_sync/)) Tests für Phone/Email/Fax Synchronisation. - Hash-basierte Change Detection - Base64-Marker System - 6 Sync-Varianten (Var1-6) - Empty Slots (DELETE-Workaround) ### 3. Adressen Sync ([adressen_sync/](adressen_sync/)) ⚠️ **Noch nicht implementiert** - API-Analyse Scripts - API-Limitierungen Tests - READ-ONLY Felder Identifikation - Hauptadressen-Logik ### 4. EspoCRM Tests ([espocrm_tests/](espocrm_tests/)) Tests für EspoCRM Custom Entities. - CBeteiligte Structure Tests - Kommunikation Arrays - Sub-Entity Relationships ### 5. Analysis ([analysis/](analysis/)) Debug & Analyse Scripts für spezifische Probleme. - Endpoint-Analyse - Entity-Vergleiche - Sync-Issue Debugging ### 6. Calendar Sync ([calendar_sync/](calendar_sync/)) Utilities für Google Calendar Sync Management. - Calendar Cleanup - Lock Management ### 7. Tools ([tools/](tools/)) Allgemeine Entwickler-Tools. - Code Validation - Notification Tests - Response Analysis ## Quick Start ### Beteiligte Sync testen ```bash cd /opt/motia-app/bitbylaw python scripts/beteiligte_sync/test_beteiligte_sync.py ``` ### Kommunikation Sync testen ```bash python scripts/kommunikation_sync/test_kommunikation_api.py python scripts/kommunikation_sync/test_kommunikation_sync_implementation.py ``` ### Code validieren ```bash python scripts/tools/validate_code.py services/kommunikation_sync_utils.py ``` ### Entity vergleichen ```bash python scripts/beteiligte_sync/compare_beteiligte.py --entity-id --betnr ``` ## Dokumentation **Hauptdokumentation**: [../docs/SYNC_OVERVIEW.md](../docs/SYNC_OVERVIEW.md) Für detaillierte Informationen zu jedem Script siehe die README.md in den jeweiligen Unterordnern: - [beteiligte_sync/README.md](beteiligte_sync/README.md) - [kommunikation_sync/README.md](kommunikation_sync/README.md) - [adressen_sync/README.md](adressen_sync/README.md) - [espocrm_tests/README.md](espocrm_tests/README.md) - [analysis/README.md](analysis/README.md) - [calendar_sync/README.md](calendar_sync/README.md) - [tools/README.md](tools/README.md) ## Konventionen ### Naming - `test_*.py` - Test-Scripts - `analyze_*.py` - Analyse-Scripts - `compare_*.py` - Vergleichs-Scripts - `verify_*.py` - Verifikations-Scripts ### Ausführung Alle Scripts sollten aus dem Projekt-Root ausgeführt werden: ```bash cd /opt/motia-app/bitbylaw python scripts//