@v-office/website-sdk 2.38.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/cli.mjs +3 -3
  2. package/dist/{client-CE4V_ybW.mjs → client-C6r06QHZ.mjs} +599 -171
  3. package/dist/index.d.mts +133 -4
  4. package/dist/index.mjs +1 -1
  5. package/dist/instructions/CHANGELOG.md +2 -0
  6. package/dist/instructions/MIGRATION.md +2 -0
  7. package/dist/instructions/booking.md +1 -1
  8. package/dist/instructions/quote.md +33 -19
  9. package/dist/instructions/rentals.md +46 -6
  10. package/dist/instructions/search.md +25 -6
  11. package/dist/instructions/versions/3.0.0/CHANGELOG.md +62 -0
  12. package/dist/instructions/versions/3.0.0/MIGRATION.md +69 -0
  13. package/dist/instructions/versions/3.1.0/CHANGELOG.md +47 -0
  14. package/dist/instructions/versions/3.1.0/MIGRATION.md +32 -0
  15. package/dist/{operations-DMqLD3e2.mjs → operations-Bc3WxjV8.mjs} +79 -3
  16. package/dist/{rentals-BsHvdwQt.mjs → rentals-BP7dfcfg.mjs} +88 -25
  17. package/dist/{search-DqdRIJwF.mjs → search-BvgpkUPo.mjs} +22 -11
  18. package/dist/{to-rental-highlights-BE6TdXYa.mjs → to-rental-highlights-9AbqVIso.mjs} +68 -32
  19. package/dist/translations/v9/de-DE/core.json +7 -1
  20. package/dist/translations/v9/en-US/core.json +7 -1
  21. package/instructions/CHANGELOG.md +2 -0
  22. package/instructions/MIGRATION.md +2 -0
  23. package/instructions/booking.md +1 -1
  24. package/instructions/quote.md +33 -19
  25. package/instructions/rentals.md +46 -6
  26. package/instructions/search.md +25 -6
  27. package/instructions/versions/3.0.0/CHANGELOG.md +62 -0
  28. package/instructions/versions/3.0.0/MIGRATION.md +69 -0
  29. package/instructions/versions/3.0.0/release.json +3 -0
  30. package/instructions/versions/3.1.0/CHANGELOG.md +47 -0
  31. package/instructions/versions/3.1.0/MIGRATION.md +32 -0
  32. package/instructions/versions/3.1.0/release.json +3 -0
  33. package/package.json +5 -4
