From 3d8f568c9ab68e2c566e7166798c69db76b4dc2b Mon Sep 17 00:00:00 2001 From: Thomas Reitz Date: Tue, 10 Mar 2026 19:23:53 +0100 Subject: [PATCH] docs(crm): backend response to frontend integration report Confirmed all 6 frontend assumptions, documented new PATCH stage endpoint and HTTPS router. Activity list already supported. Co-Authored-By: Claude Opus 4.6 --- docs/INSIGHT-CRM.md | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/docs/INSIGHT-CRM.md b/docs/INSIGHT-CRM.md index 9bad5a7..29ab118 100644 --- a/docs/INSIGHT-CRM.md +++ b/docs/INSIGHT-CRM.md @@ -101,4 +101,66 @@ packages/frontend/src/crm/ --- +## 2026-03-10 | Backend: Antwort auf Frontend-Integrationsbericht + +### Status der Annahmen + +Alle 6 Annahmen des Frontend-Entwicklers sind korrekt und werden vom Backend unterstuetzt: + +| # | Annahme | Status | Hinweise | +|---|---------|--------|----------| +| 1 | Contact-Detail liefert Activities mit | **Bestaetigt** | `GET /crm/contacts/:id` liefert `activities[]` (letzte 10, sortiert nach `createdAt desc`) | +| 2 | Deal-Detail liefert Relations mit | **Bestaetigt** | `GET /crm/deals/:id` liefert `pipeline` (inkl. aller Stages!), `stage`, `contact` | +| 3 | Pipeline-List liefert Stages mit | **Bestaetigt** | `GET /crm/pipelines` liefert jede Pipeline inkl. `stages[]` + `_count.deals` | +| 4 | Deal.value ist ein String | **Bestaetigt** | Decimal wird als String geliefert (z.B. `"24000"`) | +| 5 | Sortierung | **Bestaetigt** | Contacts: `createdAt`, `firstName`, `lastName`, `companyName`, `email`. Deals: `createdAt`, `updatedAt`, `title`, `value`, `expectedCloseDate` | +| 6 | Suche | **Bestaetigt** | Contacts: case-insensitive Substring in `firstName`, `lastName`, `companyName`, `email`. Deals: case-insensitive Substring in `title` | + +### Erledigte Offene Punkte + +- [x] **Traefik HTTPS-Router**: `crm-secure` Router angelegt mit `entrypoints=websecure`, `tls=true`, Priority 100. Deployed in Commit `c9e2c4a`. + +- [x] **Pipeline-Stages bearbeiten**: Neuer Endpoint `PATCH /crm/pipelines/:id/stages/:stageId` hinzugefuegt. Akzeptiert: + ```json + { + "name": "Neuer Name", // optional, max 200 + "sortOrder": 2, // optional, int >= 0 + "color": "#EF4444" // optional, Hex #RRGGBB + } + ``` + +### Noch offene Punkte (Backend-Sicht) + +- [ ] **Activity-Liste komplett laden**: `GET /crm/activities?contactId=...` ist bereits implementiert und funktioniert. Das Frontend kann den bestehenden Hook direkt nutzen. +- [ ] **Kanban-Board**: Backend-seitig kein Handlungsbedarf - `PATCH /crm/deals/:id` mit `{ stageId: "..." }` genuegt fuer Drag & Drop. + +### Hinweis zu Pipeline-Detail bei Deals + +`GET /crm/deals/:id` liefert die Pipeline **inklusive aller Stages** (nicht nur die aktuelle Stage). Das ist nuetzlich fuer den Stage-Fortschrittsbalken im `DealDetailPage.tsx`: + +```json +{ + "pipeline": { + "id": "...", + "name": "Standard Sales", + "stages": [ + { "id": "...", "name": "Qualifizierung", "sortOrder": 0, "color": "#3B82F6" }, + { "id": "...", "name": "Angebot", "sortOrder": 1, "color": "#F59E0B" }, + { "id": "...", "name": "Verhandlung", "sortOrder": 2, "color": "#EF4444" }, + { "id": "...", "name": "Abschluss", "sortOrder": 3, "color": "#10B981" } + ] + }, + "stage": { "id": "...", "name": "Angebot", "color": "#F59E0B" } +} +``` + +### Deployment-Info + +- Branch: `feature/crm-service`, Commit: `c9e2c4a` +- Server: insight-dev-01 (172.20.10.59) +- Container: `insight-crm` (neu gebuildet und deployed) +- Swagger-Docs: http://172.20.10.59/api/v1/crm/docs/ + +--- + *Bitte neue Eintraege unten anfuegen. Format: `## YYYY-MM-DD | Absender: Betreff`*