feat(services): F005 – complete service layer

New domain types:
- shortlist.ts: Shortlist, ShortlistItem, CreateShortlistInput
- review.ts: ReviewQueueItem, ReviewPriority, ReviewQueueStatus

New mock data:
- shortlists.ts: 2 sample shortlists
- reviewQueue.ts: 3 pending review items

New providers (interface + mockup):
- IShortlistProvider / MockupShortlistProvider (with 150ms latency)
- IReviewProvider / MockupReviewProvider (priority-sorted, with latency)
- IDashboardProvider / MockupDashboardProvider (computed from all mock data)

New services:
- reviewService: getQueue, approve, reject, assign
- shortlistService: CRUD + addItem/removeItem
- authService: wraps sessionStore, swappable for real auth
- dashboardService: getStats(organizationId?)

Enhancements:
- types.ts: typed ServiceErrorCode + ServiceError, Pagination alias
- aiService.ts: openRouterAIService stub (throws ai_generation_failed)
- lib/mockUtils.ts: mockDelay(ms) utility

New hooks:
- useUnifiedResults(needId?): joins matches+properties+signals → UnifiedMatchResult[]
- useReviewQueue: + useApproveReviewItem + useRejectReviewItem
- useMatchDetail, usePropertyDetail, useNeedProfiles aliases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Sutter
2026-05-15 11:12:06 +02:00
parent 0b874865ba
commit 5ef8b9d69d
25 changed files with 636 additions and 7 deletions
+2
View File
@@ -2,3 +2,5 @@ export { mockProperties } from './properties'
export { mockNeeds } from './needs'
export { mockMatches } from './matches'
export { mockFutureSignals } from './futureSignals'
export { mockShortlists } from './shortlists'
export { mockReviewQueue } from './reviewQueue'
+43
View File
@@ -0,0 +1,43 @@
import type { ReviewQueueItem } from '../domain/review'
export const mockReviewQueue: ReviewQueueItem[] = [
{
id: 'review-001',
matchId: 'match-001',
needId: 'need-001',
propertyId: 'prop-001',
matchScore: 88,
priority: 'HIGH',
status: 'PENDING',
assignedTo: 'user-001',
dueAt: '2025-06-15T17:00:00Z',
organizationId: 'org-wincasa',
createdAt: '2025-05-10T08:00:00Z',
updatedAt: '2025-05-10T08:00:00Z',
},
{
id: 'review-002',
matchId: 'match-002',
needId: 'need-001',
propertyId: 'prop-004',
matchScore: 64,
priority: 'MEDIUM',
status: 'PENDING',
dueAt: '2025-06-20T17:00:00Z',
organizationId: 'org-wincasa',
createdAt: '2025-05-10T08:15:00Z',
updatedAt: '2025-05-10T08:15:00Z',
},
{
id: 'review-003',
matchId: 'match-004',
needId: 'need-002',
propertyId: 'prop-006',
matchScore: 47,
priority: 'LOW',
status: 'PENDING',
organizationId: 'org-wincasa',
createdAt: '2025-05-11T09:00:00Z',
updatedAt: '2025-05-11T09:00:00Z',
},
]
+35
View File
@@ -0,0 +1,35 @@
import type { Shortlist } from '../domain/shortlist'
import { ShortlistStatus } from '../domain/enums'
export const mockShortlists: Shortlist[] = [
{
id: 'shortlist-001',
title: 'Top Büroflächen Zürich',
description: 'Beste Bürooptionen für Innovatech AG',
needId: 'need-001',
items: [
{ propertyId: 'prop-001', addedAt: '2025-03-01T10:00:00Z', note: 'Erste Wahl' },
{ propertyId: 'prop-004', addedAt: '2025-03-02T14:30:00Z', note: 'Interessante Alternative' },
],
status: ShortlistStatus.ACTIVE,
createdBy: 'user-001',
organizationId: 'org-wincasa',
createdAt: '2025-03-01T10:00:00Z',
updatedAt: '2025-03-02T14:30:00Z',
},
{
id: 'shortlist-002',
title: 'Logistik Optionen Basel',
description: 'Auswahl für Schweizer Logistik GmbH',
needId: 'need-002',
items: [
{ propertyId: 'prop-002', addedAt: '2025-03-05T09:00:00Z', note: 'Perfekte Grösse' },
],
status: ShortlistStatus.SHARED,
createdBy: 'user-001',
organizationId: 'org-wincasa',
sharedWith: ['client@schweizer-logistik.ch'],
createdAt: '2025-03-05T09:00:00Z',
updatedAt: '2025-03-06T11:00:00Z',
},
]