- Implemented comprehensive tests for the Kommunikation Sync functionality, covering base64 encoding, marker parsing, creation, type detection, and integration scenarios. - Added a verification script to check for unique IDs in Advoware communications, ensuring stability and integrity of the IDs. - Created utility scripts for code validation, notification testing, and PUT response detail analysis to enhance development and testing processes. - Updated README with details on new tools and their usage.
4.6 KiB
4.6 KiB
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/)
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/)
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/)
⚠️ Noch nicht implementiert - API-Analyse Scripts
- API-Limitierungen Tests
- READ-ONLY Felder Identifikation
- Hauptadressen-Logik
4. EspoCRM Tests (espocrm_tests/)
Tests für EspoCRM Custom Entities.
- CBeteiligte Structure Tests
- Kommunikation Arrays
- Sub-Entity Relationships
5. Analysis (analysis/)
Debug & Analyse Scripts für spezifische Probleme.
- Endpoint-Analyse
- Entity-Vergleiche
- Sync-Issue Debugging
6. Calendar Sync (calendar_sync/)
Utilities für Google Calendar Sync Management.
- Calendar Cleanup
- Lock Management
7. Tools (tools/)
Allgemeine Entwickler-Tools.
- Code Validation
- Notification Tests
- Response Analysis
Quick Start
Beteiligte Sync testen
cd /opt/motia-app/bitbylaw
python scripts/beteiligte_sync/test_beteiligte_sync.py
Kommunikation Sync testen
python scripts/kommunikation_sync/test_kommunikation_api.py
python scripts/kommunikation_sync/test_kommunikation_sync_implementation.py
Code validieren
python scripts/tools/validate_code.py services/kommunikation_sync_utils.py
Entity vergleichen
python scripts/beteiligte_sync/compare_beteiligte.py --entity-id <espo_id> --betnr <advo_betnr>
Dokumentation
Hauptdokumentation: ../docs/SYNC_OVERVIEW.md
Für detaillierte Informationen zu jedem Script siehe die README.md in den jeweiligen Unterordnern:
- beteiligte_sync/README.md
- kommunikation_sync/README.md
- adressen_sync/README.md
- espocrm_tests/README.md
- analysis/README.md
- calendar_sync/README.md
- tools/README.md
Konventionen
Naming
test_*.py- Test-Scriptsanalyze_*.py- Analyse-Scriptscompare_*.py- Vergleichs-Scriptsverify_*.py- Verifikations-Scripts
Ausführung
Alle Scripts sollten aus dem Projekt-Root ausgeführt werden:
cd /opt/motia-app/bitbylaw
python scripts/<category>/<script>.py
Umgebung
Scripts verwenden die gleiche .env wie die Hauptapplikation:
ADVOWARE_API_*- Advoware API ConfigESPOCRM_API_*- EspoCRM API ConfigREDIS_*- Redis Config