feat: Pipeline↔Anfragen integration + Compare→Pipeline + KI stage detection

Navigation: Deal Pipeline moved after Vergleich (before Anfragen)

Compare → Pipeline:
- Bookmark icon per column header; BookmarkCheck when already in pipeline
- Passes propertyId, propertyAddress, area/rent labels on save

Pipeline cards now unit-level:
- propertyAddress shown with MapPin on every card
- Chat icon (MessageSquare) on cards with linked inquiry → navigates to /demand/anfragen?inquiry=xxx
- Detail panel: Chat chip links to specific inquiry thread, propertyAddress displayed

Anfragen → Pipeline KI detection:
- Keyword scan on every sent message (besichtigung → VISITED, mietvertrag → NEGOTIATION, unterschrieben → CLOSED_WON)
- Only advances stage, never goes back
- Purple KI alert banner with direct Pipeline link, auto-dismisses after 6s
- Pipeline badge in inquiry list + stage chip in chat header with nav link
- URL param ?inquiry=xxx pre-selects inquiry (used from Pipeline chat button)

Domain: PipelineItem gains propertyId, unitId, propertyAddress, inquiryId
Mock data: pl-001/pl-002/pl-004 linked to inq-001/inq-005/inq-004

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Sutter
2026-05-22 21:42:21 +02:00
parent a002597f5b
commit 6a6ff7f2e2
8 changed files with 505 additions and 233 deletions
+118 -8
View File
@@ -1,12 +1,122 @@
import type { PipelineItem } from '../domain/pipeline'
export const mockPipelineItems: PipelineItem[] = [
{ id: 'pl-001', title: 'Bürofläche Zollstrasse 12', location: 'Zürich, Zürich-West', matchScore: 91, resultType: 'VERIFIED_PORTFOLIO', stage: 'NEGOTIATION', areaLabel: '850 m²', rentLabel: 'CHF 42/m²', availabilityLabel: '2025-09-01', addedAt: '2025-05-01T10:00:00Z', updatedAt: '2025-05-15T14:00:00Z', assignedTo: 'B. Sutter' },
{ id: 'pl-002', title: 'Gewerbe Hardturmstrasse', location: 'Zürich-West', matchScore: 87, resultType: 'VERIFIED_PORTFOLIO', stage: 'VISITED', areaLabel: '1200 m²', rentLabel: 'CHF 38/m²', availabilityLabel: '2025-10-01', addedAt: '2025-05-03T10:00:00Z', updatedAt: '2025-05-14T09:00:00Z' },
{ id: 'pl-003', title: 'Büro Binzstrasse 23', location: 'Zürich, Binz', matchScore: 83, resultType: 'MAISON_WORK', stage: 'VISITED', areaLabel: '720 m²', rentLabel: 'CHF 47/m²', addedAt: '2025-05-04T10:00:00Z', updatedAt: '2025-05-13T10:00:00Z' },
{ id: 'pl-004', title: 'Bürofläche Bahnhofstrasse', location: 'Zürich, Innenstadt', matchScore: 79, resultType: 'MAISON_WORK', stage: 'QUALIFIED', areaLabel: '950 m²', rentLabel: 'CHF 85/m²', addedAt: '2025-05-05T10:00:00Z', updatedAt: '2025-05-12T10:00:00Z', notes: 'Budget zu hoch — prüfen' },
{ id: 'pl-005', title: 'DataCloud Systems AG', location: 'Zürich-West / Technopark', matchScore: 76, resultType: 'FUTURE_AVAILABILITY', stage: 'QUALIFIED', areaLabel: '~600 m²', availabilityLabel: '~10 Monate', addedAt: '2025-05-06T10:00:00Z', updatedAt: '2025-05-11T10:00:00Z' },
{ id: 'pl-006', title: 'Neubau Wankdorf Business', location: 'Bern, Wankdorf', matchScore: 72, resultType: 'FUTURE_AVAILABILITY', stage: 'DISCOVERED', areaLabel: '~4500 m²', availabilityLabel: '~24 Monate', addedAt: '2025-05-07T10:00:00Z', updatedAt: '2025-05-10T10:00:00Z' },
{ id: 'pl-007', title: 'Bürofläche Stadthaus Bern', location: 'Bern Innenstadt', matchScore: 88, resultType: 'VERIFIED_PORTFOLIO', stage: 'CLOSED_WON', areaLabel: '650 m²', rentLabel: 'CHF 52/m²', availabilityLabel: '2025-07-01', addedAt: '2025-04-10T10:00:00Z', updatedAt: '2025-05-08T10:00:00Z', assignedTo: 'B. Sutter', notes: 'Vertrag unterschrieben' },
{ id: 'pl-008', title: 'Gewerbe Güterstrasse', location: 'Basel', matchScore: 68, resultType: 'EXTERNAL_MARKET', stage: 'CLOSED_LOST', areaLabel: '800 m²', rentLabel: 'CHF 28/m²', addedAt: '2025-04-15T10:00:00Z', updatedAt: '2025-05-05T10:00:00Z', notes: 'Vermieter hat anderes Unternehmen bevorzugt' },
{
id: 'pl-001',
propertyId: 'prop-001',
inquiryId: 'inq-001',
propertyAddress: 'Zollstrasse 12, Zürich-West',
title: 'Bürofläche Zollstrasse 12',
location: 'Zürich, Zürich-West',
matchScore: 91,
resultType: 'VERIFIED_PORTFOLIO',
stage: 'NEGOTIATION',
areaLabel: '850 m²',
rentLabel: 'CHF 42/m²',
availabilityLabel: '2026-09-01',
addedAt: '2026-05-01T10:00:00Z',
updatedAt: '2026-05-15T14:00:00Z',
assignedTo: 'B. Sutter',
},
{
id: 'pl-002',
propertyId: 'prop-007',
inquiryId: 'inq-005',
propertyAddress: 'Thurgauerstrasse 40, Zürich-Oerlikon',
title: 'Büro Oerlikon Thurgauerstrasse',
location: 'Zürich-Oerlikon',
matchScore: 87,
resultType: 'VERIFIED_PORTFOLIO',
stage: 'QUALIFIED',
areaLabel: '1200 m²',
rentLabel: 'CHF 38/m²',
availabilityLabel: '2026-10-01',
addedAt: '2026-05-03T10:00:00Z',
updatedAt: '2026-05-14T09:00:00Z',
},
{
id: 'pl-003',
propertyAddress: 'Binzstrasse 23, Zürich-Binz',
title: 'Büro Binzstrasse 23',
location: 'Zürich, Binz',
matchScore: 83,
resultType: 'MAISON_WORK',
stage: 'VISITED',
areaLabel: '720 m²',
rentLabel: 'CHF 47/m²',
addedAt: '2026-05-04T10:00:00Z',
updatedAt: '2026-05-13T10:00:00Z',
},
{
id: 'pl-004',
propertyId: 'prop-012',
inquiryId: 'inq-004',
propertyAddress: 'Baarerstrasse 14, Zug',
title: 'Bürofläche Zug Baarerstrasse',
location: 'Zug',
matchScore: 93,
resultType: 'VERIFIED_PORTFOLIO',
stage: 'VISITED',
areaLabel: '950 m²',
rentLabel: 'CHF 56/m²',
addedAt: '2026-05-05T10:00:00Z',
updatedAt: '2026-05-12T10:00:00Z',
notes: 'Besichtigungstermin 22.05. bestätigt',
},
{
id: 'pl-005',
propertyAddress: 'Technopark, Zürich-West',
title: 'DataCloud Systems AG',
location: 'Zürich-West / Technopark',
matchScore: 76,
resultType: 'FUTURE_AVAILABILITY',
stage: 'QUALIFIED',
areaLabel: '~600 m²',
availabilityLabel: '~10 Monate',
addedAt: '2026-05-06T10:00:00Z',
updatedAt: '2026-05-11T10:00:00Z',
},
{
id: 'pl-006',
propertyAddress: 'Wankdorf Business Park, Bern',
title: 'Neubau Wankdorf Business',
location: 'Bern, Wankdorf',
matchScore: 72,
resultType: 'FUTURE_AVAILABILITY',
stage: 'SAVED',
areaLabel: '~4500 m²',
availabilityLabel: '~24 Monate',
addedAt: '2026-05-07T10:00:00Z',
updatedAt: '2026-05-10T10:00:00Z',
},
{
id: 'pl-007',
propertyAddress: 'Stadthaus-Gasse 1, Bern Innenstadt',
title: 'Bürofläche Stadthaus Bern',
location: 'Bern Innenstadt',
matchScore: 88,
resultType: 'VERIFIED_PORTFOLIO',
stage: 'CLOSED_WON',
areaLabel: '650 m²',
rentLabel: 'CHF 52/m²',
availabilityLabel: '2026-07-01',
addedAt: '2026-04-10T10:00:00Z',
updatedAt: '2026-05-08T10:00:00Z',
assignedTo: 'B. Sutter',
notes: 'Vertrag unterschrieben',
},
{
id: 'pl-008',
propertyAddress: 'Güterstrasse 22, Basel',
title: 'Gewerbe Güterstrasse Basel',
location: 'Basel',
matchScore: 68,
resultType: 'EXTERNAL_MARKET',
stage: 'CLOSED_LOST',
areaLabel: '800 m²',
rentLabel: 'CHF 28/m²',
addedAt: '2026-04-15T10:00:00Z',
updatedAt: '2026-05-05T10:00:00Z',
notes: 'Vermieter hat anderes Unternehmen bevorzugt',
},
]