@final-commerce/command-frame 0.3.2-preprod.1 → 0.4.1-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.
Files changed (36) hide show
  1. package/README.md +47 -50
  2. package/dist/actions/apply-transition/mock.d.ts +1 -1
  3. package/dist/actions/apply-transition/mock.js +8 -18
  4. package/dist/actions/apply-transition/types.d.ts +6 -4
  5. package/dist/actions/extension-payment/types.d.ts +2 -2
  6. package/dist/actions/get-available-transitions/mock.d.ts +5 -3
  7. package/dist/actions/get-available-transitions/mock.js +24 -12
  8. package/dist/actions/get-refund-plan/action.d.ts +6 -0
  9. package/dist/actions/get-refund-plan/action.js +8 -0
  10. package/dist/actions/get-refund-plan/mock.d.ts +14 -0
  11. package/dist/actions/get-refund-plan/mock.js +59 -0
  12. package/dist/actions/get-refund-plan/types.d.ts +32 -0
  13. package/dist/actions/get-refund-plan/types.js +7 -0
  14. package/dist/actions/integration-payment/types.d.ts +2 -0
  15. package/dist/actions/partial-payment/types.d.ts +2 -2
  16. package/dist/actions/process-partial-refund/mock.js +9 -1
  17. package/dist/actions/process-partial-refund/types.d.ts +99 -1
  18. package/dist/actions/redeem-payment/types.d.ts +2 -0
  19. package/dist/actions/redeem-refund/action.d.ts +6 -0
  20. package/dist/actions/redeem-refund/action.js +8 -0
  21. package/dist/actions/redeem-refund/mock.d.ts +2 -0
  22. package/dist/actions/redeem-refund/mock.js +59 -0
  23. package/dist/actions/redeem-refund/types.d.ts +39 -0
  24. package/dist/actions/redeem-refund/types.js +2 -0
  25. package/dist/actions/terminal-payment/types.d.ts +3 -3
  26. package/dist/demo/database.d.ts +2 -2
  27. package/dist/demo/database.js +271 -264
  28. package/dist/index.d.ts +4 -0
  29. package/dist/index.js +4 -0
  30. package/dist/projects/render/mocks.js +6 -0
  31. package/dist/projects/render/types.d.ts +4 -1
  32. package/dist/pubsub/topics/orders/index.d.ts +2 -2
  33. package/dist/pubsub/topics/orders/index.js +27 -27
  34. package/dist/pubsub/topics/orders/types.d.ts +15 -15
  35. package/dist/pubsub/topics/orders/types.js +7 -7
  36. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -80,6 +80,8 @@ export declare const command: {
80
80
  readonly calculateRefundTotal: import(".").CalculateRefundTotal;
81
81
  readonly getRemainingRefundableQuantities: import(".").GetRemainingRefundableQuantities;
82
82
  readonly processPartialRefund: import(".").ProcessPartialRefund;
83
+ readonly redeemRefund: import(".").RedeemRefund;
84
+ readonly getRefundPlan: import(".").GetRefundPlan;
83
85
  readonly addProduct: import(".").AddProduct;
84
86
  readonly editProduct: import(".").EditProduct;
85
87
  readonly editProductVariants: import(".").EditProductVariants;
@@ -138,6 +140,8 @@ export type { ResetRefundDetails, ResetRefundDetailsResponse } from './actions/r
138
140
  export type { CalculateRefundTotal, CalculateRefundTotalParams, CalculateRefundTotalResponse, } from './actions/calculate-refund-total/types';
139
141
  export type { GetRemainingRefundableQuantities, GetRemainingRefundableQuantitiesParams, GetRemainingRefundableQuantitiesResponse, } from './actions/get-remaining-refundable-quantities/types';
140
142
  export type { ProcessPartialRefund, ProcessPartialRefundParams, ProcessPartialRefundResponse, } from './actions/process-partial-refund/types';
143
+ export type { RedeemRefund, RedeemRefundParams, RedeemRefundResponse } from './actions/redeem-refund/types';
144
+ export type { GetRefundPlan, GetRefundPlanParams, GetRefundPlanResponse, RefundPlanSource, } from './actions/get-refund-plan/types';
141
145
  export type { InitiateRefund, InitiateRefundParams, InitiateRefundResponse } from './actions/initiate-refund/types';
142
146
  export type { OpenExtensionOverlay, OpenExtensionOverlayParams, OpenExtensionOverlayResponse, } from './actions/open-extension-overlay/types';
143
147
  export type { ResolveExtensionOverlay, ResolveExtensionOverlayParams, ResolveExtensionOverlayResponse, } from './actions/resolve-extension-overlay/types';
package/dist/index.js CHANGED
@@ -87,6 +87,8 @@ import { resetRefundDetails } from './actions/reset-refund-details/action';
87
87
  import { calculateRefundTotal } from './actions/calculate-refund-total/action';
88
88
  import { getRemainingRefundableQuantities } from './actions/get-remaining-refundable-quantities/action';
89
89
  import { processPartialRefund } from './actions/process-partial-refund/action';
90
+ import { redeemRefund } from './actions/redeem-refund/action';
91
+ import { getRefundPlan } from './actions/get-refund-plan/action';
90
92
  // Custom Tables Actions
91
93
  import { getCustomTables } from './actions/get-custom-tables/action';
92
94
  import { getCustomTableFields } from './actions/get-custom-table-fields/action';
@@ -217,6 +219,8 @@ export const command = {
217
219
  calculateRefundTotal,
218
220
  getRemainingRefundableQuantities,
219
221
  processPartialRefund,
222
+ redeemRefund,
223
+ getRefundPlan,
220
224
  // Product CRUD Actions
221
225
  addProduct,
222
226
  editProduct,
@@ -50,6 +50,8 @@ import { mockOpenCashDrawer } from '../../actions/open-cash-drawer/mock';
50
50
  import { mockParkOrder } from '../../actions/park-order/mock';
51
51
  import { mockPartialPayment } from '../../actions/partial-payment/mock';
52
52
  import { mockProcessPartialRefund } from '../../actions/process-partial-refund/mock';
53
+ import { mockRedeemRefund } from '../../actions/redeem-refund/mock';
54
+ import { mockGetRefundPlan } from '../../actions/get-refund-plan/mock';
53
55
  import { mockRemoveCustomerFromCart } from '../../actions/remove-customer-from-cart/mock';
54
56
  import { mockResetRefundDetails } from '../../actions/reset-refund-details/mock';
55
57
  import { mockResumeParkedOrder } from '../../actions/resume-parked-order/mock';
@@ -92,6 +94,7 @@ import { mockSetActiveUser } from '../../actions/set-active-user/mock';
92
94
  import { mockSetActiveRefund } from '../../actions/set-active-refund/mock';
93
95
  import { canTransitionMock } from '../../actions/can-transition/mock';
94
96
  import { getAvailableTransitionsMock } from '../../actions/get-available-transitions/mock';
97
+ import { applyTransitionMock } from '../../actions/apply-transition/mock';
95
98
  import { mockGetSmartGridLayout } from '../../actions/get-smart-grid-layout/mock';
96
99
  import { mockSaveSmartGridLayout } from '../../actions/save-smart-grid-layout/mock';
97
100
  import { mockSendEmail } from '../../actions/send-email/mock';
@@ -143,6 +146,8 @@ export const RENDER_MOCKS = {
143
146
  parkOrder: mockParkOrder,
144
147
  partialPayment: mockPartialPayment,
145
148
  processPartialRefund: mockProcessPartialRefund,
149
+ redeemRefund: mockRedeemRefund,
150
+ getRefundPlan: mockGetRefundPlan,
146
151
  removeCustomerFromCart: mockRemoveCustomerFromCart,
147
152
  removeCartDiscount: mockRemoveCartDiscount,
148
153
  resetRefundDetails: mockResetRefundDetails,
@@ -193,6 +198,7 @@ export const RENDER_MOCKS = {
193
198
  removeNonRevenueItem: (params) => Promise.resolve({ success: true, externalId: params.externalId, timestamp: new Date().toISOString() }),
194
199
  canTransition: canTransitionMock,
195
200
  getAvailableTransitions: getAvailableTransitionsMock,
201
+ applyTransition: applyTransitionMock,
196
202
  getSmartGridLayout: mockGetSmartGridLayout,
197
203
  saveSmartGridLayout: mockSaveSmartGridLayout,
198
204
  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, RedeemRefund, GetRefundPlan, 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 {
@@ -64,6 +64,8 @@ export interface RenderProviderActions {
64
64
  calculateRefundTotal: CalculateRefundTotal;
65
65
  getRemainingRefundableQuantities: GetRemainingRefundableQuantities;
66
66
  processPartialRefund: ProcessPartialRefund;
67
+ redeemRefund: RedeemRefund;
68
+ getRefundPlan: GetRefundPlan;
67
69
  getCurrentCart: GetCurrentCart;
68
70
  print: Print;
69
71
  setActiveOrder: SetActiveOrder;
@@ -98,6 +100,7 @@ export interface RenderProviderActions {
98
100
  removeNonRevenueItem: RemoveNonRevenueItem;
99
101
  canTransition: CanTransition;
100
102
  getAvailableTransitions: GetAvailableTransitions;
103
+ applyTransition: ApplyTransition;
101
104
  getSmartGridLayout: GetSmartGridLayout;
102
105
  saveSmartGridLayout: SaveSmartGridLayout;
103
106
  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 "../../types";
5
+ import type { TopicDefinition } from '../../types';
6
6
  export declare const ordersTopic: TopicDefinition;
7
- export * from "./types";
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: "orders",
7
- name: "Orders",
8
- description: "Topic for order-related events",
6
+ id: 'orders',
7
+ name: 'Orders',
8
+ description: 'Topic for order-related events',
9
9
  eventTypes: [
10
10
  {
11
- id: "order-created",
12
- name: "Order Created",
13
- description: "Published when a new order is created"
11
+ id: 'order-created',
12
+ name: 'Order Created',
13
+ description: 'Published when a new order is created',
14
14
  },
15
15
  {
16
- id: "order-updated",
17
- name: "Order Updated",
18
- description: "Published when an order is updated"
16
+ id: 'order-updated',
17
+ name: 'Order Updated',
18
+ description: 'Published when an order is updated',
19
19
  },
20
20
  {
21
- id: "set-active-order",
22
- name: "Set Active Order",
23
- description: "Published when the active order is set in POS state"
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: "get-active-order",
27
- name: "Get Active Order",
28
- description: "Published when the active order is retrieved for listeners"
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: "state-transition-completed",
32
- name: "State Transition Completed",
33
- description: "Published when an order state transition completes successfully"
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: "state-transition-blocked",
37
- name: "State Transition Blocked",
38
- description: "Published when an order state transition is blocked by the state machine"
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: "order-voided",
42
- name: "Order Voided",
43
- description: "Published when an open order is voided (pure void, or captured legs refunded)"
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 "./types";
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 "./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";
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 = "order-created" | "order-updated" | "order-voided" | "set-active-order" | "get-active-order" | "state-transition-completed" | "state-transition-blocked";
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 "./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";
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.3.2-preprod.1",
3
+ "version": "0.4.1-preprod.1",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",