Commit graph

37 commits

Author SHA1 Message Date
Thomas Reitz
3f919340b5 feat: Stammdaten, CRM Reporting, Hilfesystem (hohe Priorität)
Stammdaten (Kapitel 14):
- 5 neue Prisma-Modelle: Department, Location, CostCenter, JobTitle, SkillCategory
- MasterDataModule (Core Service): vollständiges CRUD + öffentliche Dropdown-Endpoints
- Admin-UI /admin/master-data mit 5 Tabs, Inline-Edit, Farbwahl (Skill-Kategorien)

CRM Reporting (Kapitel 22.9):
- recharts ^2.12.0 installiert
- Deals: GET /deals/stats (Win/Loss-Rate, Umsatz, Trend, Verlustgründe)
- Aktivitäten: GET /activities/stats (nach Typ, Completion-Rate, offene Tasks)
- Reports-Seite /crm/reports: LineChart, PieChart, BarChart mit Zeitraum-Filter

Hilfesystem (Kapitel 16):
- @anthropic-ai/sdk installiert; ANTHROPIC_API_KEY optional in .env
- HelpModule (Core Service): POST /help/chat via Claude Haiku
- HelpTooltip-Komponente: Hover-Tooltip für Formularfelder
- HelpPanel: seitlicher Drawer mit Seitenkontext + KI-Chat
- -Button im Topbar (AppLayout), pageKey aus Route abgeleitet

Migration erforderlich: prisma migrate deploy (core-service)
Deployment: core rebuild, crm rebuild, frontend rebuild

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 10:39:30 +01:00
Thomas Reitz
0f5d01df2a docs: Stand.md aktualisiert (Button-Primärfarbe + Commit-Count)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 09:24:11 +01:00
Thomas Reitz
0a5a37d169 docs: Stand.md aktualisiert — vollständiger Feature-Überblick Stand 2026-03-15
Alle implementierten Features dokumentiert: Auth, M365 Integration, Dashboard,
CRM Phase 1-2.5 inkl. Kanban + Berechtigungsmodell, Expertenprofil, Profilzugriff,
Admin-Bereich, Login-Branding, API-Endpunkte.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 09:08:36 +01:00
Thomas Reitz
63cb05d4d8 feat(crm): Phase 2.2-2.4 backend + contract files — vollständige CRM-Service Implementierung
- Phase 2.3 Forecast: probability-Feld in PipelineStage, GET /crm/deals/forecast Endpoint
- Phase 2.2 Import: ImportModule mit preview/execute/history Endpoints (CSV, XLSX, vCard)
- Phase 2.4 Enrichment: EnrichmentModule mit /enrich + /settings/integrations/north-data
- Contracts: ContractsModule mit CRUD + File-Upload Endpoints (Multer, max 25MB)
- Migrations: 20260312_contract_files, 20260312_phase23_forecast
- docker-compose.crm.yml: uploads Volume für Vertragsdokumente

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 22:06:58 +01:00
Thomas Reitz
bfe672ec96 feat(crm): Vertragsdokumente — Datei-Upload Frontend + Backend-Briefing
Frontend (gegen API-Contract, bereit fuer Backend-Integration):
- ContractFile Interface in types.ts
- contractFilesApi (upload, list, download-as-blob, delete) in api.ts
- useContractFiles, useUploadContractFile, useDeleteContractFile in hooks.ts
- ContractsCard: Dokumente-Sektion im Edit-Modal
  - Dateiliste mit Icon (PDF/Word/Excel), Name, Groesse, Download, Loeschen
  - Upload-Button (PDF/DOC/DOCX/XLSX/XLS, max 25 MB)
  - Client-seitige Groessenvalidierung
  - Blob-Download via Axios (Auth-Header werden mitgesendet)

