36570c5bdc
- Fix MUI v9 API: PaperProps/InputLabelProps/inputProps → slotProps in 6 components - Add ExternalMarketResult alias, PropertyUnit import, OPERATIONS workspace config - Fix TradeOff.description → .concern, ScoreFactor.label → .criterion - Make schattenmarktRelease.leadTimeMonths optional, fix mock-data enum values - Fix useMatchDetailData query typing, weightingService missing WeightProfile keys - Split Pipeline/Compare/MatchDetail/IntelligenceMatchCard into sub-components - Fix all test fixtures (CreateNeedInput, CreatePropertyInput, TradeOffInput, etc.) - Add vercel.json for deployment, zero tsc errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import type { ResultType } from './enums'
|
|
import type { Property, PropertyUnit } 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' | 'MAISON_WORK'
|
|
property: Property
|
|
match: Match
|
|
unit?: PropertyUnit // specific unit this match refers to
|
|
}
|
|
|
|
export interface FutureAvailabilityResult extends UnifiedResultBase {
|
|
resultType: 'FUTURE_AVAILABILITY'
|
|
signal: FutureSignal
|
|
match: Match
|
|
property?: Property // backing property (when signal has a propertyId)
|
|
unit?: PropertyUnit // specific rentable unit (when signal has a unitId)
|
|
}
|
|
|
|
/** @deprecated Alias kept for backward compatibility — use VerifiedPortfolioResult */
|
|
export type ExternalMarketResult = VerifiedPortfolioResult
|
|
|
|
export type UnifiedMatchResult =
|
|
| VerifiedPortfolioResult
|
|
| FutureAvailabilityResult
|