feat: explicit icon label map for accommodation booking api

This commit is contained in:
2026-08-20 14:43:09 +02:00
parent b502127e2e
commit 0bdc6c873b
@@ -221,34 +221,64 @@ class ApiMiddleware implements MiddlewareInterface
$icons = []; $icons = [];
if (($hotel['beds_count'] ?? 0) > 0) { if (($hotel['beds_count'] ?? 0) > 0) {
$icons['bed'] = sprintf('%d Betten', $hotel['beds_count']); $icons[] = [
'icon' => 'bed',
'label' => sprintf('%d Betten', $hotel['beds_count']),
];
} }
if (($hotel['parking_count'] ?? 0) > 0) { if (($hotel['parking_count'] ?? 0) > 0) {
$icons['parking'] = sprintf('%d Parkplätze', $hotel['parking_count']); $icons[] = [
'icon' => 'parking',
'label' => sprintf('%d Parkplätze', $hotel['parking_count']),
];
} }
if ($hotel['altitude'] ?? null) { if ($hotel['altitude'] ?? null) {
$icons['mountain'] = $hotel['altitude']; $icons[] = [
'icon' => 'mountain',
'label' => $hotel['altitude'],
];
} }
if ($hotel['distance_bus'] ?? null) { if ($hotel['distance_bus'] ?? null) {
$icons['bus'] = $hotel['distance_bus']; $icons[] = [
'icon' => 'bus',
'label' => $hotel['distance_bus'],
];
} }
if ($hotel['distance_lift'] ?? null) { if ($hotel['distance_lift'] ?? null) {
$icons['lift'] = $hotel['distance_lift']; $icons[] = [
'icon' => 'lift',
'label' => $hotel['distance_lift'],
];
} }
if ($hotel['shower'] ?? null) { if ($hotel['shower'] ?? null) {
$icons['shower'] = $hotel['shower']; $icons[] = [
'icon' => 'shower',
'label' => $hotel['shower'],
];
} }
if ($hotel['partyroom'] ?? false) { if ($hotel['partyroom'] ?? false) {
$icons['party'] = 'Partyzimmer'; $icons[] = [
'icon' => 'party',
'label' => 'Partyzimmer',
];
} }
if ($hotel['gamesroom'] ?? false) { if ($hotel['gamesroom'] ?? false) {
$icons['dice'] = 'Spielezimmer'; $icons[] = [
'icon' => 'dice',
'label' => 'Spielezimmer',
];
} }
if ($hotel['sauna'] ?? false) { if ($hotel['sauna'] ?? false) {
$icons['sauna'] = 'Sauna'; $icons[] = [
'icon' => 'sauna',
'label' => 'Sauna',
];
} }
if ($hotel['wifi'] ?? false) { if ($hotel['wifi'] ?? false) {
$icons['wifi'] = 'WiFi'; $icons[] = [
'icon' => 'wifi',
'label' => 'WiFi',
];
} }
return [ return [