@@ -0,0 +1,62 @@
1
+ # Changelog: 3.0.0
2
+
3
+ This release reworks ERGO travel cancellation insurance on v9. The pre-contract is now created
4
+ after the stay booking and takes the policy holder from that booking, travelers are written to the
5
+ vOffice booking, and issued policies can be read and revoked. v10 does not change, and URV
6
+ insurance is booked as before; only the `createInsurancePreContract` call changes on every v9 site.
7
+
8
+ ## Added
9
+
10
+ - `live.insurance.readPolicy({ policyNumber })` returns an ERGO policy: `status` (`active` or
11
+ `revoked`), `revokedAt`, `documentUrl`, `label`, `travelPeriod` and `insuredPersons`.
12
+ - `live.insurance.revokePolicy({ policyNumber, booking })` revokes an ERGO policy. When ERGO
13
+ refuses, the call rejects with ERGO's reason and nothing is removed from the booking. There is
14
+ no revocation deadline in the SDK; ERGO decides.
15
+ - Both methods reject on v9 accounts that do not use ERGO insurance.
16
+ - `V9QuoteCreateInsurancePreContractInput`, `V9InsuranceReadPolicyInput`,
17
+ `V9InsuranceRevokePolicyInput` and `V9InsurancePolicy` are exported.
18
+
19
+ ## Changed
20
+
21
+ - **Breaking (v9):** `live.quote.createInsurancePreContract` takes `{ quote, booking }`, where
22
+ `booking` is the result of `live.booking.book`. The `customerInformation` input is gone. The
23
+ policy holder, address, email and mobile number come from the booking's customer. The destination
24
+ country is always Germany.
25
+ - `createInsurancePreContract` writes the selected travelers to the vOffice booking when the
26
+ booking has no guests yet. A failure there does not stop the insurance.
27
+ - Calling `createInsurancePreContract` again for the same booking and plan returns the existing
28
+ pre-contract with its documents instead of creating a second one. `bookInsurance` returns the
29
+ policy number of an insurance that is already booked instead of booking twice. A stored policy
30
+ only counts when ERGO still reports it as active; a revoked one is ignored, and when ERGO cannot
31
+ be asked the call rejects instead of booking blindly. A booking that already has an active policy for another plan rejects a plan change
32
+ (in `createInsurancePreContract` and `bookInsurance`); revoke that policy first.
33
+ - `createInsurancePreContract` returns all of ERGO's pre-contract documents (product information
34
+ sheet, insurance terms, data processing notice, e-commerce customer information) in
35
+ `preContract.documents`, with labels in the quote's locale. It rejects when ERGO's documents
36
+ cannot be read, because they are the § 7 VVG information the guest has to see.
37
+ - The booked policy document of `bookInsurance` and the SEPA debit option of the quote carry labels
38
+ in the quote's locale (they used to be English).
39
+ - `readPolicy` and `revokePolicy` list the insured travelers of ERGO's answer; a revoke answer
40
+ without travelers returns an empty list.
41
+ - The pre-contract needs the booking customer's birthdate and mobile number, and a customer
42
+ country that ERGO covers (DE, AT, BE, DK, FR, IT, LU, NL, PL, CZ). Otherwise the call rejects with
43
+ a message that names what is missing.
44
+ - `selectInsurance` rejects ERGO selections in which a traveler has no `birthday`.
45
+ - ERGO plans: one card per product, the one without excess preferred; when that leaves a single
46
+ card, the variant with excess is offered as a second card. Cards are ordered without excess
47
+ first, then by premium.
48
+ - More than nine travelers get no ERGO plans, only the no-insurance option.
49
+ - When the Hub settings or the plan search of ERGO or URV fail, the quote reports insurance as not
50
+ offered instead of failing.
51
+ - ERGO refusals now reject with ERGO's own error text.
52
+ - If saving the booked policy in the Hub fails after ERGO accepted the booking,
53
+ `bookInsurance` still returns `booked` with the policy number.
54
+ - Salutations are sent to ERGO as `H` (Herr, Mr., Mr) or `D` (Frau, Mrs., Ms.), and as empty for
55
+ everything else, such as Divers or Keine Angabe. They used to be sent as `F` or as raw text.
56
+
57
+ ## Fixed
58
+
59
+ - A v9 booking with a selected ERGO plan lists the SEPA debit option in
60
+ `insurancePaymentOptions` before the pre-contract exists; it used to omit it.
61
+
62
+ - ERGO policy holders were taken from the first traveler instead of the booking customer.
@@ -0,0 +1,69 @@
1
+ # Migration: 2.38.0 to 3.0.0
2
+
3
+ Every v9 caller of `createInsurancePreContract` has to update the call, because it now takes
4
+ `{ quote, booking }` (see section 2). On accounts that use URV insurance you can drop the call
5
+ instead: it always returns `not_required` there. Only the URV booking behavior stays the same: URV
6
+ is booked inside `live.booking.book`, and `bookInsurance` resolves as not required. v10 does not
7
+ change.
8
+
9
+ ## 1. Upgrade
10
+
11
+ ```sh
12
+ pnpm add @v-office/website-sdk@3.0.0
13
+ ```
14
+
15
+ ## 2. Book the stay first on v9 with ERGO
16
+
17
+ The pre-contract needs the booking, so `live.booking.book` now comes before it. Replace
18
+
19
+ ```ts
20
+ quote = await sdk.live.quote.createInsurancePreContract({ quote, customerInformation });
21
+ const booking = await sdk.live.booking.book({ quote, contact, relativeRedirectUrl });
22
+ ```
23
+
24
+ with
25
+
26
+ ```ts
27
+ const booking = await sdk.live.booking.book({ quote, contact, relativeRedirectUrl });
28
+ quote = await sdk.live.quote.createInsurancePreContract({ quote, booking });
29
+ quote = await sdk.live.quote.selectInsurancePayment({ quote, paymentInformation });
30
+ const insurance = await sdk.live.quote.bookInsurance({ quote, booking });
31
+ ```
32
+
33
+ The booking result already lists the SEPA debit option in `booking.insurancePaymentOptions` when an
34
+ ERGO plan is selected, so offer it from there.
35
+
36
+ Pass the live `booking` object that `book` returned; do not serialize it. Show the pre-contract
37
+ documents (`quote.insurance.preContract.documents`) to the guest before `bookInsurance`.
38
+
39
+ `createInsurancePreContract` no longer asks for `customerInformation`. The booking's customer is
40
+ the policy holder, so the booking form has to collect what ERGO needs:
41
+
42
+ - `contact.birthdate` and a phone number in `contact.contactDetails.phone`, which is sent as the
43
+ mobile number. Without them the call rejects.
44
+ - A country in `contact.address.countryCode` that ERGO covers: DE, AT, BE, DK, FR, IT, LU, NL, PL
45
+ or CZ.
46
+
47
+ Every traveler in `selectInsurance` needs a `birthday`. Offer ERGO only for up to nine travelers;
48
+ with more, the quote contains only the no-insurance option.
49
+
50
+ If the guest returns after a failed attempt, call `createInsurancePreContract` again. It reuses the
51
+ existing pre-contract instead of creating another one.
52
+
53
+ ## 3. Read and revoke policies
54
+
55
+ ```ts
56
+ const policy = await sdk.live.insurance.readPolicy({ policyNumber });
57
+ const revoked = await sdk.live.insurance.revokePolicy({ policyNumber, booking });
58
+ ```
59
+
60
+ `revokePolicy` rejects with ERGO's reason when ERGO refuses, for example after the revocation
61
+ period. Both methods reject on accounts that do not use ERGO insurance, so call them only after
62
+ `bookInsurance` returned `booked`.
63
+
64
+ ## What stays the same
65
+
66
+ - v10: nothing changes.
67
+ - v9 with URV insurance: booking behavior does not change; only the `createInsurancePreContract`
68
+ call has to change or go.
69
+ - `selectInsurance`, `selectInsurancePayment` and `bookInsurance` keep their inputs and outputs.
@@ -0,0 +1,47 @@
1
+ # Changelog: 3.1.0
2
+
3
+ What an English site needed from the SDK to stop reading German words: amenities, distances,
4
+ highlights and room features state their keys and values (facts), search prices come as numbers,
5
+ and v10 discounts state their type. Image alt texts and room descriptions missing in the
6
+ requested language come back in German and are marked, like descriptions since 2.38.0, and the
7
+ SDK translates the v10 system cancellation policies and the be-on! Hub's no-name placeholder.
8
+
9
+ ## Added
10
+
11
+ - `total` on priced search items and alternative periods, and `originalTotal` on their
12
+ `discount`, on v9 and v10: `{ amount, currency }`, with `amount` in the currency's minor unit
13
+ (`103339` = €1,033.39). They state the same totals as `formattedTotal` and
14
+ `discount.formattedOriginalTotal`. v9 states them in EUR, as it formats them.
15
+ - v10: `type` on each `discount.applied` entry (`EARLY_BIRD`, `LAST_MINUTE`, …). It is the same
16
+ in every locale while `label` is translated ("Frühbucher-Rabatt", "Early booking discount").
17
+ v9 states no type: its `label` is the discount name entered in the PMS.
18
+ - The type `SearchMoney`.
19
+ - `altFallback` on images and `descriptionFallback` on rooms: the language their text is in when
20
+ it is not the requested one (`"de-DE"`), omitted otherwise. Mark the text as German
21
+ (`lang="de"`) when it is set.
22
+ - Facts: every rendered list states its items with their keys and values, the same in every
23
+ locale: `facts` next to `items` in attribute subcategories and vicinity groups,
24
+ `highlightFacts` next to `highlights` (rentals, their property, search items), and
25
+ `attributeFacts` and `typeKey` on rooms. A fact is `{ key, text, value? }`: the attribute key,
26
+ the rendered item, and the raw value (`true`, a count, meters, m², an option key). `facts[i]` is
27
+ `items[i]`. The type `RentalFact`.
28
+ v9 states v10's key where v10 has the attribute (`loc_lake` → `locLake`) and features as
29
+ `true`, so a site curates one list for both backends. See "Facts" in `rentals.md`.
30
+
31
+ ## Changed
32
+
33
+ - v10: a system cancellation policy (`SYSTEM_FIRM_14`, `SYSTEM_STRICT_30`, `SYSTEM_STRICT_60`)
34
+ is labelled by the SDK's translation of its type ("Strict (30 days)" on English pages); the
35
+ PMS sent its German name ("Streng (30 Tage)") in every locale. Custom and alternative policies
36
+ keep the agency's label.
37
+ - v9: the be-on! Hub's placeholder for a reviewer without a name ("Gastname nicht genannt") is
38
+ read as no name and becomes `reviews.item.guest` ("Guest" / "Gast").
39
+ - The instructions list the texts that stay in the PMS's language because an agency enters them
40
+ there (`quote.md`, "Texts in the PMS's language").
41
+ - v10: an image (rental, property and search) or a room without a text in the requested locale
42
+ takes its German text and is marked. Before, the text was omitted: English pages had no alt
43
+ text on most images (dev-28: 937 of 951) and no room descriptions.
44
+ - v9: an image title kept per language in the PMS falls back to German and is marked. A caption
45
+ the be-on! Hub sends as plain text is compared with the German one in the same extra query
46
+ `getRentals` already makes for descriptions on non-German pages, which now also reads image
47
+ captions. German pages are unchanged and make no extra query.
@@ -0,0 +1,32 @@
1
+ # Migration: 3.0.0 to 3.1.0
2
+
3
+ No changes required.
4
+
5
+ ## 1. Upgrade
6
+
7
+ ```sh
8
+ pnpm add @v-office/website-sdk@3.1.0
9
+ ```
10
+
11
+ ## 2. Optional: stop parsing prices and discount names
12
+
13
+ - A site that reads a number out of `formattedTotal` or `discount.formattedOriginalTotal`
14
+ (for a strikethrough, a saving or a sort) can read `total.amount` and
15
+ `discount.originalTotal.amount` instead. The formatted strings use the locale's separators
16
+ ("1.033,39 €", "€1,033.39"), so parsing them breaks between languages.
17
+ - A v10 site that filters or groups campaigns by `discount.applied[].label` can use
18
+ `discount.applied[].type`: the label is translated, the type is not.
19
+
20
+ ## 3. English pages: German alt texts and room descriptions
21
+
22
+ An English page now gets the German alt text of an image and the German description of a room
23
+ where no English exists (v10: before, none). Mark them as German where `altFallback` or
24
+ `descriptionFallback` is set, for example `<img lang="de" …>`.
25
+
26
+ ## 4. Optional: curate by key, not by text
27
+
28
+ A site that recognizes amenities, distances, highlights or room features by their text
29
+ („Entfernung zum Strand", „WLAN") loses them on an English page. Read the facts instead:
30
+ `facts` in attribute subcategories and vicinity groups, `highlightFacts`, and `attributeFacts` /
31
+ `typeKey` on rooms. Match on `key`, read numbers from `value` (distances in meters), and show
32
+ `text`.
@@ -6799,7 +6799,7 @@ const documents = {
6799
6799
  }
