@open-tender/store 0.5.16 → 0.5.17
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/.DS_Store +0 -0
- package/dist/cjs/slices/order.d.ts +5 -1
- package/dist/cjs/slices/order.js +17 -1
- package/dist/cjs/types/api/menu.d.ts +12 -0
- package/dist/esm/slices/order.d.ts +5 -1
- package/dist/esm/slices/order.js +14 -0
- package/dist/esm/types/api/menu.d.ts +12 -0
- package/package.json +1 -1
package/dist/.DS_Store
CHANGED
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cart, CartCounts, CartItem, Messages, OrderType, RequestedAt, RequestError, RequestStatus, RevenueCenter, ServiceType } from '../types';
|
|
1
|
+
import { Cart, CartCounts, CartItem, MenuCategory, MenuVendor, Messages, OrderType, RequestedAt, RequestError, RequestStatus, RevenueCenter, ServiceType } from '../types';
|
|
2
2
|
import { AppState } from '../app';
|
|
3
3
|
export interface OrderState {
|
|
4
4
|
orderId: string | null;
|
|
@@ -8,6 +8,8 @@ export interface OrderState {
|
|
|
8
8
|
table: string | null;
|
|
9
9
|
prepType: 'EAT_HERE' | 'TAKE_OUT' | null;
|
|
10
10
|
requestedAt: RequestedAt;
|
|
11
|
+
currentVendor: MenuVendor | null;
|
|
12
|
+
currentCategory: MenuCategory | null;
|
|
11
13
|
currentItem: CartItem | null;
|
|
12
14
|
cart: Cart;
|
|
13
15
|
cartCounts: CartCounts;
|
|
@@ -44,6 +46,8 @@ export declare const selectMenuVars: (state: AppState) => {
|
|
|
44
46
|
serviceType: ServiceType | null;
|
|
45
47
|
requestedAt: RequestedAt;
|
|
46
48
|
};
|
|
49
|
+
export declare const selectCurrentVendor: (state: AppState) => MenuVendor | null;
|
|
50
|
+
export declare const selectCurrentCategory: (state: AppState) => MenuCategory | null;
|
|
47
51
|
export declare const selectCurrentItem: (state: AppState) => CartItem | null;
|
|
48
52
|
export declare const selectCart: (state: AppState) => Cart;
|
|
49
53
|
export declare const selectCartIds: (state: AppState) => number[];
|
package/dist/cjs/slices/order.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.orderReducer = exports.selectCartValidate = exports.selectCanOrder = exports.selectCartCounts = exports.selectCartTotal = exports.selectCartQuantity = exports.selectCartIds = exports.selectCart = exports.selectCurrentItem = exports.selectMenuVars = exports.selectMenuSlug = exports.selectRevenueCenterName = exports.selectRevenueCenter = exports.selectRequestedAt = exports.selectServiceTypeName = exports.selectServiceType = exports.selectOrderTypeName = exports.selectOrderType = exports.selectOrder = exports.selectMessages = exports.selectAlert = exports.removeMessage = exports.addMessage = exports.decrementItemInCart = exports.incrementItemInCart = exports.removeItemFromCart = exports.addItemToCart = exports.setCurrentItem = exports.setCart = exports.setMenuVars = exports.setOrderServiceType = exports.setPrepType = exports.setTable = exports.setRevenueCenter = exports.setRequestedAt = exports.setServiceType = exports.setOrderType = exports.setOrderId = exports.setAlert = exports.resetAlert = exports.resetMessages = exports.resetCart = exports.resetLocation = exports.resetRevenueCenter = exports.resetOrderType = exports.resetOrder = exports.fetchRevenueCenter = exports.OrderActionType = void 0;
|
|
4
|
+
exports.orderReducer = exports.selectCartValidate = exports.selectCanOrder = exports.selectCartCounts = exports.selectCartTotal = exports.selectCartQuantity = exports.selectCartIds = exports.selectCart = exports.selectCurrentItem = exports.selectCurrentCategory = exports.selectCurrentVendor = exports.selectMenuVars = exports.selectMenuSlug = exports.selectRevenueCenterName = exports.selectRevenueCenter = exports.selectRequestedAt = exports.selectServiceTypeName = exports.selectServiceType = exports.selectOrderTypeName = exports.selectOrderType = exports.selectOrder = exports.selectMessages = exports.selectAlert = exports.removeMessage = exports.addMessage = exports.decrementItemInCart = exports.incrementItemInCart = exports.removeItemFromCart = exports.addItemToCart = exports.setCurrentItem = exports.setCart = exports.setMenuVars = exports.setOrderServiceType = exports.setPrepType = exports.setTable = exports.setRevenueCenter = exports.setRequestedAt = exports.setServiceType = exports.setOrderType = exports.setOrderId = exports.setAlert = exports.resetAlert = exports.resetMessages = exports.resetCart = exports.resetLocation = exports.resetRevenueCenter = exports.resetOrderType = exports.resetOrder = exports.fetchRevenueCenter = exports.OrderActionType = void 0;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
var utils_1 = require("../utils");
|
|
@@ -14,6 +14,8 @@ var initialState = {
|
|
|
14
14
|
table: null,
|
|
15
15
|
prepType: null,
|
|
16
16
|
requestedAt: 'asap',
|
|
17
|
+
currentVendor: null,
|
|
18
|
+
currentCategory: null,
|
|
17
19
|
currentItem: null,
|
|
18
20
|
cart: [],
|
|
19
21
|
cartCounts: {},
|
|
@@ -114,6 +116,12 @@ var orderSlice = (0, toolkit_1.createSlice)({
|
|
|
114
116
|
state.cart = action.payload;
|
|
115
117
|
state.cartCounts = (0, utils_1.calcCartCounts)(action.payload);
|
|
116
118
|
},
|
|
119
|
+
setCurrentVendor: function (state, action) {
|
|
120
|
+
state.currentVendor = action.payload;
|
|
121
|
+
},
|
|
122
|
+
setCurrentCategory: function (state, action) {
|
|
123
|
+
state.currentCategory = action.payload;
|
|
124
|
+
},
|
|
117
125
|
setCurrentItem: function (state, action) {
|
|
118
126
|
state.currentItem = action.payload;
|
|
119
127
|
},
|
|
@@ -231,6 +239,14 @@ var selectMenuVars = function (state) {
|
|
|
231
239
|
};
|
|
232
240
|
};
|
|
233
241
|
exports.selectMenuVars = selectMenuVars;
|
|
242
|
+
var selectCurrentVendor = function (state) {
|
|
243
|
+
return state.order.currentVendor;
|
|
244
|
+
};
|
|
245
|
+
exports.selectCurrentVendor = selectCurrentVendor;
|
|
246
|
+
var selectCurrentCategory = function (state) {
|
|
247
|
+
return state.order.currentCategory;
|
|
248
|
+
};
|
|
249
|
+
exports.selectCurrentCategory = selectCurrentCategory;
|
|
234
250
|
var selectCurrentItem = function (state) { return state.order.currentItem; };
|
|
235
251
|
exports.selectCurrentItem = selectCurrentItem;
|
|
236
252
|
var selectCart = function (state) { return state.order.cart; };
|
|
@@ -126,6 +126,18 @@ export interface MenuCategory {
|
|
|
126
126
|
small_image_url: string | null;
|
|
127
127
|
}
|
|
128
128
|
export declare type MenuCategories = Array<MenuCategory>;
|
|
129
|
+
export interface MenuVendor {
|
|
130
|
+
app_image_url: string | null;
|
|
131
|
+
description: string | null;
|
|
132
|
+
display_order: number;
|
|
133
|
+
hours_desc: string | null;
|
|
134
|
+
large_image_url: string | null;
|
|
135
|
+
name: string;
|
|
136
|
+
revenue_center_id: number;
|
|
137
|
+
short_name: string;
|
|
138
|
+
small_image_url: string | null;
|
|
139
|
+
}
|
|
140
|
+
export declare type MenuVendors = Array<MenuVendor>;
|
|
129
141
|
export interface Menu {
|
|
130
142
|
menu: MenuCategories;
|
|
131
143
|
service_type: ServiceType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cart, CartCounts, CartItem, Messages, OrderType, RequestedAt, RequestError, RequestStatus, RevenueCenter, ServiceType } from '../types';
|
|
1
|
+
import { Cart, CartCounts, CartItem, MenuCategory, MenuVendor, Messages, OrderType, RequestedAt, RequestError, RequestStatus, RevenueCenter, ServiceType } from '../types';
|
|
2
2
|
import { AppState } from '../app';
|
|
3
3
|
export interface OrderState {
|
|
4
4
|
orderId: string | null;
|
|
@@ -8,6 +8,8 @@ export interface OrderState {
|
|
|
8
8
|
table: string | null;
|
|
9
9
|
prepType: 'EAT_HERE' | 'TAKE_OUT' | null;
|
|
10
10
|
requestedAt: RequestedAt;
|
|
11
|
+
currentVendor: MenuVendor | null;
|
|
12
|
+
currentCategory: MenuCategory | null;
|
|
11
13
|
currentItem: CartItem | null;
|
|
12
14
|
cart: Cart;
|
|
13
15
|
cartCounts: CartCounts;
|
|
@@ -44,6 +46,8 @@ export declare const selectMenuVars: (state: AppState) => {
|
|
|
44
46
|
serviceType: ServiceType | null;
|
|
45
47
|
requestedAt: RequestedAt;
|
|
46
48
|
};
|
|
49
|
+
export declare const selectCurrentVendor: (state: AppState) => MenuVendor | null;
|
|
50
|
+
export declare const selectCurrentCategory: (state: AppState) => MenuCategory | null;
|
|
47
51
|
export declare const selectCurrentItem: (state: AppState) => CartItem | null;
|
|
48
52
|
export declare const selectCart: (state: AppState) => Cart;
|
|
49
53
|
export declare const selectCartIds: (state: AppState) => number[];
|
package/dist/esm/slices/order.js
CHANGED
|
@@ -11,6 +11,8 @@ var initialState = {
|
|
|
11
11
|
table: null,
|
|
12
12
|
prepType: null,
|
|
13
13
|
requestedAt: 'asap',
|
|
14
|
+
currentVendor: null,
|
|
15
|
+
currentCategory: null,
|
|
14
16
|
currentItem: null,
|
|
15
17
|
cart: [],
|
|
16
18
|
cartCounts: {},
|
|
@@ -111,6 +113,12 @@ var orderSlice = createSlice({
|
|
|
111
113
|
state.cart = action.payload;
|
|
112
114
|
state.cartCounts = calcCartCounts(action.payload);
|
|
113
115
|
},
|
|
116
|
+
setCurrentVendor: function (state, action) {
|
|
117
|
+
state.currentVendor = action.payload;
|
|
118
|
+
},
|
|
119
|
+
setCurrentCategory: function (state, action) {
|
|
120
|
+
state.currentCategory = action.payload;
|
|
121
|
+
},
|
|
114
122
|
setCurrentItem: function (state, action) {
|
|
115
123
|
state.currentItem = action.payload;
|
|
116
124
|
},
|
|
@@ -216,6 +224,12 @@ export var selectMenuVars = function (state) {
|
|
|
216
224
|
requestedAt: state.order.requestedAt
|
|
217
225
|
};
|
|
218
226
|
};
|
|
227
|
+
export var selectCurrentVendor = function (state) {
|
|
228
|
+
return state.order.currentVendor;
|
|
229
|
+
};
|
|
230
|
+
export var selectCurrentCategory = function (state) {
|
|
231
|
+
return state.order.currentCategory;
|
|
232
|
+
};
|
|
219
233
|
export var selectCurrentItem = function (state) { return state.order.currentItem; };
|
|
220
234
|
export var selectCart = function (state) { return state.order.cart; };
|
|
221
235
|
export var selectCartIds = function (state) {
|
|
@@ -126,6 +126,18 @@ export interface MenuCategory {
|
|
|
126
126
|
small_image_url: string | null;
|
|
127
127
|
}
|
|
128
128
|
export declare type MenuCategories = Array<MenuCategory>;
|
|
129
|
+
export interface MenuVendor {
|
|
130
|
+
app_image_url: string | null;
|
|
131
|
+
description: string | null;
|
|
132
|
+
display_order: number;
|
|
133
|
+
hours_desc: string | null;
|
|
134
|
+
large_image_url: string | null;
|
|
135
|
+
name: string;
|
|
136
|
+
revenue_center_id: number;
|
|
137
|
+
short_name: string;
|
|
138
|
+
small_image_url: string | null;
|
|
139
|
+
}
|
|
140
|
+
export declare type MenuVendors = Array<MenuVendor>;
|
|
129
141
|
export interface Menu {
|
|
130
142
|
menu: MenuCategories;
|
|
131
143
|
service_type: ServiceType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.17",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|