@final-commerce/command-frame 0.9.0-preprod.2 → 0.9.0-preprod.4
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/actions/get-current-cart/mock.d.ts +1 -1
- package/dist/actions/get-current-cart/mock.js +6 -3
- package/dist/actions/get-current-cart/types.d.ts +7 -1
- package/dist/actions/get-order-statuses/types.d.ts +1 -1
- package/dist/actions/get-orders/mock.js +28 -3
- package/dist/actions/get-orders/types.d.ts +13 -2
- package/dist/actions/set-order-status/mock.js +9 -4
- package/dist/actions/set-order-status/types.d.ts +7 -2
- package/dist/actions/set-scheduled-for/action.d.ts +6 -0
- package/dist/actions/set-scheduled-for/action.js +8 -0
- package/dist/actions/set-scheduled-for/mock.d.ts +4 -0
- package/dist/actions/set-scheduled-for/mock.js +45 -0
- package/dist/actions/set-scheduled-for/types.d.ts +22 -0
- package/dist/actions/set-scheduled-for/types.js +1 -0
- package/dist/common-types/order-state.d.ts +9 -4
- package/dist/demo/database.d.ts +1 -1
- package/dist/demo/database.js +24 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/projects/render/mocks.js +2 -0
- package/dist/projects/render/types.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GetCurrentCart } from
|
|
1
|
+
import { GetCurrentCart } from './types';
|
|
2
2
|
export declare const mockGetCurrentCart: GetCurrentCart;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { MOCK_CART, safeSerialize } from
|
|
1
|
+
import { MOCK_CART, safeSerialize } from '../../demo/database';
|
|
2
2
|
export const mockGetCurrentCart = async () => {
|
|
3
|
-
console.log(
|
|
3
|
+
console.log('[Mock] getCurrentCart called');
|
|
4
4
|
return {
|
|
5
5
|
success: true,
|
|
6
6
|
cart: safeSerialize(MOCK_CART),
|
|
7
|
-
|
|
7
|
+
// Every mock tender settles the whole sale and clears the cart, so the demo cart
|
|
8
|
+
// never holds an order with money on it — nothing to lock.
|
|
9
|
+
itemsLocked: false,
|
|
10
|
+
timestamp: new Date().toISOString(),
|
|
8
11
|
};
|
|
9
12
|
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { CFActiveCart } from
|
|
1
|
+
import { CFActiveCart } from '../../CommonTypes';
|
|
2
2
|
export interface GetCurrentCartResponse {
|
|
3
3
|
success: boolean;
|
|
4
4
|
cart: CFActiveCart;
|
|
5
|
+
/**
|
|
6
|
+
* `true` while the order in this cart has any payment on it (a split leg, a part payment,
|
|
7
|
+
* or paid in full): its items, amounts and customer can no longer be changed — the
|
|
8
|
+
* value-changing cart commands and clearCart refuse. Absent on hosts that predate the lock.
|
|
9
|
+
*/
|
|
10
|
+
itemsLocked?: boolean;
|
|
5
11
|
timestamp: string;
|
|
6
12
|
}
|
|
7
13
|
export type GetCurrentCart = () => Promise<GetCurrentCartResponse>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CFOrderStatusDefinition } from '../../common-types/order-state';
|
|
2
2
|
export interface GetOrderStatusesResponse {
|
|
3
3
|
success: boolean;
|
|
4
|
-
/** The
|
|
4
|
+
/** The running flow's order statuses, in the order they were defined. Empty when it defines none. */
|
|
5
5
|
statuses: CFOrderStatusDefinition[];
|
|
6
6
|
timestamp: string;
|
|
7
7
|
}
|
|
@@ -5,7 +5,7 @@ export const mockGetOrders = async (params) => {
|
|
|
5
5
|
let orders = safeSerialize([...MOCK_ORDERS, ...MOCK_PARKED_ORDERS]);
|
|
6
6
|
// Filter simulation
|
|
7
7
|
if (params) {
|
|
8
|
-
const { customerId, status, sessionId, paymentState, fulfillmentState, outletId, assignedUserId, inCart, orderType, customStatusId, searchValue, limit, offset, sortBy, sortDirection, } = params;
|
|
8
|
+
const { customerId, status, sessionId, paymentState, fulfillmentState, outletId, assignedUserId, inCart, orderType, customStatusId, customStatusKey, scheduled, scheduledFrom, scheduledTo, searchValue, limit, offset, sortBy, sortDirection, } = params;
|
|
9
9
|
// 1. Filtering
|
|
10
10
|
if (customerId) {
|
|
11
11
|
orders = orders.filter((o) => o.customer && '_id' in o.customer && o.customer._id === customerId);
|
|
@@ -38,10 +38,30 @@ export const mockGetOrders = async (params) => {
|
|
|
38
38
|
if (types.length)
|
|
39
39
|
orders = orders.filter((o) => types.includes(o.orderType ?? ''));
|
|
40
40
|
}
|
|
41
|
+
if (customStatusKey !== undefined) {
|
|
42
|
+
const keys = Array.isArray(customStatusKey) ? customStatusKey : [customStatusKey];
|
|
43
|
+
if (keys.length)
|
|
44
|
+
orders = orders.filter((o) => !!o.customStatus?.key && keys.includes(o.customStatus.key));
|
|
45
|
+
}
|
|
41
46
|
if (customStatusId !== undefined) {
|
|
42
47
|
const ids = Array.isArray(customStatusId) ? customStatusId : [customStatusId];
|
|
43
|
-
if (ids.length)
|
|
44
|
-
orders = orders.filter((o) => !!o.customStatus &&
|
|
48
|
+
if (ids.length) {
|
|
49
|
+
orders = orders.filter((o) => !!o.customStatus &&
|
|
50
|
+
(ids.includes(o.customStatus.id) || (!!o.customStatus.key && ids.includes(o.customStatus.key))));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Requested time (setScheduledFor). ISO strings in UTC compare correctly as strings.
|
|
54
|
+
const scheduledOf = (o) => o.scheduledFor ?? null;
|
|
55
|
+
if (typeof scheduled === 'boolean') {
|
|
56
|
+
orders = orders.filter((o) => (scheduledOf(o) !== null) === scheduled);
|
|
57
|
+
}
|
|
58
|
+
if (scheduledFrom) {
|
|
59
|
+
const from = new Date(scheduledFrom).toISOString();
|
|
60
|
+
orders = orders.filter((o) => (scheduledOf(o) ?? '') !== '' && scheduledOf(o) >= from);
|
|
61
|
+
}
|
|
62
|
+
if (scheduledTo) {
|
|
63
|
+
const to = new Date(scheduledTo).toISOString();
|
|
64
|
+
orders = orders.filter((o) => (scheduledOf(o) ?? '') !== '' && scheduledOf(o) <= to);
|
|
45
65
|
}
|
|
46
66
|
if (typeof inCart === 'boolean') {
|
|
47
67
|
// Mirrors common's isInCart: the flag when present, else the legacy reading.
|
|
@@ -70,6 +90,11 @@ export const mockGetOrders = async (params) => {
|
|
|
70
90
|
orders.sort((a, b) => {
|
|
71
91
|
let valA = a[sortBy];
|
|
72
92
|
let valB = b[sortBy];
|
|
93
|
+
// Like the host: a missing time sorts as '' (first when ascending).
|
|
94
|
+
if (sortBy === 'scheduledFor') {
|
|
95
|
+
valA = valA ?? '';
|
|
96
|
+
valB = valB ?? '';
|
|
97
|
+
}
|
|
73
98
|
// Handle nested sort fields if necessary, basic support for now
|
|
74
99
|
if (!valA && sortBy === 'createdAt')
|
|
75
100
|
valA = a.createdAt || '';
|
|
@@ -22,14 +22,25 @@ export interface GetOrdersParams {
|
|
|
22
22
|
inCart?: boolean;
|
|
23
23
|
/** Order type label(s) set with setOrderType, e.g. 'delivery' or ['pickup', 'takeout']. Exact match; a list matches any. */
|
|
24
24
|
orderType?: string | string[];
|
|
25
|
-
/** Custom status
|
|
25
|
+
/** Custom status key(s) set with setOrderStatus, e.g. 'in-kitchen'. A list matches any of them. */
|
|
26
|
+
customStatusKey?: string | string[];
|
|
27
|
+
/**
|
|
28
|
+
* Durable custom status id(s) (getOrderStatuses `id`). Also matches a status's key, for
|
|
29
|
+
* flows written before keys — prefer `customStatusKey`. A list matches any of them.
|
|
30
|
+
*/
|
|
26
31
|
customStatusId?: string | string[];
|
|
32
|
+
/** true: only orders with a time (setScheduledFor); false: only "as soon as possible" orders (no time). */
|
|
33
|
+
scheduled?: boolean;
|
|
34
|
+
/** Only orders scheduled at or after this ISO 8601 date-time. Orders with no time never match. */
|
|
35
|
+
scheduledFrom?: string;
|
|
36
|
+
/** Only orders scheduled at or before this ISO 8601 date-time. Orders with no time never match. */
|
|
37
|
+
scheduledTo?: string;
|
|
27
38
|
/** Default: 50. */
|
|
28
39
|
limit?: number;
|
|
29
40
|
/** Default: 0. */
|
|
30
41
|
offset?: number;
|
|
31
42
|
searchValue?: string;
|
|
32
|
-
/** Default: 'createdAt'. */
|
|
43
|
+
/** Default: 'createdAt'. 'scheduledFor' sorts by the customer's requested time — orders with no time come first ascending. */
|
|
33
44
|
sortBy?: string;
|
|
34
45
|
/** Default: 'descending'. */
|
|
35
46
|
sortDirection?: 'ascending' | 'descending';
|
|
@@ -10,20 +10,25 @@ export const mockSetOrderStatus = async (params) => {
|
|
|
10
10
|
throw new Error(`Order with ID ${params.orderId} not found`);
|
|
11
11
|
}
|
|
12
12
|
const from = { payment: order.paymentState ?? 'unpaid', fulfillment: order.fulfillmentState ?? 'draft' };
|
|
13
|
-
|
|
13
|
+
const requested = params.key !== undefined ? params.key : params.statusId;
|
|
14
|
+
if (requested === undefined) {
|
|
15
|
+
throw new Error('setOrderStatus: pass a status key, or null to clear the status');
|
|
16
|
+
}
|
|
17
|
+
if (requested === null) {
|
|
14
18
|
order.customStatus = null;
|
|
15
19
|
}
|
|
16
20
|
else {
|
|
17
|
-
const def = MOCK_ORDER_STATUSES.find((s) => s.
|
|
21
|
+
const def = MOCK_ORDER_STATUSES.find((s) => s.key === requested) ??
|
|
22
|
+
(params.key === undefined ? MOCK_ORDER_STATUSES.find((s) => s.id === requested) : undefined);
|
|
18
23
|
if (!def) {
|
|
19
|
-
throw new Error(`setOrderStatus: unknown status "${
|
|
24
|
+
throw new Error(`setOrderStatus: unknown status "${requested}"`);
|
|
20
25
|
}
|
|
21
26
|
if (def.requiresPaymentState && !def.requiresPaymentState.includes(from.payment)) {
|
|
22
27
|
throw new Error(`setOrderStatus: "${def.label}" requires payment state ${def.requiresPaymentState.join(' or ')} (order is ${from.payment})`);
|
|
23
28
|
}
|
|
24
29
|
if (def.fulfillmentState)
|
|
25
30
|
order.fulfillmentState = def.fulfillmentState;
|
|
26
|
-
order.customStatus = { id: def.id, label: def.label, setAt: new Date().toISOString(), setBy: null };
|
|
31
|
+
order.customStatus = { id: def.id, key: def.key, label: def.label, setAt: new Date().toISOString(), setBy: null };
|
|
27
32
|
}
|
|
28
33
|
mockPublishEvent('orders', 'order-updated', { order });
|
|
29
34
|
const to = { payment: order.paymentState ?? 'unpaid', fulfillment: order.fulfillmentState ?? 'draft' };
|
|
@@ -3,8 +3,13 @@ import type { CFStatePair } from '../../common-types/order-state';
|
|
|
3
3
|
export interface SetOrderStatusParams {
|
|
4
4
|
/** Order to set the status on. Omit for the live cart's order. */
|
|
5
5
|
orderId?: string;
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/** Key of one of the flow's statuses (see getOrderStatuses), or null to clear the status. */
|
|
7
|
+
key?: string | null;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `key`. Kept for flows written before keys: matched against a status's
|
|
10
|
+
* key, then its id. Ignored when `key` is given.
|
|
11
|
+
*/
|
|
12
|
+
statusId?: string | null;
|
|
8
13
|
}
|
|
9
14
|
export interface SetOrderStatusResponse {
|
|
10
15
|
success: boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set scheduled-for action
|
|
3
|
+
* Calls the setScheduledFor action on the parent window
|
|
4
|
+
*/
|
|
5
|
+
import { commandFrameClient } from '../../client';
|
|
6
|
+
export const setScheduledFor = async (params) => {
|
|
7
|
+
return await commandFrameClient.call('setScheduledFor', params);
|
|
8
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { MOCK_ORDERS, MOCK_PARKED_ORDERS, mockPublishEvent } from '../../demo/database';
|
|
2
|
+
/** Time for the demo's live cart, which has no order until it is paid or parked. */
|
|
3
|
+
let mockCartScheduledFor = null;
|
|
4
|
+
/**
|
|
5
|
+
* An ISO 8601 date-time WITH a zone — 'Z' or an offset. A zoneless time ('2026-10-13T19:00') is
|
|
6
|
+
* refused: it would mean a different moment on every device. Date.parse alone is too lenient
|
|
7
|
+
* (it accepts strings like "tomorrow at 7"), so the shape is checked first.
|
|
8
|
+
*/
|
|
9
|
+
const ISO_DATE_TIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?(Z|[+-]\d{2}:?\d{2})$/;
|
|
10
|
+
/** The YYYY-MM-DD part is a real day — Date.parse quietly rolls "Feb 30" over to March 2. */
|
|
11
|
+
const isCalendarDate = (text) => {
|
|
12
|
+
const [y, m, d] = text.slice(0, 10).split('-').map(Number);
|
|
13
|
+
const day = new Date(Date.UTC(y, m - 1, d));
|
|
14
|
+
return day.getUTCFullYear() === y && day.getUTCMonth() === m - 1 && day.getUTCDate() === d;
|
|
15
|
+
};
|
|
16
|
+
/** ISO 8601 in, UTC ISO 8601 out; null stays null (as soon as possible). */
|
|
17
|
+
export const normalizeScheduledFor = (value) => {
|
|
18
|
+
if (value === null)
|
|
19
|
+
return null;
|
|
20
|
+
if (typeof value !== 'string' || !value.trim()) {
|
|
21
|
+
throw new Error('setScheduledFor: scheduledFor must be an ISO 8601 date-time or null');
|
|
22
|
+
}
|
|
23
|
+
const text = value.trim();
|
|
24
|
+
const ms = ISO_DATE_TIME.test(text) && isCalendarDate(text) ? Date.parse(text) : NaN;
|
|
25
|
+
if (Number.isNaN(ms)) {
|
|
26
|
+
throw new Error(`setScheduledFor: "${value}" is not an ISO 8601 date-time with Z or an offset`);
|
|
27
|
+
}
|
|
28
|
+
return new Date(ms).toISOString();
|
|
29
|
+
};
|
|
30
|
+
export const mockSetScheduledFor = async (params) => {
|
|
31
|
+
console.log('[Mock] setScheduledFor called', params);
|
|
32
|
+
const scheduledFor = normalizeScheduledFor(params?.scheduledFor);
|
|
33
|
+
const timestamp = new Date().toISOString();
|
|
34
|
+
if (!params.orderId) {
|
|
35
|
+
mockCartScheduledFor = scheduledFor;
|
|
36
|
+
return { success: true, orderId: null, scheduledFor: mockCartScheduledFor, timestamp };
|
|
37
|
+
}
|
|
38
|
+
const order = [...MOCK_ORDERS, ...MOCK_PARKED_ORDERS].find((o) => o._id === params.orderId);
|
|
39
|
+
if (!order) {
|
|
40
|
+
throw new Error(`Order with ID ${params.orderId} not found`);
|
|
41
|
+
}
|
|
42
|
+
order.scheduledFor = scheduledFor;
|
|
43
|
+
mockPublishEvent('orders', 'order-updated', { order });
|
|
44
|
+
return { success: true, orderId: order._id, scheduledFor, timestamp };
|
|
45
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface SetScheduledForParams {
|
|
2
|
+
/**
|
|
3
|
+
* Order to schedule. Omit to target the live cart — including a cart that isn't an
|
|
4
|
+
* order yet; the time is carried onto the order when it's created.
|
|
5
|
+
*/
|
|
6
|
+
orderId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* When the customer wants the order, as an ISO 8601 date-time with Z or an offset (e.g.
|
|
9
|
+
* '2026-10-13T23:00:00.000Z' or '2026-10-13T19:00:00-04:00'), or null for as soon as possible.
|
|
10
|
+
* Stored in UTC.
|
|
11
|
+
*/
|
|
12
|
+
scheduledFor: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface SetScheduledForResponse {
|
|
15
|
+
success: boolean;
|
|
16
|
+
/** The order that was updated, or null when the live cart has no order yet. */
|
|
17
|
+
orderId: string | null;
|
|
18
|
+
/** The time after the call, normalised to UTC ISO 8601 — or null (as soon as possible). */
|
|
19
|
+
scheduledFor: string | null;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
}
|
|
22
|
+
export type SetScheduledFor = (params: SetScheduledForParams) => Promise<SetScheduledForResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -31,13 +31,18 @@ export interface CFAvailableTransition {
|
|
|
31
31
|
conditions: CFConditionStatus[];
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* `fulfillmentState`: setting the status moves the order there
|
|
36
|
-
* rules). `requiresPaymentState`: setting it fails unless the
|
|
37
|
-
* one of these — a status never moves money. Neither set = a
|
|
34
|
+
* An order status the running flow defines (authored in the flow builder, shipped with
|
|
35
|
+
* each deployed version). `fulfillmentState`: setting the status moves the order there
|
|
36
|
+
* (normal state-machine rules). `requiresPaymentState`: setting it fails unless the
|
|
37
|
+
* order's payment state is one of these — a status never moves money. Neither set = a
|
|
38
|
+
* label-only status.
|
|
38
39
|
*/
|
|
39
40
|
export interface CFOrderStatusDefinition {
|
|
41
|
+
/** Durable id; survives a renamed key or label. */
|
|
40
42
|
id: string;
|
|
43
|
+
/** What flow code passes to setOrderStatus and getOrders({ customStatusKey }), e.g. 'in-kitchen'. */
|
|
44
|
+
key: string;
|
|
45
|
+
/** What staff see. */
|
|
41
46
|
label: string;
|
|
42
47
|
color?: string;
|
|
43
48
|
icon?: string;
|
package/dist/demo/database.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export declare let MOCK_ACTIVE_PRODUCT: CFActiveProduct;
|
|
|
77
77
|
export declare const setMockActiveProduct: (activeProduct: CFActiveProduct) => void;
|
|
78
78
|
export declare const MOCK_SMART_GRID_LAYOUTS: Record<string, CFSmartGridLayout>;
|
|
79
79
|
export declare const resetMockCart: () => void;
|
|
80
|
-
/** The demo
|
|
80
|
+
/** The demo flow's order statuses (getOrderStatuses / setOrderStatus). */
|
|
81
81
|
export declare const MOCK_ORDER_STATUSES: CFOrderStatusDefinition[];
|
|
82
82
|
/**
|
|
83
83
|
* Replace in-memory mock data used by default mock handlers. Arrays are mutated in place
|
package/dist/demo/database.js
CHANGED
|
@@ -722,13 +722,31 @@ function resolveMockOrderCurrency() {
|
|
|
722
722
|
}
|
|
723
723
|
return CurrencyCode.USD;
|
|
724
724
|
}
|
|
725
|
-
/** The demo
|
|
725
|
+
/** The demo flow's order statuses (getOrderStatuses / setOrderStatus). */
|
|
726
726
|
export const MOCK_ORDER_STATUSES = [
|
|
727
|
-
{ id: 'in-kitchen', label: 'In kitchen', color: '#f59e0b', fulfillmentState: 'pending' },
|
|
728
|
-
{
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
727
|
+
{ id: 'status_1', key: 'in-kitchen', label: 'In kitchen', color: '#f59e0b', fulfillmentState: 'pending' },
|
|
728
|
+
{
|
|
729
|
+
id: 'status_2',
|
|
730
|
+
key: 'ready-for-pickup',
|
|
731
|
+
label: 'Ready for pickup',
|
|
732
|
+
color: '#10b981',
|
|
733
|
+
fulfillmentState: 'in_progress',
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
id: 'status_3',
|
|
737
|
+
key: 'out-for-delivery',
|
|
738
|
+
label: 'Out for delivery',
|
|
739
|
+
color: '#3b82f6',
|
|
740
|
+
fulfillmentState: 'partially_fulfilled',
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
id: 'status_4',
|
|
744
|
+
key: 'delivered',
|
|
745
|
+
label: 'Delivered',
|
|
746
|
+
fulfillmentState: 'fulfilled',
|
|
747
|
+
requiresPaymentState: ['paid'],
|
|
748
|
+
},
|
|
749
|
+
{ id: 'status_5', key: 'driver-called', label: 'Driver called' },
|
|
732
750
|
];
|
|
733
751
|
/**
|
|
734
752
|
* Replace in-memory mock data used by default mock handlers. Arrays are mutated in place
|
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare const command: {
|
|
|
47
47
|
readonly assignOrderUser: import(".").AssignOrderUser;
|
|
48
48
|
readonly releaseFromCart: import(".").ReleaseFromCart;
|
|
49
49
|
readonly setOrderType: import(".").SetOrderType;
|
|
50
|
+
readonly setScheduledFor: import(".").SetScheduledFor;
|
|
50
51
|
readonly setOrderStatus: import(".").SetOrderStatus;
|
|
51
52
|
readonly getOrderStatuses: import(".").GetOrderStatuses;
|
|
52
53
|
readonly deleteParkedOrder: import(".").DeleteParkedOrder;
|
|
@@ -200,6 +201,7 @@ export type { SetOrderMetadata, SetOrderMetadataParams, SetOrderMetadataResponse
|
|
|
200
201
|
export type { AssignOrderUser, AssignOrderUserParams, AssignOrderUserResponse, } from './actions/assign-order-user/types';
|
|
201
202
|
export type { ReleaseFromCart, ReleaseFromCartResponse } from './actions/release-from-cart/types';
|
|
202
203
|
export type { SetOrderType, SetOrderTypeParams, SetOrderTypeResponse } from './actions/set-order-type/types';
|
|
204
|
+
export type { SetScheduledFor, SetScheduledForParams, SetScheduledForResponse, } from './actions/set-scheduled-for/types';
|
|
203
205
|
export type { SetOrderStatus, SetOrderStatusParams, SetOrderStatusResponse } from './actions/set-order-status/types';
|
|
204
206
|
export type { GetOrderStatuses, GetOrderStatusesResponse } from './actions/get-order-statuses/types';
|
|
205
207
|
export type { DeleteParkedOrder, DeleteParkedOrderParams, DeleteParkedOrderResponse, } from './actions/delete-parked-order/types';
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ import { setOrderMetadata } from './actions/set-order-metadata/action';
|
|
|
47
47
|
import { assignOrderUser } from './actions/assign-order-user/action';
|
|
48
48
|
import { releaseFromCart } from './actions/release-from-cart/action';
|
|
49
49
|
import { setOrderType } from './actions/set-order-type/action';
|
|
50
|
+
import { setScheduledFor } from './actions/set-scheduled-for/action';
|
|
50
51
|
import { setOrderStatus } from './actions/set-order-status/action';
|
|
51
52
|
import { getOrderStatuses } from './actions/get-order-statuses/action';
|
|
52
53
|
import { deleteParkedOrder } from './actions/delete-parked-order/action';
|
|
@@ -202,6 +203,7 @@ export const command = {
|
|
|
202
203
|
assignOrderUser,
|
|
203
204
|
releaseFromCart,
|
|
204
205
|
setOrderType,
|
|
206
|
+
setScheduledFor,
|
|
205
207
|
setOrderStatus,
|
|
206
208
|
getOrderStatuses,
|
|
207
209
|
deleteParkedOrder,
|
|
@@ -73,6 +73,7 @@ import { mockSetOrderMetadata } from '../../actions/set-order-metadata/mock';
|
|
|
73
73
|
import { mockAssignOrderUser } from '../../actions/assign-order-user/mock';
|
|
74
74
|
import { mockReleaseFromCart } from '../../actions/release-from-cart/mock';
|
|
75
75
|
import { mockSetOrderType } from '../../actions/set-order-type/mock';
|
|
76
|
+
import { mockSetScheduledFor } from '../../actions/set-scheduled-for/mock';
|
|
76
77
|
import { mockSetOrderStatus } from '../../actions/set-order-status/mock';
|
|
77
78
|
import { mockGetOrderStatuses } from '../../actions/get-order-statuses/mock';
|
|
78
79
|
import { mockSelectAllRefundItems } from '../../actions/select-all-refund-items/mock';
|
|
@@ -188,6 +189,7 @@ export const RENDER_MOCKS = {
|
|
|
188
189
|
assignOrderUser: mockAssignOrderUser,
|
|
189
190
|
releaseFromCart: mockReleaseFromCart,
|
|
190
191
|
setOrderType: mockSetOrderType,
|
|
192
|
+
setScheduledFor: mockSetScheduledFor,
|
|
191
193
|
setOrderStatus: mockSetOrderStatus,
|
|
192
194
|
getOrderStatuses: mockGetOrderStatuses,
|
|
193
195
|
selectAllRefundItems: mockSelectAllRefundItems,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExampleFunction, GetProducts, AddCustomSale, EditCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, GetTaxTables, GetCustomStockActions, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, GetProductModifierSelections, SetProductModifierSelections, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, ResumeOrder, SetOrderMetadata, AssignOrderUser, ReleaseFromCart, SetOrderType, SetOrderStatus, GetOrderStatuses, DeleteParkedOrder, VoidOrder, InitiateRefund, CashPayment, RecordExternalPayment, GetCashRoundingAmount, TapToPayPayment, TerminalPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, RedeemRefund, GetRefundPlan, CheckPermission, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal, GetUsers, GetRoles, RemoveCartDiscount, GetActiveOrder, GetActiveCustomer, SetActiveCustomer, GetActiveOutlet, GetActiveStation, GetActiveSession, GetActiveUser, SetActiveUser, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem, CanTransition, GetAvailableTransitions, ApplyTransition, IntegrationPayment, GetSmartGridLayout, SaveSmartGridLayout, SendEmail, SendSms, GetBookingResources, GetBookingAvailability, GetBookings, HoldBooking, AddBookingToCart, RemoveBookingFromCart, CancelBooking, CreatePaymentLink, ChargeMoto, GetTimeClockStatus } from '../../index';
|
|
1
|
+
import type { ExampleFunction, GetProducts, AddCustomSale, EditCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, GetTaxTables, GetCustomStockActions, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, GetProductModifierSelections, SetProductModifierSelections, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, ResumeOrder, SetOrderMetadata, AssignOrderUser, ReleaseFromCart, SetOrderType, SetScheduledFor, SetOrderStatus, GetOrderStatuses, DeleteParkedOrder, VoidOrder, InitiateRefund, CashPayment, RecordExternalPayment, GetCashRoundingAmount, TapToPayPayment, TerminalPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, RedeemRefund, GetRefundPlan, CheckPermission, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal, GetUsers, GetRoles, RemoveCartDiscount, GetActiveOrder, GetActiveCustomer, SetActiveCustomer, GetActiveOutlet, GetActiveStation, GetActiveSession, GetActiveUser, SetActiveUser, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem, CanTransition, GetAvailableTransitions, ApplyTransition, IntegrationPayment, GetSmartGridLayout, SaveSmartGridLayout, SendEmail, SendSms, GetBookingResources, GetBookingAvailability, GetBookings, HoldBooking, AddBookingToCart, RemoveBookingFromCart, CancelBooking, CreatePaymentLink, ChargeMoto, GetTimeClockStatus } from '../../index';
|
|
2
2
|
export interface RenderProviderActions {
|
|
3
3
|
exampleFunction: ExampleFunction;
|
|
4
4
|
getProducts: GetProducts;
|
|
@@ -46,6 +46,7 @@ export interface RenderProviderActions {
|
|
|
46
46
|
assignOrderUser: AssignOrderUser;
|
|
47
47
|
releaseFromCart: ReleaseFromCart;
|
|
48
48
|
setOrderType: SetOrderType;
|
|
49
|
+
setScheduledFor: SetScheduledFor;
|
|
49
50
|
setOrderStatus: SetOrderStatus;
|
|
50
51
|
getOrderStatuses: GetOrderStatuses;
|
|
51
52
|
deleteParkedOrder: DeleteParkedOrder;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@final-commerce/command-frame",
|
|
3
|
-
"version": "0.9.0-preprod.
|
|
3
|
+
"version": "0.9.0-preprod.4",
|
|
4
4
|
"description": "Commands Frame library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"ignoreBranchesMissingTickets": true
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@final-commerce/common": "2.5.1-preprod.
|
|
60
|
+
"@final-commerce/common": "2.5.1-preprod.8"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@commitlint/cli": "^19.0.0",
|