fix: give chatbot pickups per-leg surcharges including the return leg

This commit is contained in:
fromme committed 2026-10-09 08:38:57 +02:00
1 parent ac5ca7b18b
commit 3cb1548f2f
8 files changed
+58 -7

No files matched your search

+5 -1
View File
@@ -318,6 +318,8 @@ returns it in one page.
"city": "Frankfurt",
"street": "Flughafen (P36 zwischen Terminal 1 und 2)",
"price": 5.9,
"returnLeg": true,
"returnPrice": 5.9,
"datetime": "2026-12-03T23:30:00"
}
],
@@ -389,7 +391,9 @@ such as for arriving by car.
`GET /api/exports/travels` — a clock reading without an offset, `null` where upstream states no time — including
rolling a bare time past midnight onto the next day. There is no separate `time` field; format `datetime` for
display. `price` is the outbound boarding surcharge exactly as upstream states it: `null` where upstream states
none. It is not levelled against the return leg. An id absent from
none. The surcharge is charged **per leg**: `returnLeg` says whether the point is also served on the way back, and
`returnPrice` is its return surcharge, again verbatim and `null` where upstream states none. Neither price is levelled
against the other. A point served on the return leg only is not emitted. An id absent from
`GET /api/pickups` is emitted with `code`, `city` and `street` null and counted in `pickupsWithoutMasterData`. An id
of `0` is emitted as-is but not counted.
+4
View File
@@ -58,6 +58,10 @@ Trip rules (`App\Chatbot\TripCatalog`):
- `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.
- Pickup surcharges are per person and per leg, so each pickup carries `surchargeOutbound`, `surchargeReturn` and
their sum `surchargeRoundTrip`. A single figure was read by the model as the whole price. A leg listed without a
price is `0`, because BusPro bills only priced legs; `surchargeReturn` is absent only where the point is not
served on the way back.
- The export's `guide` (name, phone) and all BusPro ids are never output.
`search_trips` mirrors the search page (`/skireisen/suche/`), whose data is TYPO3's import of our own