@voyantjs/products-ui 0.101.1 → 0.102.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 (126) hide show
  1. package/dist/components/product-detail/date-picker.d.ts +44 -0
  2. package/dist/components/product-detail/date-picker.d.ts.map +1 -0
  3. package/dist/components/product-detail/date-picker.js +125 -0
  4. package/dist/components/product-detail/host.d.ts +53 -0
  5. package/dist/components/product-detail/host.d.ts.map +1 -0
  6. package/dist/components/product-detail/host.js +24 -0
  7. package/dist/components/product-detail/index.d.ts +6 -0
  8. package/dist/components/product-detail/index.d.ts.map +1 -0
  9. package/dist/components/product-detail/index.js +5 -0
  10. package/dist/components/product-detail/product-activity-section.d.ts +4 -0
  11. package/dist/components/product-detail/product-activity-section.d.ts.map +1 -0
  12. package/dist/components/product-detail/product-activity-section.js +37 -0
  13. package/dist/components/product-detail/product-day-sheet.d.ts +14 -0
  14. package/dist/components/product-detail/product-day-sheet.d.ts.map +1 -0
  15. package/dist/components/product-detail/product-day-sheet.js +75 -0
  16. package/dist/components/product-detail/product-day-translation.d.ts +41 -0
  17. package/dist/components/product-detail/product-day-translation.d.ts.map +1 -0
  18. package/dist/components/product-detail/product-day-translation.js +111 -0
  19. package/dist/components/product-detail/product-departure-dialog.d.ts +11 -0
  20. package/dist/components/product-detail/product-departure-dialog.d.ts.map +1 -0
  21. package/dist/components/product-detail/product-departure-dialog.js +10 -0
  22. package/dist/components/product-detail/product-departure-form.d.ts +25 -0
  23. package/dist/components/product-detail/product-departure-form.d.ts.map +1 -0
  24. package/dist/components/product-detail/product-departure-form.js +237 -0
  25. package/dist/components/product-detail/product-departure-pricing-override-dialog.d.ts +8 -0
  26. package/dist/components/product-detail/product-departure-pricing-override-dialog.d.ts.map +1 -0
  27. package/dist/components/product-detail/product-departure-pricing-override-dialog.js +125 -0
  28. package/dist/components/product-detail/product-detail-day-row.d.ts +14 -0
  29. package/dist/components/product-detail/product-detail-day-row.d.ts.map +1 -0
  30. package/dist/components/product-detail/product-detail-day-row.js +43 -0
  31. package/dist/components/product-detail/product-detail-dialog.d.ts +10 -0
  32. package/dist/components/product-detail/product-detail-dialog.d.ts.map +1 -0
  33. package/dist/components/product-detail/product-detail-dialog.js +10 -0
  34. package/dist/components/product-detail/product-detail-form.d.ts +19 -0
  35. package/dist/components/product-detail/product-detail-form.d.ts.map +1 -0
  36. package/dist/components/product-detail/product-detail-form.js +180 -0
  37. package/dist/components/product-detail/product-detail-header.d.ts +12 -0
  38. package/dist/components/product-detail/product-detail-header.d.ts.map +1 -0
  39. package/dist/components/product-detail/product-detail-header.js +19 -0
  40. package/dist/components/product-detail/product-detail-itinerary-section.d.ts +4 -0
  41. package/dist/components/product-detail/product-detail-itinerary-section.d.ts.map +1 -0
  42. package/dist/components/product-detail/product-detail-itinerary-section.js +201 -0
  43. package/dist/components/product-detail/product-detail-page.d.ts +4 -0
  44. package/dist/components/product-detail/product-detail-page.d.ts.map +1 -0
  45. package/dist/components/product-detail/product-detail-page.js +97 -0
  46. package/dist/components/product-detail/product-detail-sections.d.ts +63 -0
  47. package/dist/components/product-detail/product-detail-sections.d.ts.map +1 -0
  48. package/dist/components/product-detail/product-detail-sections.js +143 -0
  49. package/dist/components/product-detail/product-detail-shared.d.ts +264 -0
  50. package/dist/components/product-detail/product-detail-shared.d.ts.map +1 -0
  51. package/dist/components/product-detail/product-detail-shared.js +157 -0
  52. package/dist/components/product-detail/product-detail-skeleton.d.ts +9 -0
  53. package/dist/components/product-detail/product-detail-skeleton.d.ts.map +1 -0
  54. package/dist/components/product-detail/product-detail-skeleton.js +53 -0
  55. package/dist/components/product-detail/product-extras-section.d.ts +4 -0
  56. package/dist/components/product-detail/product-extras-section.d.ts.map +1 -0
  57. package/dist/components/product-detail/product-extras-section.js +141 -0
  58. package/dist/components/product-detail/product-itinerary-form.d.ts +16 -0
  59. package/dist/components/product-detail/product-itinerary-form.d.ts.map +1 -0
  60. package/dist/components/product-detail/product-itinerary-form.js +38 -0
  61. package/dist/components/product-detail/product-market-rules-section.d.ts +6 -0
  62. package/dist/components/product-detail/product-market-rules-section.d.ts.map +1 -0
  63. package/dist/components/product-detail/product-market-rules-section.js +81 -0
  64. package/dist/components/product-detail/product-media-gallery.d.ts +19 -0
  65. package/dist/components/product-detail/product-media-gallery.d.ts.map +1 -0
  66. package/dist/components/product-detail/product-media-gallery.js +114 -0
  67. package/dist/components/product-detail/product-option-price-rule-dialog.d.ts +12 -0
  68. package/dist/components/product-detail/product-option-price-rule-dialog.d.ts.map +1 -0
  69. package/dist/components/product-detail/product-option-price-rule-dialog.js +10 -0
  70. package/dist/components/product-detail/product-option-price-rule-form.d.ts +29 -0
  71. package/dist/components/product-detail/product-option-price-rule-form.d.ts.map +1 -0
  72. package/dist/components/product-detail/product-option-price-rule-form.js +125 -0
  73. package/dist/components/product-detail/product-option-pricing-grid.d.ts +16 -0
  74. package/dist/components/product-detail/product-option-pricing-grid.d.ts.map +1 -0
  75. package/dist/components/product-detail/product-option-pricing-grid.js +193 -0
  76. package/dist/components/product-detail/product-options-pricing.d.ts +34 -0
  77. package/dist/components/product-detail/product-options-pricing.d.ts.map +1 -0
  78. package/dist/components/product-detail/product-options-pricing.js +385 -0
  79. package/dist/components/product-detail/product-options-shared.d.ts +623 -0
  80. package/dist/components/product-detail/product-options-shared.d.ts.map +1 -0
  81. package/dist/components/product-detail/product-options-shared.js +54 -0
  82. package/dist/components/product-detail/product-payment-policy-section.d.ts +17 -0
  83. package/dist/components/product-detail/product-payment-policy-section.d.ts.map +1 -0
  84. package/dist/components/product-detail/product-payment-policy-section.js +58 -0
  85. package/dist/components/product-detail/product-schedule-dialog.d.ts +11 -0
  86. package/dist/components/product-detail/product-schedule-dialog.d.ts.map +1 -0
  87. package/dist/components/product-detail/product-schedule-dialog.js +10 -0
  88. package/dist/components/product-detail/product-schedule-form.d.ts +17 -0
  89. package/dist/components/product-detail/product-schedule-form.d.ts.map +1 -0
  90. package/dist/components/product-detail/product-schedule-form.js +222 -0
  91. package/dist/components/product-detail/product-service-dialog.d.ts +12 -0
  92. package/dist/components/product-detail/product-service-dialog.d.ts.map +1 -0
  93. package/dist/components/product-detail/product-service-dialog.js +10 -0
  94. package/dist/components/product-detail/product-service-form.d.ts +22 -0
  95. package/dist/components/product-detail/product-service-form.d.ts.map +1 -0
  96. package/dist/components/product-detail/product-service-form.js +154 -0
  97. package/dist/components/product-detail/product-translation-popover.d.ts +91 -0
  98. package/dist/components/product-detail/product-translation-popover.d.ts.map +1 -0
  99. package/dist/components/product-detail/product-translation-popover.js +217 -0
  100. package/dist/components/product-detail/product-unit-dialog.d.ts +14 -0
  101. package/dist/components/product-detail/product-unit-dialog.d.ts.map +1 -0
  102. package/dist/components/product-detail/product-unit-dialog.js +10 -0
  103. package/dist/components/product-detail/product-unit-form.d.ts +34 -0
  104. package/dist/components/product-detail/product-unit-form.d.ts.map +1 -0
  105. package/dist/components/product-detail/product-unit-form.js +139 -0
  106. package/dist/components/product-detail/product-unit-price-rule-dialog.d.ts +17 -0
  107. package/dist/components/product-detail/product-unit-price-rule-dialog.d.ts.map +1 -0
  108. package/dist/components/product-detail/product-unit-price-rule-dialog.js +10 -0
  109. package/dist/components/product-detail/product-unit-price-rule-form.d.ts +29 -0
  110. package/dist/components/product-detail/product-unit-price-rule-form.d.ts.map +1 -0
  111. package/dist/components/product-detail/product-unit-price-rule-form.js +145 -0
  112. package/dist/components/product-detail/timezone-options.d.ts +9 -0
  113. package/dist/components/product-detail/timezone-options.d.ts.map +1 -0
  114. package/dist/components/product-detail/timezone-options.js +28 -0
  115. package/dist/components/product-detail/use-product-detail-data.d.ts +41 -0
  116. package/dist/components/product-detail/use-product-detail-data.d.ts.map +1 -0
  117. package/dist/components/product-detail/use-product-detail-data.js +143 -0
  118. package/dist/components/product-detail/use-product-detail-dialogs.d.ts +24 -0
  119. package/dist/components/product-detail/use-product-detail-dialogs.d.ts.map +1 -0
  120. package/dist/components/product-detail/use-product-detail-dialogs.js +40 -0
  121. package/dist/components/product-detail/zod-resolver.d.ts +4 -0
  122. package/dist/components/product-detail/zod-resolver.d.ts.map +1 -0
  123. package/dist/components/product-detail/zod-resolver.js +39 -0
  124. package/dist/components/product-options-section.d.ts.map +1 -1
  125. package/dist/components/product-options-section.js +31 -20
  126. package/package.json +38 -19
