diff --git a/custom/Espo/Custom/Resources/i18n/de_DE/CAIKnowledge.json b/custom/Espo/Custom/Resources/i18n/de_DE/CAIKnowledge.json index 8a5413a2..77a34211 100644 --- a/custom/Espo/Custom/Resources/i18n/de_DE/CAIKnowledge.json +++ b/custom/Espo/Custom/Resources/i18n/de_DE/CAIKnowledge.json @@ -9,6 +9,7 @@ "datenbankId": "Datenbank-ID", "syncStatus": "Sync-Status", "lastSync": "Letzte Synchronisation", + "aktivierungsstatus": "Aktivierungsstatus", "dokumenteAiDocumentId": "AI Document ID", "dokumenteSyncstatus": "Sync-Status", "dokumenteLastSync": "Letzter Sync" @@ -23,6 +24,12 @@ "synced": "Synchronisiert", "unclean": "Nicht synchronisiert" }, + "aktivierungsstatus": { + "new": "Neu", + "active": "Aktiv", + "paused": "Pausiert", + "deactivated": "Deaktiviert" + }, "dokumenteSyncstatus": { "new": "Neu", "unclean": "Nicht synchronisiert", @@ -34,6 +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.", "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" } } \ No newline at end of file diff --git a/custom/Espo/Custom/Resources/i18n/de_DE/CAdvowareAkten.json b/custom/Espo/Custom/Resources/i18n/de_DE/CAdvowareAkten.json index db48801b..a577a027 100644 --- a/custom/Espo/Custom/Resources/i18n/de_DE/CAdvowareAkten.json +++ b/custom/Espo/Custom/Resources/i18n/de_DE/CAdvowareAkten.json @@ -17,6 +17,7 @@ "aktenpfad": "Aktenpfad (Windows)", "syncStatus": "Sync-Status", "lastSync": "Letzte Synchronisation", + "aktivierungsstatus": "Aktivierungsstatus", "dokumentes": "Dokumente", "dokumenteHnr": "HNR", "dokumenteSyncstatus": "Sync-Status", @@ -26,11 +27,18 @@ "syncStatus": { "synced": "Synchronisiert", "unclean": "Nicht synchronisiert" + }, + "aktivierungsstatus": { + "new": "Neu", + "active": "Aktiv", + "paused": "Pausiert", + "deactivated": "Deaktiviert" } }, "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.", "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" } } \ No newline at end of file diff --git a/custom/Espo/Custom/Resources/i18n/en_US/CAIKnowledge.json b/custom/Espo/Custom/Resources/i18n/en_US/CAIKnowledge.json index c2bd22f1..ce7ba3db 100644 --- a/custom/Espo/Custom/Resources/i18n/en_US/CAIKnowledge.json +++ b/custom/Espo/Custom/Resources/i18n/en_US/CAIKnowledge.json @@ -6,6 +6,7 @@ "datenbankId": "Database ID", "syncStatus": "Sync Status", "lastSync": "Last Synchronization", + "aktivierungsstatus": "Activation Status", "dokumenteAiDocumentId": "AI Document ID", "dokumenteSyncstatus": "Sync Status", "dokumenteLastSync": "Last Sync" @@ -23,6 +24,12 @@ "synced": "Synchronized", "unclean": "Not Synchronized" }, + "aktivierungsstatus": { + "new": "New", + "active": "Active", + "paused": "Paused", + "deactivated": "Deactivated" + }, "dokumenteSyncstatus": { "new": "New", "unclean": "Not Synchronized", @@ -34,6 +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.", "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" } } \ No newline at end of file diff --git a/custom/Espo/Custom/Resources/i18n/en_US/CAdvowareAkten.json b/custom/Espo/Custom/Resources/i18n/en_US/CAdvowareAkten.json index ad08983f..0bc96498 100644 --- a/custom/Espo/Custom/Resources/i18n/en_US/CAdvowareAkten.json +++ b/custom/Espo/Custom/Resources/i18n/en_US/CAdvowareAkten.json @@ -7,6 +7,7 @@ "aktenpfad": "File Path (Windows)", "syncStatus": "Sync Status", "lastSync": "Last Synchronization", + "aktivierungsstatus": "Activation Status", "dokumentes": "Dokumente", "dokumenteHnr": "HNR", "dokumenteSyncstatus": "Sync Status", @@ -27,11 +28,18 @@ "syncStatus": { "synced": "Synchronized", "unclean": "Not Synchronized" + }, + "aktivierungsstatus": { + "new": "New", + "active": "Active", + "paused": "Paused", + "deactivated": "Deactivated" } }, "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.", "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" } } \ No newline at end of file diff --git a/custom/Espo/Custom/Resources/metadata/entityDefs/CAIKnowledge.json b/custom/Espo/Custom/Resources/metadata/entityDefs/CAIKnowledge.json index 2d8f82b2..5dd8a9dd 100644 --- a/custom/Espo/Custom/Resources/metadata/entityDefs/CAIKnowledge.json +++ b/custom/Espo/Custom/Resources/metadata/entityDefs/CAIKnowledge.json @@ -69,6 +69,25 @@ "tooltip": true, "isCustom": true }, + "aktivierungsstatus": { + "type": "enum", + "required": false, + "options": [ + "new", + "active", + "paused", + "deactivated" + ], + "style": { + "new": "primary", + "active": "success", + "paused": "warning", + "deactivated": "danger" + }, + "default": "new", + "tooltip": true, + "isCustom": true + }, "dokumenteAiDocumentId": { "type": "varchar", "notStorable": true, diff --git a/custom/Espo/Custom/Resources/metadata/entityDefs/CAdvowareAkten.json b/custom/Espo/Custom/Resources/metadata/entityDefs/CAdvowareAkten.json index 2a4f0491..abc90148 100644 --- a/custom/Espo/Custom/Resources/metadata/entityDefs/CAdvowareAkten.json +++ b/custom/Espo/Custom/Resources/metadata/entityDefs/CAdvowareAkten.json @@ -84,6 +84,25 @@ "tooltip": true, "isCustom": true }, + "aktivierungsstatus": { + "type": "enum", + "required": false, + "options": [ + "new", + "active", + "paused", + "deactivated" + ], + "style": { + "new": "primary", + "active": "success", + "paused": "warning", + "deactivated": "danger" + }, + "default": "new", + "tooltip": true, + "isCustom": true + }, "dokumenteHnr": { "type": "int", "notStorable": true, diff --git a/custom/docs/API_ENDPOINTS.md b/custom/docs/API_ENDPOINTS.md index 84c33af5..d65c67f9 100644 --- a/custom/docs/API_ENDPOINTS.md +++ b/custom/docs/API_ENDPOINTS.md @@ -1,9 +1,13 @@ # REST API Endpunkte - EspoCRM Custom Entities -**Version:** 1.0 +**Version:** 1.1 **Datum:** 11. März 2026 **Base URL:** `https://your-crm.com/api/v1` +**Changelog:** +- v1.1 (11. März 2026): Aktivierungsstatus-Feld hinzugefügt (new, active, paused, deactivated) +- v1.0 (11. März 2026): Initiale Version + --- ## 🔐 Authentifizierung @@ -63,6 +67,7 @@ GET /api/v1/CAdvowareAkten "aktenzeichen": "123/2026", "aktennummer": 123, "aktenpfad": "/advoware/2026/001", + "aktivierungsstatus": "new", "syncStatus": "unclean", "lastSync": null, "createdAt": "2026-03-11 10:00:00", @@ -85,6 +90,7 @@ GET /api/v1/CAdvowareAkten/{id} "aktenzeichen": "123/2026", "aktennummer": 123, "aktenpfad": "/advoware/2026/001", + "aktivierungsstatus": "new", "syncStatus": "unclean", "lastSync": null, "vmhRumungsklageId": "64e3f8a1234ab", @@ -104,6 +110,7 @@ Content-Type: application/json "aktenzeichen": "124/2026", "aktennummer": 124, "aktenpfad": "/advoware/2026/002", + "aktivierungsstatus": "new", "syncStatus": "unclean" } ``` @@ -121,6 +128,7 @@ PUT /api/v1/CAdvowareAkten/{id} Content-Type: application/json { + "aktivierungsstatus": "active", "syncStatus": "synced", "lastSync": "2026-03-11T20:00:00+00:00" } @@ -211,6 +219,17 @@ GET /api/v1/CAdvowareAkten/{id}/mietinkasso ### Filterung & Suche +#### Nach aktivierungsstatus filtern +```http +GET /api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=aktivierungsstatus&where[0][value]=new +``` + +**Verfügbare Werte:** +- `new` - Neu angelegt (Standard, blaue Badge) +- `active` - Aktiv synchronisiert (grüne Badge) +- `paused` - Synchronisation pausiert (gelbe Badge) +- `deactivated` - Synchronisation deaktiviert (rote Badge) + #### Nach syncStatus filtern ```http GET /api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=syncStatus&where[0][value]=unclean @@ -228,7 +247,7 @@ GET /api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=syncStatus& #### Nur bestimmte Felder ```http -GET /api/v1/CAdvowareAkten?select=name,aktenzeichen,syncStatus,lastSync +GET /api/v1/CAdvowareAkten?select=id,name,aktivierungsstatus,syncStatus,lastSync ``` #### Mit Sortierung @@ -258,6 +277,7 @@ GET /api/v1/CAIKnowledge "id": "kb-123", "name": "Knowledge Base 2026-001", "datenbankId": "kb-external-123", + "aktivierungsstatus": "active", "syncStatus": "synced", "lastSync": "2026-03-11 19:00:00", "createdAt": "2026-03-10 10:00:00" @@ -279,6 +299,7 @@ Content-Type: application/json { "name": "Knowledge Base 2026-002", "datenbankId": "kb-external-456", + "aktivierungsstatus": "new", "syncStatus": "unclean" } ``` @@ -289,6 +310,7 @@ PUT /api/v1/CAIKnowledge/{id} Content-Type: application/json { + "aktivierungsstatus": "active", "syncStatus": "synced", "lastSync": "2026-03-11T20:00:00+00:00" } @@ -330,6 +352,17 @@ DELETE /api/v1/CAIKnowledge/{id}/dokumentes/{dokumentId} ### Filterung & Suche +#### Nach aktivierungsstatus filtern +```http +GET /api/v1/CAIKnowledge?where[0][type]=equals&where[0][attribute]=aktivierungsstatus&where[0][value]=active +``` + +**Verfügbare Werte:** +- `new` - Neu angelegt (Standard, blaue Badge) +- `active` - Aktiv synchronisiert (grüne Badge) +- `paused` - Synchronisation pausiert (gelbe Badge) +- `deactivated` - Synchronisation deaktiviert (rote Badge) + #### Nach datenbankId suchen ```http GET /api/v1/CAIKnowledge?where[0][type]=equals&where[0][attribute]=datenbankId&where[0][value]=kb-123 @@ -648,7 +681,7 @@ GET /api/v1/CAdvowareAkten?select=id,name,syncStatus,lastSync ### Beispiel 1: Alle unsynchronisierten Akten mit Details ```bash -curl -X GET "https://crm.example.com/api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=syncStatus&where[0][value]=unclean&select=id,name,aktenzeichen,syncStatus&orderBy=createdAt&order=desc" \ +curl -X GET "https://crm.example.com/api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=syncStatus&where[0][value]=unclean&select=id,name,aktenzeichen,aktivierungsstatus,syncStatus&orderBy=createdAt&order=desc" \ -H "X-Api-Key: your-api-key" ``` @@ -699,6 +732,7 @@ 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 '{ + "aktivierungsstatus": "active", "syncStatus": "synced", "lastSync": "2026-03-11T20:00:00+00:00" }' @@ -722,10 +756,64 @@ curl -X GET "https://crm.example.com/api/v1/CAdvowareAktenCDokumente?where[0][ty -H "X-Api-Key: your-api-key" ``` +### Beispiel 7: Alle aktiven Akten abrufen + +```bash +# Finde alle Akten die aktiv synchronisiert werden +curl -X GET "https://crm.example.com/api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=aktivierungsstatus&where[0][value]=active&select=id,name,aktenzeichen,aktivierungsstatus,syncStatus" \ + -H "X-Api-Key: your-api-key" +``` + +### Beispiel 8: Akte von "new" auf "active" setzen + +```bash +# Aktiviere eine neu angelegte Akte +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 '{ + "aktivierungsstatus": "active" + }' +``` + --- ## 🎯 Wichtige Hinweise +### Aktivierungsstatus + +**Zweck:** Steuerung der Synchronisations-Aktivität für Akten und AI Knowledge Entries + +**Verfügbare Status:** +- `new` (Standard) - Neu angelegte Einträge, noch nicht für Sync aktiviert +- `active` - Aktiv synchronisiert, alle Sync-Prozesse laufen +- `paused` - Synchronisation temporär pausiert, kann wieder aktiviert werden +- `deactivated` - Synchronisation dauerhaft deaktiviert + +**Anwendungsfälle:** +```bash +# Neue Akte anlegen (automatisch status="new") +POST /api/v1/CAdvowareAkten { "name": "...", "aktivierungsstatus": "new" } + +# Akte für Sync aktivieren +PUT /api/v1/CAdvowareAkten/{id} { "aktivierungsstatus": "active" } + +# Sync temporär pausieren (z.B. während Wartung) +PUT /api/v1/CAdvowareAkten/{id} { "aktivierungsstatus": "paused" } + +# Sync permanent deaktivieren +PUT /api/v1/CAdvowareAkten/{id} { "aktivierungsstatus": "deactivated" } +``` + +**Filterung:** +```bash +# Nur aktive Einträge für Sync-Job +GET /api/v1/CAdvowareAkten?where[0][type]=equals&where[0][attribute]=aktivierungsstatus&where[0][value]=active + +# Alle pausierte oder deaktivierte +GET /api/v1/CAdvowareAkten?where[0][type]=in&where[0][attribute]=aktivierungsstatus&where[0][value][0]=paused&where[0][value][1]=deactivated +``` + ### Junction-Spalten via REST API **✅ RICHTIG:** Nutze Junction-Entity-APIs @@ -780,6 +868,6 @@ WHERE name = 'Your Role Name'; --- **Letzte Aktualisierung:** 11. März 2026 -**Version:** 1.0 +**Version:** 1.1 Für weitere Fragen: Siehe `custom/docs/ESPOCRM_BEST_PRACTICES.md` diff --git a/data/config.php b/data/config.php index e5e2a142..3ec557cb 100644 --- a/data/config.php +++ b/data/config.php @@ -360,7 +360,7 @@ return [ 0 => 'youtube.com', 1 => 'google.com' ], - 'microtime' => 1773259888.998412, + 'microtime' => 1773260767.92155, 'siteUrl' => 'https://crm.bitbylaw.com', 'fullTextSearchMinLength' => 4, 'webSocketUrl' => 'ws://api.bitbylaw.com:5000/espocrm/ws', diff --git a/data/state.php b/data/state.php index 67662199..83862fab 100644 --- a/data/state.php +++ b/data/state.php @@ -1,7 +1,7 @@ 1773259889, - 'microtimeState' => 1773259889.126431, + 'cacheTimestamp' => 1773260768, + 'microtimeState' => 1773260768.04608, 'currencyRates' => [ 'EUR' => 1.0 ],