Backend-Briefing in INSIGHT-CRM.md:
- contract_files Tabelle + Prisma-Modell
- Datei-Speicherung (/app/uploads/contracts/{tenantId}/{contractId}/{uuid}-{name})
- 4 Endpoints (POST/GET/GET-download/DELETE)
- Sicherheitshinweise (Path Traversal, Tenant-Isolation, DSGVO)
- Docker-Volume Konfiguration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 21:46:32 +01:00
Thomas Reitz
0e6565e210 feat(crm): Vertraege-Modul Frontend — ContractsCard vollstaendig implementiert
- ContractsCard.tsx: CRUD-Card ersetzt Platzhalter (Liste, Create, Edit, Delete)
- types.ts: CreateContractPayload, UpdateContractPayload, ContractsQueryParams ergaenzt
- api.ts: contractsApi mit 4 Methoden (nested /crm/companies/:id/contracts)
- hooks.ts: crmKeys.contracts + useContracts, useCreate/Update/DeleteContract
- CompanyDetailPage.tsx: contractCount-Prop entfernt (Card laedt via API)
- docs/INSIGHT-CRM.md + Summarize.md aktualisiert

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 21:32:51 +01:00
Thomas Reitz
e3d254c0f9 docs(crm): briefing fuer naechste Backend-Aufgaben — Vertraege-API + Kanban + Activity-Filter 2026-03-12 21:17:07 +01:00
Thomas Reitz
a55643a0dd docs(crm): Phase 2.2-2.4 Frontend-TODOs abgehakt + Summarize.md aktualisiert
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 21:09:16 +01:00
Thomas Reitz
c8c4cea5fa docs(crm): add backend briefing for Phase 2.2, 2.3, 2.4
Comprehensive API contracts for CSV/Excel Import, Forecasting, and
Data Enrichment. Includes parallelization plan for backend + frontend
developers to work simultaneously against defined contracts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 19:19:59 +01:00
Thomas Reitz
b000353298 docs(crm): add Phase 2.1 Custom Fields frontend completion report
Documents all new/changed files, architecture decisions, supported
field types, admin UI features, and deployment notes for the CRM
custom fields frontend integration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 18:39:50 +01:00
Thomas Reitz
aaedf68085 feat(crm): Phase 2.1 Custom Fields — backend + frontend integration
Backend (CRM expert): Custom field definitions CRUD, bulk value upsert,
7 endpoints, Prisma schema with CustomFieldDef + CustomFieldValue tables.

Frontend: Types, API, hooks, admin settings page with field management,
CustomFieldsDisplay for detail pages, CustomFieldsForm for edit modals.
Also fix Vite allowedHosts for insight.xinion.lan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 18:22:57 +01:00
Thomas Reitz
f2c8444050 docs: add Phase 2 CRM backend briefing with Custom Fields, Import, Forecast, Enrichment
Adds comprehensive Phase 2 briefing for CRM backend expert:
- 2.1 Custom Fields System (schema, endpoints, DTOs, response format)
- 2.2 Contact Import (CSV, Excel, vCard with preview/mapping/execute flow)
- 2.3 Forecast Endpoint (weighted pipeline value + probability field)
- 2.4 Data Enrichment (Unternehmensregister + North Data API)
- 2.5 Permissions model (visibility filters, deferred priority)
- Phase 1 frontend integration status documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:12:56 +01:00
Thomas Reitz
48df3c3144 feat(crm): Phase 1 backend schema expansion + frontend integration
Backend (CRM-Expert Phase 1):
- New enums: ContactSource, EntityStatus, CompanySize, OwnerRole,
  LostReason, EmailType, PhoneType
- Contact: add linkedinUrl, birthday, source, department, status
- Company: add vatId, taxId, tradeRegisterNumber, registerCourt,
  companySize, deliveryAddress, dataEnrichedAt/Source, status
- Deal: add lostReason + lostReasonText (required when status=LOST)
- Multi-value emails/phones tables (contact_emails, contact_phones)
- Owner m:n model (contact_owners, company_owners, deal_owners)
- Redis Pub/Sub CRM events (crm.contact.created, crm.deal.won, etc.)
- Activity due_soon scheduler (cron every 15 min)
- SQL migration with data migration for existing records

Frontend integration:
- types.ts: all new enums, interfaces, label maps
- api.ts: owner CRUD endpoints (add/remove for contacts/companies/deals)
- hooks.ts: 6 new owner mutation hooks
- ContactFormModal: LinkedIn, birthday, source, department, status fields
- ContactDetailPage: display new fields (LinkedIn, department, birthday,
  source, status badge)
- CompanyDetailPage: display vatId, taxId, trade register, company size,
  delivery address, data enrichment info
