@final-commerce/command-frame 0.3.2-preprod.1 → 0.4.0-preprod.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/README.md +37 -29
- package/dist/actions/apply-transition/mock.d.ts +1 -1
- package/dist/actions/apply-transition/mock.js +8 -18
- package/dist/actions/apply-transition/types.d.ts +6 -4
- package/dist/actions/extension-payment/types.d.ts +2 -2
- package/dist/actions/get-available-transitions/mock.d.ts +5 -3
- package/dist/actions/get-available-transitions/mock.js +24 -12
- package/dist/actions/integration-payment/types.d.ts +2 -0
- package/dist/actions/partial-payment/types.d.ts +2 -2
- package/dist/actions/redeem-payment/types.d.ts +2 -0
- package/dist/actions/terminal-payment/types.d.ts +3 -3
- package/dist/demo/database.d.ts +2 -2
- package/dist/demo/database.js +271 -264
- package/dist/projects/render/mocks.js +2 -0
- package/dist/projects/render/types.d.ts +2 -1
- package/dist/pubsub/topics/orders/index.d.ts +2 -2
- package/dist/pubsub/topics/orders/index.js +27 -27
- package/dist/pubsub/topics/orders/types.d.ts +15 -15
- package/dist/pubsub/topics/orders/types.js +7 -7
- package/package.json +1 -1
|
@@ -92,6 +92,7 @@ import { mockSetActiveUser } from '../../actions/set-active-user/mock';
|
|
|
92
92
|
import { mockSetActiveRefund } from '../../actions/set-active-refund/mock';
|
|
93
93
|
import { canTransitionMock } from '../../actions/can-transition/mock';
|
|
94
94
|
import { getAvailableTransitionsMock } from '../../actions/get-available-transitions/mock';
|
|
95
|
+
import { applyTransitionMock } from '../../actions/apply-transition/mock';
|
|
95
96
|
import { mockGetSmartGridLayout } from '../../actions/get-smart-grid-layout/mock';
|
|
96
97
|
import { mockSaveSmartGridLayout } from '../../actions/save-smart-grid-layout/mock';
|
|
97
98
|
import { mockSendEmail } from '../../actions/send-email/mock';
|
|
@@ -193,6 +194,7 @@ export const RENDER_MOCKS = {
|
|
|
193
194
|
removeNonRevenueItem: (params) => Promise.resolve({ success: true, externalId: params.externalId, timestamp: new Date().toISOString() }),
|
|
194
195
|
canTransition: canTransitionMock,
|
|
195
196
|
getAvailableTransitions: getAvailableTransitionsMock,
|
|
197
|
+
applyTransition: applyTransitionMock,
|
|
196
198
|
getSmartGridLayout: mockGetSmartGridLayout,
|
|
197
199
|
saveSmartGridLayout: mockSaveSmartGridLayout,
|
|
198
200
|
sendEmail: mockSendEmail,
|
|
@@ -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, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, VoidOrder, InitiateRefund, CashPayment, GetCashRoundingAmount, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, 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, GetActiveStation, GetActiveSession, GetActiveUser, SetActiveUser, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem, CanTransition, GetAvailableTransitions, IntegrationPayment, GetSmartGridLayout, SaveSmartGridLayout, SendEmail, SendSms } from '../../index';
|
|
1
|
+
import type { ExampleFunction, GetProducts, AddCustomSale, EditCustomSale, 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, VoidOrder, InitiateRefund, CashPayment, GetCashRoundingAmount, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, 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, GetActiveStation, GetActiveSession, GetActiveUser, SetActiveUser, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem, CanTransition, GetAvailableTransitions, ApplyTransition, IntegrationPayment, GetSmartGridLayout, SaveSmartGridLayout, SendEmail, SendSms } from '../../index';
|
|
2
2
|
import type { OpenExtensionOverlay } from '../../actions/open-extension-overlay/types';
|
|
3
3
|
import type { ResolveExtensionOverlay } from '../../actions/resolve-extension-overlay/types';
|
|
4
4
|
export interface RenderProviderActions {
|
|
@@ -98,6 +98,7 @@ export interface RenderProviderActions {
|
|
|
98
98
|
removeNonRevenueItem: RemoveNonRevenueItem;
|
|
99
99
|
canTransition: CanTransition;
|
|
100
100
|
getAvailableTransitions: GetAvailableTransitions;
|
|
101
|
+
applyTransition: ApplyTransition;
|
|
101
102
|
getSmartGridLayout: GetSmartGridLayout;
|
|
102
103
|
saveSmartGridLayout: SaveSmartGridLayout;
|
|
103
104
|
sendEmail: SendEmail;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Orders Topic Definition
|
|
3
3
|
* Defines the orders topic and its available event types
|
|
4
4
|
*/
|
|
5
|
-
import type { TopicDefinition } from
|
|
5
|
+
import type { TopicDefinition } from '../../types';
|
|
6
6
|
export declare const ordersTopic: TopicDefinition;
|
|
7
|
-
export * from
|
|
7
|
+
export * from './types';
|
|
@@ -3,46 +3,46 @@
|
|
|
3
3
|
* Defines the orders topic and its available event types
|
|
4
4
|
*/
|
|
5
5
|
export const ordersTopic = {
|
|
6
|
-
id:
|
|
7
|
-
name:
|
|
8
|
-
description:
|
|
6
|
+
id: 'orders',
|
|
7
|
+
name: 'Orders',
|
|
8
|
+
description: 'Topic for order-related events',
|
|
9
9
|
eventTypes: [
|
|
10
10
|
{
|
|
11
|
-
id:
|
|
12
|
-
name:
|
|
13
|
-
description:
|
|
11
|
+
id: 'order-created',
|
|
12
|
+
name: 'Order Created',
|
|
13
|
+
description: 'Published when a new order is created',
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
id:
|
|
17
|
-
name:
|
|
18
|
-
description:
|
|
16
|
+
id: 'order-updated',
|
|
17
|
+
name: 'Order Updated',
|
|
18
|
+
description: 'Published when an order is updated',
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
id:
|
|
22
|
-
name:
|
|
23
|
-
description:
|
|
21
|
+
id: 'set-active-order',
|
|
22
|
+
name: 'Set Active Order',
|
|
23
|
+
description: 'Published when the active order is set in POS state',
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
id:
|
|
27
|
-
name:
|
|
28
|
-
description:
|
|
26
|
+
id: 'get-active-order',
|
|
27
|
+
name: 'Get Active Order',
|
|
28
|
+
description: 'Published when the active order is retrieved for listeners',
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
id:
|
|
32
|
-
name:
|
|
33
|
-
description:
|
|
31
|
+
id: 'state-transition-completed',
|
|
32
|
+
name: 'State Transition Completed',
|
|
33
|
+
description: 'Published when an order state transition completes successfully',
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
id:
|
|
37
|
-
name:
|
|
38
|
-
description:
|
|
36
|
+
id: 'state-transition-blocked',
|
|
37
|
+
name: 'State Transition Blocked',
|
|
38
|
+
description: 'Published when an order state transition is blocked by the state machine',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
id:
|
|
42
|
-
name:
|
|
43
|
-
description:
|
|
44
|
-
}
|
|
45
|
-
]
|
|
41
|
+
id: 'order-voided',
|
|
42
|
+
name: 'Order Voided',
|
|
43
|
+
description: 'Published when an open order is voided (pure void, or captured legs refunded)',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
46
|
};
|
|
47
47
|
// Re-export types
|
|
48
|
-
export * from
|
|
48
|
+
export * from './types';
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* Orders Topic Types
|
|
3
3
|
* Aggregated types for all order-related events
|
|
4
4
|
*/
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
import type { OrderCreatedPayload } from
|
|
13
|
-
import type { OrderUpdatedPayload } from
|
|
14
|
-
import type { OrderVoidedPayload } from
|
|
15
|
-
import type { OrderActiveSetPayload } from
|
|
16
|
-
import type { OrderActiveGetPayload } from
|
|
17
|
-
import type { OrderStateTransitionCompletedPayload } from
|
|
18
|
-
import type { OrderStateTransitionBlockedPayload } from
|
|
5
|
+
export * from './order-created/types';
|
|
6
|
+
export * from './order-updated/types';
|
|
7
|
+
export * from './order-voided/types';
|
|
8
|
+
export * from './set-active-order/types';
|
|
9
|
+
export * from './get-active-order/types';
|
|
10
|
+
export * from './state-transition-completed/types';
|
|
11
|
+
export * from './state-transition-blocked/types';
|
|
12
|
+
import type { OrderCreatedPayload } from './order-created/types';
|
|
13
|
+
import type { OrderUpdatedPayload } from './order-updated/types';
|
|
14
|
+
import type { OrderVoidedPayload } from './order-voided/types';
|
|
15
|
+
import type { OrderActiveSetPayload } from './set-active-order/types';
|
|
16
|
+
import type { OrderActiveGetPayload } from './get-active-order/types';
|
|
17
|
+
import type { OrderStateTransitionCompletedPayload } from './state-transition-completed/types';
|
|
18
|
+
import type { OrderStateTransitionBlockedPayload } from './state-transition-blocked/types';
|
|
19
19
|
export type OrdersEventPayload = OrderCreatedPayload | OrderUpdatedPayload | OrderVoidedPayload | OrderActiveSetPayload | OrderActiveGetPayload | OrderStateTransitionCompletedPayload | OrderStateTransitionBlockedPayload;
|
|
20
|
-
export type OrdersEventType =
|
|
20
|
+
export type OrdersEventType = 'order-created' | 'order-updated' | 'order-voided' | 'set-active-order' | 'get-active-order' | 'state-transition-completed' | 'state-transition-blocked';
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Aggregated types for all order-related events
|
|
4
4
|
*/
|
|
5
5
|
// Re-export all event types
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
6
|
+
export * from './order-created/types';
|
|
7
|
+
export * from './order-updated/types';
|
|
8
|
+
export * from './order-voided/types';
|
|
9
|
+
export * from './set-active-order/types';
|
|
10
|
+
export * from './get-active-order/types';
|
|
11
|
+
export * from './state-transition-completed/types';
|
|
12
|
+
export * from './state-transition-blocked/types';
|