feat: unit-level matching architecture — match against Einheiten, not Objekte
- domain/property: add getEffectiveUnits() — returns explicit units or synthesises one from property-level data so all properties work uniformly at unit level - domain/match: add unitId? field — every Match references a specific unit - domain/unifiedResult: add unit? to VerifiedPortfolioResult + ExternalMarketResult - MockupNeedProvider: generateSyntheticMatches iterates getEffectiveUnits(prop); computeScore uses unit-level areaSqm + rentPricePerSqm; resultId for PRE-MARKET signals matches useSchattenmarktSignals signal ID format - useUnifiedResults: resolve unit from match.unitId for VERIFIED_PORTFOLIO/EXTERNAL_MARKET - matchCardAdapter: unit now extracted for all result types; unitId from match.unitId - IntelligenceMatchCard: regular cards show unit chip (floor + label + m²) when a named unit is known — only adds context, never shows for synthetic/whole-property units Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,11 @@ export function useUnifiedResults(needId?: string) {
|
||||
resultType: 'FUTURE_AVAILABILITY', signal, match, property, unit: backingUnit }]
|
||||
}
|
||||
|
||||
// Resolve specific unit if the match carries a unitId
|
||||
const matchUnit = match.unitId
|
||||
? (property.units?.find(u => u.id === match.unitId) ?? undefined)
|
||||
: undefined
|
||||
|
||||
if (rt === 'EXTERNAL_MARKET' || rt === 'MAISON_WORK') {
|
||||
const result: ExternalMarketResult = {
|
||||
matchId: match.id,
|
||||
@@ -67,6 +72,7 @@ export function useUnifiedResults(needId?: string) {
|
||||
resultType: rt as 'EXTERNAL_MARKET' | 'MAISON_WORK',
|
||||
property,
|
||||
match,
|
||||
unit: matchUnit,
|
||||
}
|
||||
return [result]
|
||||
}
|
||||
@@ -78,6 +84,7 @@ export function useUnifiedResults(needId?: string) {
|
||||
resultType: 'VERIFIED_PORTFOLIO',
|
||||
property,
|
||||
match,
|
||||
unit: matchUnit,
|
||||
}
|
||||
return [result]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user