- DealFormModal: lost reason dropdown + text (shown when status=LOST)
- DealDetailPage: display lost reason with label
- CompaniesPage: EntityStatus-aware status dots (ACTIVE/INACTIVE/BLOCKED)
- ActivityType: add FOLLOWUP to all label maps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 15:56:41 +01:00
Thomas Reitz
7d8847fafa docs: add CRM expert briefing with phased task plan to INSIGHT-CRM.md
Define 4-phase execution plan for CRM backend developer:
- Phase 1 (now): Schema fields, Owner m:n, Lost reason, Redis events
- Phase 2 (after): Custom Fields, Data Enrichment, Import, Permissions
- Phase 3 (blocked by Core OAuth): Office 365 Email/Calendar/Tasks/Export
- Phase 4 (nice-to-have): Vision API scan, Reporting dashboards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:46:27 +01:00
Thomas Reitz
69f032a3d8 docs: update INSIGHT-CRM.md with architect requirements from Konzept v1.0
Extract and categorize new requirements from updated CLAUDE_BRIEFING.docx
and INSIGHT_Konzept_v1.0.docx. Add comprehensive CRM task breakdown
(Kap 22: full CRM spec, Kap 24: Office 365 integration) with prioritized
action items for the CRM backend developer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:39:18 +01:00
Thomas Reitz
6e77bf43b0 feat(crm): prevent duplicate Lexware imports — show linked status in import list
Import tab now loads all CRM companies/contacts and cross-references
lexwareContactId to detect already-imported entries. Linked contacts show
a green badge and "Öffnen" link instead of import buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:48:32 +01:00
Thomas Reitz
833bc44acd Update 2026-03-11 10:21:14 +01:00
Thomas Reitz
5bc9aebf64 docs(crm): report Lexware import 500 bug — tenantId passed as type instead of value
Bug in lexware-contacts.service.ts:229 — tenantId: String (type)
instead of tenantId: user.tenantId (value). Affects importCompany,
likely also importContact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:08:34 +01:00
Thomas Reitz
84bfb75c18 docs(crm): add deployment log and frontend updates to INSIGHT-CRM.md
- Document white screen fix (missing hooks commit)
- Document server deployment: migrations, seed data, container restart
- Document CRM settings tabbed layout + Lexware import redesign
- List all commits and remaining open items for CRM backend developer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:04:52 +01:00
Thomas Reitz
08b212bfde docs(crm): update INSIGHT-CRM.md with company detail overhaul entries
- Backend: Company Detail Overhaul with Industries, AccountTypes,
  RelationshipTypes, CompanyRelationships, Contracts entities
