@voyantjs/bookings-react 0.6.9 → 0.7.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 +4 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +4 -1
- package/dist/hooks/use-booking-convert-mutation.d.ts +6 -0
- package/dist/hooks/use-booking-convert-mutation.d.ts.map +1 -1
- package/dist/hooks/use-booking-dual-create-mutation.d.ts +146 -0
- package/dist/hooks/use-booking-dual-create-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-dual-create-mutation.js +45 -0
- package/dist/hooks/use-booking-quick-create-mutation.d.ts +122 -0
- package/dist/hooks/use-booking-quick-create-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-quick-create-mutation.js +40 -0
- package/dist/hooks/use-booking-status-mutation.d.ts +27 -0
- package/dist/hooks/use-booking-status-mutation.d.ts.map +1 -1
- package/dist/hooks/use-booking-status-mutation.js +24 -0
- package/dist/hooks/use-pricing-preview.d.ts +49 -0
- package/dist/hooks/use-pricing-preview.d.ts.map +1 -0
- package/dist/hooks/use-pricing-preview.js +18 -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 +6 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +1 -0
- package/dist/query-options.d.ts +159 -0
- package/dist/query-options.d.ts.map +1 -1
- package/dist/query-options.js +20 -1
- package/dist/schemas.d.ts +73 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +44 -0
- package/package.json +5 -5
package/dist/hooks/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { type UseBookingActivityOptions, useBookingActivity } from "./use-bookin
|
|
|
3
3
|
export { type CancelBookingInput, useBookingCancelMutation, } from "./use-booking-cancel-mutation.js";
|
|
4
4
|
export { type ConvertProductToBookingInput, useBookingConvertMutation, } from "./use-booking-convert-mutation.js";
|
|
5
5
|
export { type CreateBookingTravelerDocumentInput, type UseBookingTravelerDocumentsOptions, useBookingTravelerDocumentMutation, useBookingTravelerDocuments, } from "./use-booking-documents.js";
|
|
6
|
+
export { type DualCreateBookingInput, type DualCreateBookingResult, type DualCreateGroupInput, type DualCreateSubBookingInput, useBookingDualCreateMutation, } from "./use-booking-dual-create-mutation.js";
|
|
6
7
|
export { type UseBookingGroupOptions, useBookingGroup } from "./use-booking-group.js";
|
|
7
8
|
export { type UseBookingGroupForBookingOptions, useBookingGroupForBooking, } from "./use-booking-group-for-booking.js";
|
|
8
9
|
export { type AddBookingGroupMemberInput, useBookingGroupMemberMutation, } from "./use-booking-group-member-mutation.js";
|
|
@@ -15,8 +16,10 @@ export { type CreateBookingInput, type UpdateBookingInput, useBookingMutation, }
|
|
|
15
16
|
export { type CreateBookingNoteInput, useBookingNoteMutation, } from "./use-booking-note-mutation.js";
|
|
16
17
|
export { type UseBookingNotesOptions, useBookingNotes } from "./use-booking-notes.js";
|
|
17
18
|
export { type UseBookingPrimaryProductOptions, type UseBookingPrimaryProductResult, useBookingPrimaryProduct, } from "./use-booking-primary-product.js";
|
|
18
|
-
export { type
|
|
19
|
+
export { type QuickCreateBookingInput, type QuickCreateBookingResult, type QuickCreateGroupMembershipInput, type QuickCreatePaymentScheduleInput, type QuickCreateTravelerInput, type QuickCreateVoucherRedemptionInput, useBookingQuickCreateMutation, } from "./use-booking-quick-create-mutation.js";
|
|
20
|
+
export { type UpdateBookingStatusByIdInput, type UpdateBookingStatusInput, useBookingStatusByIdMutation, useBookingStatusMutation, } from "./use-booking-status-mutation.js";
|
|
19
21
|
export { type UseBookingsOptions, useBookings } from "./use-bookings.js";
|
|
22
|
+
export { type UsePricingPreviewOptions, usePricingPreview } from "./use-pricing-preview.js";
|
|
20
23
|
export { type UsePublicBookingSessionOptions, usePublicBookingSession, } from "./use-public-booking-session.js";
|
|
21
24
|
export { usePublicBookingSessionFlowMutation } from "./use-public-booking-session-flow-mutation.js";
|
|
22
25
|
export { type UsePublicBookingSessionStateOptions, usePublicBookingSessionState, } from "./use-public-booking-session-state.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAE,KAAK,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9F,OAAO,EACL,KAAK,kBAAkB,EACvB,wBAAwB,GACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACL,KAAK,4BAA4B,EACjC,yBAAyB,GAC1B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EACvC,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,KAAK,sBAAsB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACrF,OAAO,EACL,KAAK,gCAAgC,EACrC,yBAAyB,GAC1B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,KAAK,0BAA0B,EAC/B,6BAA6B,GAC9B,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,uBAAuB,GACxB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,KAAK,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AACxF,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,sBAAsB,GACvB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,KAAK,sBAAsB,EAAE,eAAe,EAAE,MAAM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3
|
export { useBookingCancelMutation, } from "./use-booking-cancel-mutation.js";
|
|
4
4
|
export { useBookingConvertMutation, } from "./use-booking-convert-mutation.js";
|
|
5
5
|
export { useBookingTravelerDocumentMutation, useBookingTravelerDocuments, } from "./use-booking-documents.js";
|
|
6
|
+
export { useBookingDualCreateMutation, } from "./use-booking-dual-create-mutation.js";
|
|
6
7
|
export { useBookingGroup } from "./use-booking-group.js";
|
|
7
8
|
export { useBookingGroupForBooking, } from "./use-booking-group-for-booking.js";
|
|
8
9
|
export { useBookingGroupMemberMutation, } from "./use-booking-group-member-mutation.js";
|
|
@@ -15,8 +16,10 @@ export { useBookingMutation, } from "./use-booking-mutation.js";
|
|
|
15
16
|
export { useBookingNoteMutation, } from "./use-booking-note-mutation.js";
|
|
16
17
|
export { useBookingNotes } from "./use-booking-notes.js";
|
|
17
18
|
export { useBookingPrimaryProduct, } from "./use-booking-primary-product.js";
|
|
18
|
-
export {
|
|
19
|
+
export { useBookingQuickCreateMutation, } from "./use-booking-quick-create-mutation.js";
|
|
20
|
+
export { useBookingStatusByIdMutation, useBookingStatusMutation, } from "./use-booking-status-mutation.js";
|
|
19
21
|
export { useBookings } from "./use-bookings.js";
|
|
22
|
+
export { usePricingPreview } from "./use-pricing-preview.js";
|
|
20
23
|
export { usePublicBookingSession, } from "./use-public-booking-session.js";
|
|
21
24
|
export { usePublicBookingSessionFlowMutation } from "./use-public-booking-session-flow-mutation.js";
|
|
22
25
|
export { usePublicBookingSessionState, } from "./use-public-booking-session-state.js";
|
|
@@ -2,6 +2,12 @@ export interface ConvertProductToBookingInput {
|
|
|
2
2
|
productId: string;
|
|
3
3
|
bookingNumber: string;
|
|
4
4
|
optionId?: string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Availability slot the operator picked. When set, the booking's start/end
|
|
7
|
+
* dates are pinned to the slot instead of defaulting to the (typically null)
|
|
8
|
+
* product dates. Server-side validation rejects mismatched product/option.
|
|
9
|
+
*/
|
|
10
|
+
slotId?: string | null;
|
|
5
11
|
personId?: string | null;
|
|
6
12
|
organizationId?: string | null;
|
|
7
13
|
internalNotes?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-booking-convert-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-convert-mutation.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB;;;;;;;;;;;;;;;;iDAkBxC"}
|
|
1
|
+
{"version":3,"file":"use-booking-convert-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-convert-mutation.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB;;;;;;;;;;;;;;;;iDAkBxC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { QuickCreateBookingInput } from "./use-booking-quick-create-mutation.js";
|
|
3
|
+
/**
|
|
4
|
+
* Sub-booking payload for dual-create. Same shape as quickCreate input
|
|
5
|
+
* minus `groupMembership` — the dual endpoint manages the group itself.
|
|
6
|
+
*/
|
|
7
|
+
export type DualCreateSubBookingInput = Omit<QuickCreateBookingInput, "groupMembership">;
|
|
8
|
+
export interface DualCreateGroupInput {
|
|
9
|
+
kind?: "shared_room" | "other";
|
|
10
|
+
label?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* option_unit the shared group occupies. The dual flow lives-or-dies on
|
|
13
|
+
* matching this across both bookings — when set, both sub-bookings should
|
|
14
|
+
* target the same optionUnitId in their passengers/allocations.
|
|
15
|
+
*/
|
|
16
|
+
optionUnitId?: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface DualCreateBookingInput {
|
|
19
|
+
primary: DualCreateSubBookingInput;
|
|
20
|
+
secondary: DualCreateSubBookingInput;
|
|
21
|
+
group?: DualCreateGroupInput;
|
|
22
|
+
}
|
|
23
|
+
declare const dualCreateResultSchema: z.ZodObject<{
|
|
24
|
+
primary: z.ZodObject<{
|
|
25
|
+
booking: z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
bookingNumber: z.ZodString;
|
|
28
|
+
status: z.ZodEnum<{
|
|
29
|
+
draft: "draft";
|
|
30
|
+
on_hold: "on_hold";
|
|
31
|
+
confirmed: "confirmed";
|
|
32
|
+
in_progress: "in_progress";
|
|
33
|
+
completed: "completed";
|
|
34
|
+
expired: "expired";
|
|
35
|
+
cancelled: "cancelled";
|
|
36
|
+
}>;
|
|
37
|
+
personId: z.ZodNullable<z.ZodString>;
|
|
38
|
+
organizationId: z.ZodNullable<z.ZodString>;
|
|
39
|
+
sellCurrency: z.ZodString;
|
|
40
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
41
|
+
costAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
42
|
+
marginPercent: z.ZodNullable<z.ZodNumber>;
|
|
43
|
+
startDate: z.ZodNullable<z.ZodString>;
|
|
44
|
+
endDate: z.ZodNullable<z.ZodString>;
|
|
45
|
+
pax: z.ZodNullable<z.ZodNumber>;
|
|
46
|
+
internalNotes: z.ZodNullable<z.ZodString>;
|
|
47
|
+
createdAt: z.ZodString;
|
|
48
|
+
updatedAt: z.ZodString;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
travelers: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
51
|
+
paymentSchedules: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
52
|
+
voucherRedemption: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
secondary: z.ZodObject<{
|
|
55
|
+
booking: z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
bookingNumber: z.ZodString;
|
|
58
|
+
status: z.ZodEnum<{
|
|
59
|
+
draft: "draft";
|
|
60
|
+
on_hold: "on_hold";
|
|
61
|
+
confirmed: "confirmed";
|
|
62
|
+
in_progress: "in_progress";
|
|
63
|
+
completed: "completed";
|
|
64
|
+
expired: "expired";
|
|
65
|
+
cancelled: "cancelled";
|
|
66
|
+
}>;
|
|
67
|
+
personId: z.ZodNullable<z.ZodString>;
|
|
68
|
+
organizationId: z.ZodNullable<z.ZodString>;
|
|
69
|
+
sellCurrency: z.ZodString;
|
|
70
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
71
|
+
costAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
72
|
+
marginPercent: z.ZodNullable<z.ZodNumber>;
|
|
73
|
+
startDate: z.ZodNullable<z.ZodString>;
|
|
74
|
+
endDate: z.ZodNullable<z.ZodString>;
|
|
75
|
+
pax: z.ZodNullable<z.ZodNumber>;
|
|
76
|
+
internalNotes: z.ZodNullable<z.ZodString>;
|
|
77
|
+
createdAt: z.ZodString;
|
|
78
|
+
updatedAt: z.ZodString;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
travelers: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
81
|
+
paymentSchedules: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
82
|
+
voucherRedemption: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
group: z.ZodUnknown;
|
|
85
|
+
primaryMember: z.ZodUnknown;
|
|
86
|
+
secondaryMember: z.ZodUnknown;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export type DualCreateBookingResult = z.infer<typeof dualCreateResultSchema>;
|
|
89
|
+
/**
|
|
90
|
+
* Atomic dual-booking (partaj) create: calls `POST /v1/bookings/dual-create`
|
|
91
|
+
* which wraps two quickCreate calls + one booking_group in a single
|
|
92
|
+
* transaction. Use this over calling useBookingQuickCreateMutation twice
|
|
93
|
+
* from a submit handler — a failure on the second call there would leave
|
|
94
|
+
* the first booking orphaned.
|
|
95
|
+
*/
|
|
96
|
+
export declare function useBookingDualCreateMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
97
|
+
primary: {
|
|
98
|
+
booking: {
|
|
99
|
+
id: string;
|
|
100
|
+
bookingNumber: string;
|
|
101
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
102
|
+
personId: string | null;
|
|
103
|
+
organizationId: string | null;
|
|
104
|
+
sellCurrency: string;
|
|
105
|
+
sellAmountCents: number | null;
|
|
106
|
+
costAmountCents: number | null;
|
|
107
|
+
marginPercent: number | null;
|
|
108
|
+
startDate: string | null;
|
|
109
|
+
endDate: string | null;
|
|
110
|
+
pax: number | null;
|
|
111
|
+
internalNotes: string | null;
|
|
112
|
+
createdAt: string;
|
|
113
|
+
updatedAt: string;
|
|
114
|
+
};
|
|
115
|
+
travelers?: unknown[] | undefined;
|
|
116
|
+
paymentSchedules?: unknown[] | undefined;
|
|
117
|
+
voucherRedemption?: unknown;
|
|
118
|
+
};
|
|
119
|
+
secondary: {
|
|
120
|
+
booking: {
|
|
121
|
+
id: string;
|
|
122
|
+
bookingNumber: string;
|
|
123
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
124
|
+
personId: string | null;
|
|
125
|
+
organizationId: string | null;
|
|
126
|
+
sellCurrency: string;
|
|
127
|
+
sellAmountCents: number | null;
|
|
128
|
+
costAmountCents: number | null;
|
|
129
|
+
marginPercent: number | null;
|
|
130
|
+
startDate: string | null;
|
|
131
|
+
endDate: string | null;
|
|
132
|
+
pax: number | null;
|
|
133
|
+
internalNotes: string | null;
|
|
134
|
+
createdAt: string;
|
|
135
|
+
updatedAt: string;
|
|
136
|
+
};
|
|
137
|
+
travelers?: unknown[] | undefined;
|
|
138
|
+
paymentSchedules?: unknown[] | undefined;
|
|
139
|
+
voucherRedemption?: unknown;
|
|
140
|
+
};
|
|
141
|
+
group: unknown;
|
|
142
|
+
primaryMember: unknown;
|
|
143
|
+
secondaryMember: unknown;
|
|
144
|
+
}, Error, DualCreateBookingInput, unknown>;
|
|
145
|
+
export {};
|
|
146
|
+
//# sourceMappingURL=use-booking-dual-create-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-dual-create-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-dual-create-mutation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAA;AAErF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,CAAA;AAExF,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,yBAAyB,CAAA;IAClC,SAAS,EAAE,yBAAyB,CAAA;IACpC,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAC7B;AAED,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgB1B,CAAA;AAIF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE5E;;;;;;GAMG;AACH,wBAAgB,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAkB3C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { fetchWithValidation } from "../client.js";
|
|
5
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
6
|
+
import { bookingsQueryKeys } from "../query-keys.js";
|
|
7
|
+
import { bookingRecordSchema } from "../schemas.js";
|
|
8
|
+
const dualCreateResultSchema = z.object({
|
|
9
|
+
primary: z.object({
|
|
10
|
+
booking: bookingRecordSchema,
|
|
11
|
+
travelers: z.array(z.unknown()).optional(),
|
|
12
|
+
paymentSchedules: z.array(z.unknown()).optional(),
|
|
13
|
+
voucherRedemption: z.unknown().nullable().optional(),
|
|
14
|
+
}),
|
|
15
|
+
secondary: z.object({
|
|
16
|
+
booking: bookingRecordSchema,
|
|
17
|
+
travelers: z.array(z.unknown()).optional(),
|
|
18
|
+
paymentSchedules: z.array(z.unknown()).optional(),
|
|
19
|
+
voucherRedemption: z.unknown().nullable().optional(),
|
|
20
|
+
}),
|
|
21
|
+
group: z.unknown(),
|
|
22
|
+
primaryMember: z.unknown(),
|
|
23
|
+
secondaryMember: z.unknown(),
|
|
24
|
+
});
|
|
25
|
+
const dualCreateResponseSchema = z.object({ data: dualCreateResultSchema });
|
|
26
|
+
/**
|
|
27
|
+
* Atomic dual-booking (partaj) create: calls `POST /v1/bookings/dual-create`
|
|
28
|
+
* which wraps two quickCreate calls + one booking_group in a single
|
|
29
|
+
* transaction. Use this over calling useBookingQuickCreateMutation twice
|
|
30
|
+
* from a submit handler — a failure on the second call there would leave
|
|
31
|
+
* the first booking orphaned.
|
|
32
|
+
*/
|
|
33
|
+
export function useBookingDualCreateMutation() {
|
|
34
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
35
|
+
const queryClient = useQueryClient();
|
|
36
|
+
return useMutation({
|
|
37
|
+
mutationFn: async (input) => {
|
|
38
|
+
const { data } = await fetchWithValidation("/v1/bookings/dual-create", dualCreateResponseSchema, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
39
|
+
return data;
|
|
40
|
+
},
|
|
41
|
+
onSuccess: () => {
|
|
42
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.bookings() });
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export interface QuickCreateTravelerInput {
|
|
3
|
+
firstName: string;
|
|
4
|
+
lastName: string;
|
|
5
|
+
email?: string | null;
|
|
6
|
+
phone?: string | null;
|
|
7
|
+
personId?: string | null;
|
|
8
|
+
participantType?: "traveler" | "occupant" | "other";
|
|
9
|
+
travelerCategory?: "adult" | "child" | "infant" | "senior" | "other" | null;
|
|
10
|
+
preferredLanguage?: string | null;
|
|
11
|
+
accessibilityNeeds?: string | null;
|
|
12
|
+
specialRequests?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* option_unit_id of the room the passenger is assigned to. Round-trips
|
|
15
|
+
* from the UI PassengersSection even though the server currently doesn't
|
|
16
|
+
* persist it — the follow-up that adds a traveler→room link will pick it
|
|
17
|
+
* up without the client changing.
|
|
18
|
+
*/
|
|
19
|
+
roomUnitId?: string | null;
|
|
20
|
+
isPrimary?: boolean | null;
|
|
21
|
+
notes?: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface QuickCreatePaymentScheduleInput {
|
|
24
|
+
scheduleType?: "deposit" | "installment" | "balance" | "hold" | "other";
|
|
25
|
+
status?: "pending" | "due" | "paid" | "waived" | "cancelled" | "expired";
|
|
26
|
+
dueDate: string;
|
|
27
|
+
currency: string;
|
|
28
|
+
amountCents: number;
|
|
29
|
+
notes?: string | null;
|
|
30
|
+
}
|
|
31
|
+
export interface QuickCreateVoucherRedemptionInput {
|
|
32
|
+
voucherId: string;
|
|
33
|
+
amountCents: number;
|
|
34
|
+
}
|
|
35
|
+
export type QuickCreateGroupMembershipInput = {
|
|
36
|
+
action: "join";
|
|
37
|
+
groupId: string;
|
|
38
|
+
role?: "primary" | "shared";
|
|
39
|
+
} | {
|
|
40
|
+
action: "create";
|
|
41
|
+
kind?: "shared_room" | "other";
|
|
42
|
+
label?: string | null;
|
|
43
|
+
optionUnitId?: string | null;
|
|
44
|
+
makeBookingPrimary?: boolean;
|
|
45
|
+
};
|
|
46
|
+
export interface QuickCreateBookingInput {
|
|
47
|
+
productId: string;
|
|
48
|
+
optionId?: string | null;
|
|
49
|
+
slotId?: string | null;
|
|
50
|
+
bookingNumber: string;
|
|
51
|
+
personId?: string | null;
|
|
52
|
+
organizationId?: string | null;
|
|
53
|
+
internalNotes?: string | null;
|
|
54
|
+
travelers?: QuickCreateTravelerInput[];
|
|
55
|
+
paymentSchedules?: QuickCreatePaymentScheduleInput[];
|
|
56
|
+
voucherRedemption?: QuickCreateVoucherRedemptionInput;
|
|
57
|
+
groupMembership?: QuickCreateGroupMembershipInput;
|
|
58
|
+
}
|
|
59
|
+
declare const quickCreateResultSchema: z.ZodObject<{
|
|
60
|
+
booking: z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
bookingNumber: z.ZodString;
|
|
63
|
+
status: z.ZodEnum<{
|
|
64
|
+
draft: "draft";
|
|
65
|
+
on_hold: "on_hold";
|
|
66
|
+
confirmed: "confirmed";
|
|
67
|
+
in_progress: "in_progress";
|
|
68
|
+
completed: "completed";
|
|
69
|
+
expired: "expired";
|
|
70
|
+
cancelled: "cancelled";
|
|
71
|
+
}>;
|
|
72
|
+
personId: z.ZodNullable<z.ZodString>;
|
|
73
|
+
organizationId: z.ZodNullable<z.ZodString>;
|
|
74
|
+
sellCurrency: z.ZodString;
|
|
75
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
76
|
+
costAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
77
|
+
marginPercent: z.ZodNullable<z.ZodNumber>;
|
|
78
|
+
startDate: z.ZodNullable<z.ZodString>;
|
|
79
|
+
endDate: z.ZodNullable<z.ZodString>;
|
|
80
|
+
pax: z.ZodNullable<z.ZodNumber>;
|
|
81
|
+
internalNotes: z.ZodNullable<z.ZodString>;
|
|
82
|
+
createdAt: z.ZodString;
|
|
83
|
+
updatedAt: z.ZodString;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
travelers: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
86
|
+
paymentSchedules: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
87
|
+
voucherRedemption: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
88
|
+
groupMembership: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
export type QuickCreateBookingResult = z.infer<typeof quickCreateResultSchema>;
|
|
91
|
+
/**
|
|
92
|
+
* Atomic booking-create: calls `POST /v1/bookings/quick-create` which wraps
|
|
93
|
+
* convert-from-product + travelers + payment schedules + voucher redemption
|
|
94
|
+
* + group membership in one transaction. Prefer this over chaining the
|
|
95
|
+
* separate create mutations (convert, group, traveler) from a single submit
|
|
96
|
+
* handler — a mid-chain failure there leaves orphan state.
|
|
97
|
+
*/
|
|
98
|
+
export declare function useBookingQuickCreateMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
99
|
+
booking: {
|
|
100
|
+
id: string;
|
|
101
|
+
bookingNumber: string;
|
|
102
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
103
|
+
personId: string | null;
|
|
104
|
+
organizationId: string | null;
|
|
105
|
+
sellCurrency: string;
|
|
106
|
+
sellAmountCents: number | null;
|
|
107
|
+
costAmountCents: number | null;
|
|
108
|
+
marginPercent: number | null;
|
|
109
|
+
startDate: string | null;
|
|
110
|
+
endDate: string | null;
|
|
111
|
+
pax: number | null;
|
|
112
|
+
internalNotes: string | null;
|
|
113
|
+
createdAt: string;
|
|
114
|
+
updatedAt: string;
|
|
115
|
+
};
|
|
116
|
+
travelers?: unknown[] | undefined;
|
|
117
|
+
paymentSchedules?: unknown[] | undefined;
|
|
118
|
+
voucherRedemption?: unknown;
|
|
119
|
+
groupMembership?: unknown;
|
|
120
|
+
}, Error, QuickCreateBookingInput, unknown>;
|
|
121
|
+
export {};
|
|
122
|
+
//# sourceMappingURL=use-booking-quick-create-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-quick-create-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-quick-create-mutation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,eAAe,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,OAAO,CAAA;IACnD,gBAAgB,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAA;IAC3E,iBAAiB,CAAC,EAAE,MAAM,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EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAE7B,SAAS,CAAC,EAAE,wBAAwB,EAAE,CAAA;IACtC,gBAAgB,CAAC,EAAE,+BAA+B,EAAE,CAAA;IACpD,iBAAiB,CAAC,EAAE,iCAAiC,CAAA;IACrD,eAAe,CAAC,EAAE,+BAA+B,CAAA;CAClD;AAOD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM3B,CAAA;AAIF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE9E;;;;;;GAMG;AACH,wBAAgB,6BAA6B;;;;;;;;;;;;;;;;;;;;;;4CAkB5C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { fetchWithValidation } from "../client.js";
|
|
5
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
6
|
+
import { bookingsQueryKeys } from "../query-keys.js";
|
|
7
|
+
import { bookingRecordSchema } from "../schemas.js";
|
|
8
|
+
// Response envelope: route returns `{ data: { booking, travelers, paymentSchedules, voucherRedemption, groupMembership } }`.
|
|
9
|
+
// We validate only the booking shape (which drives cache invalidation) and
|
|
10
|
+
// pass the rest through as-is so the surface can evolve without breaking
|
|
11
|
+
// clients. Callers who want typed assertions on the extras can narrow on the
|
|
12
|
+
// result.
|
|
13
|
+
const quickCreateResultSchema = z.object({
|
|
14
|
+
booking: bookingRecordSchema,
|
|
15
|
+
travelers: z.array(z.unknown()).optional(),
|
|
16
|
+
paymentSchedules: z.array(z.unknown()).optional(),
|
|
17
|
+
voucherRedemption: z.unknown().nullable().optional(),
|
|
18
|
+
groupMembership: z.unknown().nullable().optional(),
|
|
19
|
+
});
|
|
20
|
+
const quickCreateResponseSchema = z.object({ data: quickCreateResultSchema });
|
|
21
|
+
/**
|
|
22
|
+
* Atomic booking-create: calls `POST /v1/bookings/quick-create` which wraps
|
|
23
|
+
* convert-from-product + travelers + payment schedules + voucher redemption
|
|
24
|
+
* + group membership in one transaction. Prefer this over chaining the
|
|
25
|
+
* separate create mutations (convert, group, traveler) from a single submit
|
|
26
|
+
* handler — a mid-chain failure there leaves orphan state.
|
|
27
|
+
*/
|
|
28
|
+
export function useBookingQuickCreateMutation() {
|
|
29
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
30
|
+
const queryClient = useQueryClient();
|
|
31
|
+
return useMutation({
|
|
32
|
+
mutationFn: async (input) => {
|
|
33
|
+
const { data } = await fetchWithValidation("/v1/bookings/quick-create", quickCreateResponseSchema, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
34
|
+
return data;
|
|
35
|
+
},
|
|
36
|
+
onSuccess: () => {
|
|
37
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.bookings() });
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -20,4 +20,31 @@ export declare function useBookingStatusMutation(bookingId: string): import("@ta
|
|
|
20
20
|
createdAt: string;
|
|
21
21
|
updatedAt: string;
|
|
22
22
|
}, Error, UpdateBookingStatusInput, unknown>;
|
|
23
|
+
export interface UpdateBookingStatusByIdInput extends UpdateBookingStatusInput {
|
|
24
|
+
bookingId: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Variant of `useBookingStatusMutation` that accepts the booking id at call
|
|
28
|
+
* time instead of at hook-setup time. Used by flows that create a booking
|
|
29
|
+
* and immediately transition its status in the same handler — the id only
|
|
30
|
+
* exists after the create returns, so the per-booking hook shape doesn't
|
|
31
|
+
* fit.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useBookingStatusByIdMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
34
|
+
id: string;
|
|
35
|
+
bookingNumber: string;
|
|
36
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
37
|
+
personId: string | null;
|
|
38
|
+
organizationId: string | null;
|
|
39
|
+
sellCurrency: string;
|
|
40
|
+
sellAmountCents: number | null;
|
|
41
|
+
costAmountCents: number | null;
|
|
42
|
+
marginPercent: number | null;
|
|
43
|
+
startDate: string | null;
|
|
44
|
+
endDate: string | null;
|
|
45
|
+
pax: number | null;
|
|
46
|
+
internalNotes: string | null;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
}, Error, UpdateBookingStatusByIdInput, unknown>;
|
|
23
50
|
//# sourceMappingURL=use-booking-status-mutation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-booking-status-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-status-mutation.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,eAAe,CAAA;AAEzE,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;6CAoBzD"}
|
|
1
|
+
{"version":3,"file":"use-booking-status-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-status-mutation.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,eAAe,CAAA;AAEzE,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;6CAoBzD;AAED,MAAM,WAAW,4BAA6B,SAAQ,wBAAwB;IAC5E,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B;;;;;;;;;;;;;;;;iDAsB3C"}
|
|
@@ -19,3 +19,27 @@ export function useBookingStatusMutation(bookingId) {
|
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Variant of `useBookingStatusMutation` that accepts the booking id at call
|
|
24
|
+
* time instead of at hook-setup time. Used by flows that create a booking
|
|
25
|
+
* and immediately transition its status in the same handler — the id only
|
|
26
|
+
* exists after the create returns, so the per-booking hook shape doesn't
|
|
27
|
+
* fit.
|
|
28
|
+
*/
|
|
29
|
+
export function useBookingStatusByIdMutation() {
|
|
30
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
31
|
+
const queryClient = useQueryClient();
|
|
32
|
+
return useMutation({
|
|
33
|
+
mutationFn: async ({ bookingId, ...input }) => {
|
|
34
|
+
const { data } = await fetchWithValidation(`/v1/bookings/${bookingId}/status`, bookingSingleResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
35
|
+
return data;
|
|
36
|
+
},
|
|
37
|
+
onSuccess: (data, variables) => {
|
|
38
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.bookings() });
|
|
39
|
+
queryClient.setQueryData(bookingsQueryKeys.booking(variables.bookingId), { data });
|
|
40
|
+
void queryClient.invalidateQueries({
|
|
41
|
+
queryKey: bookingsQueryKeys.activity(variables.bookingId),
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { PricingPreviewFilters } from "../query-keys.js";
|
|
2
|
+
export interface UsePricingPreviewOptions extends PricingPreviewFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Catalog-resolved pricing snapshot for a product + option (+ optional
|
|
7
|
+
* catalog). Consumers match the returned `unitPrices` / `tiers` against their
|
|
8
|
+
* passenger/unit selection to render a breakdown. The snapshot is the same
|
|
9
|
+
* data the storefront session uses, so operator-side numbers stay in sync
|
|
10
|
+
* with customer-facing ones.
|
|
11
|
+
*/
|
|
12
|
+
export declare function usePricingPreview({ enabled, ...filters }: UsePricingPreviewOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
13
|
+
data: {
|
|
14
|
+
catalog: {
|
|
15
|
+
id: string;
|
|
16
|
+
currencyCode: string;
|
|
17
|
+
};
|
|
18
|
+
options: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
isDefault: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
rules: {
|
|
24
|
+
id: string;
|
|
25
|
+
optionId: string;
|
|
26
|
+
pricingMode: string;
|
|
27
|
+
baseSellAmountCents: number | null;
|
|
28
|
+
isDefault: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
unitPrices: {
|
|
31
|
+
id: string;
|
|
32
|
+
optionPriceRuleId: string;
|
|
33
|
+
unitId: string;
|
|
34
|
+
unitName: string;
|
|
35
|
+
unitType: string;
|
|
36
|
+
pricingCategoryId: string | null;
|
|
37
|
+
pricingMode: string;
|
|
38
|
+
sellAmountCents: number | null;
|
|
39
|
+
minQuantity: number | null;
|
|
40
|
+
maxQuantity: number | null;
|
|
41
|
+
tiers: {
|
|
42
|
+
minQuantity: number;
|
|
43
|
+
maxQuantity: number | null;
|
|
44
|
+
sellAmountCents: number | null;
|
|
45
|
+
}[];
|
|
46
|
+
}[];
|
|
47
|
+
};
|
|
48
|
+
}, Error>;
|
|
49
|
+
//# sourceMappingURL=use-pricing-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-pricing-preview.d.ts","sourceRoot":"","sources":["../../src/hooks/use-pricing-preview.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAG7D,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACrE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,OAAc,EAAE,GAAG,OAAO,EAAE,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAMzF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getPricingPreviewQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Catalog-resolved pricing snapshot for a product + option (+ optional
|
|
7
|
+
* catalog). Consumers match the returned `unitPrices` / `tiers` against their
|
|
8
|
+
* passenger/unit selection to render a breakdown. The snapshot is the same
|
|
9
|
+
* data the storefront session uses, so operator-side numbers stay in sync
|
|
10
|
+
* with customer-facing ones.
|
|
11
|
+
*/
|
|
12
|
+
export function usePricingPreview({ enabled = true, ...filters }) {
|
|
13
|
+
const client = useVoyantBookingsContext();
|
|
14
|
+
return useQuery({
|
|
15
|
+
...getPricingPreviewQueryOptions(client, filters),
|
|
16
|
+
enabled: enabled && Boolean(filters.productId),
|
|
17
|
+
});
|
|
18
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { defaultFetcher, fetchWithValidation, VoyantApiError, type VoyantFetcher
|
|
|
2
2
|
export * from "./hooks/index.js";
|
|
3
3
|
export { useVoyantBookingsContext, type VoyantBookingsContextValue, VoyantBookingsProvider, type VoyantBookingsProviderProps, } from "./provider.js";
|
|
4
4
|
export { bookingsQueryKeys } from "./query-keys.js";
|
|
5
|
-
export { getBookingActivityQueryOptions, getBookingGroupForBookingQueryOptions, getBookingGroupQueryOptions, getBookingGroupsQueryOptions, getBookingItemsQueryOptions, getBookingItemTravelersQueryOptions, getBookingNotesQueryOptions, getBookingQueryOptions, getBookingsQueryOptions, getBookingTravelerDocumentsQueryOptions, getPublicBookingSessionQueryOptions, getPublicBookingSessionStateQueryOptions, getSupplierStatusesQueryOptions, getTravelersQueryOptions, } from "./query-options.js";
|
|
5
|
+
export { getBookingActivityQueryOptions, getBookingGroupForBookingQueryOptions, getBookingGroupQueryOptions, getBookingGroupsQueryOptions, getBookingItemsQueryOptions, getBookingItemTravelersQueryOptions, getBookingNotesQueryOptions, getBookingQueryOptions, getBookingsQueryOptions, getBookingTravelerDocumentsQueryOptions, getPricingPreviewQueryOptions, getPublicBookingSessionQueryOptions, getPublicBookingSessionStateQueryOptions, getSupplierStatusesQueryOptions, getTravelersQueryOptions, } from "./query-options.js";
|
|
6
6
|
export * from "./schemas.js";
|
|
7
7
|
export { type BookingStatusBadgeVariant, bookingStatusBadgeVariant, bookingStatuses, bookingStatusOptions, formatBookingStatus, } from "./status-presentation.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,wBAAwB,EACxB,KAAK,0BAA0B,EAC/B,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EACL,8BAA8B,EAC9B,qCAAqC,EACrC,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,mCAAmC,EACnC,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uCAAuC,EACvC,mCAAmC,EACnC,wCAAwC,EACxC,+BAA+B,EAC/B,wBAAwB,GACzB,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,KAAK,yBAAyB,EAC9B,yBAAyB,EACzB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,wBAAwB,EACxB,KAAK,0BAA0B,EAC/B,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EACL,8BAA8B,EAC9B,qCAAqC,EACrC,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,mCAAmC,EACnC,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uCAAuC,EACvC,6BAA6B,EAC7B,mCAAmC,EACnC,wCAAwC,EACxC,+BAA+B,EAC/B,wBAAwB,GACzB,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,KAAK,yBAAyB,EAC9B,yBAAyB,EACzB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,0BAA0B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,6 @@ export { defaultFetcher, fetchWithValidation, VoyantApiError, } from "./client.j
|
|
|
2
2
|
export * from "./hooks/index.js";
|
|
3
3
|
export { useVoyantBookingsContext, VoyantBookingsProvider, } from "./provider.js";
|
|
4
4
|
export { bookingsQueryKeys } from "./query-keys.js";
|
|
5
|
-
export { getBookingActivityQueryOptions, getBookingGroupForBookingQueryOptions, getBookingGroupQueryOptions, getBookingGroupsQueryOptions, getBookingItemsQueryOptions, getBookingItemTravelersQueryOptions, getBookingNotesQueryOptions, getBookingQueryOptions, getBookingsQueryOptions, getBookingTravelerDocumentsQueryOptions, getPublicBookingSessionQueryOptions, getPublicBookingSessionStateQueryOptions, getSupplierStatusesQueryOptions, getTravelersQueryOptions, } from "./query-options.js";
|
|
5
|
+
export { getBookingActivityQueryOptions, getBookingGroupForBookingQueryOptions, getBookingGroupQueryOptions, getBookingGroupsQueryOptions, getBookingItemsQueryOptions, getBookingItemTravelersQueryOptions, getBookingNotesQueryOptions, getBookingQueryOptions, getBookingsQueryOptions, getBookingTravelerDocumentsQueryOptions, getPricingPreviewQueryOptions, getPublicBookingSessionQueryOptions, getPublicBookingSessionStateQueryOptions, getSupplierStatusesQueryOptions, getTravelersQueryOptions, } from "./query-options.js";
|
|
6
6
|
export * from "./schemas.js";
|
|
7
7
|
export { bookingStatusBadgeVariant, bookingStatuses, bookingStatusOptions, formatBookingStatus, } from "./status-presentation.js";
|
package/dist/query-keys.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export interface BookingGroupsListFilters {
|
|
|
11
11
|
limit?: number | undefined;
|
|
12
12
|
offset?: number | undefined;
|
|
13
13
|
}
|
|
14
|
+
export interface PricingPreviewFilters {
|
|
15
|
+
productId: string;
|
|
16
|
+
optionId?: string | null | undefined;
|
|
17
|
+
catalogId?: string | null | undefined;
|
|
18
|
+
}
|
|
14
19
|
export declare const bookingsQueryKeys: {
|
|
15
20
|
readonly all: readonly ["voyant", "bookings"];
|
|
16
21
|
readonly bookings: () => readonly ["voyant", "bookings", "bookings"];
|
|
@@ -33,5 +38,6 @@ export declare const bookingsQueryKeys: {
|
|
|
33
38
|
readonly group: (id: string) => readonly ["voyant", "bookings", "groups", "detail", string];
|
|
34
39
|
readonly groupMembers: (id: string) => readonly ["voyant", "bookings", "groups", "detail", string, "members"];
|
|
35
40
|
readonly groupForBooking: (bookingId: string) => readonly ["voyant", "bookings", "bookings", "detail", string, "group"];
|
|
41
|
+
readonly pricingPreview: (filters: PricingPreviewFilters) => readonly ["voyant", "bookings", "pricing-preview", PricingPreviewFilters];
|
|
36
42
|
};
|
|
37
43
|
//# sourceMappingURL=query-keys.d.ts.map
|
package/dist/query-keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,eAAO,MAAM,iBAAiB;;;;qCAKJ,mBAAmB;2BAE7B,MAAM;wCACO,MAAM;6CAED,MAAM;gCAGnB,MAAM;wCACE,MAAM,UAAU,MAAM;2CAEnB,MAAM,UAAU,MAAM;oCAE7B,MAAM;qCACL,MAAM;oCAEP,MAAM;2CACC,MAAM;mCAEd,MAAM;gCACT,MAAM;;mCAGH,wBAAwB;yBAElC,MAAM;gCACC,MAAM;0CACI,MAAM;
|
|
1
|
+
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACpC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CACtC;AAED,eAAO,MAAM,iBAAiB;;;;qCAKJ,mBAAmB;2BAE7B,MAAM;wCACO,MAAM;6CAED,MAAM;gCAGnB,MAAM;wCACE,MAAM,UAAU,MAAM;2CAEnB,MAAM,UAAU,MAAM;oCAE7B,MAAM;qCACL,MAAM;oCAEP,MAAM;2CACC,MAAM;mCAEd,MAAM;gCACT,MAAM;;mCAGH,wBAAwB;yBAElC,MAAM;gCACC,MAAM;0CACI,MAAM;uCAGT,qBAAqB;CAEvC,CAAA"}
|
package/dist/query-keys.js
CHANGED
|
@@ -20,4 +20,5 @@ export const bookingsQueryKeys = {
|
|
|
20
20
|
group: (id) => [...bookingsQueryKeys.groups(), "detail", id],
|
|
21
21
|
groupMembers: (id) => [...bookingsQueryKeys.group(id), "members"],
|
|
22
22
|
groupForBooking: (bookingId) => [...bookingsQueryKeys.booking(bookingId), "group"],
|
|
23
|
+
pricingPreview: (filters) => [...bookingsQueryKeys.all, "pricing-preview", filters],
|
|
23
24
|
};
|
package/dist/query-options.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { UseBookingNotesOptions } from "./hooks/use-booking-notes.js";
|
|
|
11
11
|
import type { UseBookingsOptions } from "./hooks/use-bookings.js";
|
|
12
12
|
import type { UseSupplierStatusesOptions } from "./hooks/use-supplier-statuses.js";
|
|
13
13
|
import type { UseTravelersOptions } from "./hooks/use-travelers.js";
|
|
14
|
+
import { type PricingPreviewFilters } from "./query-keys.js";
|
|
14
15
|
export declare function getBookingsQueryOptions(client: FetchWithValidationOptions, options?: UseBookingsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
15
16
|
data: {
|
|
16
17
|
id: string;
|
|
@@ -1365,4 +1366,162 @@ export declare function getBookingGroupForBookingQueryOptions(client: FetchWithV
|
|
|
1365
1366
|
[dataTagErrorSymbol]: Error;
|
|
1366
1367
|
};
|
|
1367
1368
|
};
|
|
1369
|
+
/**
|
|
1370
|
+
* Pricing preview — resolves the storefront pricing snapshot for a product
|
|
1371
|
+
* without creating a booking session. Use it for operator create dialogs,
|
|
1372
|
+
* tour-sheet quotes, and reconciliation where the question is "what would the
|
|
1373
|
+
* customer see?"
|
|
1374
|
+
*/
|
|
1375
|
+
export declare function getPricingPreviewQueryOptions(client: FetchWithValidationOptions, filters: PricingPreviewFilters): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
1376
|
+
data: {
|
|
1377
|
+
catalog: {
|
|
1378
|
+
id: string;
|
|
1379
|
+
currencyCode: string;
|
|
1380
|
+
};
|
|
1381
|
+
options: {
|
|
1382
|
+
id: string;
|
|
1383
|
+
name: string;
|
|
1384
|
+
isDefault: boolean;
|
|
1385
|
+
}[];
|
|
1386
|
+
rules: {
|
|
1387
|
+
id: string;
|
|
1388
|
+
optionId: string;
|
|
1389
|
+
pricingMode: string;
|
|
1390
|
+
baseSellAmountCents: number | null;
|
|
1391
|
+
isDefault: boolean;
|
|
1392
|
+
}[];
|
|
1393
|
+
unitPrices: {
|
|
1394
|
+
id: string;
|
|
1395
|
+
optionPriceRuleId: string;
|
|
1396
|
+
unitId: string;
|
|
1397
|
+
unitName: string;
|
|
1398
|
+
unitType: string;
|
|
1399
|
+
pricingCategoryId: string | null;
|
|
1400
|
+
pricingMode: string;
|
|
1401
|
+
sellAmountCents: number | null;
|
|
1402
|
+
minQuantity: number | null;
|
|
1403
|
+
maxQuantity: number | null;
|
|
1404
|
+
tiers: {
|
|
1405
|
+
minQuantity: number;
|
|
1406
|
+
maxQuantity: number | null;
|
|
1407
|
+
sellAmountCents: number | null;
|
|
1408
|
+
}[];
|
|
1409
|
+
}[];
|
|
1410
|
+
};
|
|
1411
|
+
}, Error, {
|
|
1412
|
+
data: {
|
|
1413
|
+
catalog: {
|
|
1414
|
+
id: string;
|
|
1415
|
+
currencyCode: string;
|
|
1416
|
+
};
|
|
1417
|
+
options: {
|
|
1418
|
+
id: string;
|
|
1419
|
+
name: string;
|
|
1420
|
+
isDefault: boolean;
|
|
1421
|
+
}[];
|
|
1422
|
+
rules: {
|
|
1423
|
+
id: string;
|
|
1424
|
+
optionId: string;
|
|
1425
|
+
pricingMode: string;
|
|
1426
|
+
baseSellAmountCents: number | null;
|
|
1427
|
+
isDefault: boolean;
|
|
1428
|
+
}[];
|
|
1429
|
+
unitPrices: {
|
|
1430
|
+
id: string;
|
|
1431
|
+
optionPriceRuleId: string;
|
|
1432
|
+
unitId: string;
|
|
1433
|
+
unitName: string;
|
|
1434
|
+
unitType: string;
|
|
1435
|
+
pricingCategoryId: string | null;
|
|
1436
|
+
pricingMode: string;
|
|
1437
|
+
sellAmountCents: number | null;
|
|
1438
|
+
minQuantity: number | null;
|
|
1439
|
+
maxQuantity: number | null;
|
|
1440
|
+
tiers: {
|
|
1441
|
+
minQuantity: number;
|
|
1442
|
+
maxQuantity: number | null;
|
|
1443
|
+
sellAmountCents: number | null;
|
|
1444
|
+
}[];
|
|
1445
|
+
}[];
|
|
1446
|
+
};
|
|
1447
|
+
}, readonly ["voyant", "bookings", "pricing-preview", PricingPreviewFilters]>, "queryFn"> & {
|
|
1448
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
1449
|
+
data: {
|
|
1450
|
+
catalog: {
|
|
1451
|
+
id: string;
|
|
1452
|
+
currencyCode: string;
|
|
1453
|
+
};
|
|
1454
|
+
options: {
|
|
1455
|
+
id: string;
|
|
1456
|
+
name: string;
|
|
1457
|
+
isDefault: boolean;
|
|
1458
|
+
}[];
|
|
1459
|
+
rules: {
|
|
1460
|
+
id: string;
|
|
1461
|
+
optionId: string;
|
|
1462
|
+
pricingMode: string;
|
|
1463
|
+
baseSellAmountCents: number | null;
|
|
1464
|
+
isDefault: boolean;
|
|
1465
|
+
}[];
|
|
1466
|
+
unitPrices: {
|
|
1467
|
+
id: string;
|
|
1468
|
+
optionPriceRuleId: string;
|
|
1469
|
+
unitId: string;
|
|
1470
|
+
unitName: string;
|
|
1471
|
+
unitType: string;
|
|
1472
|
+
pricingCategoryId: string | null;
|
|
1473
|
+
pricingMode: string;
|
|
1474
|
+
sellAmountCents: number | null;
|
|
1475
|
+
minQuantity: number | null;
|
|
1476
|
+
maxQuantity: number | null;
|
|
1477
|
+
tiers: {
|
|
1478
|
+
minQuantity: number;
|
|
1479
|
+
maxQuantity: number | null;
|
|
1480
|
+
sellAmountCents: number | null;
|
|
1481
|
+
}[];
|
|
1482
|
+
}[];
|
|
1483
|
+
};
|
|
1484
|
+
}, readonly ["voyant", "bookings", "pricing-preview", PricingPreviewFilters], never> | undefined;
|
|
1485
|
+
} & {
|
|
1486
|
+
queryKey: readonly ["voyant", "bookings", "pricing-preview", PricingPreviewFilters] & {
|
|
1487
|
+
[dataTagSymbol]: {
|
|
1488
|
+
data: {
|
|
1489
|
+
catalog: {
|
|
1490
|
+
id: string;
|
|
1491
|
+
currencyCode: string;
|
|
1492
|
+
};
|
|
1493
|
+
options: {
|
|
1494
|
+
id: string;
|
|
1495
|
+
name: string;
|
|
1496
|
+
isDefault: boolean;
|
|
1497
|
+
}[];
|
|
1498
|
+
rules: {
|
|
1499
|
+
id: string;
|
|
1500
|
+
optionId: string;
|
|
1501
|
+
pricingMode: string;
|
|
1502
|
+
baseSellAmountCents: number | null;
|
|
1503
|
+
isDefault: boolean;
|
|
1504
|
+
}[];
|
|
1505
|
+
unitPrices: {
|
|
1506
|
+
id: string;
|
|
1507
|
+
optionPriceRuleId: string;
|
|
1508
|
+
unitId: string;
|
|
1509
|
+
unitName: string;
|
|
1510
|
+
unitType: string;
|
|
1511
|
+
pricingCategoryId: string | null;
|
|
1512
|
+
pricingMode: string;
|
|
1513
|
+
sellAmountCents: number | null;
|
|
1514
|
+
minQuantity: number | null;
|
|
1515
|
+
maxQuantity: number | null;
|
|
1516
|
+
tiers: {
|
|
1517
|
+
minQuantity: number;
|
|
1518
|
+
maxQuantity: number | null;
|
|
1519
|
+
sellAmountCents: number | null;
|
|
1520
|
+
}[];
|
|
1521
|
+
}[];
|
|
1522
|
+
};
|
|
1523
|
+
};
|
|
1524
|
+
[dataTagErrorSymbol]: Error;
|
|
1525
|
+
};
|
|
1526
|
+
};
|
|
1368
1527
|
//# 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,kCAAkC,EAAE,MAAM,kCAAkC,CAAA;AAC1F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAA;AAChG,OAAO,KAAK,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc/B"}
|
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, bookingGroupDetailResponse, bookingGroupForBookingResponse, bookingGroupListResponse, bookingItemsResponse, bookingItemTravelersResponse, bookingListResponse, bookingNotesResponse, bookingSingleResponse, bookingSupplierStatusesResponse, bookingTravelerDocumentsResponse, bookingTravelersResponse, publicBookingSessionResponse, publicBookingSessionStateResponse, } from "./schemas.js";
|
|
5
|
+
import { bookingActivityResponse, bookingGroupDetailResponse, bookingGroupForBookingResponse, bookingGroupListResponse, bookingItemsResponse, bookingItemTravelersResponse, bookingListResponse, bookingNotesResponse, bookingSingleResponse, bookingSupplierStatusesResponse, bookingTravelerDocumentsResponse, bookingTravelersResponse, pricingPreviewResponse, publicBookingSessionResponse, publicBookingSessionStateResponse, } from "./schemas.js";
|
|
6
6
|
export function getBookingsQueryOptions(client, options = {}) {
|
|
7
7
|
const { enabled: _enabled = true, ...filters } = options;
|
|
8
8
|
return queryOptions({
|
|
@@ -127,3 +127,22 @@ export function getBookingGroupForBookingQueryOptions(client, bookingId, options
|
|
|
127
127
|
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/group`, bookingGroupForBookingResponse, client),
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Pricing preview — resolves the storefront pricing snapshot for a product
|
|
132
|
+
* without creating a booking session. Use it for operator create dialogs,
|
|
133
|
+
* tour-sheet quotes, and reconciliation where the question is "what would the
|
|
134
|
+
* customer see?"
|
|
135
|
+
*/
|
|
136
|
+
export function getPricingPreviewQueryOptions(client, filters) {
|
|
137
|
+
return queryOptions({
|
|
138
|
+
queryKey: bookingsQueryKeys.pricingPreview(filters),
|
|
139
|
+
queryFn: () => fetchWithValidation("/v1/bookings/pricing-preview", pricingPreviewResponse, client, {
|
|
140
|
+
method: "POST",
|
|
141
|
+
body: JSON.stringify({
|
|
142
|
+
productId: filters.productId,
|
|
143
|
+
optionId: filters.optionId ?? null,
|
|
144
|
+
catalogId: filters.catalogId ?? null,
|
|
145
|
+
}),
|
|
146
|
+
}),
|
|
147
|
+
});
|
|
148
|
+
}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1092,4 +1092,77 @@ export declare const publicBookingSessionRepriceResponse: z.ZodObject<{
|
|
|
1092
1092
|
}, z.core.$strip>>;
|
|
1093
1093
|
}, z.core.$strip>;
|
|
1094
1094
|
}, z.core.$strip>;
|
|
1095
|
+
export declare const pricingPreviewSnapshotSchema: z.ZodObject<{
|
|
1096
|
+
catalog: z.ZodObject<{
|
|
1097
|
+
id: z.ZodString;
|
|
1098
|
+
currencyCode: z.ZodString;
|
|
1099
|
+
}, z.core.$strip>;
|
|
1100
|
+
options: z.ZodArray<z.ZodObject<{
|
|
1101
|
+
id: z.ZodString;
|
|
1102
|
+
name: z.ZodString;
|
|
1103
|
+
isDefault: z.ZodBoolean;
|
|
1104
|
+
}, z.core.$strip>>;
|
|
1105
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
1106
|
+
id: z.ZodString;
|
|
1107
|
+
optionId: z.ZodString;
|
|
1108
|
+
pricingMode: z.ZodString;
|
|
1109
|
+
baseSellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
1110
|
+
isDefault: z.ZodBoolean;
|
|
1111
|
+
}, z.core.$strip>>;
|
|
1112
|
+
unitPrices: z.ZodArray<z.ZodObject<{
|
|
1113
|
+
id: z.ZodString;
|
|
1114
|
+
optionPriceRuleId: z.ZodString;
|
|
1115
|
+
unitId: z.ZodString;
|
|
1116
|
+
unitName: z.ZodString;
|
|
1117
|
+
unitType: z.ZodString;
|
|
1118
|
+
pricingCategoryId: z.ZodNullable<z.ZodString>;
|
|
1119
|
+
pricingMode: z.ZodString;
|
|
1120
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
1121
|
+
minQuantity: z.ZodNullable<z.ZodNumber>;
|
|
1122
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
1123
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
1124
|
+
minQuantity: z.ZodNumber;
|
|
1125
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
1126
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
1127
|
+
}, z.core.$strip>>;
|
|
1128
|
+
}, z.core.$strip>>;
|
|
1129
|
+
}, z.core.$strip>;
|
|
1130
|
+
export type PricingPreviewSnapshot = z.infer<typeof pricingPreviewSnapshotSchema>;
|
|
1131
|
+
export declare const pricingPreviewResponse: z.ZodObject<{
|
|
1132
|
+
data: z.ZodObject<{
|
|
1133
|
+
catalog: z.ZodObject<{
|
|
1134
|
+
id: z.ZodString;
|
|
1135
|
+
currencyCode: z.ZodString;
|
|
1136
|
+
}, z.core.$strip>;
|
|
1137
|
+
options: z.ZodArray<z.ZodObject<{
|
|
1138
|
+
id: z.ZodString;
|
|
1139
|
+
name: z.ZodString;
|
|
1140
|
+
isDefault: z.ZodBoolean;
|
|
1141
|
+
}, z.core.$strip>>;
|
|
1142
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
1143
|
+
id: z.ZodString;
|
|
1144
|
+
optionId: z.ZodString;
|
|
1145
|
+
pricingMode: z.ZodString;
|
|
1146
|
+
baseSellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
1147
|
+
isDefault: z.ZodBoolean;
|
|
1148
|
+
}, z.core.$strip>>;
|
|
1149
|
+
unitPrices: z.ZodArray<z.ZodObject<{
|
|
1150
|
+
id: z.ZodString;
|
|
1151
|
+
optionPriceRuleId: z.ZodString;
|
|
1152
|
+
unitId: z.ZodString;
|
|
1153
|
+
unitName: z.ZodString;
|
|
1154
|
+
unitType: z.ZodString;
|
|
1155
|
+
pricingCategoryId: z.ZodNullable<z.ZodString>;
|
|
1156
|
+
pricingMode: z.ZodString;
|
|
1157
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
1158
|
+
minQuantity: z.ZodNullable<z.ZodNumber>;
|
|
1159
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
1160
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
1161
|
+
minQuantity: z.ZodNumber;
|
|
1162
|
+
maxQuantity: z.ZodNullable<z.ZodNumber>;
|
|
1163
|
+
sellAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
1164
|
+
}, z.core.$strip>>;
|
|
1165
|
+
}, z.core.$strip>>;
|
|
1166
|
+
}, z.core.$strip>;
|
|
1167
|
+
}, z.core.$strip>;
|
|
1095
1168
|
//# sourceMappingURL=schemas.d.ts.map
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;;;;iBAM7D,CAAA;AAEJ,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAA6B,CAAA;AAC3F,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAAsC,CAAA;AACnG,eAAO,MAAM,eAAe;;iBAAqC,CAAA;AAEjE,eAAO,MAAM,mBAAmB;;;;;;;;EAQ9B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,eAAO,MAAM,gCAAgC;;;;;EAK3C,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;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arrayEnvelope(bookingNoteRecordSchema);
|
|
|
218
218
|
export const publicBookingSessionResponse = singleEnvelope(publicBookingSessionSchema);
|
|
219
219
|
export const publicBookingSessionStateResponse = singleEnvelope(publicBookingSessionStateSchema);
|
|
220
220
|
export const publicBookingSessionRepriceResponse = singleEnvelope(publicBookingSessionRepriceResultSchema);
|
|
221
|
+
// Pricing preview — the catalog-resolved snapshot the storefront engine uses
|
|
222
|
+
// to compute totals. Consumers match it against their passenger/unit selection
|
|
223
|
+
// to render a breakdown; see @voyantjs/bookings/validation for the request.
|
|
224
|
+
const pricingPreviewCatalogSchema = z.object({
|
|
225
|
+
id: z.string(),
|
|
226
|
+
currencyCode: z.string(),
|
|
227
|
+
});
|
|
228
|
+
const pricingPreviewOptionSchema = z.object({
|
|
229
|
+
id: z.string(),
|
|
230
|
+
name: z.string(),
|
|
231
|
+
isDefault: z.boolean(),
|
|
232
|
+
});
|
|
233
|
+
const pricingPreviewRuleSchema = z.object({
|
|
234
|
+
id: z.string(),
|
|
235
|
+
optionId: z.string(),
|
|
236
|
+
pricingMode: z.string(),
|
|
237
|
+
baseSellAmountCents: z.number().int().nullable(),
|
|
238
|
+
isDefault: z.boolean(),
|
|
239
|
+
});
|
|
240
|
+
const pricingPreviewUnitTierSchema = z.object({
|
|
241
|
+
minQuantity: z.number().int(),
|
|
242
|
+
maxQuantity: z.number().int().nullable(),
|
|
243
|
+
sellAmountCents: z.number().int().nullable(),
|
|
244
|
+
});
|
|
245
|
+
const pricingPreviewUnitPriceSchema = z.object({
|
|
246
|
+
id: z.string(),
|
|
247
|
+
optionPriceRuleId: z.string(),
|
|
248
|
+
unitId: z.string(),
|
|
249
|
+
unitName: z.string(),
|
|
250
|
+
unitType: z.string(),
|
|
251
|
+
pricingCategoryId: z.string().nullable(),
|
|
252
|
+
pricingMode: z.string(),
|
|
253
|
+
sellAmountCents: z.number().int().nullable(),
|
|
254
|
+
minQuantity: z.number().int().nullable(),
|
|
255
|
+
maxQuantity: z.number().int().nullable(),
|
|
256
|
+
tiers: z.array(pricingPreviewUnitTierSchema),
|
|
257
|
+
});
|
|
258
|
+
export const pricingPreviewSnapshotSchema = z.object({
|
|
259
|
+
catalog: pricingPreviewCatalogSchema,
|
|
260
|
+
options: z.array(pricingPreviewOptionSchema),
|
|
261
|
+
rules: z.array(pricingPreviewRuleSchema),
|
|
262
|
+
unitPrices: z.array(pricingPreviewUnitPriceSchema),
|
|
263
|
+
});
|
|
264
|
+
export const pricingPreviewResponse = singleEnvelope(pricingPreviewSnapshotSchema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/bookings-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react": "^19.0.0",
|
|
36
36
|
"react-dom": "^19.0.0",
|
|
37
37
|
"zod": "^4.0.0",
|
|
38
|
-
"@voyantjs/bookings": "0.
|
|
38
|
+
"@voyantjs/bookings": "0.7.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"typescript": "^6.0.2",
|
|
47
47
|
"vitest": "^4.1.2",
|
|
48
48
|
"zod": "^4.3.6",
|
|
49
|
-
"@voyantjs/bookings": "0.
|
|
50
|
-
"@voyantjs/react": "0.
|
|
49
|
+
"@voyantjs/bookings": "0.7.0",
|
|
50
|
+
"@voyantjs/react": "0.7.0",
|
|
51
51
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@voyantjs/react": "0.
|
|
54
|
+
"@voyantjs/react": "0.7.0"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"dist"
|