feat: Kalender-Code replaces the product's calendar hotel
Every hotel field now has one job. The hotel's code and aliases are import codes only (dates, lookups); a new Kalender-Code (calendar_code) decides the availability a record shows and may be shared by a house's summer and winter records. The product's "Unterkunft für Belegungskalender" is replaced by the checkbox "Kalender anzeigen" (show_calendar): a product page shows the calendar of the hotel it displays, the season still decides which one. - Price calendar, price tables, Belegungskalender, iCal feeds and /api/calendar-hotels read the Kalender-Code. A feed without one answers 404 instead of an empty calendar. - The upgrade wizard epProductsCalendarCode fills both fields from calendar_hotel, preserving today's calendars; the deploy runs it between the schema update and the switch. calendar_hotel stays in the database, so the previous release keeps working. ep:calendar-codes lists the product pages whose calendar differs from it. - HotelCodeResolver is the one lookup of import codes (date import, /api/hotel, Travelinfo); a code on several records resolves to the record whose own code it is, then the lowest uid, with a warning. Saving a code that is already another visible record's import code is refused with a message naming that record. - /api/product without hotel attaches the product's only visible Unterkunft (422 otherwise) and adds board_description, additional_services and calendar_hotel_code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
659e72fc8c
commit
5455973dba
25 files changed
+880
-127
No files matched your search
+25
-15
@@ -23,8 +23,9 @@ changed together.
|
||||
|
||||
Content of one hotel, for MyE&P's group house pages and booking flow.
|
||||
|
||||
- `hotel`: the TYPO3 hotel code or one of its matchcode aliases. In MyE&P this is the
|
||||
accommodation's **CMS code** (e.g. `DGSGRP`), which can differ from its calendar code.
|
||||
- `hotel`: an import code of the record: its "Import-Code" or one of its "Weitere Import-Codes"
|
||||
(matchcode aliases), resolved by `HotelCodeResolver`. In MyE&P this is the accommodation's
|
||||
**CMS code** (e.g. `DGSGRP`), which can differ from its calendar code.
|
||||
- `400` without `hotel`, `404 {"message": "Hotel not found"}` for an unknown code.
|
||||
|
||||
```json
|
||||
@@ -42,15 +43,23 @@ Content of one hotel, for MyE&P's group house pages and booking flow.
|
||||
|
||||
## `GET /api/product?product=<code>[&hotel=<code>]`
|
||||
|
||||
Content of one product, optionally with a hotel.
|
||||
Content of one product with a hotel.
|
||||
|
||||
- `product`: the product code. `400` without it, `404 {"message": "Product not found"}` for an
|
||||
unknown code.
|
||||
- `hotel` (optional): adds `hotel` with the same content as `/api/hotel`.
|
||||
- `product`: the product code (default language). `400` without it, `404 {"message": "Product
|
||||
not found"}` for an unknown code.
|
||||
- Without `hotel` (MyE&P's group houses, linked by product code): the product's only visible
|
||||
Unterkunft. Any other number of visible Unterkünfte answers `422 {"message": "Product <code>
|
||||
links <n> hotels, expected exactly 1", "hotel_count": <n>}`.
|
||||
- With `hotel` (MyE&P's booking flow): the record of that import code, as in `/api/hotel`; an
|
||||
unknown code gives `"hotel": []`.
|
||||
- `board_description`, `additional_services`: raw RTE values, `""` when empty.
|
||||
- `calendar_hotel_code`: the Kalender-Code of the hotel when "Kalender anzeigen" is on, else
|
||||
`null`. MyE&P compares it with its accommodation's calendar code.
|
||||
|
||||
```json
|
||||
{
|
||||
"product": {"name": "…", "code": "…", "images": {…}},
|
||||
"product": {"name": "…", "code": "…", "images": {…}, "board_description": "…",
|
||||
"additional_services": "…", "calendar_hotel_code": "SST"},
|
||||
"country": {"name": "…"},
|
||||
"region": {…},
|
||||
"city": {"name": "…"},
|
||||
@@ -60,12 +69,14 @@ Content of one product, optionally with a hotel.
|
||||
|
||||
## `GET /api/calendar-hotels`
|
||||
|
||||
The calendar hotel of every visible product: the hotel codes whose availability TYPO3 shows
|
||||
(iCal feed, availability calendar, price calendar). MyE&P syncs its contingent snapshot for
|
||||
these codes in addition to its accommodations, so hotels offered only in winter, which have no
|
||||
accommodation in MyE&P, have availability too. See [calendars.md](calendars.md).
|
||||
The Kalender-Codes of all visible hotel records: the codes whose availability TYPO3 shows (iCal
|
||||
feeds, availability calendar, price calendar). MyE&P syncs its contingent snapshot for these codes
|
||||
in addition to its accommodations, so hotels offered only in winter, which have no accommodation in
|
||||
MyE&P, have availability too. See [calendars.md](calendars.md).
|
||||
|
||||
- Only products and hotels that are not hidden or deleted; hotels without a code are left out.
|
||||
- One entry per code; `name` of the record whose import code it is, else of the first record.
|
||||
- `products`: visible products with "Kalender anzeigen" that link a record with the code under
|
||||
Unterkünfte.
|
||||
- Sorted by code; products by uid. Names have line breaks collapsed.
|
||||
- `season`: `"s"` (summer), `"w"` (winter) or `null`.
|
||||
|
||||
@@ -78,9 +89,8 @@ accommodation in MyE&P, have availability too. See [calendars.md](calendars.md).
|
||||
]
|
||||
```
|
||||
|
||||
Every code in this list should be a **BusPro calendar code**. A group house's content record
|
||||
(`…GRP`, `…SO`) set as a product's calendar hotel puts its CMS code in here, which bpn-connect does
|
||||
not know (see [calendars.md](calendars.md#the-calendar-hotel-field)).
|
||||
Every code in this list should be a **BusPro code** with a contingent (see
|
||||
[calendars.md](calendars.md#hotel-codes)).
|
||||
|
||||
## `GET /api/content/manifest` and `GET /api/content/records?type=<type>&uids=<uids>`
|
||||
|
||||
|
||||
Reference in new issue
Block a user