feat(supply): unit-centric fit-out & overview — per-unit fit-out, editable demand budget, multi-unit price/availability
- domain/unit: optional per-unit fitOut override (falls back to property.hardFacts.fitOut) - matchSyncService: pre-market unit scored with its own fitOut; matchCardAdapter prefers unit fitOut - PreMarketUnitGrid/PreMarketPanel: per-unit Ausbaustandard override in the release list (default "Wie Objekt") - PropertyDetailOverview: edit/read "Wer baut aus?" for existing listings (SHELL/BASIC), central FIT_OUT_LABELS - Phase 1 unit-centric overview: header shows area+count, price as range, "Verfügbar ab → pro Einheit"; unit table shows per-unit price + availability; "Objekt & Lage" labels marked as object-defaults for multi-unit - NeedExtendedRequirements: "Eigenes Ausbaubudget" only shown when min fit-out set + clearer helper text - UnitStructurePanel: spin-off prefill carries fitOutByLandlord Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,9 @@ export function PreMarketPanel({ p }: { p: Property }) {
|
||||
}
|
||||
return init
|
||||
})
|
||||
const [unitFitOut, setUnitFitOut] = useState<Record<string, string>>(() =>
|
||||
Object.fromEntries((p.units ?? []).map(u => [u.id, u.fitOut ?? ''])),
|
||||
)
|
||||
const [unitSaving, setUnitSaving] = useState<Record<string, boolean>>({})
|
||||
const queryClient = useQueryClient()
|
||||
const updateProperty = useUpdateProperty()
|
||||
@@ -96,6 +99,23 @@ export function PreMarketPanel({ p }: { p: Property }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function saveUnitFitOut(unitId: string, fitOut: string) {
|
||||
setUnitFitOut(prev => ({ ...prev, [unitId]: fitOut }))
|
||||
setUnitSaving(prev => ({ ...prev, [unitId]: true }))
|
||||
try {
|
||||
await MockupUnitProvider.update(unitId, {
|
||||
fitOut: (fitOut || undefined) as 'SHELL' | 'BASIC' | 'FULL' | 'PREMIUM' | undefined,
|
||||
})
|
||||
await queryClient.invalidateQueries({ queryKey: ['property', p.id] })
|
||||
await queryClient.invalidateQueries({ queryKey: ['properties'] })
|
||||
await queryClient.invalidateQueries({ queryKey: ['matches'] })
|
||||
} catch {
|
||||
showToast('Fehler beim Speichern des Ausbaustandards.', 'error')
|
||||
} finally {
|
||||
setUnitSaving(prev => ({ ...prev, [unitId]: false }))
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Divider sx={{ my: 2 }} />
|
||||
@@ -193,6 +213,9 @@ export function PreMarketPanel({ p }: { p: Property }) {
|
||||
unitSaving={unitSaving}
|
||||
setUnitStates={setUnitStates}
|
||||
saveUnit={saveUnit}
|
||||
propertyFitOut={p.hardFacts?.fitOut}
|
||||
unitFitOut={unitFitOut}
|
||||
saveUnitFitOut={saveUnitFitOut}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user