@voyantjs/bookings-react 0.4.4 → 0.5.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/hooks/index.d.ts +11 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +11 -0
- package/dist/hooks/use-booking-cancel-mutation.d.ts +25 -0
- package/dist/hooks/use-booking-cancel-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-cancel-mutation.js +24 -0
- package/dist/hooks/use-booking-convert-mutation.d.ts +31 -0
- package/dist/hooks/use-booking-convert-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-convert-mutation.js +24 -0
- package/dist/hooks/use-booking-documents.d.ts +41 -0
- package/dist/hooks/use-booking-documents.d.ts.map +1 -0
- package/dist/hooks/use-booking-documents.js +36 -0
- package/dist/hooks/use-booking-group-for-booking.d.ts +24 -0
- package/dist/hooks/use-booking-group-for-booking.d.ts.map +1 -0
- package/dist/hooks/use-booking-group-for-booking.js +12 -0
- package/dist/hooks/use-booking-group-member-mutation.d.ts +27 -0
- package/dist/hooks/use-booking-group-member-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-group-member-mutation.js +38 -0
- package/dist/hooks/use-booking-group-mutation.d.ts +40 -0
- package/dist/hooks/use-booking-group-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-group-mutation.js +32 -0
- package/dist/hooks/use-booking-group.d.ts +41 -0
- package/dist/hooks/use-booking-group.d.ts.map +1 -0
- package/dist/hooks/use-booking-group.js +12 -0
- package/dist/hooks/use-booking-groups.d.ts +21 -0
- package/dist/hooks/use-booking-groups.d.ts.map +1 -0
- package/dist/hooks/use-booking-groups.js +12 -0
- package/dist/hooks/use-booking-item-mutation.d.ts +77 -0
- package/dist/hooks/use-booking-item-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-item-mutation.js +42 -0
- package/dist/hooks/use-booking-item-participants.d.ts +32 -0
- package/dist/hooks/use-booking-item-participants.d.ts.map +1 -0
- package/dist/hooks/use-booking-item-participants.js +41 -0
- package/dist/hooks/use-booking-items.d.ts +31 -0
- package/dist/hooks/use-booking-items.d.ts.map +1 -0
- package/dist/hooks/use-booking-items.js +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/query-keys.d.ts +15 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +8 -0
- package/dist/query-options.d.ts +522 -0
- package/dist/query-options.d.ts.map +1 -1
- package/dist/query-options.js +57 -1
- package/dist/schemas.d.ts +500 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +119 -0
- package/package.json +5 -5
package/dist/query-options.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type FetchWithValidationOptions } from "./client.js";
|
|
2
2
|
import type { UseBookingOptions } from "./hooks/use-booking.js";
|
|
3
3
|
import type { UseBookingActivityOptions } from "./hooks/use-booking-activity.js";
|
|
4
|
+
import type { UseBookingDocumentsOptions } from "./hooks/use-booking-documents.js";
|
|
5
|
+
import type { UseBookingGroupOptions } from "./hooks/use-booking-group.js";
|
|
6
|
+
import type { UseBookingGroupForBookingOptions } from "./hooks/use-booking-group-for-booking.js";
|
|
7
|
+
import type { UseBookingGroupsOptions } from "./hooks/use-booking-groups.js";
|
|
8
|
+
import type { UseBookingItemParticipantsOptions } from "./hooks/use-booking-item-participants.js";
|
|
9
|
+
import type { UseBookingItemsOptions } from "./hooks/use-booking-items.js";
|
|
4
10
|
import type { UseBookingNotesOptions } from "./hooks/use-booking-notes.js";
|
|
5
11
|
import type { UseBookingsOptions } from "./hooks/use-bookings.js";
|
|
6
12
|
import type { UsePassengersOptions } from "./hooks/use-passengers.js";
|
|
@@ -177,6 +183,218 @@ export declare function getBookingQueryOptions(client: FetchWithValidationOption
|
|
|
177
183
|
[dataTagErrorSymbol]: Error;
|
|
178
184
|
};
|
|
179
185
|
};
|
|
186
|
+
export declare function getBookingItemsQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, options?: UseBookingItemsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
187
|
+
data: {
|
|
188
|
+
id: string;
|
|
189
|
+
bookingId: string;
|
|
190
|
+
title: string;
|
|
191
|
+
description: string | null;
|
|
192
|
+
itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
|
|
193
|
+
status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
|
|
194
|
+
serviceDate: string | null;
|
|
195
|
+
startsAt: string | null;
|
|
196
|
+
endsAt: string | null;
|
|
197
|
+
quantity: number;
|
|
198
|
+
sellCurrency: string;
|
|
199
|
+
unitSellAmountCents: number | null;
|
|
200
|
+
totalSellAmountCents: number | null;
|
|
201
|
+
costCurrency: string | null;
|
|
202
|
+
unitCostAmountCents: number | null;
|
|
203
|
+
totalCostAmountCents: number | null;
|
|
204
|
+
notes: string | null;
|
|
205
|
+
productId: string | null;
|
|
206
|
+
optionId: string | null;
|
|
207
|
+
optionUnitId: string | null;
|
|
208
|
+
pricingCategoryId: string | null;
|
|
209
|
+
createdAt: string;
|
|
210
|
+
updatedAt: string;
|
|
211
|
+
}[];
|
|
212
|
+
}, Error, {
|
|
213
|
+
data: {
|
|
214
|
+
id: string;
|
|
215
|
+
bookingId: string;
|
|
216
|
+
title: string;
|
|
217
|
+
description: string | null;
|
|
218
|
+
itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
|
|
219
|
+
status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
|
|
220
|
+
serviceDate: string | null;
|
|
221
|
+
startsAt: string | null;
|
|
222
|
+
endsAt: string | null;
|
|
223
|
+
quantity: number;
|
|
224
|
+
sellCurrency: string;
|
|
225
|
+
unitSellAmountCents: number | null;
|
|
226
|
+
totalSellAmountCents: number | null;
|
|
227
|
+
costCurrency: string | null;
|
|
228
|
+
unitCostAmountCents: number | null;
|
|
229
|
+
totalCostAmountCents: number | null;
|
|
230
|
+
notes: string | null;
|
|
231
|
+
productId: string | null;
|
|
232
|
+
optionId: string | null;
|
|
233
|
+
optionUnitId: string | null;
|
|
234
|
+
pricingCategoryId: string | null;
|
|
235
|
+
createdAt: string;
|
|
236
|
+
updatedAt: string;
|
|
237
|
+
}[];
|
|
238
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "items"]>, "queryFn"> & {
|
|
239
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
240
|
+
data: {
|
|
241
|
+
id: string;
|
|
242
|
+
bookingId: string;
|
|
243
|
+
title: string;
|
|
244
|
+
description: string | null;
|
|
245
|
+
itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
|
|
246
|
+
status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
|
|
247
|
+
serviceDate: string | null;
|
|
248
|
+
startsAt: string | null;
|
|
249
|
+
endsAt: string | null;
|
|
250
|
+
quantity: number;
|
|
251
|
+
sellCurrency: string;
|
|
252
|
+
unitSellAmountCents: number | null;
|
|
253
|
+
totalSellAmountCents: number | null;
|
|
254
|
+
costCurrency: string | null;
|
|
255
|
+
unitCostAmountCents: number | null;
|
|
256
|
+
totalCostAmountCents: number | null;
|
|
257
|
+
notes: string | null;
|
|
258
|
+
productId: string | null;
|
|
259
|
+
optionId: string | null;
|
|
260
|
+
optionUnitId: string | null;
|
|
261
|
+
pricingCategoryId: string | null;
|
|
262
|
+
createdAt: string;
|
|
263
|
+
updatedAt: string;
|
|
264
|
+
}[];
|
|
265
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "items"], never> | undefined;
|
|
266
|
+
} & {
|
|
267
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "detail", string, "items"] & {
|
|
268
|
+
[dataTagSymbol]: {
|
|
269
|
+
data: {
|
|
270
|
+
id: string;
|
|
271
|
+
bookingId: string;
|
|
272
|
+
title: string;
|
|
273
|
+
description: string | null;
|
|
274
|
+
itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
|
|
275
|
+
status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
|
|
276
|
+
serviceDate: string | null;
|
|
277
|
+
startsAt: string | null;
|
|
278
|
+
endsAt: string | null;
|
|
279
|
+
quantity: number;
|
|
280
|
+
sellCurrency: string;
|
|
281
|
+
unitSellAmountCents: number | null;
|
|
282
|
+
totalSellAmountCents: number | null;
|
|
283
|
+
costCurrency: string | null;
|
|
284
|
+
unitCostAmountCents: number | null;
|
|
285
|
+
totalCostAmountCents: number | null;
|
|
286
|
+
notes: string | null;
|
|
287
|
+
productId: string | null;
|
|
288
|
+
optionId: string | null;
|
|
289
|
+
optionUnitId: string | null;
|
|
290
|
+
pricingCategoryId: string | null;
|
|
291
|
+
createdAt: string;
|
|
292
|
+
updatedAt: string;
|
|
293
|
+
}[];
|
|
294
|
+
};
|
|
295
|
+
[dataTagErrorSymbol]: Error;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
export declare function getBookingItemParticipantsQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, itemId: string | null | undefined, options?: UseBookingItemParticipantsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
299
|
+
data: {
|
|
300
|
+
id: string;
|
|
301
|
+
bookingItemId: string;
|
|
302
|
+
participantId: string;
|
|
303
|
+
role: "traveler" | "occupant" | "other" | "primary_contact" | "service_assignee" | "beneficiary";
|
|
304
|
+
isPrimary: boolean;
|
|
305
|
+
createdAt: string;
|
|
306
|
+
}[];
|
|
307
|
+
}, Error, {
|
|
308
|
+
data: {
|
|
309
|
+
id: string;
|
|
310
|
+
bookingItemId: string;
|
|
311
|
+
participantId: string;
|
|
312
|
+
role: "traveler" | "occupant" | "other" | "primary_contact" | "service_assignee" | "beneficiary";
|
|
313
|
+
isPrimary: boolean;
|
|
314
|
+
createdAt: string;
|
|
315
|
+
}[];
|
|
316
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "items", string, "participants"]>, "queryFn"> & {
|
|
317
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
318
|
+
data: {
|
|
319
|
+
id: string;
|
|
320
|
+
bookingItemId: string;
|
|
321
|
+
participantId: string;
|
|
322
|
+
role: "traveler" | "occupant" | "other" | "primary_contact" | "service_assignee" | "beneficiary";
|
|
323
|
+
isPrimary: boolean;
|
|
324
|
+
createdAt: string;
|
|
325
|
+
}[];
|
|
326
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "items", string, "participants"], never> | undefined;
|
|
327
|
+
} & {
|
|
328
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "detail", string, "items", string, "participants"] & {
|
|
329
|
+
[dataTagSymbol]: {
|
|
330
|
+
data: {
|
|
331
|
+
id: string;
|
|
332
|
+
bookingItemId: string;
|
|
333
|
+
participantId: string;
|
|
334
|
+
role: "traveler" | "occupant" | "other" | "primary_contact" | "service_assignee" | "beneficiary";
|
|
335
|
+
isPrimary: boolean;
|
|
336
|
+
createdAt: string;
|
|
337
|
+
}[];
|
|
338
|
+
};
|
|
339
|
+
[dataTagErrorSymbol]: Error;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
export declare function getBookingDocumentsQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, options?: UseBookingDocumentsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
343
|
+
data: {
|
|
344
|
+
id: string;
|
|
345
|
+
bookingId: string;
|
|
346
|
+
participantId: string | null;
|
|
347
|
+
type: "other" | "visa" | "insurance" | "health" | "passport_copy";
|
|
348
|
+
fileName: string;
|
|
349
|
+
fileUrl: string;
|
|
350
|
+
expiresAt: string | null;
|
|
351
|
+
notes: string | null;
|
|
352
|
+
createdAt: string;
|
|
353
|
+
}[];
|
|
354
|
+
}, Error, {
|
|
355
|
+
data: {
|
|
356
|
+
id: string;
|
|
357
|
+
bookingId: string;
|
|
358
|
+
participantId: string | null;
|
|
359
|
+
type: "other" | "visa" | "insurance" | "health" | "passport_copy";
|
|
360
|
+
fileName: string;
|
|
361
|
+
fileUrl: string;
|
|
362
|
+
expiresAt: string | null;
|
|
363
|
+
notes: string | null;
|
|
364
|
+
createdAt: string;
|
|
365
|
+
}[];
|
|
366
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "documents"]>, "queryFn"> & {
|
|
367
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
368
|
+
data: {
|
|
369
|
+
id: string;
|
|
370
|
+
bookingId: string;
|
|
371
|
+
participantId: string | null;
|
|
372
|
+
type: "other" | "visa" | "insurance" | "health" | "passport_copy";
|
|
373
|
+
fileName: string;
|
|
374
|
+
fileUrl: string;
|
|
375
|
+
expiresAt: string | null;
|
|
376
|
+
notes: string | null;
|
|
377
|
+
createdAt: string;
|
|
378
|
+
}[];
|
|
379
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "documents"], never> | undefined;
|
|
380
|
+
} & {
|
|
381
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "detail", string, "documents"] & {
|
|
382
|
+
[dataTagSymbol]: {
|
|
383
|
+
data: {
|
|
384
|
+
id: string;
|
|
385
|
+
bookingId: string;
|
|
386
|
+
participantId: string | null;
|
|
387
|
+
type: "other" | "visa" | "insurance" | "health" | "passport_copy";
|
|
388
|
+
fileName: string;
|
|
389
|
+
fileUrl: string;
|
|
390
|
+
expiresAt: string | null;
|
|
391
|
+
notes: string | null;
|
|
392
|
+
createdAt: string;
|
|
393
|
+
}[];
|
|
394
|
+
};
|
|
395
|
+
[dataTagErrorSymbol]: Error;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
180
398
|
export declare function getPassengersQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, options?: UsePassengersOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
181
399
|
data: {
|
|
182
400
|
id: string;
|
|
@@ -825,4 +1043,308 @@ export declare function getPublicBookingSessionStateQueryOptions(client: FetchWi
|
|
|
825
1043
|
[dataTagErrorSymbol]: Error;
|
|
826
1044
|
};
|
|
827
1045
|
};
|
|
1046
|
+
export declare function getBookingGroupsQueryOptions(client: FetchWithValidationOptions, options?: UseBookingGroupsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
1047
|
+
data: {
|
|
1048
|
+
id: string;
|
|
1049
|
+
kind: "other" | "shared_room";
|
|
1050
|
+
label: string;
|
|
1051
|
+
primaryBookingId: string | null;
|
|
1052
|
+
productId: string | null;
|
|
1053
|
+
optionUnitId: string | null;
|
|
1054
|
+
metadata: Record<string, unknown> | null;
|
|
1055
|
+
createdAt: string;
|
|
1056
|
+
updatedAt: string;
|
|
1057
|
+
}[];
|
|
1058
|
+
total: number;
|
|
1059
|
+
limit: number;
|
|
1060
|
+
offset: number;
|
|
1061
|
+
}, Error, {
|
|
1062
|
+
data: {
|
|
1063
|
+
id: string;
|
|
1064
|
+
kind: "other" | "shared_room";
|
|
1065
|
+
label: string;
|
|
1066
|
+
primaryBookingId: string | null;
|
|
1067
|
+
productId: string | null;
|
|
1068
|
+
optionUnitId: string | null;
|
|
1069
|
+
metadata: Record<string, unknown> | null;
|
|
1070
|
+
createdAt: string;
|
|
1071
|
+
updatedAt: string;
|
|
1072
|
+
}[];
|
|
1073
|
+
total: number;
|
|
1074
|
+
limit: number;
|
|
1075
|
+
offset: number;
|
|
1076
|
+
}, readonly ["voyant", "bookings", "groups", "list", import("./query-keys.js").BookingGroupsListFilters]>, "queryFn"> & {
|
|
1077
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
1078
|
+
data: {
|
|
1079
|
+
id: string;
|
|
1080
|
+
kind: "other" | "shared_room";
|
|
1081
|
+
label: string;
|
|
1082
|
+
primaryBookingId: string | null;
|
|
1083
|
+
productId: string | null;
|
|
1084
|
+
optionUnitId: string | null;
|
|
1085
|
+
metadata: Record<string, unknown> | null;
|
|
1086
|
+
createdAt: string;
|
|
1087
|
+
updatedAt: string;
|
|
1088
|
+
}[];
|
|
1089
|
+
total: number;
|
|
1090
|
+
limit: number;
|
|
1091
|
+
offset: number;
|
|
1092
|
+
}, readonly ["voyant", "bookings", "groups", "list", import("./query-keys.js").BookingGroupsListFilters], never> | undefined;
|
|
1093
|
+
} & {
|
|
1094
|
+
queryKey: readonly ["voyant", "bookings", "groups", "list", import("./query-keys.js").BookingGroupsListFilters] & {
|
|
1095
|
+
[dataTagSymbol]: {
|
|
1096
|
+
data: {
|
|
1097
|
+
id: string;
|
|
1098
|
+
kind: "other" | "shared_room";
|
|
1099
|
+
label: string;
|
|
1100
|
+
primaryBookingId: string | null;
|
|
1101
|
+
productId: string | null;
|
|
1102
|
+
optionUnitId: string | null;
|
|
1103
|
+
metadata: Record<string, unknown> | null;
|
|
1104
|
+
createdAt: string;
|
|
1105
|
+
updatedAt: string;
|
|
1106
|
+
}[];
|
|
1107
|
+
total: number;
|
|
1108
|
+
limit: number;
|
|
1109
|
+
offset: number;
|
|
1110
|
+
};
|
|
1111
|
+
[dataTagErrorSymbol]: Error;
|
|
1112
|
+
};
|
|
1113
|
+
};
|
|
1114
|
+
export declare function getBookingGroupQueryOptions(client: FetchWithValidationOptions, id: string | null | undefined, options?: UseBookingGroupOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
1115
|
+
data: {
|
|
1116
|
+
id: string;
|
|
1117
|
+
kind: "other" | "shared_room";
|
|
1118
|
+
label: string;
|
|
1119
|
+
primaryBookingId: string | null;
|
|
1120
|
+
productId: string | null;
|
|
1121
|
+
optionUnitId: string | null;
|
|
1122
|
+
metadata: Record<string, unknown> | null;
|
|
1123
|
+
createdAt: string;
|
|
1124
|
+
updatedAt: string;
|
|
1125
|
+
members: {
|
|
1126
|
+
id: string;
|
|
1127
|
+
groupId: string;
|
|
1128
|
+
bookingId: string;
|
|
1129
|
+
role: "primary" | "shared";
|
|
1130
|
+
createdAt: string;
|
|
1131
|
+
booking: {
|
|
1132
|
+
id: string;
|
|
1133
|
+
bookingNumber: string;
|
|
1134
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
1135
|
+
personId: string | null;
|
|
1136
|
+
organizationId: string | null;
|
|
1137
|
+
sellCurrency: string;
|
|
1138
|
+
sellAmountCents: number | null;
|
|
1139
|
+
costAmountCents: number | null;
|
|
1140
|
+
marginPercent: number | null;
|
|
1141
|
+
startDate: string | null;
|
|
1142
|
+
endDate: string | null;
|
|
1143
|
+
pax: number | null;
|
|
1144
|
+
internalNotes: string | null;
|
|
1145
|
+
createdAt: string;
|
|
1146
|
+
updatedAt: string;
|
|
1147
|
+
} | null;
|
|
1148
|
+
}[];
|
|
1149
|
+
};
|
|
1150
|
+
}, Error, {
|
|
1151
|
+
data: {
|
|
1152
|
+
id: string;
|
|
1153
|
+
kind: "other" | "shared_room";
|
|
1154
|
+
label: string;
|
|
1155
|
+
primaryBookingId: string | null;
|
|
1156
|
+
productId: string | null;
|
|
1157
|
+
optionUnitId: string | null;
|
|
1158
|
+
metadata: Record<string, unknown> | null;
|
|
1159
|
+
createdAt: string;
|
|
1160
|
+
updatedAt: string;
|
|
1161
|
+
members: {
|
|
1162
|
+
id: string;
|
|
1163
|
+
groupId: string;
|
|
1164
|
+
bookingId: string;
|
|
1165
|
+
role: "primary" | "shared";
|
|
1166
|
+
createdAt: string;
|
|
1167
|
+
booking: {
|
|
1168
|
+
id: string;
|
|
1169
|
+
bookingNumber: string;
|
|
1170
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
1171
|
+
personId: string | null;
|
|
1172
|
+
organizationId: string | null;
|
|
1173
|
+
sellCurrency: string;
|
|
1174
|
+
sellAmountCents: number | null;
|
|
1175
|
+
costAmountCents: number | null;
|
|
1176
|
+
marginPercent: number | null;
|
|
1177
|
+
startDate: string | null;
|
|
1178
|
+
endDate: string | null;
|
|
1179
|
+
pax: number | null;
|
|
1180
|
+
internalNotes: string | null;
|
|
1181
|
+
createdAt: string;
|
|
1182
|
+
updatedAt: string;
|
|
1183
|
+
} | null;
|
|
1184
|
+
}[];
|
|
1185
|
+
};
|
|
1186
|
+
}, readonly ["voyant", "bookings", "groups", "detail", string]>, "queryFn"> & {
|
|
1187
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
1188
|
+
data: {
|
|
1189
|
+
id: string;
|
|
1190
|
+
kind: "other" | "shared_room";
|
|
1191
|
+
label: string;
|
|
1192
|
+
primaryBookingId: string | null;
|
|
1193
|
+
productId: string | null;
|
|
1194
|
+
optionUnitId: string | null;
|
|
1195
|
+
metadata: Record<string, unknown> | null;
|
|
1196
|
+
createdAt: string;
|
|
1197
|
+
updatedAt: string;
|
|
1198
|
+
members: {
|
|
1199
|
+
id: string;
|
|
1200
|
+
groupId: string;
|
|
1201
|
+
bookingId: string;
|
|
1202
|
+
role: "primary" | "shared";
|
|
1203
|
+
createdAt: string;
|
|
1204
|
+
booking: {
|
|
1205
|
+
id: string;
|
|
1206
|
+
bookingNumber: string;
|
|
1207
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
1208
|
+
personId: string | null;
|
|
1209
|
+
organizationId: string | null;
|
|
1210
|
+
sellCurrency: string;
|
|
1211
|
+
sellAmountCents: number | null;
|
|
1212
|
+
costAmountCents: number | null;
|
|
1213
|
+
marginPercent: number | null;
|
|
1214
|
+
startDate: string | null;
|
|
1215
|
+
endDate: string | null;
|
|
1216
|
+
pax: number | null;
|
|
1217
|
+
internalNotes: string | null;
|
|
1218
|
+
createdAt: string;
|
|
1219
|
+
updatedAt: string;
|
|
1220
|
+
} | null;
|
|
1221
|
+
}[];
|
|
1222
|
+
};
|
|
1223
|
+
}, readonly ["voyant", "bookings", "groups", "detail", string], never> | undefined;
|
|
1224
|
+
} & {
|
|
1225
|
+
queryKey: readonly ["voyant", "bookings", "groups", "detail", string] & {
|
|
1226
|
+
[dataTagSymbol]: {
|
|
1227
|
+
data: {
|
|
1228
|
+
id: string;
|
|
1229
|
+
kind: "other" | "shared_room";
|
|
1230
|
+
label: string;
|
|
1231
|
+
primaryBookingId: string | null;
|
|
1232
|
+
productId: string | null;
|
|
1233
|
+
optionUnitId: string | null;
|
|
1234
|
+
metadata: Record<string, unknown> | null;
|
|
1235
|
+
createdAt: string;
|
|
1236
|
+
updatedAt: string;
|
|
1237
|
+
members: {
|
|
1238
|
+
id: string;
|
|
1239
|
+
groupId: string;
|
|
1240
|
+
bookingId: string;
|
|
1241
|
+
role: "primary" | "shared";
|
|
1242
|
+
createdAt: string;
|
|
1243
|
+
booking: {
|
|
1244
|
+
id: string;
|
|
1245
|
+
bookingNumber: string;
|
|
1246
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
1247
|
+
personId: string | null;
|
|
1248
|
+
organizationId: string | null;
|
|
1249
|
+
sellCurrency: string;
|
|
1250
|
+
sellAmountCents: number | null;
|
|
1251
|
+
costAmountCents: number | null;
|
|
1252
|
+
marginPercent: number | null;
|
|
1253
|
+
startDate: string | null;
|
|
1254
|
+
endDate: string | null;
|
|
1255
|
+
pax: number | null;
|
|
1256
|
+
internalNotes: string | null;
|
|
1257
|
+
createdAt: string;
|
|
1258
|
+
updatedAt: string;
|
|
1259
|
+
} | null;
|
|
1260
|
+
}[];
|
|
1261
|
+
};
|
|
1262
|
+
};
|
|
1263
|
+
[dataTagErrorSymbol]: Error;
|
|
1264
|
+
};
|
|
1265
|
+
};
|
|
1266
|
+
export declare function getBookingGroupForBookingQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, options?: UseBookingGroupForBookingOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
1267
|
+
data: {
|
|
1268
|
+
id: string;
|
|
1269
|
+
kind: "other" | "shared_room";
|
|
1270
|
+
label: string;
|
|
1271
|
+
primaryBookingId: string | null;
|
|
1272
|
+
productId: string | null;
|
|
1273
|
+
optionUnitId: string | null;
|
|
1274
|
+
metadata: Record<string, unknown> | null;
|
|
1275
|
+
createdAt: string;
|
|
1276
|
+
updatedAt: string;
|
|
1277
|
+
membership: {
|
|
1278
|
+
id: string;
|
|
1279
|
+
groupId: string;
|
|
1280
|
+
bookingId: string;
|
|
1281
|
+
role: "primary" | "shared";
|
|
1282
|
+
createdAt: string;
|
|
1283
|
+
};
|
|
1284
|
+
} | null;
|
|
1285
|
+
}, Error, {
|
|
1286
|
+
data: {
|
|
1287
|
+
id: string;
|
|
1288
|
+
kind: "other" | "shared_room";
|
|
1289
|
+
label: string;
|
|
1290
|
+
primaryBookingId: string | null;
|
|
1291
|
+
productId: string | null;
|
|
1292
|
+
optionUnitId: string | null;
|
|
1293
|
+
metadata: Record<string, unknown> | null;
|
|
1294
|
+
createdAt: string;
|
|
1295
|
+
updatedAt: string;
|
|
1296
|
+
membership: {
|
|
1297
|
+
id: string;
|
|
1298
|
+
groupId: string;
|
|
1299
|
+
bookingId: string;
|
|
1300
|
+
role: "primary" | "shared";
|
|
1301
|
+
createdAt: string;
|
|
1302
|
+
};
|
|
1303
|
+
} | null;
|
|
1304
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "group"]>, "queryFn"> & {
|
|
1305
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
1306
|
+
data: {
|
|
1307
|
+
id: string;
|
|
1308
|
+
kind: "other" | "shared_room";
|
|
1309
|
+
label: string;
|
|
1310
|
+
primaryBookingId: string | null;
|
|
1311
|
+
productId: string | null;
|
|
1312
|
+
optionUnitId: string | null;
|
|
1313
|
+
metadata: Record<string, unknown> | null;
|
|
1314
|
+
createdAt: string;
|
|
1315
|
+
updatedAt: string;
|
|
1316
|
+
membership: {
|
|
1317
|
+
id: string;
|
|
1318
|
+
groupId: string;
|
|
1319
|
+
bookingId: string;
|
|
1320
|
+
role: "primary" | "shared";
|
|
1321
|
+
createdAt: string;
|
|
1322
|
+
};
|
|
1323
|
+
} | null;
|
|
1324
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "group"], never> | undefined;
|
|
1325
|
+
} & {
|
|
1326
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "detail", string, "group"] & {
|
|
1327
|
+
[dataTagSymbol]: {
|
|
1328
|
+
data: {
|
|
1329
|
+
id: string;
|
|
1330
|
+
kind: "other" | "shared_room";
|
|
1331
|
+
label: string;
|
|
1332
|
+
primaryBookingId: string | null;
|
|
1333
|
+
productId: string | null;
|
|
1334
|
+
optionUnitId: string | null;
|
|
1335
|
+
metadata: Record<string, unknown> | null;
|
|
1336
|
+
createdAt: string;
|
|
1337
|
+
updatedAt: string;
|
|
1338
|
+
membership: {
|
|
1339
|
+
id: string;
|
|
1340
|
+
groupId: string;
|
|
1341
|
+
bookingId: string;
|
|
1342
|
+
role: "primary" | "shared";
|
|
1343
|
+
createdAt: string;
|
|
1344
|
+
};
|
|
1345
|
+
} | null;
|
|
1346
|
+
};
|
|
1347
|
+
[dataTagErrorSymbol]: Error;
|
|
1348
|
+
};
|
|
1349
|
+
};
|
|
828
1350
|
//# sourceMappingURL=query-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAuB,MAAM,aAAa,CAAA;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBtC;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,0BAA0B,EAClC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7B,OAAO,GAAE,sBAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQrC;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,gCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY/C"}
|
package/dist/query-options.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { queryOptions } from "@tanstack/react-query";
|
|
3
3
|
import { fetchWithValidation } from "./client.js";
|
|
4
4
|
import { bookingsQueryKeys } from "./query-keys.js";
|
|
5
|
-
import { bookingActivityResponse, bookingListResponse, bookingNotesResponse, bookingPassengersResponse, bookingSingleResponse, bookingSupplierStatusesResponse, publicBookingSessionResponse, publicBookingSessionStateResponse, } from "./schemas.js";
|
|
5
|
+
import { bookingActivityResponse, bookingDocumentsResponse, bookingGroupDetailResponse, bookingGroupForBookingResponse, bookingGroupListResponse, bookingItemParticipantsResponse, bookingItemsResponse, bookingListResponse, bookingNotesResponse, bookingPassengersResponse, bookingSingleResponse, bookingSupplierStatusesResponse, publicBookingSessionResponse, publicBookingSessionStateResponse, } from "./schemas.js";
|
|
6
6
|
export function getBookingsQueryOptions(client, options = {}) {
|
|
7
7
|
const { enabled: _enabled = true, ...filters } = options;
|
|
8
8
|
return queryOptions({
|
|
@@ -29,6 +29,27 @@ export function getBookingQueryOptions(client, id, options = {}) {
|
|
|
29
29
|
queryFn: () => fetchWithValidation(`/v1/bookings/${id}`, bookingSingleResponse, client),
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
export function getBookingItemsQueryOptions(client, bookingId, options = {}) {
|
|
33
|
+
const { enabled: _enabled = true } = options;
|
|
34
|
+
return queryOptions({
|
|
35
|
+
queryKey: bookingsQueryKeys.items(bookingId ?? ""),
|
|
36
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/items`, bookingItemsResponse, client),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export function getBookingItemParticipantsQueryOptions(client, bookingId, itemId, options = {}) {
|
|
40
|
+
const { enabled: _enabled = true } = options;
|
|
41
|
+
return queryOptions({
|
|
42
|
+
queryKey: bookingsQueryKeys.itemParticipants(bookingId ?? "", itemId ?? ""),
|
|
43
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/items/${itemId}/participants`, bookingItemParticipantsResponse, client),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export function getBookingDocumentsQueryOptions(client, bookingId, options = {}) {
|
|
47
|
+
const { enabled: _enabled = true } = options;
|
|
48
|
+
return queryOptions({
|
|
49
|
+
queryKey: bookingsQueryKeys.documents(bookingId ?? ""),
|
|
50
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/documents`, bookingDocumentsResponse, client),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
32
53
|
export function getPassengersQueryOptions(client, bookingId, options = {}) {
|
|
33
54
|
const { enabled: _enabled = true } = options;
|
|
34
55
|
return queryOptions({
|
|
@@ -69,3 +90,38 @@ export function getPublicBookingSessionStateQueryOptions(client, sessionId) {
|
|
|
69
90
|
queryFn: () => fetchWithValidation(`/v1/public/bookings/sessions/${sessionId}/state`, publicBookingSessionStateResponse, client),
|
|
70
91
|
});
|
|
71
92
|
}
|
|
93
|
+
export function getBookingGroupsQueryOptions(client, options = {}) {
|
|
94
|
+
const { enabled: _enabled = true, ...filters } = options;
|
|
95
|
+
return queryOptions({
|
|
96
|
+
queryKey: bookingsQueryKeys.groupsList(filters),
|
|
97
|
+
queryFn: () => {
|
|
98
|
+
const params = new URLSearchParams();
|
|
99
|
+
if (filters.kind)
|
|
100
|
+
params.set("kind", filters.kind);
|
|
101
|
+
if (filters.productId)
|
|
102
|
+
params.set("productId", filters.productId);
|
|
103
|
+
if (filters.optionUnitId)
|
|
104
|
+
params.set("optionUnitId", filters.optionUnitId);
|
|
105
|
+
if (filters.limit !== undefined)
|
|
106
|
+
params.set("limit", String(filters.limit));
|
|
107
|
+
if (filters.offset !== undefined)
|
|
108
|
+
params.set("offset", String(filters.offset));
|
|
109
|
+
const qs = params.toString();
|
|
110
|
+
return fetchWithValidation(`/v1/bookings/groups${qs ? `?${qs}` : ""}`, bookingGroupListResponse, client);
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
export function getBookingGroupQueryOptions(client, id, options = {}) {
|
|
115
|
+
const { enabled: _enabled = true } = options;
|
|
116
|
+
return queryOptions({
|
|
117
|
+
queryKey: bookingsQueryKeys.group(id ?? ""),
|
|
118
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/groups/${id}`, bookingGroupDetailResponse, client),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
export function getBookingGroupForBookingQueryOptions(client, bookingId, options = {}) {
|
|
122
|
+
const { enabled: _enabled = true } = options;
|
|
123
|
+
return queryOptions({
|
|
124
|
+
queryKey: bookingsQueryKeys.groupForBooking(bookingId ?? ""),
|
|
125
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/group`, bookingGroupForBookingResponse, client),
|
|
126
|
+
});
|
|
127
|
+
}
|