6800
6800
  }]
6801
6801
  },
6802
- "\n query CoreSDK_RentalTexts(\n $language: String\n $voffice_ids: [Int!]\n $textAttributes: [String!]! = []\n ) {\n all(language: $language, voffice_ids: $voffice_ids) {\n voffice_id\n data(attributes: $textAttributes)\n voffice_facility {\n id\n data(attributes: $textAttributes)\n }\n }\n }\n": {
6802
+ "\n query CoreSDK_RentalTexts(\n $language: String\n $voffice_ids: [Int!]\n $textAttributes: [String!]! = []\n ) {\n all(language: $language, voffice_ids: $voffice_ids) {\n voffice_id\n data(attributes: $textAttributes)\n voffice_facility {\n id\n data(attributes: $textAttributes)\n }\n voffice_images {\n path\n title\n description\n }\n voffice_room_images {\n path\n title\n description\n }\n }\n }\n": {
6803
6803
  kind: "Document",
6804
6804
  definitions: [{
6805
6805
  kind: "OperationDefinition",
@@ -6982,6 +6982,72 @@ const documents = {
6982
6982
  }]
6983
6983
  }]
6984
6984
  }
6985
+ },
6986
+ {
6987
+ kind: "Field",
6988
+ name: {
6989
+ kind: "Name",
6990
+ value: "voffice_images"
6991
+ },
6992
+ selectionSet: {
6993
+ kind: "SelectionSet",
6994
+ selections: [
6995
+ {
6996
+ kind: "Field",
6997
+ name: {
6998
+ kind: "Name",
6999
+ value: "path"
7000
+ }
7001
+ },
7002
+ {
7003
+ kind: "Field",
7004
+ name: {
7005
+ kind: "Name",
7006
+ value: "title"
7007
+ }
7008
+ },
7009
+ {
7010
+ kind: "Field",
7011
+ name: {
7012
+ kind: "Name",
7013
+ value: "description"
7014
+ }
7015
+ }
7016
+ ]
7017
+ }
7018
+ },
7019
+ {
7020
+ kind: "Field",
7021
+ name: {
7022
+ kind: "Name",
7023
+ value: "voffice_room_images"
7024
+ },
7025
+ selectionSet: {
7026
+ kind: "SelectionSet",
7027
+ selections: [
7028
+ {
7029
+ kind: "Field",
7030
+ name: {
7031
+ kind: "Name",
7032
+ value: "path"
7033
+ }
7034
+ },
7035
+ {
7036
+ kind: "Field",
7037
+ name: {
7038
+ kind: "Name",
7039
+ value: "title"
7040
+ }
7041
+ },
7042
+ {
7043
+ kind: "Field",
7044
+ name: {
7045
+ kind: "Name",
7046
+ value: "description"
7047
+ }
7048
+ }
7049
+ ]
7050
+ }
6985
7051
  }