- Frontend: 3-column CompanyDetailPage, ActivityFeed, admin config sections
- Migration and seed data documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:00:36 +01:00
Thomas Reitz
81d84e7eb0 docs(crm): document Lexware Office frontend integration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 22:21:50 +01:00
Thomas Reitz
9d496d2e53 feat(crm): integrate Lexware Office for vouchers and contact sync
Adds complete Lexware Office integration to CRM service:
- Rate-limited HTTP client (Token Bucket, 2 req/s)
- Bidirectional contact sync (manual import + ERP-push)
- Voucher caching (quotes, orders, invoices, credit notes)
- Deal-voucher linking (m:n join table with audit)
- Cron jobs: voucher refresh (4h), ERP push (30min)
- Distributed locks via Redis for job deduplication
- Health check extended with Lexware status
- Prisma schema: LexwareVoucher, DealVoucher, VoucherType enum
- Companies/Contacts/Deals services extended with Lexware data

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:28:41 +01:00
Thomas Reitz
028364cd7d docs(crm): document Company module frontend implementation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:13:28 +01:00
Thomas Reitz
a13cca054b docs(crm): document Company entity for frontend developer
Update INSIGHT-CRM.md with complete Company API documentation,
Contact/Deal changes (companyId, position), and frontend integration
suggestions. Update Summarize.md with current test results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:47:39 +01:00
Thomas Reitz
ab4898210e docs(crm): frontend update nach backend-feedback
- Stage-Editing, DealDetail-Optimierung, Deals→Vorgänge Renaming
- Offene Punkte aktualisiert

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:40:29 +01:00
Thomas Reitz
3d8f568c9a 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 <noreply@anthropic.com>
2026-03-10 19:23:53 +01:00
Thomas Reitz
f62d032480 docs: CRM-Kommunikationsdatei mit Frontend-Integrationsstand
Initiale Dokumentation des CRM-Frontend-Status fuer die Abstimmung
zwischen Frontend- und Backend-Entwickler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:18:34 +01:00
Thomas Reitz
f65b9fb930 docs(crm): add frontend integration guide for CRM module
Comprehensive developer handoff document covering all CRM API endpoints,
TypeScript interfaces, response formats, React Query hook patterns,
and recommended frontend structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:17:11 +01:00
Thomas Reitz
ffd48a38a3 Update Briefing 2026-03-10 15:30:07 +01:00
Thomas Reitz
b18fe9376c docs: add CRM service handoff document for new dev session
Comprehensive briefing for a new Claude Code chat to build the CRM
container service, including: protected paths, architecture overview,
JWT validation, database schema conventions, Docker integration,
multi-tenancy rules, and quick-start guide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:18:04 +01:00
Thomas Reitz
15ea7627e8 docs: add developer integration guide for container applications
Comprehensive guide (INTEGRATION.md) explaining how external container
applications can integrate with the INSIGHT platform, including:
- Docker network integration and service discovery
- JWT authentication and token validation (RS256)
- API endpoints and communication patterns
- Traefik routing configuration
- Database access via PgBouncer
- Redis caching with namespace conventions
- Frontend sidebar integration
- Security requirements and checklist
- Example docker-compose extension

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 12:52:01 +01:00
Thomas Reitz
79635c31d2 Update 2026-03-09 22:51:42 +01:00
Thomas Reitz
5412ae137a feat: adapt codebase for IP-based HTTP deployment on 172.20.10.59
Switch from hostname+HTTPS (insight-dev.xinion.lan) to IP+HTTP
(172.20.10.59) for alpha/dev deployment without DNS.

Key changes:
- Cookie secure/sameSite flags environment-conditional (fixes HTTP auth)
- docker-compose.yml: remove HTTPS, update host rules, reduce PG memory
- Traefik: disable TLS, update CORS/CSP for HTTP
- Add Prisma init migration (7 tables) and admin seed script
- Generate package-lock.json for npm ci in Docker builds
- Update all documentation for IP-based access

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:21:45 +01:00
Thomas Reitz
34129401a3 docs: update ACCESS.md with server IPs and Forgejo setup completion
- Add insight-dev-01 server IP: 172.20.10.59
- Add Git server (GAIA-GIT) details: 172.20.10.11
- Replace all IP placeholders with actual values
- Update Summarize.md with Forgejo configuration status

Server setup completed on git.xinion.lan:
- Docker Engine 29.3 installed
- Forgejo Actions + Container Registry enabled
- Runner v6.3.1 registered and running
- 5 repository secrets configured
- Branch protection on main + develop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:36:16 +01:00
Thomas Reitz
b3516c5fdd docs: add Forgejo CI/CD setup guide for Git server configuration
Step-by-step instructions for:
- Enabling Forgejo Actions and Container Registry
- Installing and registering a Forgejo Runner
- Configuring repository secrets for deployment
- Setting up branch protection rules
- Testing the Container Registry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:36:22 +01:00
Thomas Reitz
0e052b001c chore: add CI/CD SSH key and update ACCESS.md with both keys
- Generate separate Ed25519 key for Forgejo Actions CI/CD pipeline
- Document both keys with clear purpose separation:
  deploy_ed25519 = server access (manual/Claude)
  cicd_ed25519   = automated deployments (Forgejo Actions)
- Add key placement matrix (which key goes where)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:34:01 +01:00
Thomas Reitz
5f54bde55e chore: project initialization with infrastructure definition and structure
- Generate SSH deployment key (Ed25519) for server access
- Define complete server infrastructure (ProxmoxVE VM, Docker, networking)
- Create ACCESS.md with all connection details and SSH instructions
- Create INFRASTRUCTURE.md with VM setup guide and service architecture
- Set up project directory structure per briefing specification
- Add .env.example with all required environment variables
- Add .gitignore for Node.js/Docker/TypeScript project
- Create comprehensive README.md for developer onboarding
- Add Summarize.md changelog
- Include concept and briefing documents

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:22:55 +01:00