@final-commerce/command-frame 0.1.63 → 0.1.73
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/CommonTypes.d.ts +147 -12
- package/dist/actions/add-customer-note/mock.js +27 -18
- package/dist/actions/add-customer-note/types.d.ts +3 -2
- package/dist/actions/add-product/mock.js +11 -5
- package/dist/actions/edit-product/mock.js +4 -2
- package/dist/actions/extension-payment/types.d.ts +4 -0
- package/dist/actions/get-context/mock.js +12 -6
- package/dist/actions/get-products/mock.js +6 -1
- package/dist/actions/get-products/types.d.ts +2 -0
- 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 +9 -0
- package/dist/actions/get-smart-grid-layout/types.d.ts +10 -0
- package/dist/actions/get-smart-grid-layout/types.js +1 -0
- 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 +56 -0
- package/dist/actions/integration-payment/types.js +1 -0
- package/dist/actions/print/mock.js +3 -6
- package/dist/actions/print/types.d.ts +1 -7
- package/dist/actions/redeem-payment/types.d.ts +9 -5
- package/dist/actions/remove-customer-note/mock.js +16 -7
- 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 +10 -0
- package/dist/actions/save-smart-grid-layout/types.d.ts +10 -0
- package/dist/actions/save-smart-grid-layout/types.js +1 -0
- package/dist/demo/database.d.ts +2 -1
- package/dist/demo/database.js +13 -24
- package/dist/index.d.ts +17 -1
- package/dist/index.js +14 -1
- package/dist/projects/render/mocks.js +7 -1
- package/dist/projects/render/types.d.ts +4 -1
- package/dist/pubsub/topics/attributes/attribute-created/types.d.ts +6 -0
- package/dist/pubsub/topics/attributes/attribute-created/types.js +1 -0
- package/dist/pubsub/topics/attributes/attribute-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/attributes/attribute-updated/types.js +1 -0
- package/dist/pubsub/topics/attributes/index.d.ts +3 -0
- package/dist/pubsub/topics/attributes/index.js +18 -0
- package/dist/pubsub/topics/attributes/types.d.ts +6 -0
- package/dist/pubsub/topics/attributes/types.js +2 -0
- package/dist/pubsub/topics/categories/category-created/types.d.ts +6 -0
- package/dist/pubsub/topics/categories/category-created/types.js +1 -0
- package/dist/pubsub/topics/categories/category-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/categories/category-updated/types.js +1 -0
- package/dist/pubsub/topics/categories/index.d.ts +3 -0
- package/dist/pubsub/topics/categories/index.js +18 -0
- package/dist/pubsub/topics/categories/types.d.ts +6 -0
- package/dist/pubsub/topics/categories/types.js +2 -0
- package/dist/pubsub/topics/index.d.ts +4 -0
- package/dist/pubsub/topics/index.js +4 -0
- package/dist/pubsub/topics/print/print-completed/types.d.ts +1 -1
- package/dist/pubsub/topics/print/print-error/types.d.ts +1 -1
- package/dist/pubsub/topics/print/print-started/types.d.ts +1 -1
- package/dist/pubsub/topics/split-payments/index.d.ts +12 -0
- package/dist/pubsub/topics/split-payments/index.js +22 -0
- package/dist/pubsub/topics/split-payments/split-payment-updated/types.d.ts +16 -0
- package/dist/pubsub/topics/split-payments/split-payment-updated/types.js +1 -0
- package/dist/pubsub/topics/split-payments/types.d.ts +10 -0
- package/dist/pubsub/topics/split-payments/types.js +5 -0
- package/dist/pubsub/topics/transactions/index.d.ts +3 -0
- package/dist/pubsub/topics/transactions/index.js +18 -0
- package/dist/pubsub/topics/transactions/transaction-created/types.d.ts +6 -0
- package/dist/pubsub/topics/transactions/transaction-created/types.js +1 -0
- package/dist/pubsub/topics/transactions/transaction-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/transactions/transaction-updated/types.js +1 -0
- package/dist/pubsub/topics/transactions/types.d.ts +6 -0
- package/dist/pubsub/topics/transactions/types.js +2 -0
- package/dist/pubsub/topics/types.d.ts +10 -0
- package/dist/pubsub/topics/users/index.js +10 -0
- package/dist/pubsub/topics/users/types.d.ts +6 -2
- package/dist/pubsub/topics/users/types.js +2 -0
- package/dist/pubsub/topics/users/user-created/types.d.ts +6 -0
- package/dist/pubsub/topics/users/user-created/types.js +1 -0
- package/dist/pubsub/topics/users/user-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/users/user-updated/types.js +1 -0
- package/dist/pubsub/topics/variants/index.d.ts +3 -0
- package/dist/pubsub/topics/variants/index.js +18 -0
- package/dist/pubsub/topics/variants/types.d.ts +6 -0
- package/dist/pubsub/topics/variants/types.js +2 -0
- package/dist/pubsub/topics/variants/variant-created/types.d.ts +6 -0
- package/dist/pubsub/topics/variants/variant-created/types.js +1 -0
- package/dist/pubsub/topics/variants/variant-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/variants/variant-updated/types.js +1 -0
- package/package.json +4 -4
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { ExtensionPaymentResponse } from "../extension-payment/types";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Redeem (e.g. gift card) — always uses paymentType `"redeem"` on the wire.
|
|
4
|
+
* `amount` is required so the persisted payment never silently falls back to the cart
|
|
5
|
+
* total. The host handler also re-validates this at runtime to catch raw-postMessage callers.
|
|
6
|
+
*/
|
|
3
7
|
export interface RedeemPaymentParams {
|
|
4
|
-
amount
|
|
5
|
-
processor?: string;
|
|
8
|
+
amount: number;
|
|
6
9
|
label?: string;
|
|
7
|
-
referenceId?: string;
|
|
8
10
|
extensionId?: string;
|
|
11
|
+
processor?: string;
|
|
12
|
+
referenceId?: string;
|
|
9
13
|
metadata?: Record<string, unknown>;
|
|
10
14
|
}
|
|
11
15
|
export type RedeemPaymentResponse = ExtensionPaymentResponse;
|
|
12
|
-
export type RedeemPayment = (params
|
|
16
|
+
export type RedeemPayment = (params: RedeemPaymentParams) => Promise<RedeemPaymentResponse>;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { MOCK_CUSTOMERS, mockPublishEvent } from "../../demo/database";
|
|
2
|
+
export const mockRemoveCustomerNote = (params) => {
|
|
2
3
|
console.log("[Mock] removeCustomerNote called", params);
|
|
3
4
|
const noteId = params?.noteId ?? "";
|
|
4
5
|
const timestamp = new Date().toISOString();
|
|
5
6
|
if (!noteId) {
|
|
6
|
-
return { success: false, noteId, timestamp };
|
|
7
|
+
return Promise.resolve({ success: false, noteId, timestamp });
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
noteId
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
for (const customer of MOCK_CUSTOMERS) {
|
|
10
|
+
const before = customer.notes?.length ?? 0;
|
|
11
|
+
const removed = (customer.notes || []).find(n => n._id === noteId);
|
|
12
|
+
customer.notes = (customer.notes || []).filter(n => n._id !== noteId);
|
|
13
|
+
if ((customer.notes?.length ?? 0) !== before) {
|
|
14
|
+
mockPublishEvent("customers", "customer-note-deleted", {
|
|
15
|
+
customer,
|
|
16
|
+
note: removed
|
|
17
|
+
});
|
|
18
|
+
return Promise.resolve({ success: true, noteId, timestamp });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return Promise.resolve({ success: false, noteId, timestamp });
|
|
13
22
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MOCK_SMART_GRID_LAYOUTS } from "../../demo/database";
|
|
2
|
+
export const mockSaveSmartGridLayout = (params) => {
|
|
3
|
+
console.log("[Mock] saveSmartGridLayout called", params);
|
|
4
|
+
MOCK_SMART_GRID_LAYOUTS[params.layout.gridId] = params.layout;
|
|
5
|
+
return Promise.resolve({
|
|
6
|
+
success: true,
|
|
7
|
+
gridId: params.layout.gridId,
|
|
8
|
+
timestamp: new Date().toISOString()
|
|
9
|
+
});
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CFSmartGridLayout } from "../../CommonTypes";
|
|
2
|
+
export interface SaveSmartGridLayoutParams {
|
|
3
|
+
layout: CFSmartGridLayout;
|
|
4
|
+
}
|
|
5
|
+
export interface SaveSmartGridLayoutResponse {
|
|
6
|
+
success: boolean;
|
|
7
|
+
gridId: string;
|
|
8
|
+
timestamp: string;
|
|
9
|
+
}
|
|
10
|
+
export type SaveSmartGridLayout = (params: SaveSmartGridLayoutParams) => Promise<SaveSmartGridLayoutResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/demo/database.d.ts
CHANGED
|
@@ -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 } from "../CommonTypes";
|
|
5
|
+
import { CFActiveCompany, CFActiveUser, CFActiveStation, CFActiveOutlet, CFActiveOrder, CFCustomer, CFProduct, CFActiveCart, CFCategory, CFActiveProduct, CFSession, CFActiveRefundDetails, CFSmartGridLayout } 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 {
|
|
@@ -64,6 +64,7 @@ export declare let MOCK_OUTLET: CFActiveOutlet;
|
|
|
64
64
|
export declare let MOCK_CART: CFActiveCart;
|
|
65
65
|
export declare let MOCK_ACTIVE_PRODUCT: CFActiveProduct;
|
|
66
66
|
export declare const setMockActiveProduct: (activeProduct: CFActiveProduct) => void;
|
|
67
|
+
export declare const MOCK_SMART_GRID_LAYOUTS: Record<string, CFSmartGridLayout>;
|
|
67
68
|
export declare const resetMockCart: () => void;
|
|
68
69
|
/**
|
|
69
70
|
* Replace in-memory mock data used by default mock handlers. Arrays are mutated in place
|
package/dist/demo/database.js
CHANGED
|
@@ -202,7 +202,7 @@ export const MOCK_CATEGORY_SPICY = {
|
|
|
202
202
|
parentId: null
|
|
203
203
|
};
|
|
204
204
|
// --- PRODUCTS ---
|
|
205
|
-
const createInventory = (stock) => [{ outletId: MOCK_OUTLET_MAIN.id, stock }];
|
|
205
|
+
const createInventory = (stock) => [{ warehouse: "main", outletId: MOCK_OUTLET_MAIN.id, stock }];
|
|
206
206
|
// Helper for Simple Product
|
|
207
207
|
const createSimpleProduct = (id, name, price, image, categories, description) => {
|
|
208
208
|
const sku = `SKU-${id.toUpperCase()}`;
|
|
@@ -366,10 +366,7 @@ export const MOCK_ORDER_1 = {
|
|
|
366
366
|
metadata: [],
|
|
367
367
|
billing: MOCK_CUSTOMER_1.billing || null,
|
|
368
368
|
shipping: null,
|
|
369
|
-
lineItems: [
|
|
370
|
-
createLineItem(MOCK_PRODUCT_GARLIC, 0, 1),
|
|
371
|
-
createLineItem(MOCK_PRODUCT_BASIL_ALMOND, 0, 1)
|
|
372
|
-
],
|
|
369
|
+
lineItems: [createLineItem(MOCK_PRODUCT_GARLIC, 0, 1), createLineItem(MOCK_PRODUCT_BASIL_ALMOND, 0, 1)],
|
|
373
370
|
customSales: [],
|
|
374
371
|
balance: 0,
|
|
375
372
|
user: MOCK_USER_LUIGI,
|
|
@@ -416,9 +413,7 @@ export const MOCK_ORDER_2 = {
|
|
|
416
413
|
metadata: [],
|
|
417
414
|
billing: null,
|
|
418
415
|
shipping: null,
|
|
419
|
-
lineItems: [
|
|
420
|
-
createLineItem(MOCK_PRODUCT_BEER, 0, 2)
|
|
421
|
-
],
|
|
416
|
+
lineItems: [createLineItem(MOCK_PRODUCT_BEER, 0, 2)],
|
|
422
417
|
customSales: [],
|
|
423
418
|
balance: 0,
|
|
424
419
|
user: MOCK_USER_MARIO,
|
|
@@ -430,20 +425,8 @@ export const MOCK_ORDER_2 = {
|
|
|
430
425
|
export const MOCK_USERS = [MOCK_USER_MARIO, MOCK_USER_LUIGI];
|
|
431
426
|
export const MOCK_STATIONS = [MOCK_STATION_1, MOCK_STATION_2];
|
|
432
427
|
export const MOCK_OUTLETS = [MOCK_OUTLET_MAIN];
|
|
433
|
-
export const MOCK_CUSTOMERS = [
|
|
434
|
-
|
|
435
|
-
MOCK_CUSTOMER_2,
|
|
436
|
-
MOCK_CUSTOMER_3,
|
|
437
|
-
MOCK_CUSTOMER_4,
|
|
438
|
-
MOCK_CUSTOMER_5
|
|
439
|
-
];
|
|
440
|
-
export const MOCK_CATEGORIES = [
|
|
441
|
-
MOCK_CATEGORY_PASTES,
|
|
442
|
-
MOCK_CATEGORY_SPECIALTY,
|
|
443
|
-
MOCK_CATEGORY_BASIC,
|
|
444
|
-
MOCK_CATEGORY_VEGAN,
|
|
445
|
-
MOCK_CATEGORY_SPICY
|
|
446
|
-
];
|
|
428
|
+
export const MOCK_CUSTOMERS = [MOCK_CUSTOMER_1, MOCK_CUSTOMER_2, MOCK_CUSTOMER_3, MOCK_CUSTOMER_4, MOCK_CUSTOMER_5];
|
|
429
|
+
export const MOCK_CATEGORIES = [MOCK_CATEGORY_PASTES, MOCK_CATEGORY_SPECIALTY, MOCK_CATEGORY_BASIC, MOCK_CATEGORY_VEGAN, MOCK_CATEGORY_SPICY];
|
|
447
430
|
export const MOCK_PRODUCTS = [
|
|
448
431
|
MOCK_PRODUCT_BASIL_ALMOND,
|
|
449
432
|
MOCK_PRODUCT_BEER,
|
|
@@ -480,6 +463,10 @@ export let MOCK_ACTIVE_PRODUCT;
|
|
|
480
463
|
export const setMockActiveProduct = (activeProduct) => {
|
|
481
464
|
MOCK_ACTIVE_PRODUCT = activeProduct;
|
|
482
465
|
};
|
|
466
|
+
// In-memory smart-grid layouts keyed by gridId. Used by mockGetSmartGridLayout /
|
|
467
|
+
// mockSaveSmartGridLayout so the standalone builder (no command-frame host) can
|
|
468
|
+
// round-trip layouts within a session.
|
|
469
|
+
export const MOCK_SMART_GRID_LAYOUTS = {};
|
|
483
470
|
// Helper to reset cart
|
|
484
471
|
export const resetMockCart = () => {
|
|
485
472
|
MOCK_CART = {
|
|
@@ -494,7 +481,8 @@ export const resetMockCart = () => {
|
|
|
494
481
|
};
|
|
495
482
|
};
|
|
496
483
|
function resolveMockOrderCurrency() {
|
|
497
|
-
const
|
|
484
|
+
const settings = MOCK_COMPANY.settings;
|
|
485
|
+
const raw = settings?.currency;
|
|
498
486
|
if (typeof raw === "string" && Object.values(CurrencyCode).includes(raw)) {
|
|
499
487
|
return raw;
|
|
500
488
|
}
|
|
@@ -554,6 +542,7 @@ export const safeSerialize = (data) => {
|
|
|
554
542
|
return JSON.parse(JSON.stringify(data));
|
|
555
543
|
};
|
|
556
544
|
const mockTopicSubscribers = {};
|
|
545
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
557
546
|
export const mockPublishEvent = (topic, eventType, data) => {
|
|
558
547
|
const subscribers = mockTopicSubscribers[topic] || [];
|
|
559
548
|
const event = {
|
|
@@ -660,6 +649,6 @@ export const createOrderFromCart = (paymentType, amount, processor = "cash") =>
|
|
|
660
649
|
MOCK_ORDERS.push(newOrder);
|
|
661
650
|
resetMockCart();
|
|
662
651
|
// Publish cart-created event after cart is reset (simulates new empty cart)
|
|
663
|
-
mockPublishEvent(
|
|
652
|
+
mockPublishEvent("cart", "cart-created", {});
|
|
664
653
|
return newOrder;
|
|
665
654
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare const command: {
|
|
|
38
38
|
readonly vendaraPayment: import("./actions/vendara-payment/types").VendaraPayment;
|
|
39
39
|
readonly extensionPayment: import("./actions/extension-payment/types").ExtensionPayment;
|
|
40
40
|
readonly redeemPayment: import("./actions/redeem-payment/types").RedeemPayment;
|
|
41
|
+
readonly integrationPayment: import("./actions/integration-payment/types").IntegrationPayment;
|
|
41
42
|
readonly addCustomerNote: import("./actions/add-customer-note/types").AddCustomerNote;
|
|
42
43
|
readonly removeCustomerNote: import("./actions/remove-customer-note/types").RemoveCustomerNote;
|
|
43
44
|
readonly removeCustomerFromCart: import("./actions/remove-customer-from-cart/types").RemoveCustomerFromCart;
|
|
@@ -85,6 +86,8 @@ export declare const command: {
|
|
|
85
86
|
readonly deleteProduct: import("./actions/delete-product/types").DeleteProduct;
|
|
86
87
|
readonly getOutlets: import("./actions/get-outlets/types").GetOutlets;
|
|
87
88
|
readonly getStations: import("./actions/get-stations/types").GetStations;
|
|
89
|
+
readonly getSmartGridLayout: import("./actions/get-smart-grid-layout/types").GetSmartGridLayout;
|
|
90
|
+
readonly saveSmartGridLayout: import("./actions/save-smart-grid-layout/types").SaveSmartGridLayout;
|
|
88
91
|
readonly getCustomTables: import("./actions/get-custom-tables/types").GetCustomTables;
|
|
89
92
|
readonly getCustomTableFields: import("./actions/get-custom-table-fields/types").GetCustomTableFields;
|
|
90
93
|
readonly getCustomTableData: import("./actions/get-custom-table-data/types").GetCustomTableData;
|
|
@@ -121,6 +124,8 @@ export type { EditProductVariants, EditProductVariantsParams, EditProductVariant
|
|
|
121
124
|
export type { DeleteProduct, DeleteProductParams, DeleteProductResponse } from "./actions/delete-product/types";
|
|
122
125
|
export type { GetOutlets, GetOutletsResponse } from "./actions/get-outlets/types";
|
|
123
126
|
export type { GetStations, GetStationsParams, GetStationsResponse } from "./actions/get-stations/types";
|
|
127
|
+
export type { GetSmartGridLayout, GetSmartGridLayoutParams, GetSmartGridLayoutResponse } from "./actions/get-smart-grid-layout/types";
|
|
128
|
+
export type { SaveSmartGridLayout, SaveSmartGridLayoutParams, SaveSmartGridLayoutResponse } from "./actions/save-smart-grid-layout/types";
|
|
124
129
|
export type { GetOrders, GetOrdersParams, GetOrdersResponse } from "./actions/get-orders/types";
|
|
125
130
|
export type { GetRefunds, GetRefundsParams, GetRefundsResponse } from "./actions/get-refunds/types";
|
|
126
131
|
export type { SetRefundStockAction, SetRefundStockActionParams, SetRefundStockActionResponse } from "./actions/set-refund-stock-action/types";
|
|
@@ -157,6 +162,7 @@ export type { TerminalPayment, TerminalPaymentParams, TerminalPaymentResponse }
|
|
|
157
162
|
export type { VendaraPayment, VendaraPaymentParams, VendaraPaymentResponse } from "./actions/vendara-payment/types";
|
|
158
163
|
export type { ExtensionPayment, ExtensionPaymentParams, ExtensionPaymentResponse } from "./actions/extension-payment/types";
|
|
159
164
|
export type { RedeemPayment, RedeemPaymentParams, RedeemPaymentResponse } from "./actions/redeem-payment/types";
|
|
165
|
+
export type { IntegrationPayment, IntegrationPaymentParams, IntegrationPaymentResponse, IntegrationEmvData } from "./actions/integration-payment/types";
|
|
160
166
|
export { EXTENSION_REFUND_REQUEST_ACTION } from "./actions/extension-refund/constants";
|
|
161
167
|
export { installExtensionRefundListener } from "./actions/extension-refund/extension-refund-listener";
|
|
162
168
|
export type { ExtensionRefundParams, ExtensionRefundResponse } from "./actions/extension-refund/types";
|
|
@@ -220,12 +226,17 @@ export { refundsTopic } from "./pubsub/topics/refunds";
|
|
|
220
226
|
export { productsTopic } from "./pubsub/topics/products";
|
|
221
227
|
export { cartTopic } from "./pubsub/topics/cart";
|
|
222
228
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
229
|
+
export { splitPaymentsTopic } from "./pubsub/topics/split-payments";
|
|
223
230
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
224
231
|
export { printTopic } from "./pubsub/topics/print";
|
|
225
232
|
export { outletTopic } from "./pubsub/topics/outlet";
|
|
226
233
|
export { stationTopic } from "./pubsub/topics/station";
|
|
227
234
|
export { sessionTopic } from "./pubsub/topics/session";
|
|
228
235
|
export { usersTopic } from "./pubsub/topics/users";
|
|
236
|
+
export { variantsTopic } from "./pubsub/topics/variants";
|
|
237
|
+
export { transactionsTopic } from "./pubsub/topics/transactions";
|
|
238
|
+
export { categoriesTopic } from "./pubsub/topics/categories";
|
|
239
|
+
export { attributesTopic } from "./pubsub/topics/attributes";
|
|
229
240
|
export type { CustomerCreatedPayload, CustomerUpdatedPayload, CustomerNoteAddedPayload, CustomerNoteDeletedPayload, CustomerAssignedPayload, CustomerUnassignedPayload, CustomerActiveSetPayload, CustomerActiveGetPayload, CustomerCreatedEvent, CustomerUpdatedEvent, CustomerNoteAddedEvent, CustomerNoteDeletedEvent, CustomerAssignedEvent, CustomerUnassignedEvent, CustomerActiveSetEvent, CustomerActiveGetEvent, CustomersEventType, CustomersEventPayload } from "./pubsub/topics/customers/types";
|
|
230
241
|
export type { OrderCreatedPayload, OrderUpdatedPayload, OrderActiveSetPayload, OrderActiveGetPayload, OrderCreatedEvent, OrderUpdatedEvent, OrderActiveSetEvent, OrderActiveGetEvent, OrdersEventType, OrdersEventPayload } from "./pubsub/topics/orders/types";
|
|
231
242
|
export type { RefundCreatedPayload, RefundUpdatedPayload, RefundActiveSetPayload, RefundActiveGetPayload, RefundCreatedEvent, RefundUpdatedEvent, RefundActiveSetEvent, RefundActiveGetEvent, RefundsEventType, RefundsEventPayload } from "./pubsub/topics/refunds/types";
|
|
@@ -233,9 +244,14 @@ export type { ProductCreatedPayload, ProductUpdatedPayload, ProductSetActivePayl
|
|
|
233
244
|
export type { OutletActiveSetPayload, OutletActiveGetPayload, OutletActiveSetEvent, OutletActiveGetEvent, OutletEventType, OutletEventPayload } from "./pubsub/topics/outlet/types";
|
|
234
245
|
export type { StationActiveSetPayload, StationActiveGetPayload, StationActiveSetEvent, StationActiveGetEvent, StationEventType, StationEventPayload } from "./pubsub/topics/station/types";
|
|
235
246
|
export type { SessionActiveSetPayload, SessionActiveGetPayload, SessionActiveSetEvent, SessionActiveGetEvent, SessionEventType, SessionEventPayload } from "./pubsub/topics/session/types";
|
|
236
|
-
export type { UserActiveSetPayload, UserActiveGetPayload, UserActiveSetEvent, UserActiveGetEvent, UsersEventType, UsersEventPayload } from "./pubsub/topics/users/types";
|
|
247
|
+
export type { UserActiveSetPayload, UserActiveGetPayload, UserActiveSetEvent, UserActiveGetEvent, UserCreatedPayload, UserCreatedEvent, UserUpdatedPayload, UserUpdatedEvent, UsersEventType, UsersEventPayload } from "./pubsub/topics/users/types";
|
|
248
|
+
export type { VariantCreatedPayload, VariantCreatedEvent, VariantUpdatedPayload, VariantUpdatedEvent, VariantsEventType, VariantsEventPayload } from "./pubsub/topics/variants/types";
|
|
249
|
+
export type { TransactionCreatedPayload, TransactionCreatedEvent, TransactionUpdatedPayload, TransactionUpdatedEvent, TransactionsEventType, TransactionsEventPayload } from "./pubsub/topics/transactions/types";
|
|
250
|
+
export type { CategoryCreatedPayload, CategoryCreatedEvent, CategoryUpdatedPayload, CategoryUpdatedEvent, CategoriesEventType, CategoriesEventPayload } from "./pubsub/topics/categories/types";
|
|
251
|
+
export type { AttributeCreatedPayload, AttributeCreatedEvent, AttributeUpdatedPayload, AttributeUpdatedEvent, AttributesEventType, AttributesEventPayload } from "./pubsub/topics/attributes/types";
|
|
237
252
|
export type { CartCreatedPayload, CartCustomerAssignedPayload, ProductAddedPayload, ProductDeletedPayload, CartDiscountAddedPayload, CartDiscountRemovedPayload, CartFeeAddedPayload, CartFeeRemovedPayload, ProductDiscountAddedPayload, ProductDiscountRemovedPayload, ProductFeeAddedPayload, ProductFeeRemovedPayload, ProductNoteAddedPayload, ProductNoteRemovedPayload, CartCreatedEvent, CartCustomerAssignedEvent, ProductAddedEvent, ProductDeletedEvent, CartDiscountAddedEvent, CartDiscountRemovedEvent, CartFeeAddedEvent, CartFeeRemovedEvent, ProductDiscountAddedEvent, ProductDiscountRemovedEvent, ProductFeeAddedEvent, ProductFeeRemovedEvent, ProductNoteAddedEvent, ProductNoteRemovedEvent, CartEventType, CartEventPayload } from "./pubsub/topics/cart/types";
|
|
238
253
|
export type { PaymentDonePayload, PaymentErrPayload, PaymentDoneEvent, PaymentErrEvent, PaymentsEventType, PaymentsEventPayload } from "./pubsub/topics/payments/types";
|
|
254
|
+
export type { SplitPaymentUpdatedPayload, SplitPaymentUpdatedEvent, SplitPaymentsEventType, SplitPaymentsEventPayload } from "./pubsub/topics/split-payments/types";
|
|
239
255
|
export type { RowCreatedPayload, RowUpdatedPayload, RowDeletedPayload, RowCreatedEvent, RowUpdatedEvent, RowDeletedEvent, CustomTablesEventType, CustomTablesEventPayload } from "./pubsub/topics/custom-tables/types";
|
|
240
256
|
export type { PrintStartedPayload, PrintCompletedPayload, PrintErrorPayload, PrintStartedEvent, PrintCompletedEvent, PrintErrorEvent, PrintEventType, PrintEventPayload } from "./pubsub/topics/print/types";
|
|
241
257
|
export { AttributeType } from "./common-types/attribute-type";
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ import { terminalPayment } from "./actions/terminal-payment/action";
|
|
|
38
38
|
import { vendaraPayment } from "./actions/vendara-payment/action";
|
|
39
39
|
import { extensionPayment } from "./actions/extension-payment/action";
|
|
40
40
|
import { redeemPayment } from "./actions/redeem-payment/action";
|
|
41
|
+
import { integrationPayment } from "./actions/integration-payment/action";
|
|
41
42
|
// Customer Actions
|
|
42
43
|
import { addCustomerNote } from "./actions/add-customer-note/action";
|
|
43
44
|
import { removeCustomerNote } from "./actions/remove-customer-note/action";
|
|
@@ -110,6 +111,9 @@ import { deleteProduct } from "./actions/delete-product/action";
|
|
|
110
111
|
// Entity Actions
|
|
111
112
|
import { getOutlets } from "./actions/get-outlets/action";
|
|
112
113
|
import { getStations } from "./actions/get-stations/action";
|
|
114
|
+
// SmartGrid Actions
|
|
115
|
+
import { getSmartGridLayout } from "./actions/get-smart-grid-layout/action";
|
|
116
|
+
import { saveSmartGridLayout } from "./actions/save-smart-grid-layout/action";
|
|
113
117
|
// Manage extension actions (optional hosts: Deerlake, etc.)
|
|
114
118
|
import { navigateTo } from "./actions/navigate-to/action";
|
|
115
119
|
import { refreshResource } from "./actions/refresh-resource/action";
|
|
@@ -160,6 +164,7 @@ export const command = {
|
|
|
160
164
|
vendaraPayment,
|
|
161
165
|
extensionPayment,
|
|
162
166
|
redeemPayment,
|
|
167
|
+
integrationPayment,
|
|
163
168
|
// Customer Actions
|
|
164
169
|
addCustomerNote,
|
|
165
170
|
removeCustomerNote,
|
|
@@ -214,6 +219,9 @@ export const command = {
|
|
|
214
219
|
// Entity Actions
|
|
215
220
|
getOutlets,
|
|
216
221
|
getStations,
|
|
222
|
+
// SmartGrid Actions
|
|
223
|
+
getSmartGridLayout,
|
|
224
|
+
saveSmartGridLayout,
|
|
217
225
|
// Custom Tables Actions
|
|
218
226
|
getCustomTables,
|
|
219
227
|
getCustomTableFields,
|
|
@@ -237,7 +245,7 @@ export const command = {
|
|
|
237
245
|
getMedia,
|
|
238
246
|
uploadMedia,
|
|
239
247
|
getTaxTables,
|
|
240
|
-
getBranding
|
|
248
|
+
getBranding
|
|
241
249
|
};
|
|
242
250
|
export { EXTENSION_REFUND_REQUEST_ACTION } from "./actions/extension-refund/constants";
|
|
243
251
|
export { installExtensionRefundListener } from "./actions/extension-refund/extension-refund-listener";
|
|
@@ -264,11 +272,16 @@ export { refundsTopic } from "./pubsub/topics/refunds";
|
|
|
264
272
|
export { productsTopic } from "./pubsub/topics/products";
|
|
265
273
|
export { cartTopic } from "./pubsub/topics/cart";
|
|
266
274
|
export { paymentsTopic } from "./pubsub/topics/payments";
|
|
275
|
+
export { splitPaymentsTopic } from "./pubsub/topics/split-payments";
|
|
267
276
|
export { customTablesTopic } from "./pubsub/topics/custom-tables";
|
|
268
277
|
export { printTopic } from "./pubsub/topics/print";
|
|
269
278
|
export { outletTopic } from "./pubsub/topics/outlet";
|
|
270
279
|
export { stationTopic } from "./pubsub/topics/station";
|
|
271
280
|
export { sessionTopic } from "./pubsub/topics/session";
|
|
272
281
|
export { usersTopic } from "./pubsub/topics/users";
|
|
282
|
+
export { variantsTopic } from "./pubsub/topics/variants";
|
|
283
|
+
export { transactionsTopic } from "./pubsub/topics/transactions";
|
|
284
|
+
export { categoriesTopic } from "./pubsub/topics/categories";
|
|
285
|
+
export { attributesTopic } from "./pubsub/topics/attributes";
|
|
273
286
|
// Export Custom Tables Types
|
|
274
287
|
export { AttributeType } from "./common-types/attribute-type";
|
|
@@ -56,6 +56,7 @@ import { mockTriggerZapierWebhook } from "../../actions/trigger-zapier-webhook/m
|
|
|
56
56
|
import { mockVendaraPayment } from "../../actions/vendara-payment/mock";
|
|
57
57
|
import { mockExtensionPayment } from "../../actions/extension-payment/mock";
|
|
58
58
|
import { mockRedeemPayment } from "../../actions/redeem-payment/mock";
|
|
59
|
+
import { mockIntegrationPayment } from "../../actions/integration-payment/mock";
|
|
59
60
|
import { mockAddNonRevenueItem } from "../../actions/add-non-revenue-item/mock";
|
|
60
61
|
import { mockGetFinalContext } from "../../actions/get-final-context/mock";
|
|
61
62
|
import { mockPrint } from "../../actions/print/mock";
|
|
@@ -85,6 +86,8 @@ import { mockSetActiveSession } from "../../actions/set-active-session/mock";
|
|
|
85
86
|
import { mockGetActiveUser } from "../../actions/get-active-user/mock";
|
|
86
87
|
import { mockSetActiveUser } from "../../actions/set-active-user/mock";
|
|
87
88
|
import { mockSetActiveRefund } from "../../actions/set-active-refund/mock";
|
|
89
|
+
import { mockGetSmartGridLayout } from "../../actions/get-smart-grid-layout/mock";
|
|
90
|
+
import { mockSaveSmartGridLayout } from "../../actions/save-smart-grid-layout/mock";
|
|
88
91
|
export const RENDER_MOCKS = {
|
|
89
92
|
addCartDiscount: mockAddCartDiscount,
|
|
90
93
|
addCartFee: mockAddCartFee,
|
|
@@ -143,6 +146,7 @@ export const RENDER_MOCKS = {
|
|
|
143
146
|
vendaraPayment: mockVendaraPayment,
|
|
144
147
|
extensionPayment: mockExtensionPayment,
|
|
145
148
|
redeemPayment: mockRedeemPayment,
|
|
149
|
+
integrationPayment: mockIntegrationPayment,
|
|
146
150
|
addNonRevenueItem: mockAddNonRevenueItem,
|
|
147
151
|
getFinalContext: mockGetFinalContext,
|
|
148
152
|
print: mockPrint,
|
|
@@ -178,5 +182,7 @@ export const RENDER_MOCKS = {
|
|
|
178
182
|
removeCartFee: mockRemoveCartFee,
|
|
179
183
|
removeOrderNote: () => Promise.resolve({ success: true, timestamp: new Date().toISOString() }),
|
|
180
184
|
removeCustomSale: params => Promise.resolve({ success: true, id: params.id, timestamp: new Date().toISOString() }),
|
|
181
|
-
removeNonRevenueItem: params => Promise.resolve({ success: true, externalId: params.externalId, timestamp: new Date().toISOString() })
|
|
185
|
+
removeNonRevenueItem: params => Promise.resolve({ success: true, externalId: params.externalId, timestamp: new Date().toISOString() }),
|
|
186
|
+
getSmartGridLayout: mockGetSmartGridLayout,
|
|
187
|
+
saveSmartGridLayout: mockSaveSmartGridLayout
|
|
182
188
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, GetTaxTables, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, TriggerWebhook, TriggerZapierWebhook, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal, GetUsers, GetRoles, RemoveCartDiscount, GetActiveOrder, GetActiveCustomer, SetActiveCustomer, GetActiveOutlet, SetActiveOutlet, GetActiveStation, SetActiveStation, GetActiveSession, SetActiveSession, GetActiveUser, SetActiveUser, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem } from "../../index";
|
|
1
|
+
import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, GetTaxTables, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, TriggerWebhook, TriggerZapierWebhook, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal, GetUsers, GetRoles, RemoveCartDiscount, GetActiveOrder, GetActiveCustomer, SetActiveCustomer, GetActiveOutlet, SetActiveOutlet, GetActiveStation, SetActiveStation, GetActiveSession, SetActiveSession, GetActiveUser, SetActiveUser, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem, IntegrationPayment, GetSmartGridLayout, SaveSmartGridLayout } from "../../index";
|
|
2
2
|
export interface RenderProviderActions {
|
|
3
3
|
exampleFunction: ExampleFunction;
|
|
4
4
|
getProducts: GetProducts;
|
|
@@ -38,6 +38,7 @@ export interface RenderProviderActions {
|
|
|
38
38
|
vendaraPayment: VendaraPayment;
|
|
39
39
|
extensionPayment: ExtensionPayment;
|
|
40
40
|
redeemPayment: RedeemPayment;
|
|
41
|
+
integrationPayment: IntegrationPayment;
|
|
41
42
|
addNonRevenueItem: AddNonRevenueItem;
|
|
42
43
|
addCustomerNote: AddCustomerNote;
|
|
43
44
|
removeCustomerNote: RemoveCustomerNote;
|
|
@@ -93,4 +94,6 @@ export interface RenderProviderActions {
|
|
|
93
94
|
removeOrderNote: RemoveOrderNote;
|
|
94
95
|
removeCustomSale: RemoveCustomSale;
|
|
95
96
|
removeNonRevenueItem: RemoveNonRevenueItem;
|
|
97
|
+
getSmartGridLayout: GetSmartGridLayout;
|
|
98
|
+
saveSmartGridLayout: SaveSmartGridLayout;
|
|
96
99
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const attributesTopic = {
|
|
2
|
+
id: "attributes",
|
|
3
|
+
name: "Attributes",
|
|
4
|
+
description: "Topic for product attribute definition changes synced from the database",
|
|
5
|
+
eventTypes: [
|
|
6
|
+
{
|
|
7
|
+
id: "attribute-created",
|
|
8
|
+
name: "Attribute Created",
|
|
9
|
+
description: "Published when a new attribute definition is synced/created"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "attribute-updated",
|
|
13
|
+
name: "Attribute Updated",
|
|
14
|
+
description: "Published when an attribute definition is synced/updated"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
export * from "./types";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./attribute-created/types";
|
|
2
|
+
export * from "./attribute-updated/types";
|
|
3
|
+
import type { AttributeCreatedPayload } from "./attribute-created/types";
|
|
4
|
+
import type { AttributeUpdatedPayload } from "./attribute-updated/types";
|
|
5
|
+
export type AttributesEventPayload = AttributeCreatedPayload | AttributeUpdatedPayload;
|
|
6
|
+
export type AttributesEventType = "attribute-created" | "attribute-updated";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const categoriesTopic = {
|
|
2
|
+
id: "categories",
|
|
3
|
+
name: "Categories",
|
|
4
|
+
description: "Topic for product category changes synced from the database",
|
|
5
|
+
eventTypes: [
|
|
6
|
+
{
|
|
7
|
+
id: "category-created",
|
|
8
|
+
name: "Category Created",
|
|
9
|
+
description: "Published when a new category is synced/created"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "category-updated",
|
|
13
|
+
name: "Category Updated",
|
|
14
|
+
description: "Published when a category is synced/updated"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
export * from "./types";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./category-created/types";
|
|
2
|
+
export * from "./category-updated/types";
|
|
3
|
+
import type { CategoryCreatedPayload } from "./category-created/types";
|
|
4
|
+
import type { CategoryUpdatedPayload } from "./category-updated/types";
|
|
5
|
+
export type CategoriesEventPayload = CategoryCreatedPayload | CategoryUpdatedPayload;
|
|
6
|
+
export type CategoriesEventType = "category-created" | "category-updated";
|
|
@@ -3,7 +3,7 @@ import type { TopicEvent } from "../../../types";
|
|
|
3
3
|
* Payload for print-completed event
|
|
4
4
|
*/
|
|
5
5
|
export interface PrintCompletedPayload {
|
|
6
|
-
type: "image" | "html" | "
|
|
6
|
+
type: "image" | "html" | "receipt";
|
|
7
7
|
orderId?: string;
|
|
8
8
|
globalBlockId?: string;
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import type { TopicEvent } from "../../../types";
|
|
|
3
3
|
* Payload for print-error event
|
|
4
4
|
*/
|
|
5
5
|
export interface PrintErrorPayload {
|
|
6
|
-
type: "image" | "html" | "
|
|
6
|
+
type: "image" | "html" | "receipt";
|
|
7
7
|
error: string;
|
|
8
8
|
orderId?: string;
|
|
9
9
|
globalBlockId?: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Payments Topic Definition
|
|
3
|
+
* Defines the split-payments topic and its available event types.
|
|
4
|
+
*
|
|
5
|
+
* This topic mirrors render's `activeEntities.splitPayment` Redux slice. The
|
|
6
|
+
* host (render) publishes the full current `CFSplitPayment` (or `null` when
|
|
7
|
+
* reset) on every mutation and on the command-frame handshake so consumers
|
|
8
|
+
* stay in sync without owning the underlying state.
|
|
9
|
+
*/
|
|
10
|
+
import type { TopicDefinition } from "../../types";
|
|
11
|
+
export declare const splitPaymentsTopic: TopicDefinition;
|
|
12
|
+
export * from "./types";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Payments Topic Definition
|
|
3
|
+
* Defines the split-payments topic and its available event types.
|
|
4
|
+
*
|
|
5
|
+
* This topic mirrors render's `activeEntities.splitPayment` Redux slice. The
|
|
6
|
+
* host (render) publishes the full current `CFSplitPayment` (or `null` when
|
|
7
|
+
* reset) on every mutation and on the command-frame handshake so consumers
|
|
8
|
+
* stay in sync without owning the underlying state.
|
|
9
|
+
*/
|
|
10
|
+
export const splitPaymentsTopic = {
|
|
11
|
+
id: "split-payments",
|
|
12
|
+
name: "Split Payments",
|
|
13
|
+
description: "Topic for in-progress split-payment session updates",
|
|
14
|
+
eventTypes: [
|
|
15
|
+
{
|
|
16
|
+
id: "split-payment-updated",
|
|
17
|
+
name: "Split Payment Updated",
|
|
18
|
+
description: "Published whenever the host's split-payment slice mutates (partial added, reset, etc.); payload carries the full current slice or null."
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
export * from "./types";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CFSplitPayment } from "../../../../CommonTypes";
|
|
2
|
+
import type { TopicEvent } from "../../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Payload for split-payment-updated event.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors the host's full split-payment slice. When no split-payment session is
|
|
7
|
+
* active (initial state or after `resetSplitPayment`) the host publishes
|
|
8
|
+
* `{ splitPayment: null }` so subscribers can clear their mirror.
|
|
9
|
+
*/
|
|
10
|
+
export interface SplitPaymentUpdatedPayload {
|
|
11
|
+
splitPayment: CFSplitPayment | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Typed event for split-payment-updated.
|
|
15
|
+
*/
|
|
16
|
+
export type SplitPaymentUpdatedEvent = TopicEvent<SplitPaymentUpdatedPayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|