Add 'pending_sync' status to syncStatus in CAIKnowledge and CAdvowareAkten entities; update tooltips and API documentation

This commit is contained in:
2026-03-11 22:05:27 +01:00
parent 54d66da52d
commit e15dd14cab
9 changed files with 116 additions and 17 deletions

View File

@@ -23,7 +23,8 @@
"options": {
"syncStatus": {
"synced": "Synchronisiert",
"unclean": "Nicht synchronisiert"
"unclean": "Nicht synchronisiert",
"pending_sync": "Synchronisierung ausstehend"
},
"aktivierungsstatus": {
"new": "Neu",
@@ -40,7 +41,7 @@
}
},
"tooltips": {
"syncStatus": "Globaler Synchronisationsstatus: synced = Alle Dokumente synchronisiert, unclean = Mindestens ein Dokument ist neu oder hat Änderungen. Wird automatisch basierend auf den Dokumenten-Status aktualisiert.",
"syncStatus": "Globaler Synchronisationsstatus: synced = Alle Dokumente synchronisiert, unclean = Mindestens ein Dokument ist neu oder hat Änderungen, pending_sync = Synchronisierung wurde gestartet aber noch nicht abgeschlossen. Wird automatisch basierend auf den Dokumenten-Status aktualisiert.",
"lastSync": "Zeitpunkt der letzten erfolgreichen Synchronisation aller Dokumente",
"aktivierungsstatus": "Aktivierungsstatus des AI Knowledge Entries: new = Neu angelegt, active = Aktiv synchronisiert, paused = Synchronisation pausiert, deactivated = Synchronisation deaktiviert",
"datenbankId": "Eindeutige ID in der AI-Datenbank"

View File

@@ -27,7 +27,8 @@
"options": {
"syncStatus": {
"synced": "Synchronisiert",
"unclean": "Nicht synchronisiert"
"unclean": "Nicht synchronisiert",
"pending_sync": "Synchronisierung ausstehend"
},
"aktivierungsstatus": {
"new": "Neu",
@@ -37,7 +38,7 @@
}
},
"tooltips": {
"syncStatus": "Globaler Synchronisationsstatus: synced = Alle Dokumente synchronisiert, unclean = Mindestens ein Dokument ist neu oder hat Änderungen. Wird automatisch basierend auf den Dokumenten-Status aktualisiert.",
"syncStatus": "Globaler Synchronisationsstatus: synced = Alle Dokumente synchronisiert, unclean = Mindestens ein Dokument ist neu oder hat Änderungen, pending_sync = Synchronisierung wurde gestartet aber noch nicht abgeschlossen. Wird automatisch basierend auf den Dokumenten-Status aktualisiert.",
"lastSync": "Zeitpunkt der letzten erfolgreichen Synchronisation aller Dokumente",
"aktivierungsstatus": "Aktivierungsstatus der Akte: new = Neu angelegt, active = Aktiv synchronisiert, paused = Synchronisation pausiert, deactivated = Synchronisation deaktiviert",
"aktenpfad": "Windows-Dateipfad zur Akte in Advoware"

View File

@@ -23,7 +23,8 @@
"options": {
"syncStatus": {
"synced": "Synchronized",
"unclean": "Not Synchronized"
"unclean": "Not Synchronized",
"pending_sync": "Synchronization Pending"
},
"aktivierungsstatus": {
"new": "New",
@@ -40,7 +41,7 @@
}
},
"tooltips": {
"syncStatus": "Global synchronization status: synced = All documents synchronized, unclean = At least one document is new or has changes. Updated automatically based on document status.",
"syncStatus": "Global synchronization status: synced = All documents synchronized, unclean = At least one document is new or has changes, pending_sync = Synchronization started but not yet completed. Updated automatically based on document status.",
"lastSync": "Timestamp of the last successful synchronization of all documents",
"aktivierungsstatus": "Activation status of the AI Knowledge entry: new = Newly created, active = Actively synchronized, paused = Synchronization paused, deactivated = Synchronization deactivated",
"datenbankId": "Unique ID in the AI database"

View File

@@ -28,7 +28,8 @@
"options": {
"syncStatus": {
"synced": "Synchronized",
"unclean": "Not Synchronized"
"unclean": "Not Synchronized",
"pending_sync": "Synchronization Pending"
},
"aktivierungsstatus": {
"new": "New",
@@ -38,7 +39,7 @@
}
},
"tooltips": {
"syncStatus": "Global synchronization status: synced = All documents synchronized, unclean = At least one document is new or has changes. Updated automatically based on document status.",
"syncStatus": "Global synchronization status: synced = All documents synchronized, unclean = At least one document is new or has changes, pending_sync = Synchronization started but not yet completed. Updated automatically based on document status.",
"lastSync": "Timestamp of the last successful synchronization of all documents",
"aktivierungsstatus": "Activation status of the file: new = Newly created, active = Actively synchronized, paused = Synchronization paused, deactivated = Synchronization deactivated",
"aktenpfad": "Windows file path to the file in Advoware"

View File

@@ -52,11 +52,13 @@
"required": false,
"options": [
"synced",
"unclean"
"unclean",
"pending_sync"
],
"style": {
"synced": "success",
"unclean": "warning"
"unclean": "warning",
"pending_sync": "info"
},
"default": "unclean",
"tooltip": true,

View File

@@ -67,11 +67,13 @@
"required": false,
"options": [
"synced",
"unclean"
"unclean",
"pending_sync"
],
"style": {
"synced": "success",
"unclean": "warning"
"unclean": "warning",
"pending_sync": "info"
},
"default": "unclean",
"tooltip": true,

View File

@@ -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`