7b7be0b436
- dataQualityService with getPortfolioQualitySummary() - Service methods: getDashboardPropertiesSummary, getStrongMatches, getSignalSummary, getDashboardTasks added to respective services - dashboardService uses Promise.allSettled for partial error resilience - KpiCard: onClick + Tooltip support - KpiGrid: navigate actions and tooltips per card - StrongMatchMiniCard: Match Center, Prüfung, Vergleichen action buttons - FutureSignalWidget: time horizon distribution (0–6, 6–12, 12–24 Mo.) - SupplyDashboard: DashboardHeader, empty state, error state, partial widget errors, permission-based rendering per UserRole Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
import { MockupPropertyProvider } from '../provider/MockupPropertyProvider'
|
|
import type { PropertyFilters } from '../provider/IPropertyProvider'
|
|
import type { CreatePropertyInput, UpdatePropertyInput } from '../domain/property'
|
|
import type { ListResponse, ItemResponse } from './types'
|
|
import type { Property } from '../domain/property'
|
|
|
|
const provider = MockupPropertyProvider
|
|
const ACTIVE_STATUSES: readonly string[] = ['AVAILABLE_NOW', 'AVAILABLE_SOON']
|
|
|
|
export const propertyService = {
|
|
async getAll(filters?: PropertyFilters): Promise<ListResponse<Property>> {
|
|
const data = await provider.getAll(filters)
|
|
return { data, meta: { total: data.length, page: 1, pageSize: data.length, hasMore: false } }
|
|
},
|
|
async getById(id: string): Promise<ItemResponse<Property | null>> {
|
|
const data = await provider.getById(id)
|
|
return { data }
|
|
},
|
|
async create(input: CreatePropertyInput): Promise<ItemResponse<Property>> {
|
|
const data = await provider.create(input)
|
|
return { data }
|
|
},
|
|
async update(id: string, input: UpdatePropertyInput): Promise<ItemResponse<Property>> {
|
|
const data = await provider.update(id, input)
|
|
return { data }
|
|
},
|
|
async remove(id: string): Promise<ItemResponse<void>> {
|
|
await provider.remove(id)
|
|
return { data: undefined }
|
|
},
|
|
|
|
async getDashboardPropertiesSummary(): Promise<{ total: number; active: number }> {
|
|
const data = await provider.getAll()
|
|
return {
|
|
total: data.length,
|
|
active: data.filter(p => ACTIVE_STATUSES.includes(p.availabilityStatus)).length,
|
|
}
|
|
},
|
|
}
|