6986
7052
  ]
6987
7053
  }
@@ -8364,8 +8430,8 @@ graphql(`
8364
8430
  }
8365
8431
  }
8366
8432
  `);
8367
- /** Only the texts of rentals and their facility, in one language: what the description
8368
- * fallback marker compares against, and nothing else. */
8433
+ /** Only the texts of rentals, their images and their facility, in one language: what the
8434
+ * fallback markers compare against, and nothing else. */
8369
8435
  const rentalTextsQuery = graphql(`
8370
8436
  query CoreSDK_RentalTexts(
8371
8437
  $language: String
@@ -8379,6 +8445,16 @@ const rentalTextsQuery = graphql(`
8379
8445
  id
8380
8446
  data(attributes: $textAttributes)
8381
8447
  }
8448
+ voffice_images {
8449
+ path
8450
+ title
8451
+ description
8452
+ }
8453
+ voffice_room_images {
8454
+ path
8455
+ title
8456
+ description
8457
+ }
8382
8458
  }
8383
8459
  }
8384
8460
  `);
@@ -1,7 +1,7 @@
1
- import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-CE4V_ybW.mjs";
2
- import { S as parseVofficeFeedbackData, _ as VofficeUnitDataPropertyCategoryValues, a as hubFiltersQuery, c as rentalIdsQuery, d as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, f as rentalsAllFeedbacksQuery, g as VofficeUnitDataPropertyCategoryLabelKeys, h as VofficeUnitDataFieldSchemas, i as facilityTextsQuery, p as rentalsAllWithoutFeedbacksQuery, s as rentalFacilitiesForObjectGroupRelationQuery, u as rentalTextsQuery, v as VofficeUnitDataPropertyMetadata, w as parseVofficeUnitData, x as parseVofficeFacilityData } from "./operations-DMqLD3e2.mjs";
3
- import { a as toFacilityImages, c as toCapacity, i as toLocation, l as toAddress, o as toImages, r as renderVofficePropertyAttribute, t as toRentalHighlights, u as toLocalizedString } from "./to-rental-highlights-BE6TdXYa.mjs";
4
- import { CoreSDKError, makeTranslate, renderResolvedCustomAttribute, toCustomAttributeList, toResolvedCustomAttributeCategoryTranslationKey, toReviewClassification } from "@v-office/sdk-core";
1
+ import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-C6r06QHZ.mjs";
2
+ import { S as parseVofficeFeedbackData, _ as VofficeUnitDataPropertyCategoryValues, a as hubFiltersQuery, c as rentalIdsQuery, d as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, f as rentalsAllFeedbacksQuery, g as VofficeUnitDataPropertyCategoryLabelKeys, h as VofficeUnitDataFieldSchemas, i as facilityTextsQuery, p as rentalsAllWithoutFeedbacksQuery, s as rentalFacilitiesForObjectGroupRelationQuery, u as rentalTextsQuery, v as VofficeUnitDataPropertyMetadata, w as parseVofficeUnitData, x as parseVofficeFacilityData } from "./operations-Bc3WxjV8.mjs";
3
+ import { a as toLocation, d as toLocalizedString, l as toCapacity, n as renderVofficePropertyAttribute, o as toFacilityImages, r as toV9Fact, s as toImages, t as toRentalHighlights, u as toAddress } from "./to-rental-highlights-9AbqVIso.mjs";
4
+ import { CoreSDKError, makeTranslate, pushFact, renderResolvedCustomAttribute, toCustomAttributeFact, toCustomAttributeList, toFact, toResolvedCustomAttributeCategoryTranslationKey, toReviewClassification } from "@v-office/sdk-core";
5
5
  import { Effect } from "effect";
6
6
  //#region src/legacy-v9/parser/rentals/to-description.ts
7
7
  const toDescription = (data, locale) => {
@@ -27,25 +27,35 @@ const toDescription = (data, locale) => {
27
27
  //#endregion
28
28
  //#region src/legacy-v9/parser/rentals/to-property-attributes.ts
29
29
  const toPropertyAttributes = ({ attributes, locale, translations }) => Effect.gen(function* () {
30
- const items = [];
30
+ const group = {
31
+ items: [],
32
+ facts: []
33
+ };
31
34
  const translate = makeTranslate(translations, locale);
32
35
  for (const key of V9_FACILITY_ATTRIBUTE_KEYS) {
36
+ const value = attributes.known[key];
33
37
  const item = yield* renderVofficePropertyAttribute({
34
38
  key,
35
39
  metadata: VofficeUnitDataPropertyMetadata[key],
36
40
  locale,
37
41
  translate,
38
- value: attributes.known[key]
42
+ value
39
43
  });
40
- if (item != null) items.push(item);
44
+ if (item != null) pushFact(group, toV9Fact({
45
+ key,
46
+ metadata: VofficeUnitDataPropertyMetadata[key],
47
+ text: item,
48
+ value
49
+ }));
41
50
  }
42
- if (items.length === 0) return [];
51
+ if (group.items.length === 0) return [];
43
52
  const label = yield* translate(VofficeUnitDataPropertyCategoryLabelKeys.GENERAL, "GENERAL");
44
53
  return [{
45
54
  label,
46
55
  subCategories: [{
47
56
  label,
48
- items
57
+ items: group.items,
58
+ facts: group.facts
49
59
  }]
50
60
  }];
51
61
  });
@@ -78,7 +88,12 @@ const toPropertyHighlights = ({ attributes, highlightPrioritization, highlightSo
78
88
  });
79
89
  if (highlight != null && !seenHighlights.has(highlight)) {
80
90
  seenHighlights.add(highlight);
81
- highlights.push(highlight);
91
+ highlights.push(toV9Fact({
92
+ key,
93
+ metadata: VofficeUnitDataPropertyMetadata[key],
94
+ text: highlight,
95
+ value: attributes.known[key]
96
+ }));
82
97
  }
83
98
  continue;
84
99
  }
@@ -87,7 +102,11 @@ const toPropertyHighlights = ({ attributes, highlightPrioritization, highlightSo
87
102
  for (const highlight of toLineList(attributes.unknown[source.v9], locale)) {
88
103
  if (seenHighlights.has(highlight)) continue;
89
104
  seenHighlights.add(highlight);
90
- highlights.push(highlight);
105
+ highlights.push(toFact({
106
+ key,
107
+ text: highlight,
108
+ value: void 0
109
+ }));
91
110
  }
92
111
  }
93
112
  return highlights;
@@ -144,7 +163,10 @@ const toProperty = ({ facility, highlightPrioritization, highlightSources, local
144
163
  if (Object.keys(description).length > 0) property.description = description;
145
164
  if (images.length > 0) property.images = images;
146
165
  if (attributes.length > 0) property.attributes = attributes;
147
- if (highlights.length > 0) property.highlights = highlights;
166
+ if (highlights.length > 0) {
167
+ property.highlights = highlights.map((fact) => fact.text);
168
+ property.highlightFacts = highlights;
169
+ }
148
170
  return property;
149
171
  });
150
172
  //#endregion
@@ -218,18 +240,29 @@ const toRentalAttributes = ({ locale, translations, attributes, customAttributes
218
240
  subCategoriesByKey.set(categoryMetadata.key, subCategory);
219
241
  category.subCategories.push(subCategory);
220
242
  }
221
- subCategory.items.push(attribute);
243
+ pushFact(subCategory, toV9Fact({
244
+ key,
245
+ metadata,
246
+ text: attribute,
247
+ value
248
+ }));
222
249
  }
223
250
  for (const attribute of toCustomAttributeList(customAttributes)) {
224
251
  const binding = attribute.v9;
225
252
  if (binding === void 0) continue;
253
+ const value = knownAttributes[binding] ?? attributes.unknown[binding];
226
254
  const rendered = renderResolvedCustomAttribute({
227
255
  attribute,
228
256
  locale,
229
- value: knownAttributes[binding] ?? attributes.unknown[binding]
257
+ value
230
258
  });
231
259
  if (rendered == null) continue;
232
- (yield* getCustomAttributeSubCategory(attribute.category)).items.push(rendered);
260
+ const subCategory = yield* getCustomAttributeSubCategory(attribute.category);
261
+ pushFact(subCategory, toCustomAttributeFact({
262
+ attribute,
263
+ text: rendered,
264
+ value
265
+ }));
233
266
  }
234
267
  return result;
235
268
  });
@@ -248,7 +281,10 @@ const LOCATION_METADATA_ENTRIES = Object.entries(VofficeUnitDataPropertyMetadata
248
281
  index
249
282
  })).filter(({ metadata }) => metadata.category.key === "LOCATION").sort((left, right) => left.index - right.index);
250
283
  const toRentalVicinity = ({ locale, translations, attributes }) => Effect.gen(function* () {
251
- const items = [];
284
+ const group = {
285
+ items: [],
286
+ facts: []
287
+ };
252
288
  const knownAttributes = attributes.known;
253
289
  const translate = makeTranslate(translations, locale);
254
290
  for (const { key, metadata } of LOCATION_METADATA_ENTRIES) {
@@ -260,12 +296,18 @@ const toRentalVicinity = ({ locale, translations, attributes }) => Effect.gen(fu
260
296
  translate,
261
297
  value
262
298
  });
263
- if (item != null) items.push(item);
299
+ if (item != null) pushFact(group, toV9Fact({
300
+ key,
301
+ metadata,
302
+ text: item,
303
+ value
304
+ }));
264
305
  }
265
- if (items.length === 0) return [];
306
+ if (group.items.length === 0) return [];
266
307
  return [{
267
308
  label: yield* translate(GENERAL_CATEGORY.labelKey, GENERAL_CATEGORY.key),
268
- items
309
+ items: group.items,
310
+ facts: group.facts
269
311
  }];
270
312
  });
271
313
  //#endregion
@@ -280,6 +322,13 @@ const toTravelDate = (locale, value) => {
280
322
  }).format(new Date(value));
281
323
  };
282
324
  const toText = (value) => typeof value === "string" && value.trim().length > 0 ? value : void 0;
325
+ /** The be-on! Hub's placeholder for a guest who gave no name: German on every page, so it is
326
+ * read as no name and becomes `reviews.item.guest` in the page's language. */
327
+ const HUB_NO_NAME_PLACEHOLDER = "gastname nicht genannt";
328
+ const toForename = (value) => {
329
+ const forename = toText(value)?.trim();
330
+ return forename === void 0 || forename.toLowerCase() === HUB_NO_NAME_PLACEHOLDER ? void 0 : forename;
331
+ };
283
332
  const toReviewText = ({ text, textCriteria }) => {
284
333
  if (textCriteria.length === 0) return text;
285
334
  return [...text === void 0 ? [] : [text], ...textCriteria.map((criterion) => `${criterion.label}\n${criterion.text}`)].join("\n\n");
@@ -325,7 +374,7 @@ const toReviews = ({ locale, translations, rental, options }) => Effect.gen(func
325
374
  }));
326
375
  return [{
327
376
  rating,
328
- forename: toText(forename)?.trim(),
377
+ forename: toForename(forename),
329
378
  city: options.showAuthorCity ? toText(city)?.trim() : void 0,
330
379
  text: reviewText,
331
380
  highlighted: highlighted === true,
@@ -408,8 +457,15 @@ const toRooms = ({ locale, translations, roomDetails }) => Effect.gen(function*
408
457
  if (!isRecord$1(room)) continue;
409
458
  const roomType = nonEmptyString(room.type);
410
459
  if (roomType == null) continue;
411
- const attributes = [];
412
- for (const [key, labelKey] of Object.entries(ROOM_ATTRIBUTE_LABEL_KEYS)) if (room[key] === true) attributes.push(yield* translate(labelKey, key));
460
+ const attributes = {
461
+ items: [],
462
+ facts: []
463
+ };
464
+ for (const [key, labelKey] of Object.entries(ROOM_ATTRIBUTE_LABEL_KEYS)) if (room[key] === true) pushFact(attributes, toFact({
465
+ key,
466
+ text: yield* translate(labelKey, key),
467
+ value: true
468
+ }));
413
469
  const beds = [];
414
470
  for (const bed of Array.isArray(room.beds) ? room.beds : []) {
415
471
  if (!isRecord$1(bed)) continue;
@@ -423,8 +479,14 @@ const toRooms = ({ locale, translations, roomDetails }) => Effect.gen(function*
423
479
  if (bedAttributes.length > 0) bedValue.attributes = bedAttributes;
424
480
  for (let index = 0; index < positiveInteger(bed.amount); index++) beds.push(bedValue);
425
481
  }
426
- const roomValue = { type: yield* translate(`${ROOM_TYPE_KEY_PREFIX}.${roomType}`, roomType) };
427
- if (attributes.length > 0) roomValue.attributes = attributes;
482
+ const roomValue = {
483
+ type: yield* translate(`${ROOM_TYPE_KEY_PREFIX}.${roomType}`, roomType),
484
+ typeKey: roomType
485
+ };
486
+ if (attributes.items.length > 0) {
487
+ roomValue.attributes = attributes.items;
488
+ roomValue.attributeFacts = attributes.facts;
489
+ }
428
490
  if (beds.length > 0) roomValue.beds = beds;
429
491
  result.push(roomValue);
430
492
  }
@@ -487,7 +549,8 @@ const toRentalRentalsOutput = ({ rental, locale, translations, imageProxyBaseUrl
487
549
  if (images.length > 0) item.images = images;
488
550
  if (attributes != null) item.attributes = attributes;
489
551
  if (vicinity != null) item.vicinity = vicinity;
490
- if (highlights != null) item.highlights = highlights;
552
+ item.highlights = highlights.map((fact) => fact.text);
553
+ item.highlightFacts = highlights;
491
554
  if (rooms.length > 0) item.rooms = rooms;
492
555
  if (rental.voffice_facility != null) item.property = yield* toProperty({
493
556
  facility: rental.voffice_facility,
@@ -1,6 +1,6 @@
1
- import { a as makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-CE4V_ybW.mjs";
2
- import { n as mapSearchQuery, r as searchQuery, w as parseVofficeUnitData } from "./operations-DMqLD3e2.mjs";
3
- import { c as toCapacity, i as toLocation, l as toAddress, n as toV9RentalHighlightKey, o as toImages, s as CAPACITY_DATA_ATTRIBUTES, t as toRentalHighlights } from "./to-rental-highlights-BE6TdXYa.mjs";
1
+ import { a as makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-C6r06QHZ.mjs";
2
+ import { n as mapSearchQuery, r as searchQuery, w as parseVofficeUnitData } from "./operations-Bc3WxjV8.mjs";
3
+ import { a as toLocation, c as CAPACITY_DATA_ATTRIBUTES, i as toV9RentalHighlightKey, l as toCapacity, s as toImages, t as toRentalHighlights, u as toAddress } from "./to-rental-highlights-9AbqVIso.mjs";
4
4
  import { CoreSDKError, STABLE_SEARCH_INPUTS, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, resolveExpandedCompositions, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
5
5
  import { Effect } from "effect";
6
6
  //#region src/legacy-v9/parser/search/input/search-input-error.ts
@@ -256,21 +256,31 @@ const resolveExactMatch = (additionalData) => {
256
256
  const DEFAULT_V9_SEARCH_CURRENCY = "EUR";
257
257
  const toSearchPriceFields = ({ locale, calc }) => {
258
258
  if (calc?.total == null) return {};
259
- const formattedTotal = toFormattedSearchPrice({
260
- amount: calc.total,
261
- currency: DEFAULT_V9_SEARCH_CURRENCY,
262
- locale
263
- });
264
- if (calc.oTotal == null || calc.oTotal <= calc.total) return { formattedTotal };
259
+ const totalFields = {
260
+ formattedTotal: toFormattedSearchPrice({
261
+ amount: calc.total,
262
+ currency: DEFAULT_V9_SEARCH_CURRENCY,
263
+ locale
264
+ }),
265
+ total: {
266
+ amount: calc.total,
267
+ currency: DEFAULT_V9_SEARCH_CURRENCY
268
+ }
269
+ };
270
+ if (calc.oTotal == null || calc.oTotal <= calc.total) return totalFields;
265
271
  const label = calc.discountName?.trim();
266
272
  return {
267
- formattedTotal,
273
+ ...totalFields,
268
274
  discount: {
269
275
  formattedOriginalTotal: toFormattedSearchPrice({
270
276
  amount: calc.oTotal,
271
277
  currency: DEFAULT_V9_SEARCH_CURRENCY,
272
278
  locale
273
279
  }),
280
+ originalTotal: {
281
+ amount: calc.oTotal,
282
+ currency: DEFAULT_V9_SEARCH_CURRENCY
283
+ },
274
284
  applied: label == null || label.length === 0 ? [] : [{
275
285
  label,
276
286
  formattedAmount: toFormattedSearchPrice({
@@ -304,7 +314,8 @@ const toSearchOutputItem = ({ locale, imageProxyBaseUrl, rentalHighlightPrioriti
304
314
  customAttributes,
305
315
  attributes: data
306
316
  });
307
- if (highlights != null) item.highlights = highlights;
317
+ item.highlights = highlights.map((fact) => fact.text);
318
+ item.highlightFacts = highlights;
308
319
  if (exactMatchCalc != null) Object.assign(item, toSearchPriceFields({
309
320
  locale,
310
321
  calc: exactMatchCalc