Commit graph

26 commits

Author SHA1 Message Date
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