@final-commerce/command-frame 0.9.0 → 0.10.0-staging.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/CommonTypes.d.ts +36 -3
  2. package/dist/actions/add-product-fee/mock.d.ts +1 -1
  3. package/dist/actions/add-product-fee/mock.js +15 -9
  4. package/dist/actions/add-product-to-cart/mock.d.ts +23 -0
  5. package/dist/actions/add-product-to-cart/mock.js +321 -1
  6. package/dist/actions/add-product-to-cart/types.d.ts +28 -2
  7. package/dist/actions/adjust-inventory/mock.js +0 -20
  8. package/dist/actions/adjust-inventory/types.d.ts +0 -13
  9. package/dist/actions/adjust-inventory/types.js +0 -1
  10. package/dist/actions/get-composite-availability/action.d.ts +6 -0
  11. package/dist/actions/get-composite-availability/action.js +8 -0
  12. package/dist/actions/get-composite-availability/mock.d.ts +2 -0
  13. package/dist/actions/get-composite-availability/mock.js +45 -0
  14. package/dist/actions/get-composite-availability/types.d.ts +29 -0
  15. package/dist/actions/get-composite-availability/types.js +1 -0
  16. package/dist/actions/get-composite-price/action.d.ts +6 -0
  17. package/dist/actions/get-composite-price/action.js +8 -0
  18. package/dist/actions/get-composite-price/mock.d.ts +2 -0
  19. package/dist/actions/get-composite-price/mock.js +37 -0
  20. package/dist/actions/get-composite-price/types.d.ts +31 -0
  21. package/dist/actions/get-composite-price/types.js +1 -0
  22. package/dist/actions/get-current-cart/mock.d.ts +1 -1
  23. package/dist/actions/get-current-cart/mock.js +13 -3
  24. package/dist/actions/get-current-cart/types.d.ts +7 -1
  25. package/dist/actions/get-product-modifier-selections/mock.js +12 -0
  26. package/dist/actions/get-products/mock.js +7 -3
  27. package/dist/actions/get-products/types.d.ts +1 -1
  28. package/dist/actions/set-product-modifier-selections/mock.js +12 -0
  29. package/dist/actions/set-variant-unavailable/action.d.ts +2 -0
  30. package/dist/actions/set-variant-unavailable/action.js +4 -0
  31. package/dist/actions/set-variant-unavailable/mock.d.ts +2 -0
  32. package/dist/actions/set-variant-unavailable/mock.js +12 -0
  33. package/dist/actions/set-variant-unavailable/types.d.ts +17 -0
  34. package/dist/actions/set-variant-unavailable/types.js +1 -0
  35. package/dist/demo/database.d.ts +54 -16
  36. package/dist/demo/database.js +219 -1
  37. package/dist/index.d.ts +7 -3
  38. package/dist/index.js +6 -2
  39. package/dist/projects/render/mocks.js +6 -2
  40. package/dist/projects/render/types.d.ts +4 -2
  41. package/dist/pubsub/topics/products/catalog-visibility-changed/types.d.ts +17 -0
  42. package/dist/pubsub/topics/products/catalog-visibility-changed/types.js +1 -0
  43. package/dist/pubsub/topics/products/composite-changed/types.d.ts +17 -0
  44. package/dist/pubsub/topics/products/composite-changed/types.js +1 -0
  45. package/dist/pubsub/topics/products/index.d.ts +2 -2
  46. package/dist/pubsub/topics/products/index.js +33 -18
  47. package/dist/pubsub/topics/products/inventory-changed/types.d.ts +18 -0
  48. package/dist/pubsub/topics/products/inventory-changed/types.js +1 -0
  49. package/dist/pubsub/topics/products/types.d.ts +16 -10
  50. package/dist/pubsub/topics/products/types.js +7 -4
  51. package/package.json +2 -2
  52. package/dist/actions/get-custom-stock-actions/action.d.ts +0 -5
  53. package/dist/actions/get-custom-stock-actions/action.js +0 -7
  54. package/dist/actions/get-custom-stock-actions/mock.d.ts +0 -2
  55. package/dist/actions/get-custom-stock-actions/mock.js +0 -11
  56. package/dist/actions/get-custom-stock-actions/types.d.ts +0 -12
  57. package/dist/actions/get-custom-stock-actions/types.js +0 -2
