@final-commerce/command-frame 0.8.1-online.1 → 0.9.0-preprod.2

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 (111) hide show
  1. package/dist/CommonTypes.d.ts +4 -15
  2. package/dist/actions/adjust-inventory/mock.js +20 -0
  3. package/dist/actions/adjust-inventory/types.d.ts +13 -0
  4. package/dist/actions/adjust-inventory/types.js +1 -0
  5. package/dist/actions/assign-order-user/action.d.ts +6 -0
  6. package/dist/actions/assign-order-user/action.js +8 -0
  7. package/dist/actions/assign-order-user/mock.d.ts +2 -0
  8. package/dist/actions/assign-order-user/mock.js +30 -0
  9. package/dist/actions/assign-order-user/types.d.ts +15 -0
  10. package/dist/actions/get-custom-stock-actions/action.d.ts +5 -0
  11. package/dist/actions/get-custom-stock-actions/action.js +7 -0
  12. package/dist/actions/get-custom-stock-actions/mock.d.ts +2 -0
  13. package/dist/actions/get-custom-stock-actions/mock.js +11 -0
  14. package/dist/actions/get-custom-stock-actions/types.d.ts +12 -0
  15. package/dist/actions/get-custom-stock-actions/types.js +2 -0
  16. package/dist/actions/get-order-statuses/action.d.ts +6 -0
  17. package/dist/actions/get-order-statuses/action.js +8 -0
  18. package/dist/actions/get-order-statuses/mock.d.ts +2 -0
  19. package/dist/actions/get-order-statuses/mock.js +5 -0
  20. package/dist/actions/get-order-statuses/types.d.ts +8 -0
  21. package/dist/actions/get-orders/action.d.ts +1 -1
  22. package/dist/actions/get-orders/action.js +2 -2
  23. package/dist/actions/get-orders/mock.d.ts +1 -1
  24. package/dist/actions/get-orders/mock.js +49 -19
  25. package/dist/actions/get-orders/types.d.ts +21 -1
  26. package/dist/actions/get-outlets/action.js +2 -2
  27. package/dist/actions/get-outlets/mock.d.ts +0 -12
  28. package/dist/actions/get-outlets/mock.js +4 -28
  29. package/dist/actions/get-outlets/types.d.ts +1 -19
  30. package/dist/actions/record-external-payment/action.d.ts +6 -0
  31. package/dist/actions/record-external-payment/action.js +8 -0
  32. package/dist/actions/record-external-payment/mock.d.ts +2 -0
  33. package/dist/actions/record-external-payment/mock.js +36 -0
  34. package/dist/actions/record-external-payment/types.d.ts +37 -0
  35. package/dist/actions/release-from-cart/action.d.ts +6 -0
  36. package/dist/actions/release-from-cart/action.js +8 -0
  37. package/dist/actions/release-from-cart/mock.d.ts +2 -0
  38. package/dist/actions/release-from-cart/mock.js +26 -0
  39. package/dist/actions/release-from-cart/types.d.ts +8 -0
  40. package/dist/actions/release-from-cart/types.js +1 -0
  41. package/dist/actions/resume-order/action.d.ts +6 -0
  42. package/dist/actions/resume-order/action.js +8 -0
  43. package/dist/actions/resume-order/mock.d.ts +2 -0
  44. package/dist/actions/resume-order/mock.js +55 -0
  45. package/dist/actions/resume-order/types.d.ts +17 -0
  46. package/dist/actions/resume-order/types.js +1 -0
  47. package/dist/actions/resume-parked-order/mock.d.ts +6 -1
  48. package/dist/actions/resume-parked-order/mock.js +32 -31
  49. package/dist/actions/set-order-metadata/action.d.ts +6 -0
  50. package/dist/actions/set-order-metadata/action.js +8 -0
  51. package/dist/actions/set-order-metadata/mock.d.ts +5 -0
  52. package/dist/actions/set-order-metadata/mock.js +38 -0
  53. package/dist/actions/set-order-metadata/types.d.ts +20 -0
  54. package/dist/actions/set-order-metadata/types.js +1 -0
  55. package/dist/actions/set-order-status/action.d.ts +6 -0
  56. package/dist/actions/set-order-status/action.js +8 -0
  57. package/dist/actions/set-order-status/mock.d.ts +3 -0
  58. package/dist/actions/set-order-status/mock.js +39 -0
  59. package/dist/actions/set-order-status/types.d.ts +20 -0
  60. package/dist/actions/set-order-status/types.js +1 -0
  61. package/dist/actions/set-order-type/action.d.ts +6 -0
  62. package/dist/actions/set-order-type/action.js +8 -0
  63. package/dist/actions/set-order-type/mock.d.ts +3 -0
  64. package/dist/actions/set-order-type/mock.js +27 -0
  65. package/dist/actions/set-order-type/types.d.ts +17 -0
  66. package/dist/actions/set-order-type/types.js +1 -0
  67. package/dist/common-types/order-state.d.ts +15 -1
  68. package/dist/demo/database.d.ts +4 -0
  69. package/dist/demo/database.js +11 -0
  70. package/dist/index.d.ts +20 -12
  71. package/dist/index.js +18 -9
  72. package/dist/projects/render/mocks.js +18 -10
  73. package/dist/projects/render/types.d.ts +10 -16
  74. package/dist/pubsub/topics/index.d.ts +17 -18
  75. package/dist/pubsub/topics/index.js +17 -18
  76. package/dist/pubsub/topics/types.d.ts +0 -8
  77. package/package.json +2 -2
  78. package/dist/actions/attach-checkout-contact/action.d.ts +0 -6
  79. package/dist/actions/attach-checkout-contact/action.js +0 -8
  80. package/dist/actions/attach-checkout-contact/mock.d.ts +0 -15
  81. package/dist/actions/attach-checkout-contact/mock.js +0 -22
  82. package/dist/actions/attach-checkout-contact/types.d.ts +0 -35
  83. package/dist/actions/attach-checkout-contact/types.js +0 -16
  84. package/dist/actions/resume-checkout/action.d.ts +0 -6
  85. package/dist/actions/resume-checkout/action.js +0 -8
  86. package/dist/actions/resume-checkout/mock.d.ts +0 -16
  87. package/dist/actions/resume-checkout/mock.js +0 -51
  88. package/dist/actions/resume-checkout/types.d.ts +0 -59
  89. package/dist/actions/resume-checkout/types.js +0 -13
  90. package/dist/actions/set-outlet/action.d.ts +0 -6
  91. package/dist/actions/set-outlet/action.js +0 -8
  92. package/dist/actions/set-outlet/mock.d.ts +0 -13
  93. package/dist/actions/set-outlet/mock.js +0 -24
  94. package/dist/actions/set-outlet/types.d.ts +0 -31
  95. package/dist/actions/set-outlet/types.js +0 -21
  96. package/dist/actions/start-checkout/action.d.ts +0 -6
  97. package/dist/actions/start-checkout/action.js +0 -8
  98. package/dist/actions/start-checkout/mock.d.ts +0 -16
  99. package/dist/actions/start-checkout/mock.js +0 -80
  100. package/dist/actions/start-checkout/types.d.ts +0 -90
  101. package/dist/actions/start-checkout/types.js +0 -10
  102. package/dist/pubsub/topics/checkout/checkout-started/types.d.ts +0 -26
  103. package/dist/pubsub/topics/checkout/index.d.ts +0 -7
  104. package/dist/pubsub/topics/checkout/index.js +0 -28
  105. package/dist/pubsub/topics/checkout/payment-completed/types.d.ts +0 -31
  106. package/dist/pubsub/topics/checkout/payment-failed/types.d.ts +0 -20
  107. package/dist/pubsub/topics/checkout/types.d.ts +0 -12
  108. package/dist/pubsub/topics/checkout/types.js +0 -8
  109. /package/dist/{pubsub/topics/checkout/checkout-started → actions/assign-order-user}/types.js +0 -0
  110. /package/dist/{pubsub/topics/checkout/payment-completed → actions/get-order-statuses}/types.js +0 -0
  111. /package/dist/{pubsub/topics/checkout/payment-failed → actions/record-external-payment}/types.js +0 -0
