feat(domain): F004 – expand domain model layer
- need.ts: add SizeRange, MustHaveCriterion, WeightedPreference types; extend Need with desiredLocation, sizeRange, mustHaveCriteria, weightedPreferences, status - futureSignal.ts: add SignalEvidence type; extend FutureSignal with title, evidence, matchabilityScore, reviewStatus - aiOutput.ts: new AIOutput entity with type, inputHash, outputJson, provider/model/promptVersion/schemaVersion, reviewStatus - activityEvent.ts: new ActivityEvent entity with actorId, action, entityType, entityId, timestamp, metadata - unifiedResult.ts: discriminated union (VerifiedPortfolioResult | ExternalMarketResult | FutureAvailabilityResult) - index.ts: export all three new files - Properties.tsx: add LIGHT_INDUSTRIAL + UNKNOWN cases to exhaustive switches Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import type { ResultType } from './enums'
|
||||
import type { Property } from './property'
|
||||
import type { FutureSignal } from './futureSignal'
|
||||
import type { Match } from './match'
|
||||
|
||||
// ── Unified Match Result (discriminated union) ────────────────────────────────
|
||||
// Wraps the three result types so UI components can handle all three paths
|
||||
// without type confusion. Discriminate on `resultType`.
|
||||
|
||||
interface UnifiedResultBase {
|
||||
matchId: string
|
||||
needId: string
|
||||
matchScore: number
|
||||
resultType: ResultType
|
||||
}
|
||||
|
||||
export interface VerifiedPortfolioResult extends UnifiedResultBase {
|
||||
resultType: 'VERIFIED_PORTFOLIO'
|
||||
property: Property
|
||||
match: Match
|
||||
}
|
||||
|
||||
export interface ExternalMarketResult extends UnifiedResultBase {
|
||||
resultType: 'EXTERNAL_MARKET'
|
||||
property: Property
|
||||
match: Match
|
||||
}
|
||||
|
||||
export interface FutureAvailabilityResult extends UnifiedResultBase {
|
||||
resultType: 'FUTURE_AVAILABILITY'
|
||||
signal: FutureSignal
|
||||
match: Match
|
||||
}
|
||||
|
||||
export type UnifiedMatchResult =
|
||||
| VerifiedPortfolioResult
|
||||
| ExternalMarketResult
|
||||
| FutureAvailabilityResult
|
||||
Reference in New Issue
Block a user