@@ -0,0 +1,29 @@
1
+ import type { CFCompositePick } from '../../CommonTypes';
2
+ export interface GetCompositeAvailabilityParams {
3
+ /** The composite's variant — the one `addProductToCart` takes. Its `composite.needsDate` is true. */
4
+ variantId: string;
5
+ /** The picks so far; their bookable items decide the seats asked. Absent = each part's `defaultPick`. */
6
+ composite?: CFCompositePick[];
7
+ /** First shop day, `YYYY-MM-DD` in the shop's zone. Defaults to today. */
8
+ fromDay?: string;
9
+ /** How many shop days from `fromDay`. Defaults to 1. */
10
+ days?: number;
11
+ }
12
+ /** A start every bookable of the composite can be held at, with the seats its picks need. */
13
+ export interface CFCompositeSlot {
14
+ /** ISO 8601 — send it back as `addProductToCart({ compositeSlot: { startAt } })`. */
15
+ startAt: string;
16
+ /** The shop day it falls on, `YYYY-MM-DD` — what a day picker groups by. */
17
+ dayKey: string;
18
+ }
19
+ export interface GetCompositeAvailabilityResponse {
20
+ /** False when the host refused: not a composite, nothing bookable picked, no booking rules on this till yet. */
21
+ success: boolean;
22
+ reason?: string;
23
+ /** In time order. Empty = nothing free for all of them in those days. */
24
+ slots: CFCompositeSlot[];
25
+ /** The clock `startAt` and `dayKey` read on; null when no bookable serves here. */
26
+ timeZone: string | null;
27
+ timestamp: string;
28
+ }
29
+ export type GetCompositeAvailability = (params: GetCompositeAvailabilityParams) => Promise<GetCompositeAvailabilityResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get composite price action (read-only)
3
+ * Calls the getCompositePrice action on the parent window
4
+ */
5
+ import type { GetCompositePrice } from './types';
6
+ export declare const getCompositePrice: GetCompositePrice;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Get composite price action (read-only)
3
+ * Calls the getCompositePrice action on the parent window
4
+ */
5
+ import { commandFrameClient } from '../../client';
6
+ export const getCompositePrice = async (params) => {
7
+ return await commandFrameClient.call('getCompositePrice', params);
8
+ };
@@ -0,0 +1,2 @@
1
+ import { GetCompositePrice } from './types';
2
+ export declare const mockGetCompositePrice: GetCompositePrice;
@@ -0,0 +1,37 @@
1
+ import { MOCK_CART, MOCK_PRODUCTS, buildModifierRows, mockCompositeAtOutlet, mockCompositeStockRefusal, mockHiddenProductIds, } from '../../demo/database';
2
+ import { compositePicksRefusal, mockCompositeLine, mockNeedsDateRefusal, mockPicksStillNeeded, } from '../add-product-to-cart/mock';
3
+ // The same line the mock addProductToCart builds, priced for ONE composite and added to nothing.
4
+ export const mockGetCompositePrice = async (params) => {
5
+ console.log('[Mock] getCompositePrice called', params);
6
+ const timestamp = new Date().toISOString();
7
+ const product = MOCK_PRODUCTS.find((candidate) => candidate.variants.some((v) => v._id === params?.variantId));
8
+ if (!product)
9
+ throw new Error(`Variant with ID ${params?.variantId} not found`);
10
+ if (!product.composite) {
11
+ return {
12
+ success: false,
13
+ reason: `${product.name} is not a composite: it takes no composite picks`,
14
+ missing: [],
15
+ timestamp,
16
+ };
17
+ }
18
+ const picks = params.composite ?? [];
19
+ // What this outlet sells (the host's catalog-visibility rules).
20
+ const composite = mockCompositeAtOutlet(product.composite, undefined, params.compositeSlot);
21
+ const missing = mockPicksStillNeeded(composite, picks);
22
+ if (mockHiddenProductIds().has(product._id)) {
23
+ return { success: false, reason: `${product.name} is not sold at this outlet`, missing, timestamp };
24
+ }
25
+ const line = mockNeedsDateRefusal(product.name, composite, params.compositeSlot) ??
26
+ compositePicksRefusal(composite, picks) ??
27
+ mockCompositeLine(composite, picks, !product.taxTable);
28
+ if (typeof line === 'string')
29
+ return { success: false, reason: line, missing, timestamp };
30
+ const shortOfStock = mockCompositeStockRefusal([
31
+ ...MOCK_CART.products,
32
+ { variantId: params.variantId, quantity: 1, components: line.components },
33
+ ]);
34
+ if (shortOfStock)
35
+ return { success: false, reason: shortOfStock, missing, timestamp };
36
+ return { success: true, total: line.price + buildModifierRows(line.modifiers, 1).modifiersTotal, missing, timestamp };
37
+ };
@@ -0,0 +1,31 @@
1
+ import type { CFCompositePick } from '../../CommonTypes';
2
+ export interface GetCompositePriceParams {
3
+ /** The composite's variant — the one `addProductToCart` takes. */
4
+ variantId: string;
5
+ /** The picks so far, exactly as `addProductToCart({ composite })` would send them. */
6
+ composite: CFCompositePick[];
7
+ /** B41: the date and time a bookable pick is for, as `addProductToCart` takes it; without one a bookable pick is refused. */
8
+ compositeSlot?: {
9
+ startAt: string;
10
+ };
11
+ }
12
+ export interface GetCompositePriceResponse {
13
+ success: boolean;
14
+ /** Why these picks are refused — the same refusal and text `addProductToCart` would give. */
15
+ reason?: string;
16
+ /**
17
+ * What ONE composite with these picks adds to the cart, minor units: the line price the host would build plus the
18
+ * picked items' modifiers. Before discounts, fees and tax. Show it; do not recompute it. Absent when refused.
19
+ */
20
+ total?: number;
21
+ /**
22
+ * The parts that still need picks before the composite can be added, and how many ("Pick 2 more"); empty when every
23
+ * required part is filled. Decided by the host — keep Add to cart disabled while this is not empty.
24
+ */
25
+ missing: {
26
+ partId: string;
27
+ needed: number;
28
+ }[];
29
+ timestamp: string;
30
+ }
31
+ export type GetCompositePrice = (params: GetCompositePriceParams) => Promise<GetCompositePriceResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,2 @@
1
- import { GetCurrentCart } from "./types";
1
+ import { GetCurrentCart } from './types';
2
2
  export declare const mockGetCurrentCart: GetCurrentCart;
