@final-commerce/command-frame 0.1.50 → 0.1.51

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Remove cart discount action
3
+ * Calls the removeCartDiscount action on the parent window
4
+ */
5
+ import type { RemoveCartDiscount } from "./types";
6
+ export declare const removeCartDiscount: RemoveCartDiscount;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Remove cart discount action
3
+ * Calls the removeCartDiscount action on the parent window
4
+ */
5
+ import { commandFrameClient } from "../../client";
6
+ export const removeCartDiscount = async () => {
7
+ return await commandFrameClient.call("removeCartDiscount");
8
+ };
@@ -0,0 +1,2 @@
1
+ import { RemoveCartDiscount } from "./types";
2
+ export declare const mockRemoveCartDiscount: RemoveCartDiscount;
@@ -0,0 +1,15 @@
1
+ import { MOCK_CART, mockPublishEvent } from "../../demo/database";
2
+ export const mockRemoveCartDiscount = async () => {
3
+ console.log("[Mock] removeCartDiscount called");
4
+ if (MOCK_CART.discount) {
5
+ delete MOCK_CART.discount;
6
+ MOCK_CART.total = MOCK_CART.subtotal;
7
+ MOCK_CART.amountToBeCharged = MOCK_CART.subtotal;
8
+ MOCK_CART.remainingBalance = MOCK_CART.subtotal;
9
+ mockPublishEvent("cart", "cart-discount-removed", {});
10
+ }
11
+ return {
12
+ success: true,
13
+ timestamp: new Date().toISOString()
14
+ };
15
+ };
@@ -0,0 +1,5 @@
1
+ export interface RemoveCartDiscountResponse {
2
+ success: boolean;
3
+ timestamp: string;
4
+ }
5
+ export type RemoveCartDiscount = () => Promise<RemoveCartDiscountResponse>;
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -35,6 +35,7 @@ export declare const command: {
35
35
  readonly redeemPayment: import("./actions/redeem-payment/types").RedeemPayment;
36
36
  readonly addCustomerNote: import("./actions/add-customer-note/types").AddCustomerNote;
37
37
  readonly removeCustomerFromCart: import("./actions/remove-customer-from-cart/types").RemoveCustomerFromCart;
38
+ readonly removeCartDiscount: import("./actions/remove-cart-discount/types").RemoveCartDiscount;
38
39
  readonly goToStationHome: import("./actions/go-to-station-home/types").GoToStationHome;
39
40
  readonly openCashDrawer: import("./actions/open-cash-drawer/types").OpenCashDrawer;
40
41
  readonly showNotification: import("./actions/show-notification/types").ShowNotification;
@@ -131,6 +132,7 @@ export { installExtensionRefundListener } from "./actions/extension-refund/exten
131
132
  export type { ExtensionRefundParams, ExtensionRefundResponse } from "./actions/extension-refund/types";
132
133
  export type { AddCustomerNote, AddCustomerNoteParams, AddCustomerNoteResponse } from "./actions/add-customer-note/types";
133
134
  export type { RemoveCustomerFromCart, RemoveCustomerFromCartResponse } from "./actions/remove-customer-from-cart/types";
135
+ export type { RemoveCartDiscount, RemoveCartDiscountResponse } from "./actions/remove-cart-discount/types";
134
136
  export type { GoToStationHome, GoToStationHomeResponse } from "./actions/go-to-station-home/types";
135
137
  export type { OpenCashDrawer, OpenCashDrawerResponse } from "./actions/open-cash-drawer/types";
136
138
  export type { ShowNotification, ShowNotificationParams, ShowNotificationResponse } from "./actions/show-notification/types";
package/dist/index.js CHANGED
@@ -36,6 +36,7 @@ import { redeemPayment } from "./actions/redeem-payment/action";
36
36
  // Customer Actions
37
37
  import { addCustomerNote } from "./actions/add-customer-note/action";
38
38
  import { removeCustomerFromCart } from "./actions/remove-customer-from-cart/action";
39
+ import { removeCartDiscount } from "./actions/remove-cart-discount/action";
39
40
  // System Actions
40
41
  import { goToStationHome } from "./actions/go-to-station-home/action";
41
42
  import { openCashDrawer } from "./actions/open-cash-drawer/action";
@@ -131,6 +132,7 @@ export const command = {
131
132
  // Customer Actions
132
133
  addCustomerNote,
133
134
  removeCustomerFromCart,
135
+ removeCartDiscount,
134
136
  // System Actions
135
137
  goToStationHome,
136
138
  openCashDrawer,
@@ -9,6 +9,7 @@ import { mockAddProductFee } from "../../actions/add-product-fee/mock";
9
9
  import { mockAddProductNote } from "../../actions/add-product-note/mock";
10
10
  import { mockAddProductToCart } from "../../actions/add-product-to-cart/mock";
11
11
  import { mockRemoveProductFromCart } from "../../actions/remove-product-from-cart/mock";
12
+ import { mockRemoveCartDiscount } from "../../actions/remove-cart-discount/mock";
12
13
  import { mockUpdateCartItemQuantity } from "../../actions/update-cart-item-quantity/mock";
13
14
  import { mockAdjustInventory } from "../../actions/adjust-inventory/mock";
14
15
  import { mockAssignCustomer } from "../../actions/assign-customer/mock";
@@ -100,6 +101,7 @@ export const RENDER_MOCKS = {
100
101
  partialPayment: mockPartialPayment,
101
102
  processPartialRefund: mockProcessPartialRefund,
102
103
  removeCustomerFromCart: mockRemoveCustomerFromCart,
104
+ removeCartDiscount: mockRemoveCartDiscount,
103
105
  resetRefundDetails: mockResetRefundDetails,
104
106
  resumeParkedOrder: mockResumeParkedOrder,
105
107
  selectAllRefundItems: mockSelectAllRefundItems,
@@ -1,4 +1,4 @@
1
- import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, GetCategories, GetOrders, GetRefunds, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, 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 } from "../../index";
1
+ import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, GetCategories, GetOrders, GetRefunds, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, ExtensionPayment, RedeemPayment, AddNonRevenueItem, AddCustomerNote, 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 } from "../../index";
2
2
  export interface RenderProviderActions {
3
3
  exampleFunction: ExampleFunction;
4
4
  getProducts: GetProducts;
@@ -35,6 +35,7 @@ export interface RenderProviderActions {
35
35
  addNonRevenueItem: AddNonRevenueItem;
36
36
  addCustomerNote: AddCustomerNote;
37
37
  removeCustomerFromCart: RemoveCustomerFromCart;
38
+ removeCartDiscount: RemoveCartDiscount;
38
39
  goToStationHome: GoToStationHome;
39
40
  openCashDrawer: OpenCashDrawer;
40
41
  showNotification: ShowNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.1.50",
3
+ "version": "0.1.51",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",