5ef8b9d69d
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>
22 lines
507 B
TypeScript
22 lines
507 B
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
import { needService } from '../services/needService'
|
|
|
|
export function useNeeds() {
|
|
return useQuery({
|
|
queryKey: ['needs'],
|
|
queryFn: () => needService.getAll(),
|
|
select: (res) => res.data ?? [],
|
|
})
|
|
}
|
|
|
|
export function useNeed(id: string) {
|
|
return useQuery({
|
|
queryKey: ['need', id],
|
|
queryFn: () => needService.getById(id),
|
|
enabled: Boolean(id),
|
|
select: (res) => res.data ?? null,
|
|
})
|
|
}
|
|
|
|
export const useNeedProfiles = useNeeds
|