@@ -1,9 +1,19 @@
1
- import { MOCK_CART, safeSerialize } from "../../demo/database";
1
+ import { MOCK_CART, buildModifierRows, safeSerialize } from '../../demo/database';
2
+ import { extendPrice } from '@final-commerce/common';
2
3
  export const mockGetCurrentCart = async () => {
3
- console.log("[Mock] getCurrentCart called");
4
+ console.log('[Mock] getCurrentCart called');
5
+ // The mock keeps no discounts or fees per line: a line is its price × quantity plus its modifier rows.
6
+ const lineTotals = Object.fromEntries([
7
+ ...MOCK_CART.products.map((line) => [
8
+ line.internalId ?? line.id,
9
+ extendPrice(line.price, line.quantity) + buildModifierRows(line.modifiers, line.quantity).modifiersTotal,
10
+ ]),
11
+ ...(MOCK_CART.customSales ?? []).map((sale) => [sale.id, extendPrice(sale.price, sale.quantity)]),
12
+ ]);
4
13
  return {
5
14
  success: true,
6
15
  cart: safeSerialize(MOCK_CART),
7
- timestamp: new Date().toISOString()
16
+ lineTotals,
17
+ timestamp: new Date().toISOString(),
8
18
  };
9
19
  };
@@ -1,7 +1,13 @@
1
- import { CFActiveCart } from "../../CommonTypes";
1
+ import { CFActiveCart } from '../../CommonTypes';
2
2
  export interface GetCurrentCartResponse {
3
3
  success: boolean;
4
4
  cart: CFActiveCart;
5
+ /**
6
+ * What each line adds to the cart, minor units, keyed by the line's `internalId` (products, bookings) or `id`
7
+ * (custom sales): price × quantity − its own discounts + its own fees + its modifiers. Before the cart discount
8
+ * and tax; Σ = the cart's subtotal before non-revenue items. Show it; do not recompute it.
9
+ */
10
+ lineTotals?: Record<string, number>;
5
11
  timestamp: string;
6
12
  }
