@final-commerce/command-frame 0.2.0-beta.6 → 0.3.0-beta.3
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/README.md +28 -26
- package/dist/CommonTypes.d.ts +72 -622
- package/dist/CommonTypes.js +5 -65
- package/dist/actions/add-product/mock.js +1 -1
- package/dist/actions/add-product-discount/mock.js +5 -5
- package/dist/actions/add-product-fee/mock.js +6 -6
- package/dist/actions/cash-payment/types.d.ts +0 -5
- package/dist/actions/delete-parked-order/types.d.ts +0 -3
- package/dist/actions/edit-product/mock.js +1 -1
- package/dist/actions/extension-payment/types.d.ts +4 -5
- package/dist/actions/get-products/mock.js +3 -3
- package/dist/actions/get-roles/mock.js +35 -41
- package/dist/actions/get-smart-grid-layout/action.d.ts +2 -0
- package/dist/actions/get-smart-grid-layout/action.js +4 -0
- package/dist/actions/get-smart-grid-layout/mock.d.ts +2 -0
- package/dist/actions/get-smart-grid-layout/mock.js +7 -0
- package/dist/actions/get-smart-grid-layout/types.d.ts +12 -0
- package/dist/actions/get-users/mock.js +16 -25
- package/dist/actions/initiate-refund/types.d.ts +0 -3
- package/dist/actions/integration-payment/action.d.ts +5 -0
- package/dist/actions/integration-payment/action.js +7 -0
- package/dist/actions/integration-payment/mock.d.ts +2 -0
- package/dist/actions/integration-payment/mock.js +4 -0
- package/dist/actions/integration-payment/types.d.ts +16 -0
- package/dist/actions/open-extension-overlay/action.d.ts +2 -0
- package/dist/actions/open-extension-overlay/action.js +4 -0
- package/dist/actions/open-extension-overlay/mock.d.ts +2 -0
- package/dist/actions/open-extension-overlay/mock.js +1 -0
- package/dist/actions/open-extension-overlay/types.d.ts +9 -0
- package/dist/actions/park-order/types.d.ts +0 -3
- package/dist/actions/partial-payment/types.d.ts +0 -5
- package/dist/actions/process-partial-refund/types.d.ts +0 -3
- package/dist/actions/resolve-extension-overlay/action.d.ts +2 -0
- package/dist/actions/resolve-extension-overlay/action.js +4 -0
- package/dist/actions/resolve-extension-overlay/mock.d.ts +2 -0
- package/dist/actions/resolve-extension-overlay/mock.js +1 -0
- package/dist/actions/resolve-extension-overlay/types.d.ts +9 -0
- package/dist/actions/resume-parked-order/mock.js +1 -1
- package/dist/actions/resume-parked-order/types.d.ts +0 -3
- package/dist/actions/save-smart-grid-layout/action.d.ts +2 -0
- package/dist/actions/save-smart-grid-layout/action.js +4 -0
- package/dist/actions/save-smart-grid-layout/mock.d.ts +2 -0
- package/dist/actions/save-smart-grid-layout/mock.js +7 -0
- package/dist/actions/save-smart-grid-layout/types.d.ts +12 -0
- package/dist/actions/set-active-product-discount/mock.js +1 -1
- package/dist/actions/set-active-product-fee/mock.js +1 -1
- package/dist/actions/tap-to-pay-payment/types.d.ts +0 -5
- package/dist/actions/terminal-payment/types.d.ts +0 -5
- package/dist/actions/vendara-payment/types.d.ts +0 -5
- package/dist/common-types/index.d.ts +0 -1
- package/dist/common-types/index.js +0 -1
- package/dist/demo/database.d.ts +21 -21
- package/dist/demo/database.js +27 -27
- package/dist/index.d.ts +115 -115
- package/dist/index.js +15 -15
- package/dist/interceptors/types.d.ts +34 -0
- package/dist/interceptors/types.js +1 -0
- package/dist/projects/render/mocks.js +10 -8
- package/dist/projects/render/types.d.ts +6 -5
- package/dist/pubsub/topics/orders/index.js +0 -10
- package/dist/pubsub/topics/orders/types.d.ts +2 -6
- package/dist/pubsub/topics/orders/types.js +0 -2
- package/dist/pubsub/topics/products/product-get-active/types.d.ts +6 -2
- package/package.json +15 -12
- package/dist/actions/can-transition/action.d.ts +0 -2
- package/dist/actions/can-transition/action.js +0 -4
- package/dist/actions/can-transition/mock.d.ts +0 -6
- package/dist/actions/can-transition/mock.js +0 -28
- package/dist/actions/can-transition/types.d.ts +0 -11
- package/dist/actions/get-available-transitions/action.d.ts +0 -2
- package/dist/actions/get-available-transitions/action.js +0 -4
- package/dist/actions/get-available-transitions/mock.d.ts +0 -6
- package/dist/actions/get-available-transitions/mock.js +0 -26
- package/dist/actions/get-available-transitions/types.d.ts +0 -9
- package/dist/actions/trigger-webhook/action.d.ts +0 -6
- package/dist/actions/trigger-webhook/action.js +0 -8
- package/dist/actions/trigger-webhook/mock.d.ts +0 -2
- package/dist/actions/trigger-webhook/mock.js +0 -8
- package/dist/actions/trigger-webhook/types.d.ts +0 -21
- package/dist/actions/trigger-webhook/types.js +0 -2
- package/dist/actions/trigger-zapier-webhook/action.d.ts +0 -6
- package/dist/actions/trigger-zapier-webhook/action.js +0 -8
- package/dist/actions/trigger-zapier-webhook/mock.d.ts +0 -2
- package/dist/actions/trigger-zapier-webhook/mock.js +0 -8
- package/dist/actions/trigger-zapier-webhook/types.d.ts +0 -9
- package/dist/common-types/order-state.d.ts +0 -32
- package/dist/common-types/order-state.js +0 -6
- package/dist/common-types/state-fragment.d.ts +0 -77
- package/dist/common-types/state-fragment.js +0 -10
- package/dist/fragments/index.d.ts +0 -1
- package/dist/fragments/index.js +0 -1
- package/dist/fragments/preorder-no-deposit.d.ts +0 -26
- package/dist/fragments/preorder-no-deposit.js +0 -166
- package/dist/pubsub/topics/orders/state-transition-blocked/types.d.ts +0 -16
- package/dist/pubsub/topics/orders/state-transition-completed/types.d.ts +0 -15
- /package/dist/actions/{can-transition → get-smart-grid-layout}/types.js +0 -0
- /package/dist/actions/{get-available-transitions → integration-payment}/types.js +0 -0
- /package/dist/actions/{trigger-zapier-webhook → open-extension-overlay}/types.js +0 -0
- /package/dist/{pubsub/topics/orders/state-transition-blocked → actions/resolve-extension-overlay}/types.js +0 -0
- /package/dist/{pubsub/topics/orders/state-transition-completed → actions/save-smart-grid-layout}/types.js +0 -0
|
@@ -39,7 +39,7 @@ export const mockResumeParkedOrder = async (params) => {
|
|
|
39
39
|
taxTableId: "",
|
|
40
40
|
attributes: li.attributes
|
|
41
41
|
}));
|
|
42
|
-
MOCK_CART.subtotal = orderToResume.summary.
|
|
42
|
+
MOCK_CART.subtotal = orderToResume.summary.subtotalAfterFees;
|
|
43
43
|
MOCK_CART.total = orderToResume.summary.total;
|
|
44
44
|
MOCK_CART.amountToBeCharged = MOCK_CART.total;
|
|
45
45
|
MOCK_CART.remainingBalance = MOCK_CART.total;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CFOrder } from "../../CommonTypes";
|
|
2
|
-
import type { CFTransitionResult } from "../../common-types/order-state";
|
|
3
2
|
export interface ResumeParkedOrderParams {
|
|
4
3
|
orderId: string;
|
|
5
4
|
}
|
|
@@ -7,7 +6,5 @@ export interface ResumeParkedOrderResponse {
|
|
|
7
6
|
success: boolean;
|
|
8
7
|
order: CFOrder;
|
|
9
8
|
timestamp: string;
|
|
10
|
-
/** Present when the state machine blocked or forced the transition. */
|
|
11
|
-
transitionResult?: CFTransitionResult;
|
|
12
9
|
}
|
|
13
10
|
export type ResumeParkedOrder = (params?: ResumeParkedOrderParams) => Promise<ResumeParkedOrderResponse>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CFSmartGridLayout } from "../../CommonTypes";
|
|
2
|
+
/** Persist a builder SmartGrid layout. The `layout.gridId` identifies the grid. */
|
|
3
|
+
export interface SaveSmartGridLayoutParams {
|
|
4
|
+
layout: CFSmartGridLayout;
|
|
5
|
+
}
|
|
6
|
+
export interface SaveSmartGridLayoutResponse {
|
|
7
|
+
success: boolean;
|
|
8
|
+
/** The gridId that was saved. */
|
|
9
|
+
gridId: string;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}
|
|
12
|
+
export type SaveSmartGridLayout = (params: SaveSmartGridLayoutParams) => Promise<SaveSmartGridLayoutResponse>;
|
|
@@ -9,7 +9,7 @@ export const mockSetActiveProductDiscount = async (params) => {
|
|
|
9
9
|
isPercent: params.isPercent || false,
|
|
10
10
|
label: params.label || "Discount"
|
|
11
11
|
};
|
|
12
|
-
setMockActiveProduct({ ...MOCK_ACTIVE_PRODUCT, discount });
|
|
12
|
+
setMockActiveProduct({ ...MOCK_ACTIVE_PRODUCT, discounts: [discount] });
|
|
13
13
|
return {
|
|
14
14
|
success: true,
|
|
15
15
|
amount: params.amount,
|
|
@@ -10,7 +10,7 @@ export const mockSetActiveProductFee = async (params) => {
|
|
|
10
10
|
isPercent: params.isPercent || false,
|
|
11
11
|
applyTaxes: params.applyTaxes || false
|
|
12
12
|
};
|
|
13
|
-
setMockActiveProduct({ ...MOCK_ACTIVE_PRODUCT, fee });
|
|
13
|
+
setMockActiveProduct({ ...MOCK_ACTIVE_PRODUCT, fees: [fee] });
|
|
14
14
|
return {
|
|
15
15
|
success: true,
|
|
16
16
|
amount: params.amount,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { CFOrder } from "../../CommonTypes";
|
|
2
|
-
import type { CFTransitionResult } from "../../common-types/order-state";
|
|
3
2
|
export interface TapToPayPaymentParams {
|
|
4
3
|
/** If not provided, uses the cart total. */
|
|
5
4
|
amount?: number;
|
|
6
|
-
/** Override the fulfillment state after full payment. Render resolves the cascade. */
|
|
7
|
-
checkoutFulfillmentTarget?: string;
|
|
8
5
|
}
|
|
9
6
|
export interface TapToPayPaymentResponse {
|
|
10
7
|
success: boolean;
|
|
@@ -12,7 +9,5 @@ export interface TapToPayPaymentResponse {
|
|
|
12
9
|
paymentType: string;
|
|
13
10
|
order: CFOrder | null;
|
|
14
11
|
timestamp: string;
|
|
15
|
-
/** Present when the state machine blocked or forced the transition. */
|
|
16
|
-
transitionResult?: CFTransitionResult;
|
|
17
12
|
}
|
|
18
13
|
export type TapToPayPayment = (params?: TapToPayPaymentParams) => Promise<TapToPayPaymentResponse>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { CFOrder } from "../../CommonTypes";
|
|
2
|
-
import type { CFTransitionResult } from "../../common-types/order-state";
|
|
3
2
|
export interface TerminalPaymentParams {
|
|
4
3
|
/** If not provided, uses the cart total. */
|
|
5
4
|
amount?: number;
|
|
6
5
|
/** "Bluetooth" or "Cloud". Defaults to "Cloud". */
|
|
7
6
|
paymentType?: 'Bluetooth' | 'Cloud';
|
|
8
|
-
/** Override the fulfillment state after full payment. Render resolves the cascade. */
|
|
9
|
-
checkoutFulfillmentTarget?: string;
|
|
10
7
|
}
|
|
11
8
|
export interface TerminalPaymentResponse {
|
|
12
9
|
success: boolean;
|
|
@@ -14,7 +11,5 @@ export interface TerminalPaymentResponse {
|
|
|
14
11
|
paymentType: string;
|
|
15
12
|
order: CFOrder | null;
|
|
16
13
|
timestamp: string;
|
|
17
|
-
/** Present when the state machine blocked or forced the transition. */
|
|
18
|
-
transitionResult?: CFTransitionResult;
|
|
19
14
|
}
|
|
20
15
|
export type TerminalPayment = (params?: TerminalPaymentParams) => Promise<TerminalPaymentResponse>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { CFOrder } from "../../CommonTypes";
|
|
2
|
-
import type { CFTransitionResult } from "../../common-types/order-state";
|
|
3
2
|
export interface VendaraPaymentParams {
|
|
4
3
|
/** If not provided, uses the cart total. */
|
|
5
4
|
amount?: number;
|
|
6
|
-
/** Override the fulfillment state after full payment. Render resolves the cascade. */
|
|
7
|
-
checkoutFulfillmentTarget?: string;
|
|
8
5
|
}
|
|
9
6
|
export interface VendaraPaymentResponse {
|
|
10
7
|
success: boolean;
|
|
@@ -12,7 +9,5 @@ export interface VendaraPaymentResponse {
|
|
|
12
9
|
paymentType: string;
|
|
13
10
|
order: CFOrder | null;
|
|
14
11
|
timestamp: string;
|
|
15
|
-
/** Present when the state machine blocked or forced the transition. */
|
|
16
|
-
transitionResult?: CFTransitionResult;
|
|
17
12
|
}
|
|
18
13
|
export type VendaraPayment = (params?: VendaraPaymentParams) => Promise<VendaraPaymentResponse>;
|
package/dist/demo/database.d.ts
CHANGED
|
@@ -34,29 +34,29 @@ export declare const MOCK_CATEGORY_SPECIALTY: CFCategory;
|
|
|
34
34
|
export declare const MOCK_CATEGORY_BASIC: CFCategory;
|
|
35
35
|
export declare const MOCK_CATEGORY_VEGAN: CFCategory;
|
|
36
36
|
export declare const MOCK_CATEGORY_SPICY: CFCategory;
|
|
37
|
-
export declare const MOCK_PRODUCT_BASIL_ALMOND:
|
|
38
|
-
export declare const MOCK_PRODUCT_BEER:
|
|
39
|
-
export declare const MOCK_PRODUCT_BEET:
|
|
40
|
-
export declare const MOCK_PRODUCT_CARAMELIZED:
|
|
41
|
-
export declare const MOCK_PRODUCT_GARLIC_ONION:
|
|
42
|
-
export declare const MOCK_PRODUCT_GARLIC:
|
|
43
|
-
export declare const MOCK_PRODUCT_GINGER_LIME:
|
|
44
|
-
export declare const MOCK_PRODUCT_LEMON:
|
|
45
|
-
export declare const MOCK_PRODUCT_RED_PEPPER:
|
|
46
|
-
export declare const MOCK_PRODUCT_ROASTED_TOMATO:
|
|
47
|
-
export declare const MOCK_PRODUCT_MINT_LEMON:
|
|
48
|
-
export declare const MOCK_PRODUCT_CHILI_GARLIC:
|
|
49
|
-
export declare const MOCK_PRODUCT_HABANERO:
|
|
50
|
-
export declare const MOCK_PRODUCT_BLACK_GARLIC:
|
|
37
|
+
export declare const MOCK_PRODUCT_BASIL_ALMOND: import("@final-commerce/common/pos-types").FullProduct;
|
|
38
|
+
export declare const MOCK_PRODUCT_BEER: import("@final-commerce/common/pos-types").FullProduct;
|
|
39
|
+
export declare const MOCK_PRODUCT_BEET: import("@final-commerce/common/pos-types").FullProduct;
|
|
40
|
+
export declare const MOCK_PRODUCT_CARAMELIZED: import("@final-commerce/common/pos-types").FullProduct;
|
|
41
|
+
export declare const MOCK_PRODUCT_GARLIC_ONION: import("@final-commerce/common/pos-types").FullProduct;
|
|
42
|
+
export declare const MOCK_PRODUCT_GARLIC: import("@final-commerce/common/pos-types").FullProduct;
|
|
43
|
+
export declare const MOCK_PRODUCT_GINGER_LIME: import("@final-commerce/common/pos-types").FullProduct;
|
|
44
|
+
export declare const MOCK_PRODUCT_LEMON: import("@final-commerce/common/pos-types").FullProduct;
|
|
45
|
+
export declare const MOCK_PRODUCT_RED_PEPPER: import("@final-commerce/common/pos-types").FullProduct;
|
|
46
|
+
export declare const MOCK_PRODUCT_ROASTED_TOMATO: import("@final-commerce/common/pos-types").FullProduct;
|
|
47
|
+
export declare const MOCK_PRODUCT_MINT_LEMON: import("@final-commerce/common/pos-types").FullProduct;
|
|
48
|
+
export declare const MOCK_PRODUCT_CHILI_GARLIC: import("@final-commerce/common/pos-types").FullProduct;
|
|
49
|
+
export declare const MOCK_PRODUCT_HABANERO: import("@final-commerce/common/pos-types").FullProduct;
|
|
50
|
+
export declare const MOCK_PRODUCT_BLACK_GARLIC: import("@final-commerce/common/pos-types").FullProduct;
|
|
51
51
|
export declare const MOCK_ORDER_1: CFActiveOrder;
|
|
52
52
|
export declare const MOCK_ORDER_2: CFActiveOrder;
|
|
53
|
-
export declare const MOCK_USERS:
|
|
54
|
-
export declare const MOCK_STATIONS:
|
|
55
|
-
export declare const MOCK_OUTLETS:
|
|
56
|
-
export declare const MOCK_CUSTOMERS:
|
|
57
|
-
export declare const MOCK_CATEGORIES:
|
|
58
|
-
export declare const MOCK_PRODUCTS:
|
|
59
|
-
export declare const MOCK_ORDERS:
|
|
53
|
+
export declare const MOCK_USERS: import("@final-commerce/common/pos-types").ActiveUser[];
|
|
54
|
+
export declare const MOCK_STATIONS: import("@final-commerce/common/pos-types").ActiveStation[];
|
|
55
|
+
export declare const MOCK_OUTLETS: import("@final-commerce/common/pos-types").ActiveOutlet[];
|
|
56
|
+
export declare const MOCK_CUSTOMERS: import("@final-commerce/common/pos-types").ActiveCustomer[];
|
|
57
|
+
export declare const MOCK_CATEGORIES: import("@final-commerce/common/pos-types").Category[];
|
|
58
|
+
export declare const MOCK_PRODUCTS: import("@final-commerce/common/pos-types").FullProduct[];
|
|
59
|
+
export declare const MOCK_ORDERS: import("@final-commerce/common/pos-types").ActiveOrder[];
|
|
60
60
|
export declare const MOCK_PARKED_ORDERS: CFActiveOrder[];
|
|
61
61
|
export declare let MOCK_USER: CFActiveUser;
|
|
62
62
|
export declare let MOCK_STATION: CFActiveStation;
|
package/dist/demo/database.js
CHANGED
|
@@ -167,39 +167,46 @@ export const MOCK_CUSTOMER_5 = {
|
|
|
167
167
|
};
|
|
168
168
|
// --- CATEGORIES ---
|
|
169
169
|
export const MOCK_CATEGORY_PASTES = {
|
|
170
|
-
|
|
170
|
+
id: "cat_pastes",
|
|
171
|
+
createdAt: "2024-01-01T00:00:00.000Z",
|
|
172
|
+
updatedAt: "2024-01-01T00:00:00.000Z",
|
|
171
173
|
name: "Pastes",
|
|
172
174
|
externalId: "ext_cat_pastes",
|
|
173
175
|
companyId: MOCK_COMPANY.id,
|
|
174
|
-
parentId: null
|
|
175
176
|
};
|
|
176
177
|
export const MOCK_CATEGORY_SPECIALTY = {
|
|
177
|
-
|
|
178
|
+
id: "cat_specialty",
|
|
179
|
+
createdAt: "2024-01-01T00:00:00.000Z",
|
|
180
|
+
updatedAt: "2024-01-01T00:00:00.000Z",
|
|
178
181
|
name: "Specialty",
|
|
179
182
|
externalId: "ext_cat_specialty",
|
|
180
183
|
companyId: MOCK_COMPANY.id,
|
|
181
184
|
parentId: "cat_pastes"
|
|
182
185
|
};
|
|
183
186
|
export const MOCK_CATEGORY_BASIC = {
|
|
184
|
-
|
|
187
|
+
id: "cat_basic",
|
|
188
|
+
createdAt: "2024-01-01T00:00:00.000Z",
|
|
189
|
+
updatedAt: "2024-01-01T00:00:00.000Z",
|
|
185
190
|
name: "Basic",
|
|
186
191
|
externalId: "ext_cat_basic",
|
|
187
192
|
companyId: MOCK_COMPANY.id,
|
|
188
193
|
parentId: "cat_pastes"
|
|
189
194
|
};
|
|
190
195
|
export const MOCK_CATEGORY_VEGAN = {
|
|
191
|
-
|
|
196
|
+
id: "cat_vegan",
|
|
197
|
+
createdAt: "2024-01-01T00:00:00.000Z",
|
|
198
|
+
updatedAt: "2024-01-01T00:00:00.000Z",
|
|
192
199
|
name: "Vegan",
|
|
193
200
|
externalId: "ext_cat_vegan",
|
|
194
201
|
companyId: MOCK_COMPANY.id,
|
|
195
|
-
parentId: null
|
|
196
202
|
};
|
|
197
203
|
export const MOCK_CATEGORY_SPICY = {
|
|
198
|
-
|
|
204
|
+
id: "cat_spicy",
|
|
205
|
+
createdAt: "2024-01-01T00:00:00.000Z",
|
|
206
|
+
updatedAt: "2024-01-01T00:00:00.000Z",
|
|
199
207
|
name: "Spicy",
|
|
200
208
|
externalId: "ext_cat_spicy",
|
|
201
209
|
companyId: MOCK_COMPANY.id,
|
|
202
|
-
parentId: null
|
|
203
210
|
};
|
|
204
211
|
// --- PRODUCTS ---
|
|
205
212
|
const createInventory = (stock) => [{ warehouse: "main", outletId: MOCK_OUTLET_MAIN.id, stock }];
|
|
@@ -221,7 +228,7 @@ const createSimpleProduct = (id, name, price, image, categories, description) =>
|
|
|
221
228
|
taxTable: "tax_standard",
|
|
222
229
|
description,
|
|
223
230
|
images: [image],
|
|
224
|
-
categories: categories.map(c => c.
|
|
231
|
+
categories: categories.map(c => ({ name: c.name, externalId: c.externalId ?? c.id })),
|
|
225
232
|
attributes: [],
|
|
226
233
|
variants: [
|
|
227
234
|
{
|
|
@@ -256,7 +263,7 @@ const createVariableProduct = (id, name, basePrice, largePrice, image, categorie
|
|
|
256
263
|
taxTable: "tax_standard",
|
|
257
264
|
description,
|
|
258
265
|
images: [image],
|
|
259
|
-
categories: categories.map(c => c.
|
|
266
|
+
categories: categories.map(c => ({ name: c.name, externalId: c.externalId ?? c.id })),
|
|
260
267
|
attributes: [{ name: "Size", values: ["Small", "Large"] }],
|
|
261
268
|
variants: [
|
|
262
269
|
{
|
|
@@ -314,12 +321,13 @@ const createLineItem = (product, variantIndex = 0, quantity = 1) => {
|
|
|
314
321
|
price: variant.price,
|
|
315
322
|
taxes: [],
|
|
316
323
|
discount: {
|
|
317
|
-
|
|
324
|
+
itemDiscounts: [],
|
|
318
325
|
cartDiscount: { percentage: 0, amount: 0 }
|
|
319
326
|
},
|
|
320
|
-
fee: {
|
|
327
|
+
fee: { itemFees: [] },
|
|
321
328
|
totalTax: 0,
|
|
322
329
|
total: variant.price * quantity,
|
|
330
|
+
lineNetWithFees: variant.price * quantity,
|
|
323
331
|
metadata: [],
|
|
324
332
|
image: product.images?.[0] || "",
|
|
325
333
|
sku: variant.sku,
|
|
@@ -335,13 +343,10 @@ export const MOCK_ORDER_1 = {
|
|
|
335
343
|
companyId: MOCK_COMPANY.id,
|
|
336
344
|
externalId: null,
|
|
337
345
|
status: "completed",
|
|
338
|
-
paymentState: "paid",
|
|
339
|
-
fulfillmentState: "fulfilled",
|
|
340
|
-
displayState: "Completed",
|
|
341
346
|
customer: MOCK_CUSTOMER_1,
|
|
342
347
|
summary: {
|
|
343
348
|
total: 2100,
|
|
344
|
-
|
|
349
|
+
subtotalAfterFees: 2100,
|
|
345
350
|
discountTotal: 0,
|
|
346
351
|
shippingTotal: 0,
|
|
347
352
|
totalTaxes: 0,
|
|
@@ -385,13 +390,10 @@ export const MOCK_ORDER_2 = {
|
|
|
385
390
|
companyId: MOCK_COMPANY.id,
|
|
386
391
|
externalId: null,
|
|
387
392
|
status: "completed",
|
|
388
|
-
paymentState: "paid",
|
|
389
|
-
fulfillmentState: "fulfilled",
|
|
390
|
-
displayState: "Completed",
|
|
391
393
|
customer: MOCK_CUSTOMER_2,
|
|
392
394
|
summary: {
|
|
393
395
|
total: 3000,
|
|
394
|
-
|
|
396
|
+
subtotalAfterFees: 3000,
|
|
395
397
|
discountTotal: 0,
|
|
396
398
|
shippingTotal: 0,
|
|
397
399
|
totalTaxes: 0,
|
|
@@ -587,12 +589,13 @@ export const createOrderFromCart = (paymentType, amount, processor = "cash") =>
|
|
|
587
589
|
price: p.price,
|
|
588
590
|
taxes: [],
|
|
589
591
|
discount: {
|
|
590
|
-
|
|
591
|
-
cartDiscount: { percentage: 0, amount: 0
|
|
592
|
+
itemDiscounts: [],
|
|
593
|
+
cartDiscount: { percentage: 0, amount: 0 }
|
|
592
594
|
},
|
|
593
|
-
fee: {
|
|
595
|
+
fee: { itemFees: [] },
|
|
594
596
|
totalTax: 0,
|
|
595
597
|
total: p.price * p.quantity,
|
|
598
|
+
lineNetWithFees: p.price * p.quantity,
|
|
596
599
|
metadata: [],
|
|
597
600
|
image: p.images?.[0] || "",
|
|
598
601
|
sku: p.sku || "",
|
|
@@ -609,13 +612,10 @@ export const createOrderFromCart = (paymentType, amount, processor = "cash") =>
|
|
|
609
612
|
companyId: MOCK_COMPANY.id,
|
|
610
613
|
externalId: null,
|
|
611
614
|
status: "completed",
|
|
612
|
-
paymentState: "paid",
|
|
613
|
-
fulfillmentState: "fulfilled",
|
|
614
|
-
displayState: "Completed",
|
|
615
615
|
customer: MOCK_CART.customer ? MOCK_CART.customer : null,
|
|
616
616
|
summary: {
|
|
617
617
|
total: totalNum,
|
|
618
|
-
|
|
618
|
+
subtotalAfterFees: totalNum,
|
|
619
619
|
discountTotal: 0,
|
|
620
620
|
shippingTotal: 0,
|
|
621
621
|
totalTaxes: 0,
|