From e3d254c0f9ad1333feb44fa46c591cb2af79f5e8 Mon Sep 17 00:00:00 2001 From: Thomas Reitz Date: Thu, 12 Mar 2026 21:17:07 +0100 Subject: [PATCH] =?UTF-8?q?docs(crm):=20briefing=20fuer=20naechste=20Backe?= =?UTF-8?q?nd-Aufgaben=20=E2=80=94=20Vertraege-API=20+=20Kanban=20+=20Acti?= =?UTF-8?q?vity-Filter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/INSIGHT-CRM.md | 68 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/docs/INSIGHT-CRM.md b/docs/INSIGHT-CRM.md index 135e13b..7db19e8 100644 --- a/docs/INSIGHT-CRM.md +++ b/docs/INSIGHT-CRM.md @@ -3119,3 +3119,71 @@ Beide Quellen werden **parallel** abgefragt (`Promise.allSettled`). Graceful Deg - [x] "Anreichern"-Button auf Company-Detail — POST /enrich, Suggestions-Modal (Tabelle mit Feld/Aktuell/Vorschlag/Quelle), "Uebernehmen" per PATCH - [x] suggestions-Konvertierung: Record → Array fuer UI - [x] North Data API-Key in CRM-Einstellungen → Tab "Integrationen" + +--- + +## 2026-03-12 | Frontend: Phase 2 abgeschlossen — Naechste Aufgaben fuer CRM-Backend + +### Phase 2 Status: KOMPLETT + +Alle vier Phase-2-Features sind backend- und frontendseitig implementiert und auf insight-dev-01 deployed. + +| Phase | Backend | Frontend | Deployed | +|-------|---------|----------|---------| +| 2.1 Custom Fields | DONE | DONE | Ja | +| 2.2 CSV/Excel Import | DONE | DONE | Ja | +| 2.3 Forecasting | DONE | DONE | Ja | +| 2.4 Datenanreicherung | DONE | DONE | Ja | + +Phase 3 (Microsoft 365 OAuth) ist BLOCKIERT bis Core-Service OAuth liefert. + +--- + +### Naechste Aufgaben fuer den CRM-Backend-Entwickler + +#### Prioritaet 1: Vertraege-API (Contract CRUD) + +Das Datenmodell (`Contract`) ist bereits im Prisma-Schema vorhanden, aber es fehlen die Endpoints. Das Frontend hat eine `ContractsCard.tsx` die aktuell nur ein Platzhalter-UI anzeigt. + +**Benoetigt:** + +``` +GET /api/v1/crm/companies/:id/contracts — Liste der Vertraege einer Firma +POST /api/v1/crm/companies/:id/contracts — Vertrag anlegen +PATCH /api/v1/crm/companies/:id/contracts/:cid — Vertrag bearbeiten +DELETE /api/v1/crm/companies/:id/contracts/:cid — Vertrag loeschen +``` + +**Contract-Felder:** title, status (DRAFT|ACTIVE|EXPIRED|CANCELLED), startDate, endDate, value (Decimal), currency (Default EUR), notes + +**Response-Format:** Standard `{ success, data, meta }` wie alle anderen Endpoints. + +**Frontend-Hinweis:** Die `ContractsCard.tsx` und die Typen (`Contract`, `ContractStatus`) sind bereits im Frontend definiert (`packages/frontend/src/crm/types.ts`). Nach Implementierung der Endpoints muss der Frontend-Entwickler nur noch die Hooks + API-Calls hinzufuegen. + +--- + +#### Prioritaet 2: Kanban-Board Support (Deal-Stage-Move) + +Das Backend ist bereits bereit (`PATCH /crm/deals/:id` mit `{ stageId }`). Der Frontend-Entwickler kann das Kanban-Board ohne Backend-Aenderungen implementieren. + +**Kein Backend-Handlungsbedarf.** + +--- + +#### Prioritaet 3: Activity Feed — E-Mail & Aufgaben Tabs + +Die Tabs "E-Mail" und "Aufgaben" auf der Company-Detail-Seite sind aktuell disabled (Platzhalter). Fuer die E-Mail-Integration wird Phase 3 (MS 365 OAuth) benoetigt. + +**Fuer Aufgaben (Tasks) ohne MS 365:** +- Task-Typ existiert bereits in `ActivityType` (`TASK`, `FOLLOWUP`) +- Das Frontend kann Aufgaben bereits anlegen/anzeigen +- Optional: `scheduledAt` + `completedAt` Filter-Endpoints (`GET /crm/activities?type=TASK&completedAt=null`) + +--- + +### TODO Backend (naechste Session) + +- [ ] Vertraege-API: `GET/POST/PATCH/DELETE /crm/companies/:id/contracts` +- [ ] Prisma-Migration: Contract-Tabelle falls noch nicht vorhanden (pruefen) +- [ ] Optional: Activity-Filter `?type=TASK` fuer Aufgaben-Tab +- [ ] Nach Implementierung: Diesen Eintrag mit "DONE" markieren und Endpoints dokumentieren