@voyantjs/availability-react 0.6.8 → 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.
@@ -9,6 +9,8 @@ export type { UseProductsOptions } from "./use-products.js";
9
9
  export { useProducts } from "./use-products.js";
10
10
  export type { UseRulesOptions } from "./use-rules.js";
11
11
  export { useRules } from "./use-rules.js";
12
+ export type { UseSlotUnitAvailabilityOptions } from "./use-slot-unit-availability.js";
13
+ export { useSlotUnitAvailability } from "./use-slot-unit-availability.js";
12
14
  export type { UseSlotsOptions } from "./use-slots.js";
13
15
  export { useSlots } from "./use-slots.js";
14
16
  export type { UseStartTimesOptions } from "./use-start-times.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAA;AAC5F,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAA;AAC5F,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAA;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA"}
@@ -5,5 +5,6 @@ export { useCloseouts } from "./use-closeouts.js";
5
5
  export { usePickupPoints } from "./use-pickup-points.js";
6
6
  export { useProducts } from "./use-products.js";
7
7
  export { useRules } from "./use-rules.js";
8
+ export { useSlotUnitAvailability } from "./use-slot-unit-availability.js";
8
9
  export { useSlots } from "./use-slots.js";
9
10
  export { useStartTimes } from "./use-start-times.js";