@@ -0,0 +1,623 @@
1
+ import { type VoyantProductsContextValue } from "@voyantjs/products-react";
2
+ /**
3
+ * The same configured `{ baseUrl, fetcher }` client (from `useVoyantProductsContext()`)
4
+ * drives both the products and pricing query-options — they hit the same API and
5
+ * auth. Callers pass it in so this module stays free of app-specific fetchers.
6
+ */
7
+ export type OptionsClient = VoyantProductsContextValue;
8
+ export declare const optionStatusVariant: Record<string, "default" | "secondary" | "outline" | "destructive">;
9
+ /**
10
+ * Which pricing layout an option shows. "rooms" = a room×traveler-type grid
11
+ * (accommodation / multi-day). "seats" = a flat traveler-type price list
12
+ * (single-day excursions, transfers). Derived from the product's bookingMode
13
+ * so the agent never picks a pricing model directly.
14
+ */
15
+ export type OptionPricingLayout = "rooms" | "seats";
16
+ /**
17
+ * Derive the pricing layout from the product's booking mode. Multi-day /
18
+ * overnight modes imply rooms; single-day activity modes imply per-person
19
+ * seats. `dayCount` is a fallback for the ambiguous `other` mode (>1 day →
20
+ * rooms), matching the operator rule "more than one day means rooms".
21
+ */
22
+ export declare function deriveOptionPricingLayout(bookingMode: string | null | undefined, dayCount?: number): OptionPricingLayout;
23
+ export declare function getProductOptionsQueryOptions(client: OptionsClient, productId: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
24
+ data: {
25
+ id: string;
26
+ productId: string;
27
+ name: string;
28
+ code: string | null;
29
+ description: string | null;
30
+ status: "active" | "draft" | "archived";
31
+ isDefault: boolean;
32
+ sortOrder: number;
33
+ availableFrom: string | null;
34
+ availableTo: string | null;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ }[];
38
+ total: number;
39
+ limit: number;
40
+ offset: number;
41
+ }, Error, {
42
+ data: {
43
+ id: string;
44
+ productId: string;
45
+ name: string;
46
+ code: string | null;
47
+ description: string | null;
48
+ status: "active" | "draft" | "archived";
49
+ isDefault: boolean;
50
+ sortOrder: number;
51
+ availableFrom: string | null;
52
+ availableTo: string | null;
53
+ createdAt: string;
54
+ updatedAt: string;
55
+ }[];
56
+ total: number;
57
+ limit: number;
58
+ offset: number;
59
+ }, readonly ["voyant", "products", "product-options", "list", import("@voyantjs/products-react/query-keys").ProductOptionsListFilters]>, "queryFn"> & {
60
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
61
+ data: {
62
+ id: string;
63
+ productId: string;
64
+ name: string;
65
+ code: string | null;
66
+ description: string | null;
67
+ status: "active" | "draft" | "archived";
68
+ isDefault: boolean;
69
+ sortOrder: number;
70
+ availableFrom: string | null;
71
+ availableTo: string | null;
72
+ createdAt: string;
73
+ updatedAt: string;
74
+ }[];
75
+ total: number;
76
+ limit: number;
77
+ offset: number;
78
+ }, readonly ["voyant", "products", "product-options", "list", import("@voyantjs/products-react/query-keys").ProductOptionsListFilters], never> | undefined;
79
+ } & {
80
+ queryKey: readonly ["voyant", "products", "product-options", "list", import("@voyantjs/products-react/query-keys").ProductOptionsListFilters] & {
81
+ [dataTagSymbol]: {
82
+ data: {
83
+ id: string;
84
+ productId: string;
85
+ name: string;
86
+ code: string | null;
87
+ description: string | null;
88
+ status: "active" | "draft" | "archived";
89
+ isDefault: boolean;
90
+ sortOrder: number;
91
+ availableFrom: string | null;
92
+ availableTo: string | null;
93
+ createdAt: string;
94
+ updatedAt: string;
95
+ }[];
96
+ total: number;
97
+ limit: number;
98
+ offset: number;
99
+ };
100
+ [dataTagErrorSymbol]: Error;
101
+ };
102
+ };
103
+ export declare function getOptionUnitsQueryOptions(client: OptionsClient, optionId: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
104
+ data: {
105
+ id: string;
106
+ optionId: string;
107
+ name: string;
108
+ code: string | null;
109
+ description: string | null;
110
+ unitType: "service" | "other" | "person" | "group" | "room" | "vehicle";
111
+ minQuantity: number | null;
112
+ maxQuantity: number | null;
113
+ minAge: number | null;
114
+ maxAge: number | null;
115
+ occupancyMin: number | null;
116
+ occupancyMax: number | null;
117
+ isRequired: boolean;
118
+ isHidden: boolean;
119
+ sortOrder: number;
120
+ }[];
121
+ total: number;
122
+ limit: number;
123
+ offset: number;
124
+ }, Error, {
125
+ data: {
126
+ id: string;
127
+ optionId: string;
128
+ name: string;
129
+ code: string | null;
130
+ description: string | null;
131
+ unitType: "service" | "other" | "person" | "group" | "room" | "vehicle";
132
+ minQuantity: number | null;
133
+ maxQuantity: number | null;
134
+ minAge: number | null;
135
+ maxAge: number | null;
136
+ occupancyMin: number | null;
137
+ occupancyMax: number | null;
138
+ isRequired: boolean;
139
+ isHidden: boolean;
140
+ sortOrder: number;
141
+ }[];
142
+ total: number;
143
+ limit: number;
144
+ offset: number;
145
+ }, readonly ["voyant", "products", "option-units", "list", import("@voyantjs/products-react/query-keys").OptionUnitsListFilters]>, "queryFn"> & {
146
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
147
+ data: {
148
+ id: string;
149
+ optionId: string;
150
+ name: string;
151
+ code: string | null;
152
+ description: string | null;
153
+ unitType: "service" | "other" | "person" | "group" | "room" | "vehicle";
154
+ minQuantity: number | null;
155
+ maxQuantity: number | null;
156
+ minAge: number | null;
157
+ maxAge: number | null;
158
+ occupancyMin: number | null;
159
+ occupancyMax: number | null;
160
+ isRequired: boolean;
161
+ isHidden: boolean;
162
+ sortOrder: number;
163
+ }[];
164
+ total: number;
165
+ limit: number;
166
+ offset: number;
167
+ }, readonly ["voyant", "products", "option-units", "list", import("@voyantjs/products-react/query-keys").OptionUnitsListFilters], never> | undefined;
168
+ } & {
169
+ queryKey: readonly ["voyant", "products", "option-units", "list", import("@voyantjs/products-react/query-keys").OptionUnitsListFilters] & {
170
+ [dataTagSymbol]: {
171
+ data: {
172
+ id: string;
173
+ optionId: string;
174
+ name: string;
175
+ code: string | null;
176
+ description: string | null;
177
+ unitType: "service" | "other" | "person" | "group" | "room" | "vehicle";
178
+ minQuantity: number | null;
179
+ maxQuantity: number | null;
180
+ minAge: number | null;
181
+ maxAge: number | null;
182
+ occupancyMin: number | null;
183
+ occupancyMax: number | null;
184
+ isRequired: boolean;
185
+ isHidden: boolean;
186
+ sortOrder: number;
187
+ }[];
188
+ total: number;
189
+ limit: number;
190
+ offset: number;
191
+ };
192
+ [dataTagErrorSymbol]: Error;
193
+ };
194
+ };
195
+ export declare function getOptionPriceRulesQueryOptions(client: OptionsClient, optionId: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
196
+ data: {
197
+ id: string;
198
+ productId: string;
199
+ optionId: string;
200
+ priceCatalogId: string;
201
+ priceScheduleId: string | null;
202
+ cancellationPolicyId: string | null;
203
+ code: string | null;
204
+ name: string;
205
+ description: string | null;
206
+ pricingMode: "on_request" | "per_booking" | "per_person" | "free" | "starting_from";
207
+ baseSellAmountCents: number | null;
208
+ baseCostAmountCents: number | null;
209
+ minPerBooking: number | null;
210
+ maxPerBooking: number | null;
211
+ allPricingCategories: boolean;
212
+ isDefault: boolean;
213
+ active: boolean;
214
+ notes: string | null;
215
+ }[];
216
+ total: number;
217
+ limit: number;
218
+ offset: number;
219
+ }, Error, {
220
+ data: {
221
+ id: string;
222
+ productId: string;
223
+ optionId: string;
224
+ priceCatalogId: string;
225
+ priceScheduleId: string | null;
226
+ cancellationPolicyId: string | null;
227
+ code: string | null;
228
+ name: string;
229
+ description: string | null;
230
+ pricingMode: "on_request" | "per_booking" | "per_person" | "free" | "starting_from";
231
+ baseSellAmountCents: number | null;
232
+ baseCostAmountCents: number | null;
233
+ minPerBooking: number | null;
234
+ maxPerBooking: number | null;
235
+ allPricingCategories: boolean;
236
+ isDefault: boolean;
237
+ active: boolean;
238
+ notes: string | null;
239
+ }[];
240
+ total: number;
241
+ limit: number;
242
+ offset: number;
243
+ }, readonly ["voyant", "pricing", "option-price-rules", "list", import("@voyantjs/pricing-react/query-keys").OptionPriceRulesListFilters]>, "queryFn"> & {
244
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
245
+ data: {
246
+ id: string;
247
+ productId: string;
248
+ optionId: string;
249
+ priceCatalogId: string;
250
+ priceScheduleId: string | null;
251
+ cancellationPolicyId: string | null;
252
+ code: string | null;
253
+ name: string;
254
+ description: string | null;
255
+ pricingMode: "on_request" | "per_booking" | "per_person" | "free" | "starting_from";
256
+ baseSellAmountCents: number | null;
257
+ baseCostAmountCents: number | null;
258
+ minPerBooking: number | null;
259
+ maxPerBooking: number | null;
260
+ allPricingCategories: boolean;
261
+ isDefault: boolean;
262
+ active: boolean;
263
+ notes: string | null;
264
+ }[];
265
+ total: number;
266
+ limit: number;
267
+ offset: number;
268
+ }, readonly ["voyant", "pricing", "option-price-rules", "list", import("@voyantjs/pricing-react/query-keys").OptionPriceRulesListFilters], never> | undefined;
269
+ } & {
270
+ queryKey: readonly ["voyant", "pricing", "option-price-rules", "list", import("@voyantjs/pricing-react/query-keys").OptionPriceRulesListFilters] & {
271
+ [dataTagSymbol]: {
272
+ data: {
273
+ id: string;
274
+ productId: string;
275
+ optionId: string;
276
+ priceCatalogId: string;
277
+ priceScheduleId: string | null;
278
+ cancellationPolicyId: string | null;
279
+ code: string | null;
280
+ name: string;
281
+ description: string | null;
282
+ pricingMode: "on_request" | "per_booking" | "per_person" | "free" | "starting_from";
283
+ baseSellAmountCents: number | null;
284
+ baseCostAmountCents: number | null;
285
+ minPerBooking: number | null;
286
+ maxPerBooking: number | null;
287
+ allPricingCategories: boolean;
288
+ isDefault: boolean;
289
+ active: boolean;
290
+ notes: string | null;
291
+ }[];
292
+ total: number;
293
+ limit: number;
294
+ offset: number;
295
+ };
296
+ [dataTagErrorSymbol]: Error;
297
+ };
298
+ };
299
+ export declare function getPricingCategoriesQueryOptions(client: OptionsClient): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
300
+ data: {
301
+ id: string;
302
+ productId: string | null;
303
+ optionId: string | null;
304
+ unitId: string | null;
305
+ code: string | null;
306
+ name: string;
307
+ categoryType: "service" | "child" | "other" | "group" | "room" | "vehicle" | "adult" | "infant" | "senior";
308
+ seatOccupancy: number;
309
+ groupSize: number | null;
310
+ isAgeQualified: boolean;
311
+ minAge: number | null;
312
+ maxAge: number | null;
313
+ internalUseOnly: boolean;
314
+ active: boolean;
315
+ sortOrder: number;
316
+ createdAt: string;
317
+ updatedAt: string;
318
+ metadata?: Record<string, unknown> | null | undefined;
319
+ }[];
320
+ total: number;
321
+ limit: number;
322
+ offset: number;
323
+ }, Error, {
324
+ data: {
325
+ id: string;
326
+ productId: string | null;
327
+ optionId: string | null;
328
+ unitId: string | null;
329
+ code: string | null;
330
+ name: string;
331
+ categoryType: "service" | "child" | "other" | "group" | "room" | "vehicle" | "adult" | "infant" | "senior";
332
+ seatOccupancy: number;
333
+ groupSize: number | null;
334
+ isAgeQualified: boolean;
335
+ minAge: number | null;
336
+ maxAge: number | null;
337
+ internalUseOnly: boolean;
338
+ active: boolean;
339
+ sortOrder: number;
340
+ createdAt: string;
341
+ updatedAt: string;
342
+ metadata?: Record<string, unknown> | null | undefined;
343
+ }[];
344
+ total: number;
345
+ limit: number;
346
+ offset: number;
347
+ }, readonly ["voyant", "pricing", "pricing-categories", "list", import("@voyantjs/pricing-react/query-keys").PricingCategoriesListFilters]>, "queryFn"> & {
348
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
349
+ data: {
350
+ id: string;
351
+ productId: string | null;
352
+ optionId: string | null;
353
+ unitId: string | null;
354
+ code: string | null;
355
+ name: string;
356
+ categoryType: "service" | "child" | "other" | "group" | "room" | "vehicle" | "adult" | "infant" | "senior";
357
+ seatOccupancy: number;
358
+ groupSize: number | null;
359
+ isAgeQualified: boolean;
360
+ minAge: number | null;
361
+ maxAge: number | null;
362
+ internalUseOnly: boolean;
363
+ active: boolean;
364
+ sortOrder: number;
365
+ createdAt: string;
366
+ updatedAt: string;
367
+ metadata?: Record<string, unknown> | null | undefined;
368
+ }[];
369
+ total: number;
370
+ limit: number;
371
+ offset: number;
372
+ }, readonly ["voyant", "pricing", "pricing-categories", "list", import("@voyantjs/pricing-react/query-keys").PricingCategoriesListFilters], never> | undefined;
373
+ } & {
374
+ queryKey: readonly ["voyant", "pricing", "pricing-categories", "list", import("@voyantjs/pricing-react/query-keys").PricingCategoriesListFilters] & {
375
+ [dataTagSymbol]: {
376
+ data: {
377
+ id: string;
378
+ productId: string | null;
379
+ optionId: string | null;
380
+ unitId: string | null;
381
+ code: string | null;
382
+ name: string;
383
+ categoryType: "service" | "child" | "other" | "group" | "room" | "vehicle" | "adult" | "infant" | "senior";
384
+ seatOccupancy: number;
385
+ groupSize: number | null;
386
+ isAgeQualified: boolean;
387
+ minAge: number | null;
388
+ maxAge: number | null;
389
+ internalUseOnly: boolean;
390
+ active: boolean;
391
+ sortOrder: number;
392
+ createdAt: string;
393
+ updatedAt: string;
394
+ metadata?: Record<string, unknown> | null | undefined;
395
+ }[];
396
+ total: number;
397
+ limit: number;
398
+ offset: number;
399
+ };
400
+ [dataTagErrorSymbol]: Error;
401
+ };
402
+ };
403
+ export declare function getOptionUnitPriceRulesQueryOptions(client: OptionsClient, optionPriceRuleId: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
404
+ data: {
405
+ id: string;
406
+ optionPriceRuleId: string;
407
+ optionId: string;
408
+ unitId: string;
409
+ pricingCategoryId: string | null;
410
+ pricingMode: "on_request" | "per_booking" | "per_person" | "included" | "free" | "per_unit";
411
+ sellAmountCents: number | null;
412
+ costAmountCents: number | null;
413
+ minQuantity: number | null;
414
+ maxQuantity: number | null;
415
+ sortOrder: number;
416
+ active: boolean;
417
+ notes: string | null;
418
+ }[];
419
+ total: number;
420
+ limit: number;
421
+ offset: number;
422
+ }, Error, {
423
+ data: {
424
+ id: string;
425
+ optionPriceRuleId: string;
426
+ optionId: string;
427
+ unitId: string;
428
+ pricingCategoryId: string | null;
429
+ pricingMode: "on_request" | "per_booking" | "per_person" | "included" | "free" | "per_unit";
430
+ sellAmountCents: number | null;
431
+ costAmountCents: number | null;
432
+ minQuantity: number | null;
433
+ maxQuantity: number | null;
434
+ sortOrder: number;
435
+ active: boolean;
436
+ notes: string | null;
437
+ }[];
438
+ total: number;
439
+ limit: number;
440
+ offset: number;
441
+ }, readonly ["voyant", "pricing", "option-unit-price-rules", "list", import("@voyantjs/pricing-react/query-keys").OptionUnitPriceRulesListFilters]>, "queryFn"> & {
442
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
443
+ data: {
444
+ id: string;
445
+ optionPriceRuleId: string;
446
+ optionId: string;
447
+ unitId: string;
448
+ pricingCategoryId: string | null;
449
+ pricingMode: "on_request" | "per_booking" | "per_person" | "included" | "free" | "per_unit";
450
+ sellAmountCents: number | null;
451
+ costAmountCents: number | null;
452
+ minQuantity: number | null;
453
+ maxQuantity: number | null;
454
+ sortOrder: number;
455
+ active: boolean;
456
+ notes: string | null;
457
+ }[];
458
+ total: number;
459
+ limit: number;
460
+ offset: number;
461
+ }, readonly ["voyant", "pricing", "option-unit-price-rules", "list", import("@voyantjs/pricing-react/query-keys").OptionUnitPriceRulesListFilters], never> | undefined;
462
+ } & {
463
+ queryKey: readonly ["voyant", "pricing", "option-unit-price-rules", "list", import("@voyantjs/pricing-react/query-keys").OptionUnitPriceRulesListFilters] & {
464
+ [dataTagSymbol]: {
465
+ data: {
466
+ id: string;
467
+ optionPriceRuleId: string;
468
+ optionId: string;
469
+ unitId: string;
470
+ pricingCategoryId: string | null;
471
+ pricingMode: "on_request" | "per_booking" | "per_person" | "included" | "free" | "per_unit";
472
+ sellAmountCents: number | null;
473
+ costAmountCents: number | null;
474
+ minQuantity: number | null;
475
+ maxQuantity: number | null;
476
+ sortOrder: number;
477
+ active: boolean;
478
+ notes: string | null;
479
+ }[];
480
+ total: number;
481
+ limit: number;
482
+ offset: number;
483
+ };
484
+ [dataTagErrorSymbol]: Error;
485
+ };
486
+ };
487
+ export declare function getPriceCatalogsQueryOptions(client: OptionsClient): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
488
+ data: {
489
+ id: string;
490
+ code: string;
491
+ name: string;
492
+ currencyCode: string | null;
493
+ catalogType: "internal" | "other" | "public" | "contract" | "net" | "promo" | "gross";
494
+ isDefault: boolean;
495
+ active: boolean;
496
+ notes: string | null;
497
+ }[];
498
+ total: number;
499
+ limit: number;
500
+ offset: number;
501
+ }, Error, {
502
+ data: {
503
+ id: string;
504
+ code: string;
505
+ name: string;
506
+ currencyCode: string | null;
507
+ catalogType: "internal" | "other" | "public" | "contract" | "net" | "promo" | "gross";
508
+ isDefault: boolean;
509
+ active: boolean;
510
+ notes: string | null;
511
+ }[];
512
+ total: number;
513
+ limit: number;
514
+ offset: number;
515
+ }, readonly ["voyant", "pricing", "price-catalogs", "list", import("@voyantjs/pricing-react/query-keys").PriceCatalogsListFilters]>, "queryFn"> & {
516
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
517
+ data: {
518
+ id: string;
519
+ code: string;
520
+ name: string;
521
+ currencyCode: string | null;
522
+ catalogType: "internal" | "other" | "public" | "contract" | "net" | "promo" | "gross";
523
+ isDefault: boolean;
524
+ active: boolean;
525
+ notes: string | null;
526
+ }[];
527
+ total: number;
528
+ limit: number;
529
+ offset: number;
530
+ }, readonly ["voyant", "pricing", "price-catalogs", "list", import("@voyantjs/pricing-react/query-keys").PriceCatalogsListFilters], never> | undefined;
531
+ } & {
532
+ queryKey: readonly ["voyant", "pricing", "price-catalogs", "list", import("@voyantjs/pricing-react/query-keys").PriceCatalogsListFilters] & {
533
+ [dataTagSymbol]: {
534
+ data: {
535
+ id: string;
536
+ code: string;
537
+ name: string;
538
+ currencyCode: string | null;
539
+ catalogType: "internal" | "other" | "public" | "contract" | "net" | "promo" | "gross";
540
+ isDefault: boolean;
541
+ active: boolean;
542
+ notes: string | null;
543
+ }[];
544
+ total: number;
545
+ limit: number;
546
+ offset: number;
547
+ };
548
+ [dataTagErrorSymbol]: Error;
549
+ };
550
+ };
551
+ export declare function getDeparturePriceOverridesQueryOptions(client: OptionsClient, departureId: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
552
+ data: {
553
+ id: string;
554
+ departureId: string;
555
+ optionId: string;
556
+ optionUnitId: string;
557
+ priceCatalogId: string;
558
+ sellAmountCents: number;
559
+ costAmountCents: number | null;
560
+ notes: string | null;
561
+ active: boolean;
562
+ metadata?: Record<string, unknown> | null | undefined;
563
+ }[];
564
+ total: number;
565
+ limit: number;
566
+ offset: number;
567
+ }, Error, {
568
+ data: {
569
+ id: string;
570
+ departureId: string;
571
+ optionId: string;
572
+ optionUnitId: string;
573
+ priceCatalogId: string;
574
+ sellAmountCents: number;
575
+ costAmountCents: number | null;
576
+ notes: string | null;
577
+ active: boolean;
578
+ metadata?: Record<string, unknown> | null | undefined;
579
+ }[];
580
+ total: number;
581
+ limit: number;
582
+ offset: number;
583
+ }, readonly ["voyant", "pricing", "departure-price-overrides", "list", import("@voyantjs/pricing-react/query-keys").DeparturePriceOverridesListFilters]>, "queryFn"> & {
584
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
585
+ data: {
586
+ id: string;
587
+ departureId: string;
588
+ optionId: string;
589
+ optionUnitId: string;
590
+ priceCatalogId: string;
591
+ sellAmountCents: number;
592
+ costAmountCents: number | null;
593
+ notes: string | null;
594
+ active: boolean;
595
+ metadata?: Record<string, unknown> | null | undefined;
596
+ }[];
597
+ total: number;
598
+ limit: number;
599
+ offset: number;
600
+ }, readonly ["voyant", "pricing", "departure-price-overrides", "list", import("@voyantjs/pricing-react/query-keys").DeparturePriceOverridesListFilters], never> | undefined;
601
+ } & {
602
+ queryKey: readonly ["voyant", "pricing", "departure-price-overrides", "list", import("@voyantjs/pricing-react/query-keys").DeparturePriceOverridesListFilters] & {
603
+ [dataTagSymbol]: {
604
+ data: {
605
+ id: string;
606
+ departureId: string;
607
+ optionId: string;
608
+ optionUnitId: string;
609
+ priceCatalogId: string;
610
+ sellAmountCents: number;
611
+ costAmountCents: number | null;
612
+ notes: string | null;
613
+ active: boolean;
614
+ metadata?: Record<string, unknown> | null | undefined;
615
+ }[];
616
+ total: number;
617
+ limit: number;
618
+ offset: number;
619
+ };
620
+ [dataTagErrorSymbol]: Error;
621
+ };
622
+ };
623
+ //# sourceMappingURL=product-options-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-options-shared.d.ts","sourceRoot":"","sources":["../../../src/components/product-detail/product-options-shared.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAA;AAEjC;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,0BAA0B,CAAA;AAEtD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,MAAM,EACN,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,CAKpD,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,OAAO,CAAA;AAEnD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,QAAQ,CAAC,EAAE,MAAM,GAChB,mBAAmB,CAarB;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAErF;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjF;AAED,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtF;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAErE;AAED,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,aAAa,EACrB,iBAAiB,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM1B;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjE;AAED,wBAAgB,sCAAsC,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhG"}
@@ -0,0 +1,54 @@
1
+ import { getDeparturePriceOverridesQueryOptions as getSharedDeparturePriceOverridesQueryOptions, getOptionPriceRulesQueryOptions as getSharedOptionPriceRulesQueryOptions, getOptionUnitPriceRulesQueryOptions as getSharedOptionUnitPriceRulesQueryOptions, getPriceCatalogsQueryOptions as getSharedPriceCatalogsQueryOptions, getPricingCategoriesQueryOptions as getSharedPricingCategoriesQueryOptions, } from "@voyantjs/pricing-react";
2
+ import { getOptionUnitsQueryOptions as getSharedOptionUnitsQueryOptions, getProductOptionsQueryOptions as getSharedProductOptionsQueryOptions, } from "@voyantjs/products-react";
3
+ export const optionStatusVariant = {
4
+ draft: "outline",
5
+ active: "default",
6
+ archived: "secondary",
7
+ };
8
+ /**
9
+ * Derive the pricing layout from the product's booking mode. Multi-day /
10
+ * overnight modes imply rooms; single-day activity modes imply per-person
11
+ * seats. `dayCount` is a fallback for the ambiguous `other` mode (>1 day →
12
+ * rooms), matching the operator rule "more than one day means rooms".
13
+ */
14
+ export function deriveOptionPricingLayout(bookingMode, dayCount) {
15
+ switch (bookingMode) {
16
+ case "stay":
17
+ case "itinerary":
18
+ return "rooms";
19
+ case "date":
20
+ case "date_time":
21
+ case "open":
22
+ case "transfer":
23
+ return "seats";
24
+ default:
25
+ return dayCount != null && dayCount > 1 ? "rooms" : "seats";
26
+ }
27
+ }
28
+ export function getProductOptionsQueryOptions(client, productId) {
29
+ return getSharedProductOptionsQueryOptions(client, { productId, limit: 100 });
30
+ }
31
+ export function getOptionUnitsQueryOptions(client, optionId) {
32
+ return getSharedOptionUnitsQueryOptions(client, { optionId, limit: 100 });
33
+ }
34
+ export function getOptionPriceRulesQueryOptions(client, optionId) {
35
+ return getSharedOptionPriceRulesQueryOptions(client, { optionId, limit: 100 });
36
+ }
37
+ export function getPricingCategoriesQueryOptions(client) {
38
+ return getSharedPricingCategoriesQueryOptions(client, { limit: 100 });
39
+ }
40
+ export function getOptionUnitPriceRulesQueryOptions(client, optionPriceRuleId) {
41
+ return getSharedOptionUnitPriceRulesQueryOptions(client, {
42
+ optionPriceRuleId,
43
+ limit: 100,
44
+ });
45
+ }
46
+ export function getPriceCatalogsQueryOptions(client) {
47
+ return getSharedPriceCatalogsQueryOptions(client, { limit: 100 });
48
+ }
49
+ export function getDeparturePriceOverridesQueryOptions(client, departureId) {
50
+ return getSharedDeparturePriceOverridesQueryOptions(client, {
51
+ departureId,
52
+ limit: 100,
53
+ });
54
+ }