Add 'pending_sync' status to syncStatus in CAIKnowledge and CAdvowareAkten entities; update tooltips and API documentation
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
# REST API Endpunkte - EspoCRM Custom Entities
|
||||
|
||||
**Version:** 1.2
|
||||
**Version:** 1.3
|
||||
**Datum:** 11. März 2026
|
||||
**Base URL:** `https://your-crm.com/api/v1`
|
||||
|
||||
**Changelog:**
|
||||
- v1.3 (11. März 2026): pending_sync Status zu globalem syncStatus hinzugefügt
|
||||
- v1.2 (11. März 2026): syncedHash-Feld zu Junction-Tables hinzugefügt
|
||||
- v1.1 (11. März 2026): Aktivierungsstatus-Feld hinzugefügt (new, active, paused, deactivated)
|
||||
- v1.0 (11. März 2026): Initiale Version
|
||||
@@ -236,6 +237,11 @@ GET /api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=aktivierung
|
||||
GET /api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=syncStatus&where[0][value]=unclean
|
||||
```
|
||||
|
||||
**Verfügbare Werte:**
|
||||
- `synced` - Alle Dokumente synchronisiert (grüne Badge)
|
||||
- `unclean` - Mindestens ein Dokument neu oder geändert (gelbe Badge)
|
||||
- `pending_sync` - Synchronisierung läuft (blaue Badge)
|
||||
|
||||
#### Nach Aktenzeichen suchen
|
||||
```http
|
||||
GET /api/v1/CAdvowareAkten?where[0][type]=contains&where[0][attribute]=aktenzeichen&where[0][value]=2026
|
||||
@@ -374,6 +380,11 @@ GET /api/v1/CAIKnowledge?where[0][type]=equals&where[0][attribute]=datenbankId&w
|
||||
GET /api/v1/CAIKnowledge?where[0][type]=equals&where[0][attribute]=syncStatus&where[0][value]=unclean
|
||||
```
|
||||
|
||||
**Verfügbare syncStatus Werte:**
|
||||
- `synced` - Alle Dokumente synchronisiert (grüne Badge)
|
||||
- `unclean` - Mindestens ein Dokument neu oder geändert (gelbe Badge)
|
||||
- `pending_sync` - Synchronisierung läuft (blaue Badge)
|
||||
|
||||
---
|
||||
|
||||
## Junction Tables
|
||||
@@ -789,6 +800,42 @@ curl -X PUT "https://crm.example.com/api/v1/CAdvowareAkten/akte-123" \
|
||||
}'
|
||||
```
|
||||
|
||||
### Beispiel 9: Synchronisations-Workflow mit pending_sync
|
||||
|
||||
```bash
|
||||
# Schritt 1: Hole alle Akten mit Status "unclean" die synchronisiert werden müssen
|
||||
AKTEN=$(curl -s -X GET "https://crm.example.com/api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=syncStatus&where[0][value]=unclean&where[1][type]=equals&where[1][attribute]=aktivierungsstatus&where[1][value]=active" \
|
||||
-H "X-Api-Key: your-api-key")
|
||||
|
||||
# Schritt 2: Setze Status auf "pending_sync" vor Synchronisation
|
||||
curl -X PUT "https://crm.example.com/api/v1/CAdvowareAkten/akte-123" \
|
||||
-H "X-Api-Key: your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"syncStatus": "pending_sync"
|
||||
}'
|
||||
|
||||
# Schritt 3: Führe Synchronisation durch...
|
||||
# (Hole Junction-Einträge, synchronisiere mit Advoware, etc.)
|
||||
|
||||
# Schritt 4: Nach erfolgreicher Synchronisation
|
||||
curl -X PUT "https://crm.example.com/api/v1/CAdvowareAkten/akte-123" \
|
||||
-H "X-Api-Key: your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"syncStatus": "synced",
|
||||
"lastSync": "2026-03-11T20:00:00+00:00"
|
||||
}'
|
||||
|
||||
# Schritt 5: Bei Fehler während Synchronisation
|
||||
curl -X PUT "https://crm.example.com/api/v1/CAdvowareAkten/akte-123" \
|
||||
-H "X-Api-Key: your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"syncStatus": "unclean"
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Wichtige Hinweise
|
||||
@@ -846,6 +893,50 @@ Das Feld wird automatisch in der Link-Multiple-Spalte "Dokumente" angezeigt:
|
||||
- `paused` - Synchronisation temporär pausiert, kann wieder aktiviert werden
|
||||
- `deactivated` - Synchronisation dauerhaft deaktiviert
|
||||
|
||||
### Globaler syncStatus
|
||||
|
||||
**Zweck:** Übersicht über den Synchronisationszustand aller Dokumente einer Akte/eines AI Knowledge Entries
|
||||
|
||||
**Verfügbare Status:**
|
||||
- `synced` (grün) - Alle Dokumente vollständig synchronisiert
|
||||
- `unclean` (gelb) - Mindestens ein Dokument ist neu, geändert oder gelöscht
|
||||
- `pending_sync` (blau) - Synchronisierung wurde gestartet aber noch nicht abgeschlossen
|
||||
|
||||
**Status-Übergänge:**
|
||||
```
|
||||
unclean → pending_sync (beim Start der Synchronisation)
|
||||
pending_sync → synced (nach erfolgreicher Synchronisation aller Dokumente)
|
||||
pending_sync → unclean (bei Fehler oder wenn ein Dokument während Sync geändert wurde)
|
||||
synced → unclean (wenn ein Dokument geändert/hinzugefügt/gelöscht wird)
|
||||
```
|
||||
|
||||
**Verwendung:**
|
||||
```bash
|
||||
# 1. Vor Synchronisation: Status auf pending_sync setzen
|
||||
PUT /api/v1/CAdvowareAkten/{id} { "syncStatus": "pending_sync" }
|
||||
|
||||
# 2. Nach erfolgreicher Synchronisation: Status auf synced setzen
|
||||
PUT /api/v1/CAdvowareAkten/{id} {
|
||||
"syncStatus": "synced",
|
||||
"lastSync": "2026-03-11T20:00:00+00:00"
|
||||
}
|
||||
|
||||
# 3. Bei Fehler: Zurück auf unclean
|
||||
PUT /api/v1/CAdvowareAkten/{id} { "syncStatus": "unclean" }
|
||||
```
|
||||
|
||||
**Filterung:**
|
||||
```bash
|
||||
# Alle Akten die auf Synchronisation warten
|
||||
GET /api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=syncStatus&where[0][value]=unclean
|
||||
|
||||
# Alle Akten bei denen gerade eine Synchronisation läuft
|
||||
GET /api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=syncStatus&where[0][value]=pending_sync
|
||||
|
||||
# Alle erfolgreich synchronisierten Akten
|
||||
GET /api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=syncStatus&where[0][value]=synced
|
||||
```
|
||||
|
||||
**Anwendungsfälle:**
|
||||
```bash
|
||||
# Neue Akte anlegen (automatisch status="new")
|
||||
@@ -924,6 +1015,6 @@ WHERE name = 'Your Role Name';
|
||||
---
|
||||
|
||||
**Letzte Aktualisierung:** 11. März 2026
|
||||
**Version:** 1.2
|
||||
**Version:** 1.3
|
||||
|
||||
Für weitere Fragen: Siehe `custom/docs/ESPOCRM_BEST_PRACTICES.md`
|
||||
|
||||
Reference in New Issue
Block a user