@@ -3,6 +3,7 @@ export declare function useAvailabilitySlotMutation(): {
3
3
  create: import("@tanstack/react-query").UseMutationResult<{
4
4
  id: string;
5
5
  productId: string;
6
+ itineraryId: string | null;
6
7
  optionId: string | null;
7
8
  facilityId: string | null;
8
9
  availabilityRuleId: string | null;
@@ -24,6 +25,7 @@ export declare function useAvailabilitySlotMutation(): {
24
25
  dateLocal: string;
25
26
  startsAt: string;
26
27
  timezone: string;
28
+ itineraryId?: string | null | undefined;
27
29
  optionId?: string | null | undefined;
28
30
  facilityId?: string | null | undefined;
29
31
  availabilityRuleId?: string | null | undefined;
@@ -45,6 +47,7 @@ export declare function useAvailabilitySlotMutation(): {
45
47
  update: import("@tanstack/react-query").UseMutationResult<{
46
48
  id: string;
47
49
  productId: string;
50
+ itineraryId: string | null;
48
51
  optionId: string | null;
49
52
  facilityId: string | null;
50
53
  availabilityRuleId: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"use-availability-slot-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-availability-slot-mutation.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,2BAA2B,EACjC,MAAM,eAAe,CAAA;AAEtB,wBAAgB,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAuBC,MAAM;eAAS,2BAA2B;;;;;EA+BrF"}
1
+ {"version":3,"file":"use-availability-slot-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-availability-slot-mutation.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,2BAA2B,EACjC,MAAM,eAAe,CAAA;AAEtB,wBAAgB,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAuBC,MAAM;eAAS,2BAA2B;;;;;EA+BrF"}
@@ -0,0 +1,25 @@
1
+ export interface UseSlotUnitAvailabilityOptions {
2
+ slotId: string | null | undefined;
3
+ enabled?: boolean;
4
+ }
5
+ /**
6
+ * Per-option-unit availability for a slot. Returns one row per `option_unit`
7
+ * on the slot's option, with `initial` (from `option_units.max_quantity`),
8
+ * `reserved` (sum of active bookings' item quantity for this slot + unit),
9
+ * and `remaining = initial - reserved` (or `null` when the pool is
10
+ * unlimited).
11
+ *
12
+ * Active booking statuses counted: draft, on_hold, confirmed, in_progress,
13
+ * completed. cancelled + expired are excluded.
14
+ */
15
+ export declare function useSlotUnitAvailability({ slotId, enabled, }: UseSlotUnitAvailabilityOptions): import("@tanstack/react-query").UseQueryResult<{
16
+ data: {
17
+ optionUnitId: string;
18
+ unitName: string;
19
+ occupancyMax: number | null;
20
+ initial: number | null;
21
+ reserved: number;
22
+ remaining: number | null;
23
+ }[];
24
+ }, Error>;
25
+ //# sourceMappingURL=use-slot-unit-availability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-slot-unit-availability.d.ts","sourceRoot":"","sources":["../../src/hooks/use-slot-unit-availability.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACjC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,OAAc,GACf,EAAE,8BAA8B;;;;;;;;;UAMhC"}
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { useQuery } from "@tanstack/react-query";
3
+ import { useVoyantAvailabilityContext } from "../provider.js";
4
+ import { getSlotUnitAvailabilityQueryOptions } from "../query-options.js";
5
+ /**
6
+ * Per-option-unit availability for a slot. Returns one row per `option_unit`
7
+ * on the slot's option, with `initial` (from `option_units.max_quantity`),
8
+ * `reserved` (sum of active bookings' item quantity for this slot + unit),
9
+ * and `remaining = initial - reserved` (or `null` when the pool is
10
+ * unlimited).
11
+ *
12
+ * Active booking statuses counted: draft, on_hold, confirmed, in_progress,
13
+ * completed. cancelled + expired are excluded.
14
+ */
15
+ export function useSlotUnitAvailability({ slotId, enabled = true, }) {
16
+ const client = useVoyantAvailabilityContext();
17
+ return useQuery({
18
+ ...getSlotUnitAvailabilityQueryOptions(client, slotId),
19
+ enabled: enabled && Boolean(slotId),
20
+ });
21
+ }
@@ -6,6 +6,7 @@ export declare function useSlots(options?: UseSlotsOptions): import("@tanstack/r
6
6
  data: {
7
7
  id: string;
8
8
  productId: string;
9
+ itineraryId: string | null;
9
10
  optionId: string | null;
10
11
  facilityId: string | null;
11
12
  availabilityRuleId: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"use-slots.d.ts","sourceRoot":"","sources":["../../src/hooks/use-slots.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAGpE,MAAM,WAAW,eAAgB,SAAQ,4BAA4B;IACnE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB;;;;;;;;;;;;;;;;;;;;;;;;UAIrD"}
1
+ {"version":3,"file":"use-slots.d.ts","sourceRoot":"","sources":["../../src/hooks/use-slots.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAGpE,MAAM,WAAW,eAAgB,SAAQ,4BAA4B;IACnE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB;;;;;;;;;;;;;;;;;;;;;;;;;UAIrD"}
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export * from "./constants.js";
3
3
  export * from "./hooks/index.js";
4
4
  export { useVoyantAvailabilityContext, type VoyantAvailabilityContextValue, VoyantAvailabilityProvider, type VoyantAvailabilityProviderProps, } from "./provider.js";
5
5
  export { availabilityQueryKeys } from "./query-keys.js";
6
- export { getCloseoutsQueryOptions, getPickupPointsQueryOptions, getProductQueryOptions, getProductsQueryOptions, getRulesQueryOptions, getSlotAssignmentsQueryOptions, getSlotBookingsQueryOptions, getSlotCloseoutsQueryOptions, getSlotPickupsQueryOptions, getSlotQueryOptions, getSlotResourcesQueryOptions, getSlotsQueryOptions, getStartTimesQueryOptions, } from "./query-options.js";
6
+ export { getCloseoutsQueryOptions, getPickupPointsQueryOptions, getProductQueryOptions, getProductsQueryOptions, getRulesQueryOptions, getSlotAssignmentsQueryOptions, getSlotBookingsQueryOptions, getSlotCloseoutsQueryOptions, getSlotPickupsQueryOptions, getSlotQueryOptions, getSlotResourcesQueryOptions, getSlotsQueryOptions, getSlotUnitAvailabilityQueryOptions, getStartTimesQueryOptions, } from "./query-options.js";
7
7
  export * from "./schemas.js";
8
8
  export * from "./utils.js";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -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,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,4BAA4B,EAC5B,KAAK,8BAA8B,EACnC,0BAA0B,EAC1B,KAAK,+BAA+B,GACrC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,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,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,4BAA4B,EAC5B,KAAK,8BAA8B,EACnC,0BAA0B,EAC1B,KAAK,+BAA+B,GACrC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,mCAAmC,EACnC,yBAAyB,GAC1B,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -3,6 +3,6 @@ export * from "./constants.js";
3
3
  export * from "./hooks/index.js";
4
4
  export { useVoyantAvailabilityContext, VoyantAvailabilityProvider, } from "./provider.js";
5
5
  export { availabilityQueryKeys } from "./query-keys.js";
6
- export { getCloseoutsQueryOptions, getPickupPointsQueryOptions, getProductQueryOptions, getProductsQueryOptions, getRulesQueryOptions, getSlotAssignmentsQueryOptions, getSlotBookingsQueryOptions, getSlotCloseoutsQueryOptions, getSlotPickupsQueryOptions, getSlotQueryOptions, getSlotResourcesQueryOptions, getSlotsQueryOptions, getStartTimesQueryOptions, } from "./query-options.js";
6
+ export { getCloseoutsQueryOptions, getPickupPointsQueryOptions, getProductQueryOptions, getProductsQueryOptions, getRulesQueryOptions, getSlotAssignmentsQueryOptions, getSlotBookingsQueryOptions, getSlotCloseoutsQueryOptions, getSlotPickupsQueryOptions, getSlotQueryOptions, getSlotResourcesQueryOptions, getSlotsQueryOptions, getSlotUnitAvailabilityQueryOptions, getStartTimesQueryOptions, } from "./query-options.js";
7
7
  export * from "./schemas.js";
8
8
  export * from "./utils.js";
@@ -44,6 +44,7 @@ export declare const availabilityQueryKeys: {
44
44
  readonly pickupPoints: () => readonly ["voyant", "availability", "pickup-points"];
45
45
  readonly pickupPointsList: (filters: AvailabilityPickupPointsListFilters) => readonly ["voyant", "availability", "pickup-points", "list", AvailabilityPickupPointsListFilters];
46
46
  readonly slotDetail: (id: string) => readonly ["voyant", "availability", "slots", "detail", string];
47
+ readonly slotUnitAvailability: (id: string) => readonly ["voyant", "availability", "slots", "unit-availability", string];
47
48
  readonly slotPickupsList: (filters: AvailabilitySlotDetailFilters) => readonly ["voyant", "availability", "slots", "pickups", "list", AvailabilitySlotDetailFilters];
48
49
  readonly slotCloseoutsList: (filters: AvailabilitySlotDetailFilters) => readonly ["voyant", "availability", "slots", "closeouts", "list", AvailabilitySlotDetailFilters];
49
50
  readonly slotAssignmentsList: (filters: AvailabilitySlotDetailFilters) => readonly ["voyant", "availability", "slots", "assignments", "list", AvailabilitySlotDetailFilters];
@@ -1 +1 @@
1
- {"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;CAAG;AAEhE,MAAM,WAAW,4BAA6B,SAAQ,iBAAiB;IACrE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC/B;AAED,MAAM,WAAW,iCAAkC,SAAQ,iBAAiB;IAC1E,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC/B;AAED,MAAM,WAAW,4BAA6B,SAAQ,iBAAiB;IACrE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAA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CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC/B;AAED,MAAM,WAAW,4BAA6B,SAAQ,iBAAiB;IACrE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,gCAAiC,SAAQ,iBAAiB;IACzE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,mCAAoC,SAAQ,iBAAiB;IAC5E,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC7B;AAED,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACtE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,eAAO,MAAM,qBAAqB;;;qCAIR,kBAAkB;;kCAIrB,4BAA4B;8BAEhC,MAAM;;uCAGG,iCAAiC;mCAErC,MAAM;;kCAGP,4BAA4B;;sCAIxB,gCAAgC;;yCAI7B,mCAAmC;8BAG9C,MAAM;wCACI,MAAM;wCAEN,6BAA6B;0CAE3B,6BAA6B;4CAE3B,6BAA6B;0CAE/B,iBAAiB;yCAElB,iBAAiB;2BAE/B,MAAM;CACZ,CAAA"}
@@ -15,6 +15,7 @@ export const availabilityQueryKeys = {
15
15
  pickupPoints: () => [...availabilityQueryKeys.all, "pickup-points"],
16
16
  pickupPointsList: (filters) => [...availabilityQueryKeys.pickupPoints(), "list", filters],
17
17
  slotDetail: (id) => [...availabilityQueryKeys.slots(), "detail", id],
18
+ slotUnitAvailability: (id) => [...availabilityQueryKeys.slots(), "unit-availability", id],
18
19
  slotPickupsList: (filters) => [...availabilityQueryKeys.slots(), "pickups", "list", filters],
19
20
  slotCloseoutsList: (filters) => [...availabilityQueryKeys.slots(), "closeouts", "list", filters],
20
21
  slotAssignmentsList: (filters) => [...availabilityQueryKeys.slots(), "assignments", "list", filters],
@@ -205,6 +205,7 @@ export declare function getSlotsQueryOptions(client: FetchWithValidationOptions,
205
205
  data: {
206
206
  id: string;
207
207
  productId: string;
208
+ itineraryId: string | null;
208
209
  optionId: string | null;
209
210
  facilityId: string | null;
210
211
  availabilityRuleId: string | null;
@@ -229,6 +230,7 @@ export declare function getSlotsQueryOptions(client: FetchWithValidationOptions,
229
230
  data: {
230
231
  id: string;
231
232
  productId: string;
233
+ itineraryId: string | null;
232
234
  optionId: string | null;
233
235
  facilityId: string | null;
234
236
  availabilityRuleId: string | null;
@@ -254,6 +256,7 @@ export declare function getSlotsQueryOptions(client: FetchWithValidationOptions,
254
256
  data: {
255
257
  id: string;
256
258
  productId: string;
259
+ itineraryId: string | null;
257
260
  optionId: string | null;
258
261
  facilityId: string | null;
259
262
  availabilityRuleId: string | null;
@@ -281,6 +284,7 @@ export declare function getSlotsQueryOptions(client: FetchWithValidationOptions,
281
284
  data: {
282
285
  id: string;
283
286
  productId: string;
287
+ itineraryId: string | null;
284
288
  optionId: string | null;
285
289
  facilityId: string | null;
286
290
  availabilityRuleId: string | null;
@@ -429,6 +433,7 @@ export declare function getSlotQueryOptions(client: FetchWithValidationOptions,
429
433
  data: {
430
434
  id: string;
431
435
  productId: string;
436
+ itineraryId: string | null;
432
437
  optionId: string | null;
433
438
  facilityId: string | null;
434
439
  availabilityRuleId: string | null;
@@ -457,6 +462,7 @@ export declare function getSlotQueryOptions(client: FetchWithValidationOptions,
457
462
  data: {
458
463
  id: string;
459
464
  productId: string;
465
+ itineraryId: string | null;
460
466
  optionId: string | null;
461
467
  facilityId: string | null;
462
468
  availabilityRuleId: string | null;
@@ -486,6 +492,7 @@ export declare function getSlotQueryOptions(client: FetchWithValidationOptions,
486
492
  data: {
487
493
  id: string;
488
494
  productId: string;
495
+ itineraryId: string | null;
489
496
  optionId: string | null;
490
497
  facilityId: string | null;
491
498
  availabilityRuleId: string | null;
@@ -517,6 +524,7 @@ export declare function getSlotQueryOptions(client: FetchWithValidationOptions,
517
524
  data: {
518
525
  id: string;
519
526
  productId: string;
527
+ itineraryId: string | null;
520
528
  optionId: string | null;
521
529
  facilityId: string | null;
522
530
  availabilityRuleId: string | null;
@@ -545,6 +553,50 @@ export declare function getSlotQueryOptions(client: FetchWithValidationOptions,
545
553
  [dataTagErrorSymbol]: Error;
546
554
  };
547
555
  };
556
+ export declare function getSlotUnitAvailabilityQueryOptions(client: FetchWithValidationOptions, slotId: string | null | undefined): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
557
+ data: {
558
+ optionUnitId: string;
559
+ unitName: string;
560
+ occupancyMax: number | null;
561
+ initial: number | null;
562
+ reserved: number;
563
+ remaining: number | null;
564
+ }[];
565
+ }, Error, {
566
+ data: {
567
+ optionUnitId: string;
568
+ unitName: string;
569
+ occupancyMax: number | null;
570
+ initial: number | null;
571
+ reserved: number;
572
+ remaining: number | null;
573
+ }[];
574
+ }, readonly ["voyant", "availability", "slots", "unit-availability", string]>, "queryFn"> & {
575
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
576
+ data: {
577
+ optionUnitId: string;
578
+ unitName: string;
579
+ occupancyMax: number | null;
580
+ initial: number | null;
581
+ reserved: number;
582
+ remaining: number | null;
583
+ }[];
584
+ }, readonly ["voyant", "availability", "slots", "unit-availability", string], never> | undefined;
585
+ } & {
586
+ queryKey: readonly ["voyant", "availability", "slots", "unit-availability", string] & {
587
+ [dataTagSymbol]: {
588
+ data: {
589
+ optionUnitId: string;
590
+ unitName: string;
591
+ occupancyMax: number | null;
592
+ initial: number | null;
593
+ reserved: number;
594
+ remaining: number | null;
595
+ }[];
596
+ };
597
+ [dataTagErrorSymbol]: Error;
598
+ };
599
+ };
548
600
  export declare function getProductQueryOptions(client: FetchWithValidationOptions, id: string | null | undefined): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
549
601
  data: {
550
602
  id: string;
@@ -691,7 +743,7 @@ export declare function getSlotAssignmentsQueryOptions(client: FetchWithValidati
691
743
  poolId: string | null;
692
744
  resourceId: string | null;
693
745
  bookingId: string | null;
694
- status: "cancelled" | "reserved" | "assigned" | "released" | "completed";
746
+ status: "cancelled" | "completed" | "reserved" | "assigned" | "released";
695
747
  assignedBy: string | null;
696
748
  releasedAt: string | null;
697
749
  notes: string | null;
@@ -705,7 +757,7 @@ export declare function getSlotAssignmentsQueryOptions(client: FetchWithValidati
705
757
  poolId: string | null;
706
758
  resourceId: string | null;
707
759
  bookingId: string | null;
708
- status: "cancelled" | "reserved" | "assigned" | "released" | "completed";
760
+ status: "cancelled" | "completed" | "reserved" | "assigned" | "released";
709
761
  assignedBy: string | null;
710
762
  releasedAt: string | null;
711
763
  notes: string | null;
@@ -720,7 +772,7 @@ export declare function getSlotAssignmentsQueryOptions(client: FetchWithValidati
720
772
  poolId: string | null;
721
773
  resourceId: string | null;
722
774
  bookingId: string | null;
723
- status: "cancelled" | "reserved" | "assigned" | "released" | "completed";
775
+ status: "cancelled" | "completed" | "reserved" | "assigned" | "released";
724
776
  assignedBy: string | null;
725
777
  releasedAt: string | null;
726
778
  notes: string | null;
@@ -737,7 +789,7 @@ export declare function getSlotAssignmentsQueryOptions(client: FetchWithValidati
737
789
  poolId: string | null;
738
790
  resourceId: string | null;
739
791
  bookingId: string | null;
740
- status: "cancelled" | "reserved" | "assigned" | "released" | "completed";
792
+ status: "cancelled" | "completed" | "reserved" | "assigned" | "released";
741
793
  assignedBy: string | null;
742
794
  releasedAt: string | null;
743
795
  notes: string | null;
@@ -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,OAA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AAE,OAAO,GAAG,QAAQ,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBxD;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,0BAA0B,EAClC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,OAAO,GAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,QAAQ,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB5D;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,0BAA0B,EAClC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,OAAO,GAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,QAAQ,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBxD;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,QAAQ,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe3D;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,QAAQ,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe3D"}
@@ -2,7 +2,7 @@
2
2
  import { queryOptions } from "@tanstack/react-query";
3
3
  import { fetchWithValidation } from "./client.js";
4
4
  import { availabilityQueryKeys } from "./query-keys.js";
5
- import { availabilityCloseoutListResponse, availabilityPickupPointListResponse, availabilityRuleListResponse, availabilitySlotAssignmentListResponse, availabilitySlotListResponse, availabilitySlotPickupListResponse, availabilitySlotSingleResponse, availabilityStartTimeListResponse, bookingSummaryListResponse, productListResponse, productSingleResponse, resourceSummaryListResponse, } from "./schemas.js";
5
+ import { availabilityCloseoutListResponse, availabilityPickupPointListResponse, availabilityRuleListResponse, availabilitySlotAssignmentListResponse, availabilitySlotListResponse, availabilitySlotPickupListResponse, availabilitySlotSingleResponse, availabilityStartTimeListResponse, bookingSummaryListResponse, productListResponse, productSingleResponse, resourceSummaryListResponse, slotUnitAvailabilityListResponse, } from "./schemas.js";
6
6
  function appendPagination(params, filters) {
7
7
  if (filters.limit !== undefined)
8
8
  params.set("limit", String(filters.limit));
@@ -111,6 +111,16 @@ export function getSlotQueryOptions(client, id) {
111
111
  },
112
112
  });
113
113
  }
114
+ export function getSlotUnitAvailabilityQueryOptions(client, slotId) {
115
+ return queryOptions({
116
+ queryKey: availabilityQueryKeys.slotUnitAvailability(slotId ?? ""),
117
+ queryFn: async () => {
118
+ if (!slotId)
119
+ throw new Error("getSlotUnitAvailabilityQueryOptions requires a slotId");
120
+ return fetchWithValidation(`/v1/availability/slots/${slotId}/unit-availability`, slotUnitAvailabilityListResponse, client);
121
+ },
122
+ });
123
+ }
114
124
  export function getProductQueryOptions(client, id) {
115
125
  return queryOptions({
116
126
  queryKey: availabilityQueryKeys.product(id ?? ""),
package/dist/schemas.d.ts CHANGED
@@ -52,6 +52,7 @@ export declare const availabilitySlotRecordSchema: z.ZodObject<{
52
52
  id: z.ZodString;
53
53
  productId: z.ZodString;
54
54
  productName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ itineraryId: z.ZodNullable<z.ZodString>;
55
56
  optionId: z.ZodNullable<z.ZodString>;
56
57
  facilityId: z.ZodNullable<z.ZodString>;
57
58
  availabilityRuleId: z.ZodNullable<z.ZodString>;
@@ -79,6 +80,7 @@ export declare const availabilitySlotDetailSchema: z.ZodObject<{
79
80
  id: z.ZodString;
80
81
  productId: z.ZodString;
81
82
  productName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
+ itineraryId: z.ZodNullable<z.ZodString>;
82
84
  optionId: z.ZodNullable<z.ZodString>;
83
85
  facilityId: z.ZodNullable<z.ZodString>;
84
86
  availabilityRuleId: z.ZodNullable<z.ZodString>;
@@ -153,10 +155,10 @@ export declare const availabilitySlotAssignmentRecordSchema: z.ZodObject<{
153
155
  bookingId: z.ZodNullable<z.ZodString>;
154
156
  status: z.ZodEnum<{
155
157
  cancelled: "cancelled";
158
+ completed: "completed";
156
159
  reserved: "reserved";
157
160
  assigned: "assigned";
158
161
  released: "released";
159
- completed: "completed";
160
162
  }>;
161
163
  assignedBy: z.ZodNullable<z.ZodString>;
162
164
  releasedAt: z.ZodNullable<z.ZodString>;
@@ -251,6 +253,7 @@ export declare const availabilitySlotListResponse: z.ZodObject<{
251
253
  id: z.ZodString;
252
254
  productId: z.ZodString;
253
255
  productName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
256
+ itineraryId: z.ZodNullable<z.ZodString>;
254
257
  optionId: z.ZodNullable<z.ZodString>;
255
258
  facilityId: z.ZodNullable<z.ZodString>;
256
259
  availabilityRuleId: z.ZodNullable<z.ZodString>;
@@ -281,6 +284,7 @@ export declare const availabilitySlotRecordResponse: z.ZodObject<{
281
284
  id: z.ZodString;
282
285
  productId: z.ZodString;
283
286
  productName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
+ itineraryId: z.ZodNullable<z.ZodString>;
284
288
  optionId: z.ZodNullable<z.ZodString>;
285
289
  facilityId: z.ZodNullable<z.ZodString>;
286
290
  availabilityRuleId: z.ZodNullable<z.ZodString>;
@@ -308,6 +312,7 @@ export declare const availabilitySlotSingleResponse: z.ZodObject<{
308
312
  id: z.ZodString;
309
313
  productId: z.ZodString;
310
314
  productName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
+ itineraryId: z.ZodNullable<z.ZodString>;
311
316
  optionId: z.ZodNullable<z.ZodString>;
312
317
  facilityId: z.ZodNullable<z.ZodString>;
313
318
  availabilityRuleId: z.ZodNullable<z.ZodString>;
@@ -385,10 +390,10 @@ export declare const availabilitySlotAssignmentListResponse: z.ZodObject<{
385
390
  bookingId: z.ZodNullable<z.ZodString>;
386
391
  status: z.ZodEnum<{
387
392
  cancelled: "cancelled";
393
+ completed: "completed";
388
394
  reserved: "reserved";
389
395
  assigned: "assigned";
390
396
  released: "released";
391
- completed: "completed";
392
397
  }>;
393
398
  assignedBy: z.ZodNullable<z.ZodString>;
394
399
  releasedAt: z.ZodNullable<z.ZodString>;
@@ -416,6 +421,25 @@ export declare const resourceSummaryListResponse: z.ZodObject<{
416
421
  limit: z.ZodNumber;
417
422
  offset: z.ZodNumber;
418
423
  }, z.core.$strip>;
424
+ export declare const slotUnitAvailabilityRecordSchema: z.ZodObject<{
425
+ optionUnitId: z.ZodString;
426
+ unitName: z.ZodString;
427
+ occupancyMax: z.ZodNullable<z.ZodNumber>;
428
+ initial: z.ZodNullable<z.ZodNumber>;
429
+ reserved: z.ZodNumber;
430
+ remaining: z.ZodNullable<z.ZodNumber>;
431
+ }, z.core.$strip>;
432
+ export type SlotUnitAvailabilityRecord = z.infer<typeof slotUnitAvailabilityRecordSchema>;
433
+ export declare const slotUnitAvailabilityListResponse: z.ZodObject<{
434
+ data: z.ZodArray<z.ZodObject<{
435
+ optionUnitId: z.ZodString;
436
+ unitName: z.ZodString;
437
+ occupancyMax: z.ZodNullable<z.ZodNumber>;
438
+ initial: z.ZodNullable<z.ZodNumber>;
439
+ reserved: z.ZodNumber;
440
+ remaining: z.ZodNullable<z.ZodNumber>;
441
+ }, z.core.$strip>>;
442
+ }, z.core.$strip>;
419
443
  export { insertAvailabilityRuleSchema, insertAvailabilitySlotSchema, insertAvailabilityStartTimeSchema, updateAvailabilityRuleSchema, updateAvailabilitySlotSchema, updateAvailabilityStartTimeSchema, };
420
444
  export type CreateAvailabilityRuleInput = z.input<typeof insertAvailabilityRuleSchema>;
421
445
  export type UpdateAvailabilityRuleInput = z.input<typeof updateAvailabilityRuleSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,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 -43,6 +43,7 @@ export const availabilitySlotRecordSchema = z.object({
43
43
  id: z.string(),
44
44
  productId: z.string(),
45
45
  productName: z.string().nullable().optional(),
46
+ itineraryId: z.string().nullable(),
46
47
  optionId: z.string().nullable(),
47
48
  facilityId: z.string().nullable(),
48
49
  availabilityRuleId: z.string().nullable(),
@@ -128,4 +129,15 @@ export const availabilitySlotPickupListResponse = paginatedEnvelope(availability
128
129
  export const availabilitySlotAssignmentListResponse = paginatedEnvelope(availabilitySlotAssignmentRecordSchema);
129
130
  export const bookingSummaryListResponse = paginatedEnvelope(bookingSummarySchema);
130
131
  export const resourceSummaryListResponse = paginatedEnvelope(resourceSummarySchema);
132
+ export const slotUnitAvailabilityRecordSchema = z.object({
133
+ optionUnitId: z.string(),
134
+ unitName: z.string(),
135
+ occupancyMax: z.number().int().nullable(),
136
+ initial: z.number().int().nullable(),
137
+ reserved: z.number().int(),
138
+ remaining: z.number().int().nullable(),
139
+ });
140
+ export const slotUnitAvailabilityListResponse = z.object({
141
+ data: z.array(slotUnitAvailabilityRecordSchema),
142
+ });
131
143
  export { insertAvailabilityRuleSchema, insertAvailabilitySlotSchema, insertAvailabilityStartTimeSchema, updateAvailabilityRuleSchema, updateAvailabilitySlotSchema, updateAvailabilityStartTimeSchema, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/availability-react",
3
- "version": "0.6.8",
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/availability": "0.6.8"
38
+ "@voyantjs/availability": "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/availability": "0.6.8",
50
- "@voyantjs/react": "0.6.8",
49
+ "@voyantjs/availability": "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.6.8"
54
+ "@voyantjs/react": "0.7.0"
55
55
  },
56
56
  "files": [
57
57
  "dist"