feat: add bookable flag to product export rooms

This commit is contained in:
fromme committed 2026-11-10 17:32:38 +01:00
1 parent 2b27b9809d
commit 0ff312c0c0
10 files changed
+126 -28

No files matched your search

+8
View File
@@ -268,6 +268,13 @@ page-consistency rule as `GET /api/exports/travels` above; only the rows differ.
`Buchungsstop` rooms and services, rooms without a price and boarding points with id `0` are all emitted. Which of
them a website shows, and how, is the client's rule, not this endpoint's.
**Which rooms can be booked.** Each room carries `bookable`, the one derived field: `true` exactly when the
booking flow offers the room for a new booking. That is status `Frei` with `available` above 0. A room on request
(`Anfrage`) is not bookable even with rooms left, because booking it would only produce an inquiry; neither is a
room with `available` 0 or `null`. Show a room that is not bookable as sold out and do not count it towards places
or the "ab" price. Read `bookable` rather than deriving it from `status` and `available`, so a change to the rule
reaches you without a client change.
At current volumes the export is ~420 rows and ~3.8 MB of JSON (a row is 4–24 kB), so the default `perPage=500`
returns it in one page.
@@ -313,6 +320,7 @@ returns it in one page.
"price": 229,
"available": 24,
"status": "Frei",
"bookable": true,
"boardCode": "Lt. Auss.",
"boardBusProId": 2
}
+6 -3
View File
@@ -79,9 +79,12 @@ Trip rules (`App\Chatbot\TripCatalog`):
("NEU Sportclub Lederer Wochenenden und Kurztrips", "Vacanceole Résidence L'Edelweiss"), so a hotel is
shown under its TYPO3 title, and under BusPro's name only when TYPO3 has no hotel for its code.
`query` searches both. Trips have no name in BusPro's export, only a code; their names are TYPO3's.
- A room is bookable unless its status is `Buchungsstop`. The baby row (room code `Baby`) is not a room.
`available` counts rooms, so the places of a date at a hotel are `Σ available × maxPax` over its
bookable rooms. The tools never output room counts, only `frei` or `auf Anfrage`.
- A room is listed unless its status is `Buchungsstop`. The baby row (room code `Baby`) is not a room.
A listed room is bookable when the booking flow offers it (`Frei` with rooms left, the export's `bookable`);
any other room, including one on request (`Anfrage`), is sold out, as the website shows it. Dates with
only sold-out rooms stay in `search_trips`, marked `ausgebucht`. `available` counts rooms, so the places
of a date at a hotel are `Σ available × maxPax` over its bookable rooms, and the "ab" price is the
cheapest bookable room's. The tools never output room counts, only `frei` or `ausgebucht`.
- `search_trips` only offers products that TYPO3 lists in its own website search (`searchable`) and does
not mark as unbookable. Closed group trips and staff trainings are `searchable: false`. `get_trip` still
answers when someone names their code.