7
13
  export type GetCurrentCart = () => Promise<GetCurrentCartResponse>;
@@ -16,6 +16,18 @@ export const mockGetProductModifierSelections = async (params) => {
16
16
  timestamp: new Date().toISOString(),
17
17
  };
18
18
  }
19
+ // Like the host (FT-83): a composite line's modifiers belong to its components.
20
+ if (line.components?.length) {
21
+ return {
22
+ success: false,
23
+ reason: 'The modifiers of a composite line cannot be edited yet: remove the line and add it again with its picks',
24
+ internalId: line.internalId,
25
+ selections: [],
26
+ rows: [],
27
+ modifiersTotal: 0,
28
+ timestamp: new Date().toISOString(),
29
+ };
30
+ }
19
31
  // The priced rows already sit on the line; extending them by the line quantity is
20
32
  // the host's job, not the flow's.
21
33
  const { rows, modifiersTotal } = buildModifierRows(line.modifiers, line.quantity);
@@ -1,9 +1,13 @@
1
- import { MOCK_PRODUCTS, safeSerialize } from '../../demo/database';
1
+ import { MOCK_PRODUCTS, mockCompositeAtOutlet, mockHiddenProductIds, safeSerialize } from '../../demo/database';
2
2
  import { resolveUnit } from '@final-commerce/common';
