Files
property-match/src/provider/MockupPropertyProvider.ts
T
Benjamin Sutter efc406ace9 feat: role-aware UX, market intelligence, score fix & layout scroll
- Role-based workspace access: Property Manager gets Supply+Demand,
  Operations restricted to Super Admin + Reviewer only
- Root redirect routes each persona to their first workspace
- Match Center: replaced 3-panel with auto-sorted flat list + drawer
- AI Search: unified form with dual-action (Jetzt suchen / Als Suchprofil speichern)
- CompareTray hidden on non-Demand routes; Vergleichen removed from Supply
- LocationIntelligencePanel: city KPIs, rent trends, soft factors, comparables
- NegotiationInsightsPanel: price positioning, active demand, selling arguments
- scoreCalculator: cap hardMatchScore and softFactorScore to max 100
- Layout: add display:flex to overflow:hidden wrappers so inner scroll works
  (MatchCenter drawer, MarketIntelligence, SourceMonitoring, SignalPipeline)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 00:58:10 +02:00

37 lines
1.7 KiB
TypeScript

import type { IPropertyProvider, PropertyFilters } from './IPropertyProvider'
import type { Property, CreatePropertyInput, UpdatePropertyInput } from '../domain/property'
import { mockProperties } from '../mock-data/properties'
export const propertyStore: Property[] = [...mockProperties]
const store = propertyStore
export const MockupPropertyProvider: IPropertyProvider = {
async getAll(filters?: PropertyFilters) {
let results = [...store]
if (filters?.assetType) results = results.filter(p => p.assetType === filters.assetType)
if (filters?.resultType) results = results.filter(p => p.resultType === filters.resultType)
if (filters?.city) results = results.filter(p => p.location.city.toLowerCase().includes(filters.city!.toLowerCase()))
if (filters?.minAreaSqm) results = results.filter(p => p.areaSqm >= filters.minAreaSqm!)
if (filters?.maxRentPerSqm) results = results.filter(p => p.rentPricePerSqm <= filters.maxRentPerSqm!)
if (filters?.organizationId) results = results.filter(p => p.organizationId === filters.organizationId)
return results
},
async getById(id) {
return store.find(p => p.id === id) ?? null
},
async create(data: CreatePropertyInput) {
const next: Property = { id: crypto.randomUUID(), ...data, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() }
store.push(next)
return next
},
async update(id, data: UpdatePropertyInput) {
const idx = store.findIndex(p => p.id === id)
store[idx] = { ...store[idx], ...data, updatedAt: new Date().toISOString() }
return store[idx]
},
async remove(id) {
const idx = store.findIndex(p => p.id === id)
store.splice(idx, 1)
},
}