@open-tender/utils 0.1.4 → 0.1.6
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/cjs/utils/cart.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { UnpreparedOrderData, Money, Order, Tender, CheckoutConfig, SoldOut, MenuCategories, Address, MenuItem, CartItem, OrderItem, Cart, Favorites, Orders, CartItemGroups, Customer, CartItemOption, CartOwner, SimpleCartItem, MenuItems, SimpleCart, SimpleCartGroups, OrderItemGroups, NutritionalInfoCalcs, OrderItemImages, DisplayItems, DisplayItem, GroupOrderGuests, GroupOrderGuest } from '@open-tender/types';
|
|
1
|
+
import { UnpreparedOrderData, Money, Order, Tender, CheckoutConfig, SoldOut, MenuCategories, Address, MenuItem, CartItem, OrderItem, Cart, Favorites, Orders, CartItemGroups, Customer, CartItemOption, CartOwner, SimpleCartItem, MenuItems, SimpleCart, SimpleCartGroups, OrderItemGroups, NutritionalInfoCalcs, OrderItemImages, DisplayItems, DisplayItem, GroupOrderGuests, GroupOrderGuest, CartLevels } from '@open-tender/types';
|
|
2
2
|
export declare const getItemOptions: (item: Partial<CartItem>) => CartItemOption[];
|
|
3
3
|
export declare const makeModifierNames: (item: CartItem) => string;
|
|
4
4
|
export declare const hasGroupsBelowMin: (option: CartItemOption | null, groups: CartItemGroups) => boolean;
|
|
5
|
-
export declare const makeModifierGroups: (groups: CartItemGroups) =>
|
|
5
|
+
export declare const makeModifierGroups: (groups: CartItemGroups) => [CartItemGroups, CartLevels];
|
|
6
6
|
export declare const makeUpsellItems: (itemIds: number[], itemLookup: Record<string, MenuItem>) => (CartItem | CartItemOption)[];
|
|
7
|
-
export declare const calcNutrition: (item: CartItemOption) => NutritionalInfoCalcs;
|
|
7
|
+
export declare const calcNutrition: (item: CartItem | CartItemOption) => NutritionalInfoCalcs;
|
|
8
8
|
export declare const calcPrices: (item: CartItem | CartItemOption) => CartItem | CartItemOption;
|
|
9
9
|
export declare const checkSoldOut: (id: number, suspendUntil: number | null, soldOut?: number[]) => boolean;
|
|
10
10
|
export declare const makeOrderItem: (item: MenuItem, isEdit?: boolean, soldOut?: SoldOut, simpleItem?: SimpleCartItem, hasPoints?: boolean) => CartItem | CartItemOption;
|
|
@@ -107,8 +107,8 @@ export declare const combineCarts: (cart: Cart, guestCart: SimpleCart, cartOwner
|
|
|
107
107
|
id: number;
|
|
108
108
|
quantity: number;
|
|
109
109
|
groups: SimpleCartGroups;
|
|
110
|
-
made_for?: string | undefined;
|
|
111
|
-
notes?: string | undefined;
|
|
110
|
+
made_for?: string | null | undefined;
|
|
111
|
+
notes?: string | null | undefined;
|
|
112
112
|
cart_guest_id?: number | undefined;
|
|
113
113
|
customer_id?: number | undefined;
|
|
114
114
|
})[];
|
package/dist/esm/utils/cart.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { UnpreparedOrderData, Money, Order, Tender, CheckoutConfig, SoldOut, MenuCategories, Address, MenuItem, CartItem, OrderItem, Cart, Favorites, Orders, CartItemGroups, Customer, CartItemOption, CartOwner, SimpleCartItem, MenuItems, SimpleCart, SimpleCartGroups, OrderItemGroups, NutritionalInfoCalcs, OrderItemImages, DisplayItems, DisplayItem, GroupOrderGuests, GroupOrderGuest } from '@open-tender/types';
|
|
1
|
+
import { UnpreparedOrderData, Money, Order, Tender, CheckoutConfig, SoldOut, MenuCategories, Address, MenuItem, CartItem, OrderItem, Cart, Favorites, Orders, CartItemGroups, Customer, CartItemOption, CartOwner, SimpleCartItem, MenuItems, SimpleCart, SimpleCartGroups, OrderItemGroups, NutritionalInfoCalcs, OrderItemImages, DisplayItems, DisplayItem, GroupOrderGuests, GroupOrderGuest, CartLevels } from '@open-tender/types';
|
|
2
2
|
export declare const getItemOptions: (item: Partial<CartItem>) => CartItemOption[];
|
|
3
3
|
export declare const makeModifierNames: (item: CartItem) => string;
|
|
4
4
|
export declare const hasGroupsBelowMin: (option: CartItemOption | null, groups: CartItemGroups) => boolean;
|
|
5
|
-
export declare const makeModifierGroups: (groups: CartItemGroups) =>
|
|
5
|
+
export declare const makeModifierGroups: (groups: CartItemGroups) => [CartItemGroups, CartLevels];
|
|
6
6
|
export declare const makeUpsellItems: (itemIds: number[], itemLookup: Record<string, MenuItem>) => (CartItem | CartItemOption)[];
|
|
7
|
-
export declare const calcNutrition: (item: CartItemOption) => NutritionalInfoCalcs;
|
|
7
|
+
export declare const calcNutrition: (item: CartItem | CartItemOption) => NutritionalInfoCalcs;
|
|
8
8
|
export declare const calcPrices: (item: CartItem | CartItemOption) => CartItem | CartItemOption;
|
|
9
9
|
export declare const checkSoldOut: (id: number, suspendUntil: number | null, soldOut?: number[]) => boolean;
|
|
10
10
|
export declare const makeOrderItem: (item: MenuItem, isEdit?: boolean, soldOut?: SoldOut, simpleItem?: SimpleCartItem, hasPoints?: boolean) => CartItem | CartItemOption;
|
|
@@ -107,8 +107,8 @@ export declare const combineCarts: (cart: Cart, guestCart: SimpleCart, cartOwner
|
|
|
107
107
|
id: number;
|
|
108
108
|
quantity: number;
|
|
109
109
|
groups: SimpleCartGroups;
|
|
110
|
-
made_for?: string | undefined;
|
|
111
|
-
notes?: string | undefined;
|
|
110
|
+
made_for?: string | null | undefined;
|
|
111
|
+
notes?: string | null | undefined;
|
|
112
112
|
cart_guest_id?: number | undefined;
|
|
113
113
|
customer_id?: number | undefined;
|
|
114
114
|
})[];
|
package/package.json
CHANGED