3
3
  export const mockGetProducts = async (params) => {
4
4
  console.log('[Mock] getProducts called', params);
5
- // Simple filter simulation
6
- let products = MOCK_PRODUCTS;
5
+ // Simple filter simulation. Like the host: a product hidden at this outlet is left out, and a composite offers only
6
+ // what is sold here.
7
+ const hidden = mockHiddenProductIds();
8
+ let products = MOCK_PRODUCTS.filter((p) => !hidden.has(p._id)).map((p) =>
9
+ // B43: the host never hands a composite modifiers of its own.
10
+ p.composite ? { ...p, modifiers: [], composite: mockCompositeAtOutlet(p.composite, hidden) } : p);
7
11
  const query = params?.query || {};
8
12
  // Same rule as the real host: a bookable service is not catalogue stock and is left out unless
9
13
  // the query names `productType`. Mirrored here on purpose — a mock that hands back services the
@@ -27,7 +27,7 @@ export interface GetProductsParams {
27
27
  };
28
28
  status?: string;
29
29
  /**
30
- * `simple` | `variable` | `booking`. Naming it at all switches OFF the default exclusion
30
+ * `simple` | `variable` | `booking` | `composite`. Naming it at all switches OFF the default exclusion
31
31
  * of bookable services — including `{ $ne: 'booking' }`, which then means what it says.
32
32
  */
33
33
  productType?: string | {
@@ -30,6 +30,18 @@ export const mockSetProductModifierSelections = async (params) => {
30
30
  timestamp: new Date().toISOString(),
31
31
  };
32
32
  }
33
+ // Like the host (FT-83): a composite line's modifiers belong to its components.
34
+ if (line.components?.length) {
35
+ return {
36
+ success: false,
37
+ reason: 'The modifiers of a composite line cannot be edited yet: remove the line and add it again with its picks',
38
+ internalId: line.internalId,
39
+ selections: [],
40
+ rows: [],
41
+ modifiersTotal: 0,
42
+ timestamp: new Date().toISOString(),
43
+ };
44
+ }
33
45
  // Full replacement — passing [] clears the rows. The line drops the product's resolved
34
46
  // stack when it is built, so the menu is re-read from the catalogue to price against.
35
47
  // Cart totals are not touched, for the same reason addProductToCart does not move them
@@ -0,0 +1,2 @@
1
+ import type { SetVariantUnavailable } from './types';
2
+ export declare const setVariantUnavailable: SetVariantUnavailable;
@@ -0,0 +1,4 @@
1
+ import { commandFrameClient } from '../../client';
2
+ export const setVariantUnavailable = async (params) => {
3
+ return await commandFrameClient.call('setVariantUnavailable', params);
4
+ };
@@ -0,0 +1,2 @@
1
+ import { SetVariantUnavailable } from './types';
2
+ export declare const mockSetVariantUnavailable: SetVariantUnavailable;
@@ -0,0 +1,12 @@
1
+ import { MOCK_OUTLET, MOCK_PRODUCTS } from '../../demo/database';
2
+ export const mockSetVariantUnavailable = async (params) => {
3
+ console.log('[Mock] setVariantUnavailable called', params);
4
+ if (!params?.variantId)
5
+ throw new Error('variantId is required');
6
+ const { variantId, unavailable } = params;
7
+ const variant = MOCK_PRODUCTS.flatMap((product) => product.variants).find((v) => v._id === variantId);
8
+ if (!variant)
9
+ throw new Error(`Variant with ID ${variantId} not found`);
10
+ variant.unavailable = unavailable;
11
+ return { success: true, variantId, outletId: MOCK_OUTLET.id, unavailable, timestamp: new Date().toISOString() };
12
+ };
@@ -0,0 +1,17 @@
1
+ export interface SetVariantUnavailableParams {
2
+ /** Variant to mark or unmark. */
3
+ variantId: string;
4
+ /**
5
+ * `true` marks the variant "can't be sold here right now" at the ACTIVE outlet; `false` removes the mark.
6
+ * Independent of stock and of catalog visibility. Needs a connection: the host refuses offline.
7
+ */
8
+ unavailable: boolean;
9
+ }
10
+ export interface SetVariantUnavailableResponse {
11
+ success: boolean;
12
+ variantId: string;
13
+ outletId: string;
14
+ unavailable: boolean;
15
+ timestamp: string;
16
+ }
17
+ export type SetVariantUnavailable = (params?: SetVariantUnavailableParams) => Promise<SetVariantUnavailableResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -2,7 +2,7 @@
2
2
  * Mock Database for Standalone/Demo Mode
3
3
  * Stores mock data that mimics the Render environment
4
4
  */
5
- import { CFActiveCompany, CFActiveUser, CFActiveStation, CFActiveOutlet, CFActiveOrder, CFCustomer, CFProduct, CFActiveCart, CFCategory, CFActiveProduct, CFSession, CFActiveRefundDetails, CFSmartGridLayout, CFBooking, CFBookingAvailability, CFBookingResource, CFCartLineModifier, CFProdModifierBreakdown, CFModifierSelection, CFResolvedModifier } from '../CommonTypes';
5
+ import { CFActiveCompany, CFActiveUser, CFActiveStation, CFActiveOutlet, CFActiveOrder, CFCustomer, CFProduct, CFComposite, CFCartLineComponent, CFActiveCart, CFCategory, CFActiveProduct, CFSession, CFActiveRefundDetails, CFSmartGridLayout, CFBooking, CFBookingAvailability, CFBookingResource, CFBookingSlot, CFCartLineModifier, CFProdModifierBreakdown, CFModifierSelection, CFResolvedModifier } from '../CommonTypes';
6
6
  export * from './mocks';
7
7
  /** Replace mock catalog / context data in place (same array references mock handlers use). */
8
8
  export interface MockDatabaseConfig {
@@ -19,6 +19,12 @@ export interface MockDatabaseConfig {
19
19
  bookingResources?: CFBookingResource[];
20
20
  /** Windows already taken when the dataset loads, so a calendar does not open empty. */
21
21
  bookings?: CFBooking[];
22
+ /** Products hidden at an outlet (the host's `catalog-visibility`, product-level rows). Empty = sold everywhere. */
23
+ catalogVisibility?: MockCatalogVisibility[];
24
+ }
25
+ export interface MockCatalogVisibility {
26
+ productId: string;
27
+ outletId: string;
22
28
  }
23
29
  export declare const MOCK_COMPANY: CFActiveCompany;
24
30
  export declare const MOCK_OUTLET_MAIN: CFActiveOutlet;
@@ -38,20 +44,20 @@ export declare const MOCK_CATEGORY_SPECIALTY: CFCategory;
38
44
  export declare const MOCK_CATEGORY_BASIC: CFCategory;
39
45
  export declare const MOCK_CATEGORY_VEGAN: CFCategory;
40
46
  export declare const MOCK_CATEGORY_SPICY: CFCategory;
41
- export declare const MOCK_PRODUCT_BASIL_ALMOND: import("@final-commerce/common/pos-types").FullProduct;
42
- export declare const MOCK_PRODUCT_BEER: import("@final-commerce/common/pos-types").FullProduct;
43
- export declare const MOCK_PRODUCT_BEET: import("@final-commerce/common/pos-types").FullProduct;
44
- export declare const MOCK_PRODUCT_CARAMELIZED: import("@final-commerce/common/pos-types").FullProduct;
45
- export declare const MOCK_PRODUCT_GARLIC_ONION: import("@final-commerce/common/pos-types").FullProduct;
46
- export declare const MOCK_PRODUCT_GARLIC: import("@final-commerce/common/pos-types").FullProduct;
47
- export declare const MOCK_PRODUCT_GINGER_LIME: import("@final-commerce/common/pos-types").FullProduct;
48
- export declare const MOCK_PRODUCT_LEMON: import("@final-commerce/common/pos-types").FullProduct;
49
- export declare const MOCK_PRODUCT_RED_PEPPER: import("@final-commerce/common/pos-types").FullProduct;
50
- export declare const MOCK_PRODUCT_ROASTED_TOMATO: import("@final-commerce/common/pos-types").FullProduct;
51
- export declare const MOCK_PRODUCT_MINT_LEMON: import("@final-commerce/common/pos-types").FullProduct;
52
- export declare const MOCK_PRODUCT_CHILI_GARLIC: import("@final-commerce/common/pos-types").FullProduct;
53
- export declare const MOCK_PRODUCT_HABANERO: import("@final-commerce/common/pos-types").FullProduct;
54
- export declare const MOCK_PRODUCT_BLACK_GARLIC: import("@final-commerce/common/pos-types").FullProduct;
47
+ export declare const MOCK_PRODUCT_BASIL_ALMOND: CFProduct;
48
+ export declare const MOCK_PRODUCT_BEER: CFProduct;
49
+ export declare const MOCK_PRODUCT_BEET: CFProduct;
50
+ export declare const MOCK_PRODUCT_CARAMELIZED: CFProduct;
51
+ export declare const MOCK_PRODUCT_GARLIC_ONION: CFProduct;
52
+ export declare const MOCK_PRODUCT_GARLIC: CFProduct;
53
+ export declare const MOCK_PRODUCT_GINGER_LIME: CFProduct;
54
+ export declare const MOCK_PRODUCT_LEMON: CFProduct;
55
+ export declare const MOCK_PRODUCT_RED_PEPPER: CFProduct;
56
+ export declare const MOCK_PRODUCT_ROASTED_TOMATO: CFProduct;
57
+ export declare const MOCK_PRODUCT_MINT_LEMON: CFProduct;
58
+ export declare const MOCK_PRODUCT_CHILI_GARLIC: CFProduct;
59
+ export declare const MOCK_PRODUCT_HABANERO: CFProduct;
60
+ export declare const MOCK_PRODUCT_BLACK_GARLIC: CFProduct;
55
61
  export declare const MOCK_ORDER_1: CFActiveOrder;
56
62
  export declare const MOCK_ORDER_2: CFActiveOrder;
57
63
  export declare const MOCK_ORDER_3: CFActiveOrder;
@@ -64,8 +70,40 @@ export declare const MOCK_OUTLETS: import("@final-commerce/common/pos-types").Ac
64
70
  export declare const MOCK_CUSTOMERS: import("@final-commerce/common/pos-types").ActiveCustomer[];
65
71
  export declare const MOCK_CATEGORIES: import("@final-commerce/common/pos-types").Category[];
66
72
  export declare const MOCK_PRODUCT_HAIRCUT: CFProduct;
67
- export declare const MOCK_PRODUCTS: import("@final-commerce/common/pos-types").FullProduct[];
73
+ export declare const MOCK_PRODUCT_PASTE_TRIO: CFProduct;
74
+ export declare const MOCK_PRODUCTS: CFProduct[];
68
75
  export declare const MOCK_ORDERS: import("@final-commerce/common/pos-types").ActiveOrder[];
76
+ /** Nothing hidden by default; `setMockDatabase({ catalogVisibility })` hides products at an outlet. */
77
+ export declare const MOCK_CATALOG_VISIBILITY: MockCatalogVisibility[];
78
+ /**
79
+ * The host's cart stock check for composites (kaching `compositeStockRefusal`), over the demo shelves — a copy: what the
80
+ * cart takes of each component's variant (plain lines and components × their line quantity) against its shelf here.
81
+ * The demo has no pools or units, so it counts per variant; untracked and backordered variants are never short.
82
+ */
83
+ export declare function mockCompositeStockRefusal(products: {
84
+ variantId: string;
85
+ quantity: number;
86
+ components?: CFCartLineComponent[];
87
+ }[]): string | null;
88
+ /** Product ids hidden at the demo's active outlet. */
89
+ export declare const mockHiddenProductIds: () => Set<string>;
90
+ /**
91
+ * The host's outlet rules for a composite (kaching `resolveComposite`), over the demo's static view — a copy, change both
92
+ * in one step: an item whose product is hidden here is left out, a category item keeps only products sold here (none →
93
+ * `'empty'`), an Optional part with nothing to pick is not offered, a required one with nothing makes it unavailable,
94
+ * and the D36 default and "from" price are read off what is left.
95
+ */
96
+ /** B41: the seats a bookable demo product has free in the slot starting at `startAt` — as the host reads them. */
97
+ export declare function mockBookableWindow(productId: string, startAt: string): {
98
+ free: number;
99
+ slot: CFBookingSlot | null;
100
+ };
101
+ export declare const mockIsBookable: (productId: string) => boolean;
102
+ export declare function mockCompositeAtOutlet(composite: Omit<CFComposite, 'needsDate'>, hidden?: Set<string>,
103
+ /** B41: the window bookable items are judged in; absent = `by_date`. */
104
+ slot?: {
105
+ startAt: string;
106
+ }): CFComposite;
69
107
  export declare const MOCK_PARKED_ORDERS: CFActiveOrder[];
70
108
  export declare let MOCK_USER: CFActiveUser;
71
109
  export declare let MOCK_STATION: CFActiveStation;