@voyantjs/availability-react 0.6.9 → 0.8.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";
@@ -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
+ }
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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B;;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],
@@ -553,6 +553,50 @@ export declare function getSlotQueryOptions(client: FetchWithValidationOptions,
553
553
  [dataTagErrorSymbol]: Error;
554
554
  };
555
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
+ };
556
600
  export declare function getProductQueryOptions(client: FetchWithValidationOptions, id: string | null | undefined): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
557
601
  data: {
558
602
  id: string;
@@ -699,7 +743,7 @@ export declare function getSlotAssignmentsQueryOptions(client: FetchWithValidati
699
743
  poolId: string | null;
700
744
  resourceId: string | null;
701
745
  bookingId: string | null;
702
- status: "cancelled" | "reserved" | "assigned" | "released" | "completed";
746
+ status: "cancelled" | "completed" | "reserved" | "assigned" | "released";
703
747
  assignedBy: string | null;
704
748
  releasedAt: string | null;
705
749
  notes: string | null;
@@ -713,7 +757,7 @@ export declare function getSlotAssignmentsQueryOptions(client: FetchWithValidati
713
757
  poolId: string | null;
714
758
  resourceId: string | null;
715
759
  bookingId: string | null;
716
- status: "cancelled" | "reserved" | "assigned" | "released" | "completed";
760
+ status: "cancelled" | "completed" | "reserved" | "assigned" | "released";
717
761
  assignedBy: string | null;
718
762
  releasedAt: string | null;
719
763
  notes: string | null;
@@ -728,7 +772,7 @@ export declare function getSlotAssignmentsQueryOptions(client: FetchWithValidati
728
772
  poolId: string | null;
729
773
  resourceId: string | null;
730
774
  bookingId: string | null;
731
- status: "cancelled" | "reserved" | "assigned" | "released" | "completed";
775
+ status: "cancelled" | "completed" | "reserved" | "assigned" | "released";
732
776
  assignedBy: string | null;
733
777
  releasedAt: string | null;
734
778
  notes: string | null;
@@ -745,7 +789,7 @@ export declare function getSlotAssignmentsQueryOptions(client: FetchWithValidati
745
789
  poolId: string | null;
746
790
  resourceId: string | null;
747
791
  bookingId: string | null;
748
- status: "cancelled" | "reserved" | "assigned" | "released" | "completed";
792
+ status: "cancelled" | "completed" | "reserved" | "assigned" | "released";
749
793
  assignedBy: string | null;
750
794
  releasedAt: string | null;
751
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,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAsBtE,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,kBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYjC;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,eAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB9B;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,oBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBnC;AAED,w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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
@@ -155,10 +155,10 @@ export declare const availabilitySlotAssignmentRecordSchema: z.ZodObject<{
155
155
  bookingId: z.ZodNullable<z.ZodString>;
156
156
  status: z.ZodEnum<{
157
157
  cancelled: "cancelled";
158
+ completed: "completed";
158
159
  reserved: "reserved";
159
160
  assigned: "assigned";
160
161
  released: "released";
161
- completed: "completed";
162
162
  }>;
163
163
  assignedBy: z.ZodNullable<z.ZodString>;
164
164
  releasedAt: z.ZodNullable<z.ZodString>;
@@ -390,10 +390,10 @@ export declare const availabilitySlotAssignmentListResponse: z.ZodObject<{
390
390
  bookingId: z.ZodNullable<z.ZodString>;
391
391
  status: z.ZodEnum<{
392
392
  cancelled: "cancelled";
393
+ completed: "completed";
393
394
  reserved: "reserved";
394
395
  assigned: "assigned";
395
396
  released: "released";
396
- completed: "completed";
397
397
  }>;
398
398
  assignedBy: z.ZodNullable<z.ZodString>;
399
399
  releasedAt: z.ZodNullable<z.ZodString>;
@@ -421,6 +421,25 @@ export declare const resourceSummaryListResponse: z.ZodObject<{
421
421
  limit: z.ZodNumber;
422
422
  offset: z.ZodNumber;
423
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>;
424
443
  export { insertAvailabilityRuleSchema, insertAvailabilitySlotSchema, insertAvailabilityStartTimeSchema, updateAvailabilityRuleSchema, updateAvailabilitySlotSchema, updateAvailabilityStartTimeSchema, };
425
444
  export type CreateAvailabilityRuleInput = z.input<typeof insertAvailabilityRuleSchema>;
426
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,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,iCAAiC,EACjC,4BAA4B,EAC5B,4BAA4B,EAC5B,iCAAiC,EAClC,MAAM,wBAAwB,CAAA;AAC/B,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,eAAe;;iBAAqC,CAAA;AAEjE,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;iBAcvC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACjF,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAA;AAExD,eAAO,MAAM,iCAAiC;;;;;;;;;;;iBAW5C,CAAA;AAEF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAC3F,MAAM,MAAM,wBAAwB,GAAG,2BAA2B,CAAA;AAElE,eAAO,MAAM,4BAA4B;;;;;;;;;;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,iCAAiC,CAAC,CAAA;AAChG,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAChG,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACtF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
package/dist/schemas.js CHANGED
@@ -129,4 +129,15 @@ export const availabilitySlotPickupListResponse = paginatedEnvelope(availability
129
129
  export const availabilitySlotAssignmentListResponse = paginatedEnvelope(availabilitySlotAssignmentRecordSchema);
130
130
  export const bookingSummaryListResponse = paginatedEnvelope(bookingSummarySchema);
131
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
+ });
132
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.9",
3
+ "version": "0.8.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.9"
38
+ "@voyantjs/availability": "0.8.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.9",
50
- "@voyantjs/react": "0.6.9",
49
+ "@voyantjs/availability": "0.8.0",
50
+ "@voyantjs/react": "0.8.0",
51
51
  "@voyantjs/voyant-typescript-config": "0.1.0"
52
52
  },
53
53
  "dependencies": {
54
- "@voyantjs/react": "0.6.9"
54
+ "@voyantjs/react": "0.8.0"
55
55
  },
56
56
  "files": [
57
57
  "dist"