@final-commerce/command-frame 0.8.1-online.1 → 0.9.0-online.1
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/add-booking-to-cart/mock.js +12 -8
- package/dist/actions/add-product-to-cart/mock.js +4 -0
- package/dist/actions/adjust-inventory/mock.js +20 -0
- package/dist/actions/adjust-inventory/types.d.ts +13 -0
- package/dist/actions/adjust-inventory/types.js +1 -0
- package/dist/actions/get-custom-stock-actions/action.d.ts +5 -0
- package/dist/actions/get-custom-stock-actions/action.js +7 -0
- package/dist/actions/get-custom-stock-actions/mock.d.ts +2 -0
- package/dist/actions/get-custom-stock-actions/mock.js +11 -0
- package/dist/actions/get-custom-stock-actions/types.d.ts +12 -0
- package/dist/actions/get-custom-stock-actions/types.js +2 -0
- package/dist/actions/get-products/mock.js +13 -0
- package/dist/actions/get-products/types.d.ts +16 -0
- package/dist/actions/resume-parked-order/mock.d.ts +1 -1
- package/dist/actions/resume-parked-order/mock.js +16 -10
- package/dist/actions/update-cart-item-quantity/mock.js +7 -1
- package/dist/index.d.ts +3 -1
- 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
|
@@ -2,14 +2,6 @@ import { MOCK_CART, MOCK_PRODUCTS, mockPublishEvent } from '../../demo/database'
|
|
|
2
2
|
import { mockHoldBooking } from '../hold-booking/mock';
|
|
3
3
|
export const mockAddBookingToCart = async (params) => {
|
|
4
4
|
console.log('[Mock] addBookingToCart called', params);
|
|
5
|
-
// One call, two effects — the window is claimed AND the service is in the cart. The claim goes
|
|
6
|
-
// first and its refusal propagates: a cart line for a window somebody else took is worse than
|
|
7
|
-
// no line at all.
|
|
8
|
-
const held = await mockHoldBooking(params);
|
|
9
|
-
if (!held.success || !held.booking) {
|
|
10
|
-
return { success: false, reason: held.reason, timestamp: new Date().toISOString() };
|
|
11
|
-
}
|
|
12
|
-
const booking = held.booking;
|
|
13
5
|
// An unknown product used to be sold as "Booking" at zero. The host refuses it, and a mock that
|
|
14
6
|
// quietly sells something no catalogue contains teaches a screen a case that cannot happen.
|
|
15
7
|
const product = MOCK_PRODUCTS.find(({ _id }) => _id === params.productId);
|
|
@@ -27,6 +19,18 @@ export const mockAddBookingToCart = async (params) => {
|
|
|
27
19
|
timestamp: new Date().toISOString(),
|
|
28
20
|
};
|
|
29
21
|
}
|
|
22
|
+
// Same refusal and text as the host (kaching add-booking-to-cart).
|
|
23
|
+
if (product.notSoldInPos || variant?.notSoldInPos) {
|
|
24
|
+
return { success: false, reason: `${product.name} is not sold in POS`, timestamp: new Date().toISOString() };
|
|
25
|
+
}
|
|
26
|
+
// One call, two effects — the window is claimed AND the service is in the cart. Like the host, the
|
|
27
|
+
// claim comes after the product checks and before the line; its refusal propagates: a cart line for
|
|
28
|
+
// a window somebody else took is worse than no line at all.
|
|
29
|
+
const held = await mockHoldBooking(params);
|
|
30
|
+
if (!held.success || !held.booking) {
|
|
31
|
+
return { success: false, reason: held.reason, timestamp: new Date().toISOString() };
|
|
32
|
+
}
|
|
33
|
+
const booking = held.booking;
|
|
30
34
|
const price = variant?.price ?? product.minPrice ?? 0;
|
|
31
35
|
const reservation = {
|
|
32
36
|
internalId: `res_${booking.id}`,
|
|
@@ -21,6 +21,10 @@ export const mockAddProductToCart = async (params) => {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
// Same refusal and text as the host (kaching add-product-to-cart).
|
|
25
|
+
if (product.notSoldInPos || variant.notSoldInPos) {
|
|
26
|
+
throw new Error(`${product.name} is not sold in POS`);
|
|
27
|
+
}
|
|
24
28
|
// A measured variant carries a resolved unit; the host does the same. What the unit can
|
|
25
29
|
// express is its precision — 1.5 of a kilogram is a sale, 1.5 of a piece is a typo.
|
|
26
30
|
const unit = variant.unitId ? resolveUnit(variant.unitId) : undefined;
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { MOCK_PRODUCTS } from '../../demo/database';
|
|
2
|
+
// Same rules and messages as the kaching handler.
|
|
3
|
+
const STOCK_TYPE_BY_REASON = {
|
|
4
|
+
STOCK_RECEIVED: 'add',
|
|
5
|
+
RESTOCK_RETURN: 'add',
|
|
6
|
+
DAMAGE: 'subtract',
|
|
7
|
+
THEFT: 'subtract',
|
|
8
|
+
LOSS: 'subtract',
|
|
9
|
+
INVENTORY_RECOUNT: 'set',
|
|
10
|
+
};
|
|
2
11
|
export const mockAdjustInventory = async (params) => {
|
|
3
12
|
console.log('[Mock] adjustInventory called', params);
|
|
13
|
+
if (params?.specificAction != null) {
|
|
14
|
+
const { specificAction, stockType, customActionId } = params;
|
|
15
|
+
if (customActionId)
|
|
16
|
+
throw new Error('Pass either customActionId or specificAction, not both');
|
|
17
|
+
const reasonStockType = STOCK_TYPE_BY_REASON[specificAction];
|
|
18
|
+
if (!reasonStockType)
|
|
19
|
+
throw new Error(`Unknown specificAction: ${specificAction}`);
|
|
20
|
+
if (reasonStockType !== stockType) {
|
|
21
|
+
throw new Error(`specificAction ${specificAction} requires stockType '${reasonStockType}', got '${stockType}'`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
4
24
|
let newStock = 0;
|
|
5
25
|
// Real handler keys off variantId (falling back to the active product's
|
|
6
26
|
// variant); mirror that here by finding the owning product for the variant.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** The manual reasons a person can pick, as hub-api's InventorySpecificActionType names them. */
|
|
2
|
+
export type ManualStockReason = 'STOCK_RECEIVED' | 'RESTOCK_RETURN' | 'DAMAGE' | 'THEFT' | 'LOSS' | 'INVENTORY_RECOUNT';
|
|
1
3
|
export interface AdjustInventoryParams {
|
|
2
4
|
/** String to preserve precision. */
|
|
3
5
|
amount: string;
|
|
@@ -5,6 +7,17 @@ export interface AdjustInventoryParams {
|
|
|
5
7
|
stockType: 'add' | 'subtract' | 'set';
|
|
6
8
|
/** Variant to adjust. Omit to use the active product's selected variant. */
|
|
7
9
|
variantId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* A company action from getCustomStockActions. The movement is recorded under its name;
|
|
12
|
+
* `stockType` must match its baseAction (ADD → 'add', REMOVE → 'subtract', RECOUNT → 'set').
|
|
13
|
+
*/
|
|
14
|
+
customActionId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* A built-in reason to record instead of the host's default for `stockType`. Must match it:
|
|
17
|
+
* STOCK_RECEIVED / RESTOCK_RETURN → 'add', DAMAGE / THEFT / LOSS → 'subtract', INVENTORY_RECOUNT → 'set'.
|
|
18
|
+
* Rejected together with `customActionId`.
|
|
19
|
+
*/
|
|
20
|
+
specificAction?: ManualStockReason;
|
|
8
21
|
}
|
|
9
22
|
export interface AdjustInventoryResponse {
|
|
10
23
|
success: boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const mockGetCustomStockActions = async () => {
|
|
2
|
+
console.log('[Mock] getCustomStockActions called');
|
|
3
|
+
return {
|
|
4
|
+
customStockActions: [
|
|
5
|
+
{ _id: 'mock_custom_action_1', name: 'Opening stock', baseAction: 'ADD' },
|
|
6
|
+
{ _id: 'mock_custom_action_2', name: 'Exhibition loan', baseAction: 'REMOVE' },
|
|
7
|
+
{ _id: 'mock_custom_action_3', name: 'Year-end count', baseAction: 'RECOUNT' },
|
|
8
|
+
],
|
|
9
|
+
timestamp: new Date().toISOString(),
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface CustomStockActionPayload {
|
|
2
|
+
_id: string;
|
|
3
|
+
/** Name the company gave the action, shown in pickers and stock history. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** What the action does to stock — pass the matching `stockType` to adjustInventory. */
|
|
6
|
+
baseAction: 'ADD' | 'REMOVE' | 'RECOUNT';
|
|
7
|
+
}
|
|
8
|
+
export interface GetCustomStockActionsResponse {
|
|
9
|
+
customStockActions: CustomStockActionPayload[];
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}
|
|
12
|
+
export type GetCustomStockActions = () => Promise<GetCustomStockActionsResponse>;
|
|
@@ -11,6 +11,19 @@ export const mockGetProducts = async (params) => {
|
|
|
11
11
|
if (!JSON.stringify(query).includes('productType')) {
|
|
12
12
|
products = products.filter((p) => p.productType !== 'booking');
|
|
13
13
|
}
|
|
14
|
+
// Same as the host: `true` = flagged, `false` = not flagged (missing counts).
|
|
15
|
+
for (const flag of ['notSoldInPos', 'notSoldOnline']) {
|
|
16
|
+
if (typeof query[flag] === 'boolean')
|
|
17
|
+
products = products.filter((p) => !!p[flag] === query[flag]);
|
|
18
|
+
}
|
|
19
|
+
if (!params?.includeUnlisted) {
|
|
20
|
+
// Same as the host: flagged variants are stripped, a product left with none is dropped.
|
|
21
|
+
if (query.notSoldInPos === undefined)
|
|
22
|
+
products = products.filter((p) => !p.notSoldInPos);
|
|
23
|
+
products = products
|
|
24
|
+
.filter((p) => !p.variants.length || p.variants.some((v) => !v.notSoldInPos))
|
|
25
|
+
.map((p) => ({ ...p, variants: p.variants.filter((v) => !v.notSoldInPos) }));
|
|
26
|
+
}
|
|
14
27
|
if (query.searchValue) {
|
|
15
28
|
const search = String(query.searchValue).toLowerCase();
|
|
16
29
|
products = products.filter((p) => p.name.toLowerCase().includes(search) || p.sku?.toLowerCase().includes(search));
|
|
@@ -42,8 +42,24 @@ export interface GetProductsParams {
|
|
|
42
42
|
};
|
|
43
43
|
supplier?: string;
|
|
44
44
|
externalId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Product-level flag filter. `true` = only products flagged `notSoldInPos`; `false` = only
|
|
47
|
+
* products NOT flagged (a missing field counts as not flagged). On a till, naming it switches off
|
|
48
|
+
* the default exclusion, so `true` works without `includeUnlisted`.
|
|
49
|
+
*/
|
|
50
|
+
notSoldInPos?: boolean;
|
|
51
|
+
/** Product-level flag filter: `true` = flagged `notSoldOnline`; `false` = sold online (missing counts). On a storefront, naming it switches off the default exclusion. */
|
|
52
|
+
notSoldOnline?: boolean;
|
|
45
53
|
[key: string]: any;
|
|
46
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* The sales-channel flag follows the host channel: `notSoldInPos` on a till, `notSoldOnline` on a
|
|
57
|
+
* storefront. Products with that flag are left out unless this is `true` (default `false`) or the
|
|
58
|
+
* query names that flag. They still cannot be sold: `addProductToCart` / `addBookingToCart` refuse a
|
|
59
|
+
* product or a variant with it. Without it, flagged variants are also stripped from `variants[]`
|
|
60
|
+
* and a product whose every variant is flagged is left out — whatever the query says.
|
|
61
|
+
*/
|
|
62
|
+
includeUnlisted?: boolean;
|
|
47
63
|
/** Defaults to 0. */
|
|
48
64
|
offset?: number;
|
|
49
65
|
/** Defaults to 100. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ResumeParkedOrder } from
|
|
1
|
+
import { ResumeParkedOrder } from './types';
|
|
2
2
|
export declare const mockResumeParkedOrder: ResumeParkedOrder;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { MOCK_PARKED_ORDERS, MOCK_CART, resetMockCart, mockPublishEvent } from
|
|
1
|
+
import { MOCK_PARKED_ORDERS, MOCK_CART, MOCK_PRODUCTS, resetMockCart, mockPublishEvent } from '../../demo/database';
|
|
2
2
|
export const mockResumeParkedOrder = async (params) => {
|
|
3
|
-
console.log(
|
|
3
|
+
console.log('[Mock] resumeParkedOrder called', params);
|
|
4
4
|
const orderId = params?.orderId;
|
|
5
5
|
let orderToResume = null;
|
|
6
6
|
let index = -1;
|
|
7
7
|
if (orderId) {
|
|
8
|
-
index = MOCK_PARKED_ORDERS.findIndex(o => o._id === orderId);
|
|
8
|
+
index = MOCK_PARKED_ORDERS.findIndex((o) => o._id === orderId);
|
|
9
9
|
if (index !== -1)
|
|
10
10
|
orderToResume = MOCK_PARKED_ORDERS[index];
|
|
11
11
|
}
|
|
@@ -17,8 +17,14 @@ export const mockResumeParkedOrder = async (params) => {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
if (!orderToResume) {
|
|
20
|
-
throw new Error(
|
|
20
|
+
throw new Error('Parked order not found');
|
|
21
21
|
}
|
|
22
|
+
// Same refusal and text as the host, before anything is restored: the parked order stays.
|
|
23
|
+
const notSoldNames = orderToResume.lineItems
|
|
24
|
+
.filter((li) => MOCK_PRODUCTS.some((p) => p.variants.some((v) => v._id === li.variantId && (p.notSoldInPos || v.notSoldInPos))))
|
|
25
|
+
.map((li) => li.name);
|
|
26
|
+
if (notSoldNames.length)
|
|
27
|
+
throw new Error(`${notSoldNames.join(', ')} is not sold in POS`);
|
|
22
28
|
// Restore to MOCK_CART
|
|
23
29
|
// Logic to convert Order back to Cart (simplified)
|
|
24
30
|
resetMockCart();
|
|
@@ -26,7 +32,7 @@ export const mockResumeParkedOrder = async (params) => {
|
|
|
26
32
|
MOCK_CART.customer = orderToResume.customer; // Cast if needed
|
|
27
33
|
// MOCK_CART.products = orderToResume.lineItems... (Mapping needed)
|
|
28
34
|
// For Mock demo, we'll do a best effort mapping
|
|
29
|
-
MOCK_CART.products = orderToResume.lineItems.map(li => ({
|
|
35
|
+
MOCK_CART.products = orderToResume.lineItems.map((li) => ({
|
|
30
36
|
id: li.productId,
|
|
31
37
|
name: li.name,
|
|
32
38
|
quantity: li.quantity,
|
|
@@ -36,8 +42,8 @@ export const mockResumeParkedOrder = async (params) => {
|
|
|
36
42
|
sku: li.sku,
|
|
37
43
|
images: [li.image],
|
|
38
44
|
stock: 100,
|
|
39
|
-
taxTableId:
|
|
40
|
-
attributes: li.attributes
|
|
45
|
+
taxTableId: '',
|
|
46
|
+
attributes: li.attributes,
|
|
41
47
|
}));
|
|
42
48
|
MOCK_CART.subtotal = orderToResume.summary.subtotalAfterFees;
|
|
43
49
|
MOCK_CART.total = orderToResume.summary.total;
|
|
@@ -46,11 +52,11 @@ export const mockResumeParkedOrder = async (params) => {
|
|
|
46
52
|
// Remove from parked
|
|
47
53
|
MOCK_PARKED_ORDERS.splice(index, 1);
|
|
48
54
|
// Refresh the restored cart and the order lists.
|
|
49
|
-
mockPublishEvent(
|
|
50
|
-
mockPublishEvent(
|
|
55
|
+
mockPublishEvent('cart', 'parked-order-resumed', { orderId });
|
|
56
|
+
mockPublishEvent('orders', 'parked-order-resumed', { orderId });
|
|
51
57
|
return {
|
|
52
58
|
success: true,
|
|
53
59
|
order: orderToResume,
|
|
54
|
-
timestamp: new Date().toISOString()
|
|
60
|
+
timestamp: new Date().toISOString(),
|
|
55
61
|
};
|
|
56
62
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MOCK_CART, mockPublishEvent } from '../../demo/database';
|
|
1
|
+
import { MOCK_CART, MOCK_PRODUCTS, mockPublishEvent } from '../../demo/database';
|
|
2
2
|
import { extendPrice, isValidQuantity } from '@final-commerce/common';
|
|
3
3
|
export const mockUpdateCartItemQuantity = (params) => {
|
|
4
4
|
console.log('[Mock] updateCartItemQuantity called', params);
|
|
@@ -44,6 +44,12 @@ export const mockUpdateCartItemQuantity = (params) => {
|
|
|
44
44
|
timestamp: new Date().toISOString(),
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
+
// Same refusal and text as the host: raising a line not sold in POS (lowering always works).
|
|
48
|
+
const source = MOCK_PRODUCTS.find((p) => p.variants.some((v) => v._id === product.variantId));
|
|
49
|
+
const variant = source?.variants.find((v) => v._id === product.variantId);
|
|
50
|
+
if (quantity > previousQuantity && (source?.notSoldInPos || variant?.notSoldInPos)) {
|
|
51
|
+
throw new Error(`${source?.name} is not sold in POS`);
|
|
52
|
+
}
|
|
47
53
|
// Update quantity
|
|
48
54
|
product.quantity = quantity;
|
|
49
55
|
// Difference of the two ROUNDED extensions — rounding the delta itself would let the
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare const command: {
|
|
|
35
35
|
readonly getActiveProduct: import(".").GetActiveProduct;
|
|
36
36
|
readonly setActiveProduct: import(".").SetActiveProduct;
|
|
37
37
|
readonly adjustInventory: import(".").AdjustInventory;
|
|
38
|
+
readonly getCustomStockActions: import(".").GetCustomStockActions;
|
|
38
39
|
readonly addOrderNote: import(".").AddOrderNote;
|
|
39
40
|
readonly addCartFee: import(".").AddCartFee;
|
|
40
41
|
readonly getCurrentCart: import(".").GetCurrentCart;
|
|
@@ -183,7 +184,8 @@ export type { SetActiveProductFee, SetActiveProductFeeParams, SetActiveProductFe
|
|
|
183
184
|
export type { SetActiveProductDiscount, SetActiveProductDiscountParams, SetActiveProductDiscountResponse, } from './actions/set-active-product-discount/types';
|
|
184
185
|
export type { GetActiveProduct, GetActiveProductResponse } from './actions/get-active-product/types';
|
|
185
186
|
export type { SetActiveProduct, SetActiveProductParams, SetActiveProductResponse, } from './actions/set-active-product/types';
|
|
186
|
-
export type { AdjustInventory, AdjustInventoryParams, AdjustInventoryResponse } from './actions/adjust-inventory/types';
|
|
187
|
+
export type { AdjustInventory, AdjustInventoryParams, AdjustInventoryResponse, ManualStockReason, } from './actions/adjust-inventory/types';
|
|
188
|
+
export type { CustomStockActionPayload, GetCustomStockActions, GetCustomStockActionsResponse, } from './actions/get-custom-stock-actions/types';
|
|
187
189
|
export type { AddOrderNote, AddOrderNoteParams, AddOrderNoteResponse } from './actions/add-order-note/types';
|
|
188
190
|
export type { AddCartFee, AddCartFeeParams, AddCartFeeResponse } from './actions/add-cart-fee/types';
|
|
189
191
|
export type { ClearCart, ClearCartResponse } from './actions/clear-cart/types';
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ import { setActiveProductDiscount } from './actions/set-active-product-discount/
|
|
|
34
34
|
import { getActiveProduct } from './actions/get-active-product/action';
|
|
35
35
|
import { setActiveProduct } from './actions/set-active-product/action';
|
|
36
36
|
import { adjustInventory } from './actions/adjust-inventory/action';
|
|
37
|
+
import { getCustomStockActions } from './actions/get-custom-stock-actions/action';
|
|
37
38
|
// Order Actions
|
|
38
39
|
import { addOrderNote } from './actions/add-order-note/action';
|
|
39
40
|
import { addCartFee } from './actions/add-cart-fee/action';
|
|
@@ -184,6 +185,7 @@ export const command = {
|
|
|
184
185
|
getActiveProduct,
|
|
185
186
|
setActiveProduct,
|
|
186
187
|
adjustInventory,
|
|
188
|
+
getCustomStockActions,
|
|
187
189
|
// Order Actions
|
|
188
190
|
addOrderNote,
|
|
189
191
|
addCartFee,
|
|
@@ -26,6 +26,7 @@ import { mockRemoveProductFromCart } from '../../actions/remove-product-from-car
|
|
|
26
26
|
import { mockRemoveCartDiscount } from '../../actions/remove-cart-discount/mock';
|
|
27
27
|
import { mockUpdateCartItemQuantity } from '../../actions/update-cart-item-quantity/mock';
|
|
28
28
|
import { mockAdjustInventory } from '../../actions/adjust-inventory/mock';
|
|
29
|
+
import { mockGetCustomStockActions } from '../../actions/get-custom-stock-actions/mock';
|
|
29
30
|
import { mockAssignCustomer } from '../../actions/assign-customer/mock';
|
|
30
31
|
import { mockAuthenticateUser } from '../../actions/authenticate-user/mock';
|
|
31
32
|
import { mockCalculateRefundTotal } from '../../actions/calculate-refund-total/mock';
|
|
@@ -137,6 +138,7 @@ export const RENDER_MOCKS = {
|
|
|
137
138
|
removeProductFromCart: mockRemoveProductFromCart,
|
|
138
139
|
updateCartItemQuantity: mockUpdateCartItemQuantity,
|
|
139
140
|
adjustInventory: mockAdjustInventory,
|
|
141
|
+
getCustomStockActions: mockGetCustomStockActions,
|
|
140
142
|
assignCustomer: mockAssignCustomer,
|
|
141
143
|
authenticateUser: mockAuthenticateUser,
|
|
142
144
|
calculateRefundTotal: mockCalculateRefundTotal,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExampleFunction, GetProducts, AddCustomSale, EditCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, GetTaxTables, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, GetProductModifierSelections, SetProductModifierSelections, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, VoidOrder, InitiateRefund, CashPayment, 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, StartCheckout, AttachCheckoutContact, GetOutlets, SetOutlet, ResumeCheckout, 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, DeleteParkedOrder, VoidOrder, InitiateRefund, CashPayment, 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, StartCheckout, AttachCheckoutContact, GetOutlets, SetOutlet, ResumeCheckout, GetTimeClockStatus } from '../../index';
|
|
2
2
|
export interface RenderProviderActions {
|
|
3
3
|
exampleFunction: ExampleFunction;
|
|
4
4
|
getProducts: GetProducts;
|
|
@@ -35,6 +35,7 @@ export interface RenderProviderActions {
|
|
|
35
35
|
getActiveProduct: GetActiveProduct;
|
|
36
36
|
setActiveProduct: SetActiveProduct;
|
|
37
37
|
adjustInventory: AdjustInventory;
|
|
38
|
+
getCustomStockActions: GetCustomStockActions;
|
|
38
39
|
addOrderNote: AddOrderNote;
|
|
39
40
|
addCartFee: AddCartFee;
|
|
40
41
|
clearCart: ClearCart;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@final-commerce/command-frame",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-online.1",
|
|
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.
|
|
60
|
+
"@final-commerce/common": "2.5.1-online.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@commitlint/cli": "^19.0.0",
|