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
+29
View File
@@ -0,0 +1,29 @@
export const ReviewPriority = {
HIGH: 'HIGH',
MEDIUM: 'MEDIUM',
LOW: 'LOW',
} as const
export type ReviewPriority = typeof ReviewPriority[keyof typeof ReviewPriority]
export const ReviewQueueStatus = {
PENDING: 'PENDING',
IN_REVIEW: 'IN_REVIEW',
COMPLETED: 'COMPLETED',
} as const
export type ReviewQueueStatus = typeof ReviewQueueStatus[keyof typeof ReviewQueueStatus]
export interface ReviewQueueItem {
id: string
matchId: string
needId: string
propertyId: string
matchScore: number
priority: ReviewPriority
status: ReviewQueueStatus
assignedTo?: string
notes?: string
dueAt?: string
organizationId?: string
createdAt: string
updatedAt: string
}