@open-tender/store 0.3.11 → 0.3.13
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/slices/config.js +4 -3
- package/dist/cjs/slices/kds.js +5 -43
- package/dist/cjs/types/api/config.d.ts +2 -1
- package/dist/cjs/types/api/kds.d.ts +1 -1
- package/dist/cjs/utils/orders.d.ts +2 -2
- package/dist/cjs/utils/orders.js +10 -2
- package/dist/esm/slices/config.js +5 -4
- package/dist/esm/slices/kds.js +5 -43
- package/dist/esm/types/api/config.d.ts +2 -1
- package/dist/esm/types/api/kds.d.ts +1 -1
- package/dist/esm/utils/orders.d.ts +2 -2
- package/dist/esm/utils/orders.js +10 -2
- package/package.json +1 -1
|
@@ -34,7 +34,7 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
|
|
|
34
34
|
var apiUrl = _a.apiUrl, version = _a.version;
|
|
35
35
|
var dispatch = _b.dispatch, getState = _b.getState, rejectWithValue = _b.rejectWithValue;
|
|
36
36
|
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
37
|
-
var app, api, _c, config, store, _d, selectOptions, _e, itemTypes, _f, levelup, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, name_1, ipAddress, hasPinpad, hasCashDrawer, err_2;
|
|
37
|
+
var app, api, _c, config, store, _d, selectOptions, _e, itemTypes, _f, levelup, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, name_1, ipAddress, hasPinpad, hasCashDrawer, prep_stations, err_2;
|
|
38
38
|
return tslib_1.__generator(this, function (_g) {
|
|
39
39
|
switch (_g.label) {
|
|
40
40
|
case 0:
|
|
@@ -70,9 +70,10 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
|
|
|
70
70
|
err_1 = _g.sent();
|
|
71
71
|
return [3 /*break*/, 5];
|
|
72
72
|
case 5:
|
|
73
|
-
dispatch((0, kds_1.setKdsItemTypes)(itemTypes));
|
|
74
73
|
revenueCenterId = store.revenue_center_id;
|
|
75
|
-
name_1 = config.name, ipAddress = config.ip_address, hasPinpad = config.has_pinpad, hasCashDrawer = config.has_cashdrawer;
|
|
74
|
+
name_1 = config.name, ipAddress = config.ip_address, hasPinpad = config.has_pinpad, hasCashDrawer = config.has_cashdrawer, prep_stations = config.prep_stations;
|
|
75
|
+
dispatch((0, kds_1.setKdsItemTypes)(itemTypes));
|
|
76
|
+
dispatch((0, kds_1.setKdsPrepStations)(prep_stations));
|
|
76
77
|
return [2 /*return*/, {
|
|
77
78
|
api: api,
|
|
78
79
|
app: app,
|
package/dist/cjs/slices/kds.js
CHANGED
|
@@ -7,47 +7,9 @@ var toolkit_1 = require("@reduxjs/toolkit");
|
|
|
7
7
|
var types_1 = require("./types");
|
|
8
8
|
var utils_1 = require("../utils");
|
|
9
9
|
var alerts_1 = require("./alerts");
|
|
10
|
-
var prepStations = [
|
|
11
|
-
{
|
|
12
|
-
prep_station_id: 1,
|
|
13
|
-
name: 'Entrees',
|
|
14
|
-
item_type_ids: [4],
|
|
15
|
-
prep_type: 'ASSEMBLY',
|
|
16
|
-
assembly_options: 'PRINT_DONE',
|
|
17
|
-
show_print: false,
|
|
18
|
-
show_reset: false
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
prep_station_id: 2,
|
|
22
|
-
name: 'Sides',
|
|
23
|
-
item_type_ids: [5],
|
|
24
|
-
prep_type: 'ASSEMBLY',
|
|
25
|
-
assembly_options: 'MARK_DONE',
|
|
26
|
-
show_print: false,
|
|
27
|
-
show_reset: false
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
prep_station_id: 3,
|
|
31
|
-
name: 'Drinks',
|
|
32
|
-
item_type_ids: [6],
|
|
33
|
-
prep_type: 'ASSEMBLY',
|
|
34
|
-
assembly_options: 'PRINT_AND_DONE',
|
|
35
|
-
show_print: false,
|
|
36
|
-
show_reset: false
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
prep_station_id: 4,
|
|
40
|
-
name: 'Expo',
|
|
41
|
-
item_type_ids: [4, 5, 6],
|
|
42
|
-
prep_type: 'EXPO',
|
|
43
|
-
assembly_options: null,
|
|
44
|
-
show_print: false,
|
|
45
|
-
show_reset: false
|
|
46
|
-
}
|
|
47
|
-
];
|
|
48
10
|
var initialState = {
|
|
49
11
|
itemTypes: null,
|
|
50
|
-
prepStations:
|
|
12
|
+
prepStations: [],
|
|
51
13
|
prepStationId: null,
|
|
52
14
|
orderType: 'CURRENT',
|
|
53
15
|
columns: 4,
|
|
@@ -79,7 +41,7 @@ var KdsActionType;
|
|
|
79
41
|
exports.fetchKdsOrders = (0, toolkit_1.createAsyncThunk)(KdsActionType.FetchKdsOrders, function (params, _a) {
|
|
80
42
|
var getState = _a.getState, rejectWithValue = _a.rejectWithValue;
|
|
81
43
|
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
82
|
-
var api, args, orders, ordersKds,
|
|
44
|
+
var api, args, orders, ordersKds, prepStations, stationCounts, err_1;
|
|
83
45
|
return tslib_1.__generator(this, function (_b) {
|
|
84
46
|
switch (_b.label) {
|
|
85
47
|
case 0:
|
|
@@ -90,9 +52,9 @@ exports.fetchKdsOrders = (0, toolkit_1.createAsyncThunk)(KdsActionType.FetchKdsO
|
|
|
90
52
|
case 1:
|
|
91
53
|
orders = _b.sent();
|
|
92
54
|
ordersKds = (0, utils_1.makeKdsOrders)(orders);
|
|
93
|
-
|
|
94
|
-
stationCounts =
|
|
95
|
-
? (0, utils_1.makeKdsStationCounts)(ordersKds,
|
|
55
|
+
prepStations = getState().kds.prepStations;
|
|
56
|
+
stationCounts = prepStations
|
|
57
|
+
? (0, utils_1.makeKdsStationCounts)(ordersKds, prepStations)
|
|
96
58
|
: null;
|
|
97
59
|
// const itemTypes = getState().kds.itemTypes
|
|
98
60
|
// const counts = makeKdsCounts(itemTypes, ordersKds)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IpAddress } from '../global';
|
|
2
|
-
import { PrepStatus } from './kds';
|
|
2
|
+
import { PrepStations, PrepStatus } from './kds';
|
|
3
3
|
export interface Config {
|
|
4
4
|
backup_printer_ip_address: IpAddress | null;
|
|
5
5
|
backup_printer_use_beeper: boolean;
|
|
@@ -15,6 +15,7 @@ export interface Config {
|
|
|
15
15
|
name: string;
|
|
16
16
|
pos_server_id: number;
|
|
17
17
|
pos_terminal_id: number;
|
|
18
|
+
prep_stations?: PrepStations | null;
|
|
18
19
|
print_kds: boolean;
|
|
19
20
|
print_receipt: 'never' | 'always' | 'prompt';
|
|
20
21
|
printer: IpAddress;
|
|
@@ -12,7 +12,7 @@ export declare type KdsAssemblyOptions = 'AUTO_PRINT' | 'PRINT_DONE' | 'MARK_DON
|
|
|
12
12
|
export interface PrepStation {
|
|
13
13
|
prep_station_id: number;
|
|
14
14
|
name: string;
|
|
15
|
-
item_type_ids: number[];
|
|
15
|
+
item_type_ids: number[] | null;
|
|
16
16
|
prep_type: KdsPrepType;
|
|
17
17
|
assembly_options: KdsAssemblyOptions;
|
|
18
18
|
show_print: boolean;
|
|
@@ -10,7 +10,7 @@ export declare const makeCurrentOrders: (orders: OrdersKds) => OrdersKds;
|
|
|
10
10
|
export declare const makeFutureOrders: (orders: OrdersKds) => OrdersKds;
|
|
11
11
|
export declare const makeCompletedOrders: (orders: OrdersKds) => OrdersKds;
|
|
12
12
|
export declare const makeOrdersOfType: (orders: OrdersKds, orderType: KdsOrderType) => OrdersKds;
|
|
13
|
-
export declare const filterOrdersByItemType: (orders: OrdersKds, itemTypeIds: number[]) => OrdersKds;
|
|
13
|
+
export declare const filterOrdersByItemType: (orders: OrdersKds, itemTypeIds: number[] | null) => OrdersKds;
|
|
14
14
|
export declare const makeOrdersForPrepStation: (orders: OrdersKds, prepStation: PrepStation, orderType: KdsOrderType) => OrdersKds;
|
|
15
15
|
export declare const makeKdsCounts: (itemTypes: ItemTypes | null, orders: OrdersKds | null) => {
|
|
16
16
|
current: null;
|
|
@@ -25,7 +25,7 @@ export declare const makeCurrentAndFutureOrders: (orders: OrdersKds) => {
|
|
|
25
25
|
current: OrdersKds;
|
|
26
26
|
future: OrdersKds;
|
|
27
27
|
};
|
|
28
|
-
export declare const makeKdsStationCount: (orders: OrdersKds, itemTypeIds: number[]) => KdsStationOrderTypeCount;
|
|
28
|
+
export declare const makeKdsStationCount: (orders: OrdersKds, itemTypeIds: number[] | null) => KdsStationOrderTypeCount;
|
|
29
29
|
export declare const makeKdsStationCounts: (orders: OrdersKds, prepStations: PrepStations) => KdsStationCounts;
|
|
30
30
|
export declare const makeOrderBuckets: (orders: OrdersKds, tz: Timezone, prepStates?: Array<PrepStatus>) => OrderBuckets;
|
|
31
31
|
export declare const makeOrderBucketsCounts: (itemTypes?: ItemTypes, orders?: OrdersKds) => Record<string, number>;
|
package/dist/cjs/utils/orders.js
CHANGED
|
@@ -113,6 +113,8 @@ var makeOrdersOfType = function (orders, orderType) {
|
|
|
113
113
|
};
|
|
114
114
|
exports.makeOrdersOfType = makeOrdersOfType;
|
|
115
115
|
var filterOrdersByItemType = function (orders, itemTypeIds) {
|
|
116
|
+
if (!itemTypeIds)
|
|
117
|
+
return orders;
|
|
116
118
|
return orders
|
|
117
119
|
.reduce(function (arr, i) {
|
|
118
120
|
var tickets = i.tickets.filter(function (t) {
|
|
@@ -215,10 +217,16 @@ var makeKdsStationCount = function (orders, itemTypeIds) {
|
|
|
215
217
|
exports.makeKdsStationCount = makeKdsStationCount;
|
|
216
218
|
var makeKdsStationCounts = function (orders, prepStations) {
|
|
217
219
|
var _a = (0, exports.makeCurrentAndFutureOrders)(orders), currentOrders = _a.current, futureOrders = _a.future;
|
|
220
|
+
var currentAssembly = currentOrders.filter(function (i) { return (0, exports.notDone)(i.prep_status); });
|
|
221
|
+
var currentExpo = currentOrders.filter(function (i) { return i.prep_status === 'DONE'; });
|
|
222
|
+
var futureAssembly = futureOrders.filter(function (i) { return (0, exports.notDone)(i.prep_status); });
|
|
223
|
+
var futureExpo = futureOrders.filter(function (i) { return i.prep_status === 'DONE'; });
|
|
218
224
|
return prepStations.reduce(function (obj, i) {
|
|
219
225
|
var _a;
|
|
220
|
-
var
|
|
221
|
-
var
|
|
226
|
+
var currentFiltered = i.prep_type === 'ASSEMBLY' ? currentAssembly : currentExpo;
|
|
227
|
+
var current = (0, exports.makeKdsStationCount)(currentFiltered, i.item_type_ids);
|
|
228
|
+
var futureFiltered = i.prep_type === 'ASSEMBLY' ? futureAssembly : futureExpo;
|
|
229
|
+
var future = (0, exports.makeKdsStationCount)(futureFiltered, i.item_type_ids);
|
|
222
230
|
return tslib_1.__assign(tslib_1.__assign({}, obj), (_a = {}, _a[i.prep_station_id] = { CURRENT: current, FUTURE: future }, _a));
|
|
223
231
|
}, {});
|
|
224
232
|
};
|
|
@@ -6,7 +6,7 @@ import { ReducerType } from './types';
|
|
|
6
6
|
import { timezoneMap, getUserTimezone, currentLocalDateStr } from '../utils';
|
|
7
7
|
import { errorsApi } from '../services/errors';
|
|
8
8
|
import { setCashier } from './pos';
|
|
9
|
-
import { setKdsItemTypes } from './kds';
|
|
9
|
+
import { setKdsItemTypes, setKdsPrepStations } from './kds';
|
|
10
10
|
var initialState = {
|
|
11
11
|
api: null,
|
|
12
12
|
app: null,
|
|
@@ -31,7 +31,7 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
|
|
|
31
31
|
var apiUrl = _a.apiUrl, version = _a.version;
|
|
32
32
|
var dispatch = _b.dispatch, getState = _b.getState, rejectWithValue = _b.rejectWithValue;
|
|
33
33
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
34
|
-
var app, api, _c, config, store, _d, selectOptions, _e, itemTypes, _f, levelup, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, name_1, ipAddress, hasPinpad, hasCashDrawer, err_2;
|
|
34
|
+
var app, api, _c, config, store, _d, selectOptions, _e, itemTypes, _f, levelup, err, cashier, employee, tz, businessDate, err_1, revenueCenterId, name_1, ipAddress, hasPinpad, hasCashDrawer, prep_stations, err_2;
|
|
35
35
|
return __generator(this, function (_g) {
|
|
36
36
|
switch (_g.label) {
|
|
37
37
|
case 0:
|
|
@@ -67,9 +67,10 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
|
|
|
67
67
|
err_1 = _g.sent();
|
|
68
68
|
return [3 /*break*/, 5];
|
|
69
69
|
case 5:
|
|
70
|
-
dispatch(setKdsItemTypes(itemTypes));
|
|
71
70
|
revenueCenterId = store.revenue_center_id;
|
|
72
|
-
name_1 = config.name, ipAddress = config.ip_address, hasPinpad = config.has_pinpad, hasCashDrawer = config.has_cashdrawer;
|
|
71
|
+
name_1 = config.name, ipAddress = config.ip_address, hasPinpad = config.has_pinpad, hasCashDrawer = config.has_cashdrawer, prep_stations = config.prep_stations;
|
|
72
|
+
dispatch(setKdsItemTypes(itemTypes));
|
|
73
|
+
dispatch(setKdsPrepStations(prep_stations));
|
|
73
74
|
return [2 /*return*/, {
|
|
74
75
|
api: api,
|
|
75
76
|
app: app,
|
package/dist/esm/slices/kds.js
CHANGED
|
@@ -4,47 +4,9 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
|
4
4
|
import { ReducerType } from './types';
|
|
5
5
|
import { currentLocalDate, isoToDate, makeFetchOrdersArgs, makeKdsOrders, makeKdsStationCounts, makeOrdersForPrepStation, notDone, timezoneMap } from '../utils';
|
|
6
6
|
import { addAlert } from './alerts';
|
|
7
|
-
var prepStations = [
|
|
8
|
-
{
|
|
9
|
-
prep_station_id: 1,
|
|
10
|
-
name: 'Entrees',
|
|
11
|
-
item_type_ids: [4],
|
|
12
|
-
prep_type: 'ASSEMBLY',
|
|
13
|
-
assembly_options: 'PRINT_DONE',
|
|
14
|
-
show_print: false,
|
|
15
|
-
show_reset: false
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
prep_station_id: 2,
|
|
19
|
-
name: 'Sides',
|
|
20
|
-
item_type_ids: [5],
|
|
21
|
-
prep_type: 'ASSEMBLY',
|
|
22
|
-
assembly_options: 'MARK_DONE',
|
|
23
|
-
show_print: false,
|
|
24
|
-
show_reset: false
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
prep_station_id: 3,
|
|
28
|
-
name: 'Drinks',
|
|
29
|
-
item_type_ids: [6],
|
|
30
|
-
prep_type: 'ASSEMBLY',
|
|
31
|
-
assembly_options: 'PRINT_AND_DONE',
|
|
32
|
-
show_print: false,
|
|
33
|
-
show_reset: false
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
prep_station_id: 4,
|
|
37
|
-
name: 'Expo',
|
|
38
|
-
item_type_ids: [4, 5, 6],
|
|
39
|
-
prep_type: 'EXPO',
|
|
40
|
-
assembly_options: null,
|
|
41
|
-
show_print: false,
|
|
42
|
-
show_reset: false
|
|
43
|
-
}
|
|
44
|
-
];
|
|
45
7
|
var initialState = {
|
|
46
8
|
itemTypes: null,
|
|
47
|
-
prepStations:
|
|
9
|
+
prepStations: [],
|
|
48
10
|
prepStationId: null,
|
|
49
11
|
orderType: 'CURRENT',
|
|
50
12
|
columns: 4,
|
|
@@ -76,7 +38,7 @@ export var KdsActionType;
|
|
|
76
38
|
export var fetchKdsOrders = createAsyncThunk(KdsActionType.FetchKdsOrders, function (params, _a) {
|
|
77
39
|
var getState = _a.getState, rejectWithValue = _a.rejectWithValue;
|
|
78
40
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
79
|
-
var api, args, orders, ordersKds,
|
|
41
|
+
var api, args, orders, ordersKds, prepStations, stationCounts, err_1;
|
|
80
42
|
return __generator(this, function (_b) {
|
|
81
43
|
switch (_b.label) {
|
|
82
44
|
case 0:
|
|
@@ -87,9 +49,9 @@ export var fetchKdsOrders = createAsyncThunk(KdsActionType.FetchKdsOrders, funct
|
|
|
87
49
|
case 1:
|
|
88
50
|
orders = _b.sent();
|
|
89
51
|
ordersKds = makeKdsOrders(orders);
|
|
90
|
-
|
|
91
|
-
stationCounts =
|
|
92
|
-
? makeKdsStationCounts(ordersKds,
|
|
52
|
+
prepStations = getState().kds.prepStations;
|
|
53
|
+
stationCounts = prepStations
|
|
54
|
+
? makeKdsStationCounts(ordersKds, prepStations)
|
|
93
55
|
: null;
|
|
94
56
|
// const itemTypes = getState().kds.itemTypes
|
|
95
57
|
// const counts = makeKdsCounts(itemTypes, ordersKds)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IpAddress } from '../global';
|
|
2
|
-
import { PrepStatus } from './kds';
|
|
2
|
+
import { PrepStations, PrepStatus } from './kds';
|
|
3
3
|
export interface Config {
|
|
4
4
|
backup_printer_ip_address: IpAddress | null;
|
|
5
5
|
backup_printer_use_beeper: boolean;
|
|
@@ -15,6 +15,7 @@ export interface Config {
|
|
|
15
15
|
name: string;
|
|
16
16
|
pos_server_id: number;
|
|
17
17
|
pos_terminal_id: number;
|
|
18
|
+
prep_stations?: PrepStations | null;
|
|
18
19
|
print_kds: boolean;
|
|
19
20
|
print_receipt: 'never' | 'always' | 'prompt';
|
|
20
21
|
printer: IpAddress;
|
|
@@ -12,7 +12,7 @@ export declare type KdsAssemblyOptions = 'AUTO_PRINT' | 'PRINT_DONE' | 'MARK_DON
|
|
|
12
12
|
export interface PrepStation {
|
|
13
13
|
prep_station_id: number;
|
|
14
14
|
name: string;
|
|
15
|
-
item_type_ids: number[];
|
|
15
|
+
item_type_ids: number[] | null;
|
|
16
16
|
prep_type: KdsPrepType;
|
|
17
17
|
assembly_options: KdsAssemblyOptions;
|
|
18
18
|
show_print: boolean;
|
|
@@ -10,7 +10,7 @@ export declare const makeCurrentOrders: (orders: OrdersKds) => OrdersKds;
|
|
|
10
10
|
export declare const makeFutureOrders: (orders: OrdersKds) => OrdersKds;
|
|
11
11
|
export declare const makeCompletedOrders: (orders: OrdersKds) => OrdersKds;
|
|
12
12
|
export declare const makeOrdersOfType: (orders: OrdersKds, orderType: KdsOrderType) => OrdersKds;
|
|
13
|
-
export declare const filterOrdersByItemType: (orders: OrdersKds, itemTypeIds: number[]) => OrdersKds;
|
|
13
|
+
export declare const filterOrdersByItemType: (orders: OrdersKds, itemTypeIds: number[] | null) => OrdersKds;
|
|
14
14
|
export declare const makeOrdersForPrepStation: (orders: OrdersKds, prepStation: PrepStation, orderType: KdsOrderType) => OrdersKds;
|
|
15
15
|
export declare const makeKdsCounts: (itemTypes: ItemTypes | null, orders: OrdersKds | null) => {
|
|
16
16
|
current: null;
|
|
@@ -25,7 +25,7 @@ export declare const makeCurrentAndFutureOrders: (orders: OrdersKds) => {
|
|
|
25
25
|
current: OrdersKds;
|
|
26
26
|
future: OrdersKds;
|
|
27
27
|
};
|
|
28
|
-
export declare const makeKdsStationCount: (orders: OrdersKds, itemTypeIds: number[]) => KdsStationOrderTypeCount;
|
|
28
|
+
export declare const makeKdsStationCount: (orders: OrdersKds, itemTypeIds: number[] | null) => KdsStationOrderTypeCount;
|
|
29
29
|
export declare const makeKdsStationCounts: (orders: OrdersKds, prepStations: PrepStations) => KdsStationCounts;
|
|
30
30
|
export declare const makeOrderBuckets: (orders: OrdersKds, tz: Timezone, prepStates?: Array<PrepStatus>) => OrderBuckets;
|
|
31
31
|
export declare const makeOrderBucketsCounts: (itemTypes?: ItemTypes, orders?: OrdersKds) => Record<string, number>;
|
package/dist/esm/utils/orders.js
CHANGED
|
@@ -100,6 +100,8 @@ export var makeOrdersOfType = function (orders, orderType) {
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
export var filterOrdersByItemType = function (orders, itemTypeIds) {
|
|
103
|
+
if (!itemTypeIds)
|
|
104
|
+
return orders;
|
|
103
105
|
return orders
|
|
104
106
|
.reduce(function (arr, i) {
|
|
105
107
|
var tickets = i.tickets.filter(function (t) {
|
|
@@ -197,10 +199,16 @@ export var makeKdsStationCount = function (orders, itemTypeIds) {
|
|
|
197
199
|
};
|
|
198
200
|
export var makeKdsStationCounts = function (orders, prepStations) {
|
|
199
201
|
var _a = makeCurrentAndFutureOrders(orders), currentOrders = _a.current, futureOrders = _a.future;
|
|
202
|
+
var currentAssembly = currentOrders.filter(function (i) { return notDone(i.prep_status); });
|
|
203
|
+
var currentExpo = currentOrders.filter(function (i) { return i.prep_status === 'DONE'; });
|
|
204
|
+
var futureAssembly = futureOrders.filter(function (i) { return notDone(i.prep_status); });
|
|
205
|
+
var futureExpo = futureOrders.filter(function (i) { return i.prep_status === 'DONE'; });
|
|
200
206
|
return prepStations.reduce(function (obj, i) {
|
|
201
207
|
var _a;
|
|
202
|
-
var
|
|
203
|
-
var
|
|
208
|
+
var currentFiltered = i.prep_type === 'ASSEMBLY' ? currentAssembly : currentExpo;
|
|
209
|
+
var current = makeKdsStationCount(currentFiltered, i.item_type_ids);
|
|
210
|
+
var futureFiltered = i.prep_type === 'ASSEMBLY' ? futureAssembly : futureExpo;
|
|
211
|
+
var future = makeKdsStationCount(futureFiltered, i.item_type_ids);
|
|
204
212
|
return __assign(__assign({}, obj), (_a = {}, _a[i.prep_station_id] = { CURRENT: current, FUTURE: future }, _a));
|
|
205
213
|
}, {});
|
|
206
214
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
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",
|