package/dist/index.d.ts CHANGED
@@ -35,15 +35,24 @@ export declare const command: {
35
35
  readonly getActiveProduct: import(".").GetActiveProduct;
36
36
  readonly setActiveProduct: import(".").SetActiveProduct;
37
37
  readonly adjustInventory: import(".").AdjustInventory;
38
+ readonly getCustomStockActions: import(".").GetCustomStockActions;
38
39
  readonly addOrderNote: import(".").AddOrderNote;
39
40
  readonly addCartFee: import(".").AddCartFee;
40
41
  readonly getCurrentCart: import(".").GetCurrentCart;
41
42
  readonly clearCart: import(".").ClearCart;
42
43
  readonly parkOrder: import(".").ParkOrder;
43
44
  readonly resumeParkedOrder: import(".").ResumeParkedOrder;
45
+ readonly resumeOrder: import(".").ResumeOrder;
46
+ readonly setOrderMetadata: import(".").SetOrderMetadata;
47
+ readonly assignOrderUser: import(".").AssignOrderUser;
48
+ readonly releaseFromCart: import(".").ReleaseFromCart;
49
+ readonly setOrderType: import(".").SetOrderType;
50
+ readonly setOrderStatus: import(".").SetOrderStatus;
51
+ readonly getOrderStatuses: import(".").GetOrderStatuses;
44
52
  readonly deleteParkedOrder: import(".").DeleteParkedOrder;
45
53
  readonly voidOrder: import(".").VoidOrder;
46
54
  readonly cashPayment: import(".").CashPayment;
55
+ readonly recordExternalPayment: import(".").RecordExternalPayment;
47
56
  readonly getCashRoundingAmount: import(".").GetCashRoundingAmount;
48
57
  readonly tapToPayPayment: import(".").TapToPayPayment;
49
58
  readonly terminalPayment: import(".").TerminalPayment;
@@ -52,10 +61,6 @@ export declare const command: {
52
61
  readonly integrationPayment: import(".").IntegrationPayment;
53
62
  readonly createPaymentLink: import(".").CreatePaymentLink;
54
63
  readonly chargeMoto: import(".").ChargeMoto;
55
- readonly startCheckout: import(".").StartCheckout;
56
- readonly attachCheckoutContact: import(".").AttachCheckoutContact;
57
- readonly setOutlet: import(".").SetOutlet;
58
- readonly resumeCheckout: import(".").ResumeCheckout;
59
64
  readonly addCustomerNote: import(".").AddCustomerNote;
60
65
  readonly removeCustomerNote: import(".").RemoveCustomerNote;
61
66
  readonly removeCustomerFromCart: import(".").RemoveCustomerFromCart;
@@ -151,7 +156,7 @@ export type { AddProduct, AddProductParams, AddProductResponse } from './actions
151
156
  export type { EditProduct, EditProductParams, EditProductResponse } from './actions/edit-product/types';
152
157
  export type { EditProductVariants, EditProductVariantsParams, EditProductVariantsResponse, } from './actions/edit-product-variants/types';
153
158
  export type { DeleteProduct, DeleteProductParams, DeleteProductResponse } from './actions/delete-product/types';
154
- export type { GetOutlets, GetOutletsParams, GetOutletsResponse } from './actions/get-outlets/types';
159
+ export type { GetOutlets, GetOutletsResponse } from './actions/get-outlets/types';
155
160
  export type { GetStations, GetStationsParams, GetStationsResponse } from './actions/get-stations/types';
156
161
  export type { GetSmartGridLayout, GetSmartGridLayoutParams, GetSmartGridLayoutResponse, } from './actions/get-smart-grid-layout/types';
157
162
  export type { SaveSmartGridLayout, SaveSmartGridLayoutParams, SaveSmartGridLayoutResponse, } from './actions/save-smart-grid-layout/types';
@@ -183,15 +188,24 @@ export type { SetActiveProductFee, SetActiveProductFeeParams, SetActiveProductFe
183
188
  export type { SetActiveProductDiscount, SetActiveProductDiscountParams, SetActiveProductDiscountResponse, } from './actions/set-active-product-discount/types';
184
189
  export type { GetActiveProduct, GetActiveProductResponse } from './actions/get-active-product/types';
185
190
  export type { SetActiveProduct, SetActiveProductParams, SetActiveProductResponse, } from './actions/set-active-product/types';
186
- export type { AdjustInventory, AdjustInventoryParams, AdjustInventoryResponse } from './actions/adjust-inventory/types';
191
+ export type { AdjustInventory, AdjustInventoryParams, AdjustInventoryResponse, ManualStockReason, } from './actions/adjust-inventory/types';
192
+ export type { CustomStockActionPayload, GetCustomStockActions, GetCustomStockActionsResponse, } from './actions/get-custom-stock-actions/types';
187
193
  export type { AddOrderNote, AddOrderNoteParams, AddOrderNoteResponse } from './actions/add-order-note/types';
188
194
  export type { AddCartFee, AddCartFeeParams, AddCartFeeResponse } from './actions/add-cart-fee/types';
189
195
  export type { ClearCart, ClearCartResponse } from './actions/clear-cart/types';
190
196
  export type { ParkOrder, ParkOrderResponse } from './actions/park-order/types';
191
197
  export type { ResumeParkedOrder, ResumeParkedOrderParams, ResumeParkedOrderResponse, } from './actions/resume-parked-order/types';
198
+ export type { ResumeOrder, ResumeOrderParams, ResumeOrderResponse } from './actions/resume-order/types';
199
+ export type { SetOrderMetadata, SetOrderMetadataParams, SetOrderMetadataResponse, } from './actions/set-order-metadata/types';
200
+ export type { AssignOrderUser, AssignOrderUserParams, AssignOrderUserResponse, } from './actions/assign-order-user/types';
201
+ export type { ReleaseFromCart, ReleaseFromCartResponse } from './actions/release-from-cart/types';
202
+ export type { SetOrderType, SetOrderTypeParams, SetOrderTypeResponse } from './actions/set-order-type/types';
203
+ export type { SetOrderStatus, SetOrderStatusParams, SetOrderStatusResponse } from './actions/set-order-status/types';
204
+ export type { GetOrderStatuses, GetOrderStatusesResponse } from './actions/get-order-statuses/types';
192
205
  export type { DeleteParkedOrder, DeleteParkedOrderParams, DeleteParkedOrderResponse, } from './actions/delete-parked-order/types';
193
206
  export type { VoidOrder, VoidOrderParams, VoidOrderResponse, VoidOrderOutcome } from './actions/void-order/types';
194
207
  export type { CashPayment, CashPaymentParams, CashPaymentResponse } from './actions/cash-payment/types';
208
+ export type { RecordExternalPayment, RecordExternalPaymentParams, RecordExternalPaymentResponse, } from './actions/record-external-payment/types';
195
209
  export type { GetCashRoundingAmount, GetCashRoundingAmountParams, GetCashRoundingAmountResponse, } from './actions/get-cash-rounding-amount/types';
196
210
  export type { TapToPayPayment, TapToPayPaymentParams, TapToPayPaymentResponse, } from './actions/tap-to-pay-payment/types';
197
211
  export type { TerminalPayment, TerminalPaymentParams, TerminalPaymentResponse } from './actions/terminal-payment/types';
@@ -200,10 +214,6 @@ export type { RedeemPayment, RedeemPaymentParams, RedeemPaymentResponse } from '
200
214
  export type { IntegrationPayment, IntegrationPaymentParams, IntegrationPaymentResponse, IntegrationEmvData, } from './actions/integration-payment/types';
201
215
  export type { CreatePaymentLink, CreatePaymentLinkParams, CreatePaymentLinkResponse, } from './actions/create-payment-link/types';
202
216
  export type { ChargeMoto, ChargeMotoParams, ChargeMotoResponse, ChargeMotoCardFields, } from './actions/charge-moto/types';
203
- export type { StartCheckout, StartCheckoutParams, StartCheckoutResponse, StartCheckoutContact, StartCheckoutOrder, } from './actions/start-checkout/types';
204
- export type { AttachCheckoutContact, AttachCheckoutContactParams, AttachCheckoutContactResponse, } from './actions/attach-checkout-contact/types';
205
- export type { SetOutlet, SetOutletParams, SetOutletResponse } from './actions/set-outlet/types';
206
- export type { ResumeCheckout, ResumeCheckoutParams, ResumeCheckoutResponse, ResumeCheckoutResult, } from './actions/resume-checkout/types';
207
217
  export type { AddCustomerNote, AddCustomerNoteParams, AddCustomerNoteResponse, } from './actions/add-customer-note/types';
208
218
  export type { RemoveCustomerNote, RemoveCustomerNoteParams, RemoveCustomerNoteResponse, } from './actions/remove-customer-note/types';
209
219
  export type { RemoveCustomerFromCart, RemoveCustomerFromCartResponse } from './actions/remove-customer-from-cart/types';
@@ -260,7 +270,6 @@ export { refundsTopic } from './pubsub/topics/refunds';
260
270
  export { productsTopic } from './pubsub/topics/products';
261
271
  export { cartTopic } from './pubsub/topics/cart';
262
272
  export { paymentsTopic } from './pubsub/topics/payments';
263
- export { checkoutTopic } from './pubsub/topics/checkout';
264
273
  export { splitPaymentsTopic } from './pubsub/topics/split-payments';
265
274
  export { customTablesTopic } from './pubsub/topics/custom-tables';
266
275
  export { printTopic } from './pubsub/topics/print';
@@ -288,7 +297,6 @@ export type { CategoryCreatedPayload, CategoryCreatedEvent, CategoryUpdatedPaylo
288
297
  export type { AttributeCreatedPayload, AttributeCreatedEvent, AttributeUpdatedPayload, AttributeUpdatedEvent, AttributesEventType, AttributesEventPayload, } from './pubsub/topics/attributes/types';
289
298
  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';
290
299
  export type { PaymentDonePayload, PaymentErrPayload, PaymentDoneEvent, PaymentErrEvent, PaymentsEventType, PaymentsEventPayload, } from './pubsub/topics/payments/types';
291
- export type { CheckoutStartedPayload, PaymentCompletedPayload, PaymentFailedPayload, CheckoutStartedEvent, PaymentCompletedEvent, PaymentFailedEvent, CheckoutEventType, CheckoutEventPayload, } from './pubsub/topics/checkout/types';
292
300
  export type { SplitPaymentUpdatedPayload, SplitPaymentUpdatedEvent, SplitPaymentsEventType, SplitPaymentsEventPayload, } from './pubsub/topics/split-payments/types';
293
301
  export type { RowCreatedPayload, RowUpdatedPayload, RowDeletedPayload, RowCreatedEvent, RowUpdatedEvent, RowDeletedEvent, CustomTablesEventType, CustomTablesEventPayload, } from './pubsub/topics/custom-tables/types';
294
302
  export type { PrintStartedPayload, PrintCompletedPayload, PrintErrorPayload, PrintStartedEvent, PrintCompletedEvent, PrintErrorEvent, PrintEventType, PrintEventPayload, } from './pubsub/topics/print/types';
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ import { setActiveProductDiscount } from './actions/set-active-product-discount/
34
34
  import { getActiveProduct } from './actions/get-active-product/action';
35
35
  import { setActiveProduct } from './actions/set-active-product/action';
36
36
  import { adjustInventory } from './actions/adjust-inventory/action';
37
+ import { getCustomStockActions } from './actions/get-custom-stock-actions/action';
37
38
  // Order Actions
38
39
  import { addOrderNote } from './actions/add-order-note/action';
39
40
  import { addCartFee } from './actions/add-cart-fee/action';
@@ -41,9 +42,17 @@ import { getCurrentCart } from './actions/get-current-cart/action';
41
42
  import { clearCart } from './actions/clear-cart/action';
42
43
  import { parkOrder } from './actions/park-order/action';
43
44
  import { resumeParkedOrder } from './actions/resume-parked-order/action';
45
+ import { resumeOrder } from './actions/resume-order/action';
46
+ import { setOrderMetadata } from './actions/set-order-metadata/action';
47
+ import { assignOrderUser } from './actions/assign-order-user/action';
48
+ import { releaseFromCart } from './actions/release-from-cart/action';
49
+ import { setOrderType } from './actions/set-order-type/action';
50
+ import { setOrderStatus } from './actions/set-order-status/action';
51
+ import { getOrderStatuses } from './actions/get-order-statuses/action';
44
52
  import { deleteParkedOrder } from './actions/delete-parked-order/action';
45
53
  import { voidOrder } from './actions/void-order/action';
46
54
  import { cashPayment } from './actions/cash-payment/action';
55
+ import { recordExternalPayment } from './actions/record-external-payment/action';
47
56
  import { getCashRoundingAmount } from './actions/get-cash-rounding-amount/action';
48
57
  import { tapToPayPayment } from './actions/tap-to-pay-payment/action';
49
58
  import { terminalPayment } from './actions/terminal-payment/action';
@@ -52,10 +61,6 @@ import { redeemPayment } from './actions/redeem-payment/action';
52
61
  import { integrationPayment } from './actions/integration-payment/action';
53
62
  import { createPaymentLink } from './actions/create-payment-link/action';
54
63
  import { chargeMoto } from './actions/charge-moto/action';
55
- import { startCheckout } from './actions/start-checkout/action';
56
- import { attachCheckoutContact } from './actions/attach-checkout-contact/action';
57
- import { setOutlet } from './actions/set-outlet/action';
58
- import { resumeCheckout } from './actions/resume-checkout/action';
59
64
  // Customer Actions
60
65
  import { addCustomerNote } from './actions/add-customer-note/action';
61
66
  import { removeCustomerNote } from './actions/remove-customer-note/action';
@@ -184,6 +189,7 @@ export const command = {
184
189
  getActiveProduct,
185
190
  setActiveProduct,
186
191
  adjustInventory,
192
+ getCustomStockActions,
187
193
  // Order Actions
188
194
  addOrderNote,
189
195
  addCartFee,
@@ -191,9 +197,17 @@ export const command = {
191
197
  clearCart,
192
198
  parkOrder,
193
199
  resumeParkedOrder,
200
+ resumeOrder,
201
+ setOrderMetadata,
202
+ assignOrderUser,
203
+ releaseFromCart,
204
+ setOrderType,
205
+ setOrderStatus,
206
+ getOrderStatuses,
194
207
  deleteParkedOrder,
195
208
  voidOrder,
196
209
  cashPayment,
210
+ recordExternalPayment,
197
211
  getCashRoundingAmount,
198
212
  tapToPayPayment,
199
213
  terminalPayment,
@@ -202,10 +216,6 @@ export const command = {
202
216
  integrationPayment,
203
217
  createPaymentLink,
204
218
  chargeMoto,
205
- startCheckout,
206
- attachCheckoutContact,
207
- setOutlet,
208
- resumeCheckout,
209
219
  // Customer Actions
210
220
  addCustomerNote,
211
221
  removeCustomerNote,
@@ -316,7 +326,6 @@ export { refundsTopic } from './pubsub/topics/refunds';
316
326
  export { productsTopic } from './pubsub/topics/products';
317
327
  export { cartTopic } from './pubsub/topics/cart';
318
328
  export { paymentsTopic } from './pubsub/topics/payments';
319
- export { checkoutTopic } from './pubsub/topics/checkout';
320
329
  export { splitPaymentsTopic } from './pubsub/topics/split-payments';
321
330
  export { customTablesTopic } from './pubsub/topics/custom-tables';
322
331
  export { printTopic } from './pubsub/topics/print';
@@ -26,18 +26,15 @@ import { mockRemoveProductFromCart } from '../../actions/remove-product-from-car
26
26
  import { mockRemoveCartDiscount } from '../../actions/remove-cart-discount/mock';
27
27
  import { mockUpdateCartItemQuantity } from '../../actions/update-cart-item-quantity/mock';
28
28
  import { mockAdjustInventory } from '../../actions/adjust-inventory/mock';
29
+ import { mockGetCustomStockActions } from '../../actions/get-custom-stock-actions/mock';
29
30
  import { mockAssignCustomer } from '../../actions/assign-customer/mock';
30
31
  import { mockAuthenticateUser } from '../../actions/authenticate-user/mock';
31
32
  import { mockCalculateRefundTotal } from '../../actions/calculate-refund-total/mock';
32
33
  import { mockCashPayment } from '../../actions/cash-payment/mock';
34
+ import { mockRecordExternalPayment } from '../../actions/record-external-payment/mock';
33
35
  import { mockGetCashRoundingAmount } from '../../actions/get-cash-rounding-amount/mock';
34
36
  import { mockCreatePaymentLink } from '../../actions/create-payment-link/mock';
35
37
  import { mockChargeMoto } from '../../actions/charge-moto/mock';
36
- import { mockStartCheckout } from '../../actions/start-checkout/mock';
37
- import { mockAttachCheckoutContact } from '../../actions/attach-checkout-contact/mock';
38
- import { mockGetOutlets } from '../../actions/get-outlets/mock';
39
- import { mockSetOutlet } from '../../actions/set-outlet/mock';
40
- import { mockResumeCheckout } from '../../actions/resume-checkout/mock';
41
38
  import { mockGetTimeClockStatus } from '../../actions/get-time-clock-status/mock';
42
39
  import { mockClearCart } from '../../actions/clear-cart/mock';
43
40
  import { mockDeleteParkedOrder } from '../../actions/delete-parked-order/mock';
@@ -71,6 +68,13 @@ import { mockCheckPermission } from '../../actions/check-permission/mock';
71
68
  import { mockRemoveCustomerFromCart } from '../../actions/remove-customer-from-cart/mock';
72
69
  import { mockResetRefundDetails } from '../../actions/reset-refund-details/mock';
73
70
  import { mockResumeParkedOrder } from '../../actions/resume-parked-order/mock';
71
+ import { mockResumeOrder } from '../../actions/resume-order/mock';
72
+ import { mockSetOrderMetadata } from '../../actions/set-order-metadata/mock';
73
+ import { mockAssignOrderUser } from '../../actions/assign-order-user/mock';
74
+ import { mockReleaseFromCart } from '../../actions/release-from-cart/mock';
75
+ import { mockSetOrderType } from '../../actions/set-order-type/mock';
76
+ import { mockSetOrderStatus } from '../../actions/set-order-status/mock';
77
+ import { mockGetOrderStatuses } from '../../actions/get-order-statuses/mock';
74
78
  import { mockSelectAllRefundItems } from '../../actions/select-all-refund-items/mock';
75
79
  import { mockSetRefundStockAction } from '../../actions/set-refund-stock-action/mock';
76
80
  import { mockShowConfirmation } from '../../actions/show-confirmation/mock';
@@ -137,18 +141,15 @@ export const RENDER_MOCKS = {
137
141
  removeProductFromCart: mockRemoveProductFromCart,
138
142
  updateCartItemQuantity: mockUpdateCartItemQuantity,
139
143
  adjustInventory: mockAdjustInventory,
144
+ getCustomStockActions: mockGetCustomStockActions,
140
145
  assignCustomer: mockAssignCustomer,
141
146
  authenticateUser: mockAuthenticateUser,
142
147
  calculateRefundTotal: mockCalculateRefundTotal,
143
148
  cashPayment: mockCashPayment,
149
+ recordExternalPayment: mockRecordExternalPayment,
144
150
  getCashRoundingAmount: mockGetCashRoundingAmount,
145
151
  createPaymentLink: mockCreatePaymentLink,
146
152
  chargeMoto: mockChargeMoto,
147
- startCheckout: mockStartCheckout,
148
- attachCheckoutContact: mockAttachCheckoutContact,
149
- getOutlets: mockGetOutlets,
150
- setOutlet: mockSetOutlet,
151
- resumeCheckout: mockResumeCheckout,
152
153
  clearCart: mockClearCart,
153
154
  deleteParkedOrder: mockDeleteParkedOrder,
154
155
  voidOrder: mockVoidOrder,
@@ -182,6 +183,13 @@ export const RENDER_MOCKS = {
182
183
  removeCartDiscount: mockRemoveCartDiscount,
183
184
  resetRefundDetails: mockResetRefundDetails,
184
185
  resumeParkedOrder: mockResumeParkedOrder,
186
+ resumeOrder: mockResumeOrder,
187
+ setOrderMetadata: mockSetOrderMetadata,
188
+ assignOrderUser: mockAssignOrderUser,
189
+ releaseFromCart: mockReleaseFromCart,
190
+ setOrderType: mockSetOrderType,
191
+ setOrderStatus: mockSetOrderStatus,
192
+ getOrderStatuses: mockGetOrderStatuses,
185
193
  selectAllRefundItems: mockSelectAllRefundItems,
186
194
  setRefundStockAction: mockSetRefundStockAction,
187
195
  showConfirmation: mockShowConfirmation,
@@ -1,4 +1,4 @@
1
- import type { ExampleFunction, GetProducts, AddCustomSale, EditCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, GetTaxTables, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, GetProductModifierSelections, SetProductModifierSelections, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, VoidOrder, InitiateRefund, CashPayment, GetCashRoundingAmount, TapToPayPayment, TerminalPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, RedeemRefund, GetRefundPlan, CheckPermission, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal, GetUsers, GetRoles, RemoveCartDiscount, GetActiveOrder, GetActiveCustomer, SetActiveCustomer, GetActiveOutlet, GetActiveStation, GetActiveSession, GetActiveUser, SetActiveUser, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem, CanTransition, GetAvailableTransitions, ApplyTransition, IntegrationPayment, GetSmartGridLayout, SaveSmartGridLayout, SendEmail, SendSms, GetBookingResources, GetBookingAvailability, GetBookings, HoldBooking, AddBookingToCart, RemoveBookingFromCart, CancelBooking, CreatePaymentLink, ChargeMoto, StartCheckout, AttachCheckoutContact, GetOutlets, SetOutlet, ResumeCheckout, GetTimeClockStatus } from '../../index';
1
+ import type { ExampleFunction, GetProducts, AddCustomSale, EditCustomSale, GetCustomers, AssignCustomer, AddCustomer, EditCustomer, GetCategories, GetOrders, GetRefunds, GetTaxTables, GetCustomStockActions, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, GetProductModifierSelections, SetProductModifierSelections, SetActiveProductFee, SetActiveProductDiscount, GetActiveProduct, SetActiveProduct, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, ResumeOrder, SetOrderMetadata, AssignOrderUser, ReleaseFromCart, SetOrderType, SetOrderStatus, GetOrderStatuses, DeleteParkedOrder, VoidOrder, InitiateRefund, CashPayment, RecordExternalPayment, GetCashRoundingAmount, TapToPayPayment, TerminalPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, RemoveCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, RedeemRefund, GetRefundPlan, CheckPermission, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal, GetUsers, GetRoles, RemoveCartDiscount, GetActiveOrder, GetActiveCustomer, SetActiveCustomer, GetActiveOutlet, GetActiveStation, GetActiveSession, GetActiveUser, SetActiveUser, SetActiveRefund, RemoveProductDiscount, RemoveProductFee, RemoveProductNote, RemoveCartFee, RemoveOrderNote, RemoveCustomSale, RemoveNonRevenueItem, CanTransition, GetAvailableTransitions, ApplyTransition, IntegrationPayment, GetSmartGridLayout, SaveSmartGridLayout, SendEmail, SendSms, GetBookingResources, GetBookingAvailability, GetBookings, HoldBooking, AddBookingToCart, RemoveBookingFromCart, CancelBooking, CreatePaymentLink, ChargeMoto, GetTimeClockStatus } from '../../index';
2
2
  export interface RenderProviderActions {
3
3
  exampleFunction: ExampleFunction;
4
4
  getProducts: GetProducts;
@@ -35,15 +35,24 @@ export interface RenderProviderActions {
35
35
  getActiveProduct: GetActiveProduct;
36
36
  setActiveProduct: SetActiveProduct;
37
37
  adjustInventory: AdjustInventory;
38
+ getCustomStockActions: GetCustomStockActions;
38
39
  addOrderNote: AddOrderNote;
39
40
  addCartFee: AddCartFee;
40
41
  clearCart: ClearCart;
41
42
  parkOrder: ParkOrder;
42
43
  resumeParkedOrder: ResumeParkedOrder;
44
+ resumeOrder: ResumeOrder;
45
+ setOrderMetadata: SetOrderMetadata;
46
+ assignOrderUser: AssignOrderUser;
47
+ releaseFromCart: ReleaseFromCart;
48
+ setOrderType: SetOrderType;
49
+ setOrderStatus: SetOrderStatus;
50
+ getOrderStatuses: GetOrderStatuses;
43
51
  deleteParkedOrder: DeleteParkedOrder;
44
52
  voidOrder: VoidOrder;
45
53
  initiateRefund: InitiateRefund;
46
54
  cashPayment: CashPayment;
55
+ recordExternalPayment: RecordExternalPayment;
47
56
  getCashRoundingAmount: GetCashRoundingAmount;
48
57
  tapToPayPayment: TapToPayPayment;
49
58
  terminalPayment: TerminalPayment;
@@ -52,21 +61,6 @@ export interface RenderProviderActions {
52
61
  integrationPayment: IntegrationPayment;
53
62
  createPaymentLink: CreatePaymentLink;
54
63
  chargeMoto: ChargeMoto;
55
- /**
56
- * ONLINE checkout — served only by the storefront runtime (a published
57
- * website). The till tenders above are refused there, and this is refused on
58
- * a register, because the two declare different things to the card networks.
59
- */
60
- startCheckout: StartCheckout;
61
- attachCheckoutContact: AttachCheckoutContact;
62
- getOutlets: GetOutlets;
63
- setOutlet: SetOutlet;
64
- /**
65
- * The RETURN LEG of an online checkout, after a redirect payment method or
66
- * 3-D Secure sent the shopper away and back. Storefront-only, like
67
- * `startCheckout`, and safe to call on every page load.
68
- */
69
- resumeCheckout: ResumeCheckout;
70
64
  addNonRevenueItem: AddNonRevenueItem;
71
65
  addCustomerNote: AddCustomerNote;
72
66
  removeCustomerNote: RemoveCustomerNote;
@@ -2,21 +2,20 @@
2
2
  * Pub/Sub Topics
3
3
  * Export all available topics and their types
4
4
  */
5
- export * from "./customers";
6
- export * from "./orders";
7
- export * from "./bookings";
8
- export * from "./refunds";
9
- export * from "./products";
10
- export * from "./cart";
11
- export * from "./payments";
12
- export * from "./checkout";
13
- export * from "./custom-tables";
14
- export * from "./print";
15
- export * from "./outlet";
16
- export * from "./station";
17
- export * from "./session";
18
- export * from "./users";
19
- export * from "./variants";
20
- export * from "./transactions";
21
- export * from "./categories";
22
- export * from "./attributes";
5
+ export * from './customers';
6
+ export * from './orders';
7
+ export * from './bookings';
8
+ export * from './refunds';
9
+ export * from './products';
10
+ export * from './cart';
11
+ export * from './payments';
12
+ export * from './custom-tables';
13
+ export * from './print';
14
+ export * from './outlet';
15
+ export * from './station';
16
+ export * from './session';
17
+ export * from './users';
18
+ export * from './variants';
19
+ export * from './transactions';
20
+ export * from './categories';
21
+ export * from './attributes';
@@ -2,21 +2,20 @@
2
2
  * Pub/Sub Topics
3
3
  * Export all available topics and their types
4
4
  */
5
- export * from "./customers";
6
- export * from "./orders";
7
- export * from "./bookings";
8
- export * from "./refunds";
9
- export * from "./products";
10
- export * from "./cart";
11
- export * from "./payments";
12
- export * from "./checkout";
13
- export * from "./custom-tables";
14
- export * from "./print";
15
- export * from "./outlet";
16
- export * from "./station";
17
- export * from "./session";
18
- export * from "./users";
19
- export * from "./variants";
20
- export * from "./transactions";
21
- export * from "./categories";
22
- export * from "./attributes";
5
+ export * from './customers';
6
+ export * from './orders';
7
+ export * from './bookings';
8
+ export * from './refunds';
9
+ export * from './products';
10
+ export * from './cart';
11
+ export * from './payments';
12
+ export * from './custom-tables';
13
+ export * from './print';
14
+ export * from './outlet';
15
+ export * from './station';
16
+ export * from './session';
17
+ export * from './users';
18
+ export * from './variants';
19
+ export * from './transactions';
20
+ export * from './categories';
21
+ export * from './attributes';
@@ -4,7 +4,6 @@ import { RefundsEventType, RefundsEventPayload } from "./refunds/types";
4
4
  import { ProductsEventType, ProductsEventPayload } from "./products/types";
5
5
  import { CartEventType, CartEventPayload } from "./cart/types";
6
6
  import { PaymentsEventType, PaymentsEventPayload } from "./payments/types";
7
- import { CheckoutEventType, CheckoutEventPayload } from "./checkout/types";
8
7
  import { SplitPaymentsEventType, SplitPaymentsEventPayload } from "./split-payments/types";
9
8
  import { CustomTablesEventPayload, CustomTablesEventType } from "./custom-tables/types";
10
9
  import { PrintEventType, PrintEventPayload } from "./print/types";
@@ -24,13 +23,6 @@ export interface TopicEventPayloadMap {
24
23
  products: Record<ProductsEventType, ProductsEventPayload>;
25
24
  cart: Record<CartEventType, CartEventPayload>;
26
25
  payments: Record<PaymentsEventType, PaymentsEventPayload>;
27
- /**
28
- * ONLINE checkout only (a published website), where the POS `payments`
29
- * topic never fires: `payments` reports a till tender settling in front of
30
- * a cashier, while a web shopper's outcome arrives asynchronously and can
31
- * only ever be an authorisation until the provider's webhook lands.
32
- */
33
- checkout: Record<CheckoutEventType, CheckoutEventPayload>;
34
26
  "split-payments": Record<SplitPaymentsEventType, SplitPaymentsEventPayload>;
35
27
  customTables: Record<CustomTablesEventType, CustomTablesEventPayload>;
36
28
  print: Record<PrintEventType, PrintEventPayload>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.8.1-online.1",
3
+ "version": "0.9.0-preprod.2",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -57,7 +57,7 @@
57
57
  "ignoreBranchesMissingTickets": true
58
58
  },
59
59
  "dependencies": {
60
- "@final-commerce/common": "2.4.1-online.1"
60
+ "@final-commerce/common": "2.5.1-preprod.3"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@commitlint/cli": "^19.0.0",
@@ -1,6 +0,0 @@
1
- /**
2
- * Attach Checkout Contact action
3
- * Calls the attachCheckoutContact action on the parent window
4
- */
5
- import type { AttachCheckoutContact } from './types';
6
- export declare const attachCheckoutContact: AttachCheckoutContact;
@@ -1,8 +0,0 @@
1
- /**
2
- * Attach Checkout Contact action
3
- * Calls the attachCheckoutContact action on the parent window
4
- */
5
- import { commandFrameClient } from '../../client';
6
- export const attachCheckoutContact = async (params) => {
7
- return await commandFrameClient.call('attachCheckoutContact', params);
8
- };
@@ -1,15 +0,0 @@
1
- import type { AttachCheckoutContact } from './types';
2
- /**
3
- * Standalone mock of attaching contact to an online order.
4
- *
5
- * It mirrors the one REFUSAL the real command makes — a missing email — because
6
- * that is the mistake a builder actually hits, and a mock that accepted anything
7
- * would let a checkout screen look finished and lose receipts on the published
8
- * site.
9
- *
10
- * It does NOT mirror "no order to attach to". The real command answers
11
- * `attached: false` there rather than throwing, precisely so a flow can call it
12
- * optimistically and still let the shopper pay; the mock always has a checkout
13
- * to attach to, so it reports `true`.
14
- */
15
- export declare const mockAttachCheckoutContact: AttachCheckoutContact;
@@ -1,22 +0,0 @@
1
- /**
2
- * Standalone mock of attaching contact to an online order.
3
- *
4
- * It mirrors the one REFUSAL the real command makes — a missing email — because
5
- * that is the mistake a builder actually hits, and a mock that accepted anything
6
- * would let a checkout screen look finished and lose receipts on the published
7
- * site.
8
- *
9
- * It does NOT mirror "no order to attach to". The real command answers
10
- * `attached: false` there rather than throwing, precisely so a flow can call it
11
- * optimistically and still let the shopper pay; the mock always has a checkout
12
- * to attach to, so it reports `true`.
13
- */
14
- export const mockAttachCheckoutContact = async (params) => {
15
- console.log('[Mock] attachCheckoutContact called', params);
16
- if (!params)
17
- throw new Error('Params required');
18
- if (!params.email || !params.email.trim()) {
19
- throw new Error('attachCheckoutContact: email is required — it is where the receipt goes');
20
- }
21
- return { attached: true, timestamp: new Date().toISOString() };
22
- };
@@ -1,35 +0,0 @@
1
- /**
2
- * Guest contact for the order. There is no shopper account, so this is the only
3
- * way to reach them — `email` is where the receipt goes and is required.
4
- */
5
- export interface AttachCheckoutContactParams {
6
- email: string;
7
- name?: string;
8
- phone?: string;
9
- /** Defaults to the outlet the storefront booted against. */
10
- outletId?: string;
11
- }
12
- export interface AttachCheckoutContactResponse {
13
- /**
14
- * `false` means there was nothing to attach to — no checkout had been started
15
- * for this cart. It is NOT a failure to record the contact on an order that
16
- * exists, and it never means the shopper was charged.
17
- */
18
- attached: boolean;
19
- timestamp: string;
20
- }
21
- /**
22
- * Put the shopper's contact on the order `startCheckout` already created.
23
- *
24
- * Call it BEFORE paying, whenever the email is known — on blur, on submit, or
25
- * as the shopper leaves the contact step. It reuses the order's idempotency
26
- * key, so it updates that order rather than creating a second one.
27
- *
28
- * SAFE TO CALL TWICE. The server only ever ADDS contact to an order that has
29
- * none, so a later call cannot redirect a receipt that was already addressed.
30
- *
31
- * NEVER THROWS FOR A MISSING ORDER. Failing to record an email must not stop a
32
- * payment the shopper is trying to make, so the caller gets `attached: false`
33
- * and can carry on to pay.
34
- */
35
- export type AttachCheckoutContact = (params: AttachCheckoutContactParams) => Promise<AttachCheckoutContactResponse>;
@@ -1,16 +0,0 @@
1
- // Attach Checkout Contact Types
2
- //
3
- // The second half of the online checkout. `startCheckout` creates the order and
4
- // mounts the payment fields the moment a shopper ARRIVES; this puts their email
5
- // on that same order once they have typed it.
6
- //
7
- // WHY THESE ARE TWO COMMANDS. The card fields cannot render without a payment
8
- // session, a session needs a server-priced amount, and an amount needs an order.
9
- // So the order has to exist before the shopper has typed anything. Demanding an
10
- // email first is what forced the old "fill the form, then see the card fields"
11
- // checkout — and it also meant every cart edit minted a NEW order, because the
12
- // idempotency key moved with the cart.
13
- //
14
- // Served ONLY by the storefront runtime (a published website), like
15
- // `startCheckout` itself. On a register it does not exist.
16
- export {};
@@ -1,6 +0,0 @@
1
- /**
2
- * Resume Checkout action
3
- * Calls the resumeCheckout action on the parent window
4
- */
5
- import type { ResumeCheckout } from './types';
6
- export declare const resumeCheckout: ResumeCheckout;
@@ -1,8 +0,0 @@
1
- /**
2
- * Resume Checkout action
3
- * Calls the resumeCheckout action on the parent window
4
- */
5
- import { commandFrameClient } from '../../client';
6
- export const resumeCheckout = async (params) => {
7
- return await commandFrameClient.call('resumeCheckout', params ?? {});
8
- };
@@ -1,16 +0,0 @@
1
- import { ResumeCheckout } from './types';
2
- /**
3
- * Standalone mock of the checkout return leg.
4
- *
5
- * It reads the SAME query parameters the real provider sends a shopper back
6
- * with, so a builder can exercise the redirect path in preview by appending
7
- * them by hand:
8
- *
9
- * ?sessionId=CS_MOCK&redirectResult=MOCK
10
- *
11
- * Without them it answers `{ resumed: false }` and does nothing, which is what
12
- * the real command does on an ordinary page load. That is the branch a
13
- * checkout screen hits on every normal visit, so it is the one worth getting
14
- * right in a mock.
15
- */
16
- export declare const mockResumeCheckout: ResumeCheckout;
@@ -1,51 +0,0 @@
1
- import { mockPublishEvent } from '../../demo/database';
2
- /**
3
- * Standalone mock of the checkout return leg.
4
- *
5
- * It reads the SAME query parameters the real provider sends a shopper back
6
- * with, so a builder can exercise the redirect path in preview by appending
7
- * them by hand:
8
- *
9
- * ?sessionId=CS_MOCK&redirectResult=MOCK
10
- *
11
- * Without them it answers `{ resumed: false }` and does nothing, which is what
12
- * the real command does on an ordinary page load. That is the branch a
13
- * checkout screen hits on every normal visit, so it is the one worth getting
14
- * right in a mock.
15
- */
16
- export const mockResumeCheckout = async (params) => {
17
- console.log('[Mock] resumeCheckout called', params);
18
- const href = params?.url ?? (typeof window === 'undefined' ? '' : window.location.href);
19
- let redirectResult = null;
20
- try {
21
- redirectResult = new URL(href).searchParams.get('redirectResult');
22
- }
23
- catch {
24
- redirectResult = null;
25
- }
26
- if (!redirectResult) {
27
- return {
28
- success: true,
29
- timestamp: new Date().toISOString(),
30
- checkout: { resumed: false },
31
- };
32
- }
33
- const suffix = String(Date.now()).slice(-6);
34
- const checkout = {
35
- resumed: true,
36
- orderId: `mock-order-${suffix}`,
37
- receiptId: `ON-001-${suffix}`,
38
- // `Authorised` is what the real provider reports for a completed redirect.
39
- // It is NOT settlement — see the checkout topic docs.
40
- resultCode: 'Authorised',
41
- sessionResult: `mock-session-result-${suffix}`,
42
- orderPassword: `mock-pw-${suffix}`,
43
- };
44
- mockPublishEvent('checkout', 'payment-completed', {
45
- orderId: checkout.orderId,
46
- receiptId: checkout.receiptId,
47
- resultCode: checkout.resultCode,
48
- sessionResult: checkout.sessionResult,
49
- });
50
- return { success: true, timestamp: new Date().toISOString(), checkout };
51
- };