@v-office/website-sdk 2.15.0 → 2.16.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.
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as createWebsiteSDK, zt as defineWebsiteSDKOptions } from "./client-C0pqpk-N.mjs";
2
+ import { t as createWebsiteSDK, zt as defineWebsiteSDKOptions } from "./client-CaZZGJAW.mjs";
3
3
  import { SearchSearchSortSchema, defineCustomAttributesFromUnknown } from "@v-office/sdk-core";
4
4
  import { Console, Effect, FileSystem, Layer, Option, Path, Schema, Stdio, Terminal } from "effect";
5
5
  import { Command, Flag } from "effect/unstable/cli";
@@ -16,7 +16,7 @@ var CLICheckFailed = class extends Error {
16
16
  const toCLIError = (message, cause) => cause instanceof Error ? new CLICheckFailed(`${message}: ${cause.message}`, { cause }) : new CLICheckFailed(message, { cause });
17
17
  //#endregion
18
18
  //#region package.json
19
- var version = "2.15.0";
19
+ var version = "2.16.0";
20
20
  //#endregion
21
21
  //#region src/cli/output.ts
22
22
  const toJson = (value) => Effect.try({
@@ -5202,7 +5202,7 @@ const bookV9Insurance = ({ quote, bookingNumber, guestToken, v1Client }) => Effe
5202
5202
  //#region src/legacy-v9/live/quote.ts
5203
5203
  const loadQuoteRuntime = Effect.tryPromise({
5204
5204
  try: async () => {
5205
- return { toGuestQuote: (await import("./quote-Qy_affum.mjs")).toGuestQuote };
5205
+ return { toGuestQuote: (await import("./quote-C-Bs3XTE.mjs")).toGuestQuote };
5206
5206
  },
5207
5207
  catch: (cause) => new CoreSDKError({
5208
5208
  source: "v10",
@@ -5477,7 +5477,7 @@ const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
5477
5477
  return page;
5478
5478
  });
5479
5479
  const loadV9SearchRuntime = Effect.tryPromise({
5480
- try: () => import("./search-X9spQmG5.mjs"),
5480
+ try: () => import("./search-Dqiou4mc.mjs"),
5481
5481
  catch: (cause) => new CoreSDKError({
5482
5482
  source: "v10",
5483
5483
  operation: "v9.search.runtime",
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as quoteEffect, B as OnOfficeUnitSchema, C as DocumentResourceSchema, Ct as clearAdditionalServicesEffect, D as DocumentTypeSchema, Dt as getRentalsEffect, E as DocumentSummarySchema, Et as getInitialAvailabilityEffect, F as ErgoPolicyNumberRequestSchema, Ft as selectInsurancePaymentEffect, G as QuotePricesResponseSchema, H as PaymentScheduleSchema, I as ErgoReadPreContractRequestSchema, It as submitContactEffect, J as RawObjectResponseSchema, K as QuoteSchema, L as ErgoTripAndCustomerRequestSchema, Lt as submitPaymentOption, M as ErgoCreatePreContractRequestSchema, Mt as searchEffect, N as ErgoPersonSchema, Nt as selectCancellationPolicyEffect, O as ErgoAddressSchema, Ot as getStartDateSelectedAvailabilityEffect, P as ErgoPlanSearchRequestSchema, Pt as selectInsuranceEffect, Q as SearchPropertiesResponseSchema, R as FacilityListResponseSchema, Rt as submitPaymentOptionEffect, S as DocumentResourceResponseSchema, St as bookInsuranceEffect, T as DocumentStatusUpdateRequestSchema, Tt as getFiltersEffect, U as QuoteLineSchema, V as PaymentScheduleItemSchema, W as QuotePricesPayloadSchema, X as RegionListResponseSchema, Y as RawVofficeObjectSchema, Z as RoomImageSchema, _ as CalendarDaySchema, _t as V1_OPERATIONS, at as TileCollectionResponseSchema, b as CustomerUnitSummarySchema, bt as addAdditionalServiceEffect, c as V0OpenApiClient, ct as TravelInsuranceBookingSchema, d as makeV0OpenApiClientLive, dt as UnitListItemSchema, et as ServiceImageSchema, f as V1OpenApiClient, ft as UnitListResponseSchema, g as ApiEnvelopeBaseSchema, gt as V1_BASE_URL, h as makeV1OpenApiClientLive, ht as UnitServicePriceSchema, it as SetupResponseSchema, j as ErgoCommonFieldsSchema, jt as removeAdditionalServiceEffect, k as ErgoBankSchema, kt as getTermsAndPrivacyPolicyEffect, l as V0OpenApiClientError, lt as TravelInsuranceBookingStoreRequestSchema, m as makeV1OpenApiClientFetchLive, mt as UnitResponseSchema, nt as ServiceListResponseSchema, ot as TileSchema, p as V1OpenApiClientError, pt as UnitOfferSchema, q as QuoteServiceSchema, rt as SetupDataSchema, st as TileTagSchema, t as createWebsiteSDK, tt as ServiceLimitSchema, u as makeV0OpenApiClientFetchLive, ut as UnitIdsResponseSchema, v as CalendarResponseSchema, vt as VideoResponseSchema, w as DocumentStatusSchema, wt as createInsurancePreContractEffect, x as DocumentCollectionResponseSchema, xt as bookEffect, y as CurrentMemberResponseSchema, yt as decodeV1OperationResponse, z as OnOfficeUnitCollectionResponseSchema, zt as defineWebsiteSDKOptions } from "./client-C0pqpk-N.mjs";
1
+ import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as quoteEffect, B as OnOfficeUnitSchema, C as DocumentResourceSchema, Ct as clearAdditionalServicesEffect, D as DocumentTypeSchema, Dt as getRentalsEffect, E as DocumentSummarySchema, Et as getInitialAvailabilityEffect, F as ErgoPolicyNumberRequestSchema, Ft as selectInsurancePaymentEffect, G as QuotePricesResponseSchema, H as PaymentScheduleSchema, I as ErgoReadPreContractRequestSchema, It as submitContactEffect, J as RawObjectResponseSchema, K as QuoteSchema, L as ErgoTripAndCustomerRequestSchema, Lt as submitPaymentOption, M as ErgoCreatePreContractRequestSchema, Mt as searchEffect, N as ErgoPersonSchema, Nt as selectCancellationPolicyEffect, O as ErgoAddressSchema, Ot as getStartDateSelectedAvailabilityEffect, P as ErgoPlanSearchRequestSchema, Pt as selectInsuranceEffect, Q as SearchPropertiesResponseSchema, R as FacilityListResponseSchema, Rt as submitPaymentOptionEffect, S as DocumentResourceResponseSchema, St as bookInsuranceEffect, T as DocumentStatusUpdateRequestSchema, Tt as getFiltersEffect, U as QuoteLineSchema, V as PaymentScheduleItemSchema, W as QuotePricesPayloadSchema, X as RegionListResponseSchema, Y as RawVofficeObjectSchema, Z as RoomImageSchema, _ as CalendarDaySchema, _t as V1_OPERATIONS, at as TileCollectionResponseSchema, b as CustomerUnitSummarySchema, bt as addAdditionalServiceEffect, c as V0OpenApiClient, ct as TravelInsuranceBookingSchema, d as makeV0OpenApiClientLive, dt as UnitListItemSchema, et as ServiceImageSchema, f as V1OpenApiClient, ft as UnitListResponseSchema, g as ApiEnvelopeBaseSchema, gt as V1_BASE_URL, h as makeV1OpenApiClientLive, ht as UnitServicePriceSchema, it as SetupResponseSchema, j as ErgoCommonFieldsSchema, jt as removeAdditionalServiceEffect, k as ErgoBankSchema, kt as getTermsAndPrivacyPolicyEffect, l as V0OpenApiClientError, lt as TravelInsuranceBookingStoreRequestSchema, m as makeV1OpenApiClientFetchLive, mt as UnitResponseSchema, nt as ServiceListResponseSchema, ot as TileSchema, p as V1OpenApiClientError, pt as UnitOfferSchema, q as QuoteServiceSchema, rt as SetupDataSchema, st as TileTagSchema, t as createWebsiteSDK, tt as ServiceLimitSchema, u as makeV0OpenApiClientFetchLive, ut as UnitIdsResponseSchema, v as CalendarResponseSchema, vt as VideoResponseSchema, w as DocumentStatusSchema, wt as createInsurancePreContractEffect, x as DocumentCollectionResponseSchema, xt as bookEffect, y as CurrentMemberResponseSchema, yt as decodeV1OperationResponse, z as OnOfficeUnitCollectionResponseSchema, zt as defineWebsiteSDKOptions } from "./client-CaZZGJAW.mjs";
2
2
  import { AdditionalServiceLimitExceeded, CoreSDKError, CoreSDKError as CMSError, CustomAttributeCatalogSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, SearchSearchFieldOrderBySchema, SearchSearchFieldSortSchema, SearchSearchInputSchema, SearchSearchOutputSchema, SearchSearchPriceSortSchema, SearchSearchRandomSortSchema, SearchSearchRatingSortSchema, SearchSearchSortSchema, SearchSortDirectionSchema, UnknownAdditionalService, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
3
3
  //#region codegen/v9/heuristic-generation/public-api.ts
4
4
  const customDataAttribute = (name) => name;
@@ -4,6 +4,7 @@ This file is the versioned changelog index for the website SDK instructions.
4
4
 
5
5
  ## Versions
6
6
 
7
+ - `versions/2.16.0/CHANGELOG.md`: `@v-office/website-sdk` 2.16.0 release notes.
7
8
  - `versions/2.15.0/CHANGELOG.md`: `@v-office/website-sdk` 2.15.0 release notes.
8
9
  - `versions/2.14.0/CHANGELOG.md`: `@v-office/website-sdk` 2.14.0 release notes.
9
10
  - `versions/2.13.0/CHANGELOG.md`: `@v-office/website-sdk` 2.13.0 release notes.
@@ -4,6 +4,7 @@ This file is the versioned migration index for the website SDK instructions.
4
4
 
5
5
  ## Available Guides
6
6
 
7
+ - `versions/2.16.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.15.0 to 2.16.0.
7
8
  - `versions/2.15.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.14.0 to 2.15.0.
8
9
  - `versions/2.14.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.13.0 to 2.14.0.
9
10
  - `versions/2.13.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.12.0 to 2.13.0.
@@ -1,7 +1,7 @@
1
1
  # Website SDK Instructions
2
2
 
3
3
  These instructions describe the current source targeted for
4
- `@v-office/website-sdk` 2.15.0. Package versions remain unchanged until the release
4
+ `@v-office/website-sdk` 2.16.0. Package versions remain unchanged until the release
5
5
  workflow performs the coordinated core and website bumps.
6
6
 
7
7
  Use this directory as the consumer-facing reference for the package:
@@ -18,6 +18,9 @@ Use this directory as the consumer-facing reference for the package:
18
18
  - `document-structured-json.md`: `sdk.static.documents.getTermsAndPrivacyPolicy` and structured document JSON rendering rules.
19
19
  - `CHANGELOG.md`: versioned changelog index.
20
20
  - `MIGRATION.md`: versioned migration index.
21
+ - `versions/2.16.0/`: 2.16.0 machine-readable unavailable quote codes,
22
+ multi-rate configuration diagnostics, and the 2.15.0-to-2.16.0 migration
23
+ guide.
21
24
  - `versions/2.15.0/`: 2.15.0 v9 facility images in normalized
22
25
  `property.images`, responsive vOffice image URLs, and the 2.14.0-to-2.15.0
23
26
  migration guide.
@@ -93,5 +96,5 @@ website-sdk --backend v10 search --locale de-DE --query "adults=2" --sort '{"by"
93
96
  ```
94
97
 
95
98
  Config file examples in these docs use the flat `WebsiteSDKConfig` shape introduced
96
- in 2.0.0 and kept in 2.15.0. v10 config additionally requires `searchEndpoint` as
99
+ in 2.0.0 and kept in 2.16.0. v10 config additionally requires `searchEndpoint` as
97
100
  of 2.5.0.
@@ -133,10 +133,40 @@ Unavailable sample:
133
133
  ```json
134
134
  {
135
135
  "status": "unavailable",
136
+ "code": "NotBookable",
136
137
  "reason": "Rental is not available for the selected period."
137
138
  }
138
139
  ```
139
140
 
141
+ From 2.16.0, every unavailable quote includes a machine-readable `code`:
142
+
143
+ - `NotBookable`: the backend did not return a bookable price, including normal
144
+ availability failures. Legacy v9 unavailable quotes always use this code.
145
+ - `AmbiguousMultiRate`: v10 priced the stay, but more than one multi-rate
146
+ matched the default cancellation policy.
147
+ - `UnresolvableMultiRate`: v10 priced the stay, but no multi-rate could be
148
+ resolved for the default cancellation policy.
149
+
150
+ Use `code` for application behavior and logging. `reason` remains localized
151
+ display text and can be identical for inventory and multi-rate failures. The SDK
152
+ keeps ambiguous and unresolvable v10 quotes unavailable because booking requires
153
+ one exact multi-rate.
154
+
155
+ ```ts
156
+ const result = await sdk.live.quote.quote(input);
157
+
158
+ if (result.status === "unavailable") {
159
+ if (result.code === "AmbiguousMultiRate" || result.code === "UnresolvableMultiRate") {
160
+ reportQuoteConfigurationProblem(result.code);
161
+ }
162
+
163
+ showUnavailableMessage(result.reason);
164
+ }
165
+ ```
166
+
167
+ See `versions/2.16.0/CHANGELOG.md` and
168
+ `versions/2.16.0/MIGRATION.md` for release and upgrade details.
169
+
140
170
  Selection methods return `{ ok: true, quote }` or `{ ok: false, error }`. Possible selection errors include unknown additional service, additional service limit exceeded, unknown cancellation policy, unavailable cancellation policy quote, and unavailable quote combination.
141
171
 
142
172
  ## Booking-Card Breakdown
@@ -0,0 +1,44 @@
1
+ # Changelog: 2.16.0
2
+
3
+ This release makes unavailable quote results machine-readable. Applications can
4
+ now distinguish normal booking unavailability from v10 multi-rate
5
+ configuration failures without parsing localized text.
6
+
7
+ ## Added
8
+
9
+ - Every unavailable `GuestQuoteResult` contains a `code`:
10
+ - `NotBookable`
11
+ - `AmbiguousMultiRate`
12
+ - `UnresolvableMultiRate`
13
+ - The public quote output schema validates the new code.
14
+ - v10 reports `AmbiguousMultiRate` when a priced default cancellation policy
15
+ matches more than one multi-rate.
16
+ - v10 reports `UnresolvableMultiRate` when a priced default cancellation policy
17
+ cannot be mapped to a multi-rate.
18
+
19
+ ## Changed
20
+
21
+ - Legacy v9 unavailable quotes now include `code: "NotBookable"`.
22
+ - Normal v10 quote failures also use `code: "NotBookable"`.
23
+ - v10 retains the exact default-policy multi-rate resolution result instead of
24
+ reducing it to a boolean before creating the public unavailable result.
25
+
26
+ ## Unchanged
27
+
28
+ - `sdk.live.quote.quote(input)` and its input are unchanged.
29
+ - Available quote results remain `{ status: "available", quote }`.
30
+ - Unavailable results retain the localized `reason` field.
31
+ - Ambiguous or unresolvable v10 multi-rates remain unavailable. The SDK does not
32
+ select an arbitrary fallback because booking requires one exact multi-rate.
33
+ - Search and calendar availability behavior are unchanged.
34
+
35
+ ## Compatibility
36
+
37
+ - Consumers that only inspect `status` and display `reason` continue to work.
38
+ - TypeScript mocks, complete-object assertions, snapshots, and schema fixtures
39
+ for unavailable quotes must include `code`.
40
+ - Application behavior should branch on `code`, not localized `reason`.
41
+ - `AmbiguousMultiRate` and `UnresolvableMultiRate` indicate configuration or
42
+ mapping problems and should normally be reported to site operations.
43
+
44
+ See `versions/2.16.0/MIGRATION.md` and `../../quote.md`.
@@ -0,0 +1,109 @@
1
+ # Migration: 2.15.0 to 2.16.0
2
+
3
+ 2.16.0 adds a required machine-readable `code` to unavailable quote results.
4
+ The service call, quote input, available result, and localized unavailable
5
+ `reason` are unchanged.
6
+
7
+ ## 1. Handle the Unavailable Code
8
+
9
+ An unavailable result now has this shape:
10
+
11
+ ```ts
12
+ type UnavailableGuestQuoteResult = {
13
+ readonly status: "unavailable";
14
+ readonly code: "NotBookable" | "AmbiguousMultiRate" | "UnresolvableMultiRate";
15
+ readonly reason: string;
16
+ };
17
+ ```
18
+
19
+ Branch on `code` after narrowing by `status`:
20
+
21
+ ```ts
22
+ const result = await sdk.live.quote.quote(input);
23
+
24
+ if (result.status === "unavailable") {
25
+ switch (result.code) {
26
+ case "AmbiguousMultiRate":
27
+ case "UnresolvableMultiRate":
28
+ reportQuoteConfigurationProblem(result.code);
29
+ break;
30
+ case "NotBookable":
31
+ break;
32
+ }
33
+
34
+ showUnavailableMessage(result.reason);
35
+ }
36
+ ```
37
+
38
+ Keep displaying `reason` when appropriate, but do not parse or compare it to
39
+ select application behavior. It is localized and can still contain the same
40
+ text for different codes.
41
+
42
+ ## 2. Treat Multi-Rate Codes as Operational Failures
43
+
44
+ The v10-specific codes mean:
45
+
46
+ - `AmbiguousMultiRate`: the stay was priced, but more than one multi-rate
47
+ matched the default cancellation policy.
48
+ - `UnresolvableMultiRate`: the stay was priced, but no multi-rate could be
49
+ resolved for the default cancellation policy.
50
+
51
+ These are not proof that another guest booked the period. Keep the public quote
52
+ unavailable, show suitable fallback copy, and send the code to monitoring or
53
+ site operations so the rental configuration can be corrected.
54
+
55
+ Do not retry booking with an arbitrary multi-rate. The price alone does not
56
+ identify the exact multi-rate required by the booking request.
57
+
58
+ ## 3. Keep Normal Unavailability Handling
59
+
60
+ `NotBookable` represents ordinary unavailable quote results, including backend
61
+ responses without a bookable price:
62
+
63
+ ```ts
64
+ if (result.status === "unavailable" && result.code === "NotBookable") {
65
+ showUnavailableMessage(result.reason);
66
+ }
67
+ ```
68
+
69
+ Legacy v9 unavailable quotes always use `NotBookable`. No v9 configuration or
70
+ request change is required.
71
+
72
+ ## 4. Update Mocks, Fixtures, and Snapshots
73
+
74
+ Add `code` anywhere an unavailable result is constructed or compared:
75
+
76
+ ```ts
77
+ const unavailableQuote = {
78
+ status: "unavailable",
79
+ code: "NotBookable",
80
+ reason: "Not available",
81
+ } as const;
82
+ ```
83
+
84
+ Update:
85
+
86
+ 1. TypeScript mocks typed as `GuestQuoteResult` or `QuoteQuoteOutput`.
87
+ 2. JSON fixtures decoded with `QuoteQuoteOutputSchema`.
88
+ 3. Complete-object assertions and snapshots.
89
+ 4. API adapters that persist or forward quote results.
90
+
91
+ Available-result fixtures require no changes.
92
+
93
+ ## Required Consumer Work
94
+
95
+ 1. Add `code` to unavailable quote mocks and fixtures.
96
+ 2. Replace reason-string comparisons with code checks.
97
+ 3. Route `AmbiguousMultiRate` and `UnresolvableMultiRate` to operational
98
+ diagnostics.
99
+ 4. Keep all three codes unavailable in booking UI.
100
+
101
+ ## Recommended Verification
102
+
103
+ 1. Confirm a normal blocked period returns `NotBookable`.
104
+ 2. Confirm unavailable copy still uses the localized `reason`.
105
+ 3. Confirm monitoring distinguishes both multi-rate codes from
106
+ `NotBookable`.
107
+ 4. Confirm the UI never enables booking for either multi-rate code.
108
+ 5. Confirm available quote, option selection, and booking flows are unchanged.
109
+ 6. Confirm legacy v9 unavailable quote snapshots include `NotBookable`.
@@ -286,6 +286,7 @@ const toGuestQuote = (input, guestQuoteResult, locale, translations, options) =>
286
286
  const errorReason = toErrorReason(guestQuoteResult);
287
287
  if (errorReason !== void 0) return {
288
288
  status: "unavailable",
289
+ code: "NotBookable",
289
290
  reason: errorReason
290
291
  };
291
292
  const sections = yield* toSections({
@@ -1,4 +1,4 @@
1
- import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-C0pqpk-N.mjs";
1
+ import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-CaZZGJAW.mjs";
2
2
  import { a as toAddress, g as parseVofficeUnitData, i as toImages, s as searchQuery, t as toRentalHighlights, u as VofficeUnitDataFieldSchemas } from "./to-rental-highlights-BAsEuxoy.mjs";
3
3
  import { CoreSDKError, STABLE_SEARCH_INPUTS, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, resolveExpandedCompositions, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
4
4
  import { Effect } from "effect";
@@ -4,6 +4,7 @@ This file is the versioned changelog index for the website SDK instructions.
4
4
 
5
5
  ## Versions
6
6
 
7
+ - `versions/2.16.0/CHANGELOG.md`: `@v-office/website-sdk` 2.16.0 release notes.
7
8
  - `versions/2.15.0/CHANGELOG.md`: `@v-office/website-sdk` 2.15.0 release notes.
8
9
  - `versions/2.14.0/CHANGELOG.md`: `@v-office/website-sdk` 2.14.0 release notes.
9
10
  - `versions/2.13.0/CHANGELOG.md`: `@v-office/website-sdk` 2.13.0 release notes.
@@ -4,6 +4,7 @@ This file is the versioned migration index for the website SDK instructions.
4
4
 
5
5
  ## Available Guides
6
6
 
7
+ - `versions/2.16.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.15.0 to 2.16.0.
7
8
  - `versions/2.15.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.14.0 to 2.15.0.
8
9
  - `versions/2.14.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.13.0 to 2.14.0.
9
10
  - `versions/2.13.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.12.0 to 2.13.0.
@@ -1,7 +1,7 @@
1
1
  # Website SDK Instructions
2
2
 
3
3
  These instructions describe the current source targeted for
4
- `@v-office/website-sdk` 2.15.0. Package versions remain unchanged until the release
4
+ `@v-office/website-sdk` 2.16.0. Package versions remain unchanged until the release
5
5
  workflow performs the coordinated core and website bumps.
6
6
 
7
7
  Use this directory as the consumer-facing reference for the package:
@@ -18,6 +18,9 @@ Use this directory as the consumer-facing reference for the package:
18
18
  - `document-structured-json.md`: `sdk.static.documents.getTermsAndPrivacyPolicy` and structured document JSON rendering rules.
19
19
  - `CHANGELOG.md`: versioned changelog index.
20
20
  - `MIGRATION.md`: versioned migration index.
21
+ - `versions/2.16.0/`: 2.16.0 machine-readable unavailable quote codes,
22
+ multi-rate configuration diagnostics, and the 2.15.0-to-2.16.0 migration
23
+ guide.
21
24
  - `versions/2.15.0/`: 2.15.0 v9 facility images in normalized
22
25
  `property.images`, responsive vOffice image URLs, and the 2.14.0-to-2.15.0
23
26
  migration guide.
@@ -93,5 +96,5 @@ website-sdk --backend v10 search --locale de-DE --query "adults=2" --sort '{"by"
93
96
  ```
94
97
 
95
98
  Config file examples in these docs use the flat `WebsiteSDKConfig` shape introduced
96
- in 2.0.0 and kept in 2.15.0. v10 config additionally requires `searchEndpoint` as
99
+ in 2.0.0 and kept in 2.16.0. v10 config additionally requires `searchEndpoint` as
97
100
  of 2.5.0.
@@ -133,10 +133,40 @@ Unavailable sample:
133
133
  ```json
134
134
  {
135
135
  "status": "unavailable",
136
+ "code": "NotBookable",
136
137
  "reason": "Rental is not available for the selected period."
137
138
  }
138
139
  ```
139
140
 
141
+ From 2.16.0, every unavailable quote includes a machine-readable `code`:
142
+
143
+ - `NotBookable`: the backend did not return a bookable price, including normal
144
+ availability failures. Legacy v9 unavailable quotes always use this code.
145
+ - `AmbiguousMultiRate`: v10 priced the stay, but more than one multi-rate
146
+ matched the default cancellation policy.
147
+ - `UnresolvableMultiRate`: v10 priced the stay, but no multi-rate could be
148
+ resolved for the default cancellation policy.
149
+
150
+ Use `code` for application behavior and logging. `reason` remains localized
151
+ display text and can be identical for inventory and multi-rate failures. The SDK
152
+ keeps ambiguous and unresolvable v10 quotes unavailable because booking requires
153
+ one exact multi-rate.
154
+
155
+ ```ts
156
+ const result = await sdk.live.quote.quote(input);
157
+
158
+ if (result.status === "unavailable") {
159
+ if (result.code === "AmbiguousMultiRate" || result.code === "UnresolvableMultiRate") {
160
+ reportQuoteConfigurationProblem(result.code);
161
+ }
162
+
163
+ showUnavailableMessage(result.reason);
164
+ }
165
+ ```
166
+
167
+ See `versions/2.16.0/CHANGELOG.md` and
168
+ `versions/2.16.0/MIGRATION.md` for release and upgrade details.
169
+
140
170
  Selection methods return `{ ok: true, quote }` or `{ ok: false, error }`. Possible selection errors include unknown additional service, additional service limit exceeded, unknown cancellation policy, unavailable cancellation policy quote, and unavailable quote combination.
141
171
 
142
172
  ## Booking-Card Breakdown
@@ -0,0 +1,44 @@
1
+ # Changelog: 2.16.0
2
+
3
+ This release makes unavailable quote results machine-readable. Applications can
4
+ now distinguish normal booking unavailability from v10 multi-rate
5
+ configuration failures without parsing localized text.
6
+
7
+ ## Added
8
+
9
+ - Every unavailable `GuestQuoteResult` contains a `code`:
10
+ - `NotBookable`
11
+ - `AmbiguousMultiRate`
12
+ - `UnresolvableMultiRate`
13
+ - The public quote output schema validates the new code.
14
+ - v10 reports `AmbiguousMultiRate` when a priced default cancellation policy
15
+ matches more than one multi-rate.
16
+ - v10 reports `UnresolvableMultiRate` when a priced default cancellation policy
17
+ cannot be mapped to a multi-rate.
18
+
19
+ ## Changed
20
+
21
+ - Legacy v9 unavailable quotes now include `code: "NotBookable"`.
22
+ - Normal v10 quote failures also use `code: "NotBookable"`.
23
+ - v10 retains the exact default-policy multi-rate resolution result instead of
24
+ reducing it to a boolean before creating the public unavailable result.
25
+
26
+ ## Unchanged
27
+
28
+ - `sdk.live.quote.quote(input)` and its input are unchanged.
29
+ - Available quote results remain `{ status: "available", quote }`.
30
+ - Unavailable results retain the localized `reason` field.
31
+ - Ambiguous or unresolvable v10 multi-rates remain unavailable. The SDK does not
32
+ select an arbitrary fallback because booking requires one exact multi-rate.
33
+ - Search and calendar availability behavior are unchanged.
34
+
35
+ ## Compatibility
36
+
37
+ - Consumers that only inspect `status` and display `reason` continue to work.
38
+ - TypeScript mocks, complete-object assertions, snapshots, and schema fixtures
39
+ for unavailable quotes must include `code`.
40
+ - Application behavior should branch on `code`, not localized `reason`.
41
+ - `AmbiguousMultiRate` and `UnresolvableMultiRate` indicate configuration or
42
+ mapping problems and should normally be reported to site operations.
43
+
44
+ See `versions/2.16.0/MIGRATION.md` and `../../quote.md`.
@@ -0,0 +1,109 @@
1
+ # Migration: 2.15.0 to 2.16.0
2
+
3
+ 2.16.0 adds a required machine-readable `code` to unavailable quote results.
4
+ The service call, quote input, available result, and localized unavailable
5
+ `reason` are unchanged.
6
+
7
+ ## 1. Handle the Unavailable Code
8
+
9
+ An unavailable result now has this shape:
10
+
11
+ ```ts
12
+ type UnavailableGuestQuoteResult = {
13
+ readonly status: "unavailable";
14
+ readonly code: "NotBookable" | "AmbiguousMultiRate" | "UnresolvableMultiRate";
15
+ readonly reason: string;
16
+ };
17
+ ```
18
+
19
+ Branch on `code` after narrowing by `status`:
20
+
21
+ ```ts
22
+ const result = await sdk.live.quote.quote(input);
23
+
24
+ if (result.status === "unavailable") {
25
+ switch (result.code) {
26
+ case "AmbiguousMultiRate":
27
+ case "UnresolvableMultiRate":
28
+ reportQuoteConfigurationProblem(result.code);
29
+ break;
30
+ case "NotBookable":
31
+ break;
32
+ }
33
+
34
+ showUnavailableMessage(result.reason);
35
+ }
36
+ ```
37
+
38
+ Keep displaying `reason` when appropriate, but do not parse or compare it to
39
+ select application behavior. It is localized and can still contain the same
40
+ text for different codes.
41
+
42
+ ## 2. Treat Multi-Rate Codes as Operational Failures
43
+
44
+ The v10-specific codes mean:
45
+
46
+ - `AmbiguousMultiRate`: the stay was priced, but more than one multi-rate
47
+ matched the default cancellation policy.
48
+ - `UnresolvableMultiRate`: the stay was priced, but no multi-rate could be
49
+ resolved for the default cancellation policy.
50
+
51
+ These are not proof that another guest booked the period. Keep the public quote
52
+ unavailable, show suitable fallback copy, and send the code to monitoring or
53
+ site operations so the rental configuration can be corrected.
54
+
55
+ Do not retry booking with an arbitrary multi-rate. The price alone does not
56
+ identify the exact multi-rate required by the booking request.
57
+
58
+ ## 3. Keep Normal Unavailability Handling
59
+
60
+ `NotBookable` represents ordinary unavailable quote results, including backend
61
+ responses without a bookable price:
62
+
63
+ ```ts
64
+ if (result.status === "unavailable" && result.code === "NotBookable") {
65
+ showUnavailableMessage(result.reason);
66
+ }
67
+ ```
68
+
69
+ Legacy v9 unavailable quotes always use `NotBookable`. No v9 configuration or
70
+ request change is required.
71
+
72
+ ## 4. Update Mocks, Fixtures, and Snapshots
73
+
74
+ Add `code` anywhere an unavailable result is constructed or compared:
75
+
76
+ ```ts
77
+ const unavailableQuote = {
78
+ status: "unavailable",
79
+ code: "NotBookable",
80
+ reason: "Not available",
81
+ } as const;
82
+ ```
83
+
84
+ Update:
85
+
86
+ 1. TypeScript mocks typed as `GuestQuoteResult` or `QuoteQuoteOutput`.
87
+ 2. JSON fixtures decoded with `QuoteQuoteOutputSchema`.
88
+ 3. Complete-object assertions and snapshots.
89
+ 4. API adapters that persist or forward quote results.
90
+
91
+ Available-result fixtures require no changes.
92
+
93
+ ## Required Consumer Work
94
+
95
+ 1. Add `code` to unavailable quote mocks and fixtures.
96
+ 2. Replace reason-string comparisons with code checks.
97
+ 3. Route `AmbiguousMultiRate` and `UnresolvableMultiRate` to operational
98
+ diagnostics.
99
+ 4. Keep all three codes unavailable in booking UI.
100
+
101
+ ## Recommended Verification
102
+
103
+ 1. Confirm a normal blocked period returns `NotBookable`.
104
+ 2. Confirm unavailable copy still uses the localized `reason`.
105
+ 3. Confirm monitoring distinguishes both multi-rate codes from
106
+ `NotBookable`.
107
+ 4. Confirm the UI never enables booking for either multi-rate code.
108
+ 5. Confirm available quote, option selection, and booking flows are unchanged.
109
+ 6. Confirm legacy v9 unavailable quote snapshots include `NotBookable`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/website-sdk",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "description": "Website-facing SDK facade backed by @v-office/sdk-core",
5
5
  "bin": {
6
6
  "website-sdk": "./dist/cli.mjs"
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@graphql-typed-document-node/core": "3.2.0",
45
- "@v-office/sdk-core": "^1.15.0",
45
+ "@v-office/sdk-core": "^1.16.0",
46
46
  "effect": "4.0.0-beta.85",
47
47
  "graphql": "17.0.2",
48
48
  "yaml": "^2.9.0"