@open-tender/store 1.1.48 → 1.1.49
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/app/hooks.d.ts +1 -0
- package/dist/cjs/app/store.d.ts +4 -0
- package/dist/cjs/app/store.js +1 -0
- package/dist/cjs/services/api.d.ts +2 -1
- package/dist/cjs/services/api.js +3 -0
- package/dist/cjs/slices/index.d.ts +1 -0
- package/dist/cjs/slices/index.js +1 -0
- package/dist/cjs/slices/kiosk.d.ts +5 -0
- package/dist/cjs/slices/menuPages.d.ts +1 -0
- package/dist/cjs/slices/order.d.ts +4 -0
- package/dist/cjs/slices/sendReceipt.d.ts +25 -0
- package/dist/cjs/slices/sendReceipt.js +57 -0
- package/dist/cjs/slices/types.d.ts +1 -0
- package/dist/cjs/slices/types.js +1 -0
- package/dist/esm/app/hooks.d.ts +1 -0
- package/dist/esm/app/store.d.ts +4 -0
- package/dist/esm/app/store.js +2 -1
- package/dist/esm/services/api.d.ts +2 -1
- package/dist/esm/services/api.js +3 -0
- package/dist/esm/slices/index.d.ts +1 -0
- package/dist/esm/slices/index.js +1 -0
- package/dist/esm/slices/kiosk.d.ts +5 -0
- package/dist/esm/slices/menuPages.d.ts +1 -0
- package/dist/esm/slices/order.d.ts +4 -0
- package/dist/esm/slices/sendReceipt.d.ts +25 -0
- package/dist/esm/slices/sendReceipt.js +53 -0
- package/dist/esm/slices/types.d.ts +1 -0
- package/dist/esm/slices/types.js +1 -0
- package/package.json +2 -2
package/dist/cjs/app/hooks.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
22
22
|
pos: import("..").PosState;
|
|
23
23
|
punches: import("..").PunchesState;
|
|
24
24
|
refund: import("..").RefundState;
|
|
25
|
+
sendReceipt: import("..").SendReceiptState;
|
|
25
26
|
settings: import("..").SettingsState;
|
|
26
27
|
sidebar: import("..").SidebarState;
|
|
27
28
|
surcharges: import("..").SurchargesState;
|
package/dist/cjs/app/store.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const appReducer: import("redux").Reducer<{
|
|
|
21
21
|
pos: import("../slices").PosState;
|
|
22
22
|
punches: import("../slices").PunchesState;
|
|
23
23
|
refund: import("../slices").RefundState;
|
|
24
|
+
sendReceipt: import("../slices").SendReceiptState;
|
|
24
25
|
settings: import("../slices").SettingsState;
|
|
25
26
|
sidebar: import("../slices").SidebarState;
|
|
26
27
|
surcharges: import("../slices").SurchargesState;
|
|
@@ -47,6 +48,7 @@ export declare const appReducer: import("redux").Reducer<{
|
|
|
47
48
|
pos: import("../slices").PosState | undefined;
|
|
48
49
|
punches: import("../slices").PunchesState | undefined;
|
|
49
50
|
refund: import("../slices").RefundState | undefined;
|
|
51
|
+
sendReceipt: import("../slices").SendReceiptState | undefined;
|
|
50
52
|
settings: import("../slices").SettingsState | undefined;
|
|
51
53
|
sidebar: import("../slices").SidebarState | undefined;
|
|
52
54
|
surcharges: import("../slices").SurchargesState | undefined;
|
|
@@ -75,6 +77,7 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
75
77
|
pos: import("../slices").PosState;
|
|
76
78
|
punches: import("../slices").PunchesState;
|
|
77
79
|
refund: import("../slices").RefundState;
|
|
80
|
+
sendReceipt: import("../slices").SendReceiptState;
|
|
78
81
|
settings: import("../slices").SettingsState;
|
|
79
82
|
sidebar: import("../slices").SidebarState;
|
|
80
83
|
surcharges: import("../slices").SurchargesState;
|
|
@@ -102,6 +105,7 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
102
105
|
pos: import("../slices").PosState;
|
|
103
106
|
punches: import("../slices").PunchesState;
|
|
104
107
|
refund: import("../slices").RefundState;
|
|
108
|
+
sendReceipt: import("../slices").SendReceiptState;
|
|
105
109
|
settings: import("../slices").SettingsState;
|
|
106
110
|
sidebar: import("../slices").SidebarState;
|
|
107
111
|
surcharges: import("../slices").SurchargesState;
|
package/dist/cjs/app/store.js
CHANGED
|
@@ -25,6 +25,7 @@ exports.appReducer = (0, toolkit_1.combineReducers)({
|
|
|
25
25
|
pos: slices_1.posReducer,
|
|
26
26
|
punches: slices_1.punchesReducer,
|
|
27
27
|
refund: slices_1.refundReducer,
|
|
28
|
+
sendReceipt: slices_1.sendReceiptReducer,
|
|
28
29
|
settings: slices_1.settingsReducer,
|
|
29
30
|
sidebar: slices_1.sidebarReducer,
|
|
30
31
|
surcharges: slices_1.surchargesReducer,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arrivals, CheckoutTender, CustomerEndpoints, CustomerIdentifier, CustomerIdentify, Discount, Discounts, ItemTypes, Menu, Order, Orders, OrderCreatePos, OrderTender, OrderUpdate, OrderType, RequestedAt, RevenueCenter, SelectOptions, ServiceType, TicketUpdate, TicketsUpdate, TicketStatusUpdate, EntityType, KioskConfig, Store, Settings, InternalSettings, GiftCardCredit, GiftCardBalance, Employee, Punch, Employees, CashEvent, CashSummary, ErrorAlerts, ErrorAlert, OfflineAuths, OfflineAuthsResult, MenuColors, MenuPages, Surcharges, Taxes, CheckoutTenderPos, Refund, DeviceRead } from '@open-tender/types';
|
|
1
|
+
import { Arrivals, CheckoutTender, CustomerEndpoints, CustomerIdentifier, CustomerIdentify, Discount, Discounts, ItemTypes, Menu, Order, Orders, OrderCreatePos, OrderTender, OrderUpdate, OrderType, RequestedAt, RevenueCenter, SelectOptions, ServiceType, TicketUpdate, TicketsUpdate, TicketStatusUpdate, EntityType, KioskConfig, Store, Settings, InternalSettings, GiftCardCredit, GiftCardBalance, Employee, Punch, Employees, CashEvent, CashSummary, ErrorAlerts, ErrorAlert, OfflineAuths, OfflineAuthsResult, MenuColors, MenuPages, Surcharges, Taxes, CheckoutTenderPos, Refund, DeviceRead, OrderCreateSendReceipt } from '@open-tender/types';
|
|
2
2
|
import { OrdersParams } from '../slices';
|
|
3
3
|
export interface InitAPI {
|
|
4
4
|
apiUrl: string;
|
|
@@ -60,6 +60,7 @@ declare class PosAPI {
|
|
|
60
60
|
postChipDNACancel(): Promise<null>;
|
|
61
61
|
postChipDNATmsUpdate(): Promise<null>;
|
|
62
62
|
postIdentifyCustomer(data: CustomerIdentifier): Promise<CustomerIdentify>;
|
|
63
|
+
postSendReceipt(orderUuid: string, data: OrderCreateSendReceipt): Promise<void>;
|
|
63
64
|
getCustomer(customerId: number, endpoints: CustomerEndpoints): Promise<any>;
|
|
64
65
|
postOrderValidate(order: OrderCreatePos): Promise<Order>;
|
|
65
66
|
postOrder(order: OrderCreatePos): Promise<Order>;
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -288,6 +288,9 @@ var PosAPI = /** @class */ (function () {
|
|
|
288
288
|
PosAPI.prototype.postIdentifyCustomer = function (data) {
|
|
289
289
|
return this.request("/identify-customer", 'POST', data);
|
|
290
290
|
};
|
|
291
|
+
PosAPI.prototype.postSendReceipt = function (orderUuid, data) {
|
|
292
|
+
return this.request("/orders/".concat(orderUuid, "/send-receipt"), 'POST', data);
|
|
293
|
+
};
|
|
291
294
|
PosAPI.prototype.getCustomer = function (customerId, endpoints) {
|
|
292
295
|
var query = "endpoints=".concat(endpoints.join(','));
|
|
293
296
|
return this.request("/customers/".concat(customerId, "?").concat(query));
|
package/dist/cjs/slices/index.js
CHANGED
|
@@ -22,6 +22,7 @@ tslib_1.__exportStar(require("./order"), exports);
|
|
|
22
22
|
tslib_1.__exportStar(require("./pos"), exports);
|
|
23
23
|
tslib_1.__exportStar(require("./punches"), exports);
|
|
24
24
|
tslib_1.__exportStar(require("./refund"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./sendReceipt"), exports);
|
|
25
26
|
tslib_1.__exportStar(require("./settings"), exports);
|
|
26
27
|
tslib_1.__exportStar(require("./sidebar"), exports);
|
|
27
28
|
tslib_1.__exportStar(require("./surcharges"), exports);
|
|
@@ -62,6 +62,7 @@ export declare const selectKioskTerminal: ((state: {
|
|
|
62
62
|
pos: import("./pos").PosState;
|
|
63
63
|
punches: import("./punches").PunchesState;
|
|
64
64
|
refund: import("./refund").RefundState;
|
|
65
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
65
66
|
settings: import("./settings").SettingsState;
|
|
66
67
|
sidebar: import("./sidebar").SidebarState;
|
|
67
68
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -118,6 +119,7 @@ export declare const selectKioskShowPrint: ((state: {
|
|
|
118
119
|
pos: import("./pos").PosState;
|
|
119
120
|
punches: import("./punches").PunchesState;
|
|
120
121
|
refund: import("./refund").RefundState;
|
|
122
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
121
123
|
settings: import("./settings").SettingsState;
|
|
122
124
|
sidebar: import("./sidebar").SidebarState;
|
|
123
125
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -174,6 +176,7 @@ export declare const selectKioskApi: ((state: {
|
|
|
174
176
|
pos: import("./pos").PosState;
|
|
175
177
|
punches: import("./punches").PunchesState;
|
|
176
178
|
refund: import("./refund").RefundState;
|
|
179
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
177
180
|
settings: import("./settings").SettingsState;
|
|
178
181
|
sidebar: import("./sidebar").SidebarState;
|
|
179
182
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -221,6 +224,7 @@ export declare const selectKioskConfig: ((state: {
|
|
|
221
224
|
pos: import("./pos").PosState;
|
|
222
225
|
punches: import("./punches").PunchesState;
|
|
223
226
|
refund: import("./refund").RefundState;
|
|
227
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
224
228
|
settings: import("./settings").SettingsState;
|
|
225
229
|
sidebar: import("./sidebar").SidebarState;
|
|
226
230
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -268,6 +272,7 @@ export declare const selectKioskConfigScreen: (screen: string) => ((state: {
|
|
|
268
272
|
pos: import("./pos").PosState;
|
|
269
273
|
punches: import("./punches").PunchesState;
|
|
270
274
|
refund: import("./refund").RefundState;
|
|
275
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
271
276
|
settings: import("./settings").SettingsState;
|
|
272
277
|
sidebar: import("./sidebar").SidebarState;
|
|
273
278
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -42,6 +42,7 @@ export declare const selectMenuPagesFiltered: ((state: {
|
|
|
42
42
|
pos: import("./pos").PosState;
|
|
43
43
|
punches: import("./punches").PunchesState;
|
|
44
44
|
refund: import("./refund").RefundState;
|
|
45
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
45
46
|
settings: import("./settings").SettingsState;
|
|
46
47
|
sidebar: import("./sidebar").SidebarState;
|
|
47
48
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -85,6 +85,7 @@ export declare const selectCartIds: ((state: {
|
|
|
85
85
|
pos: import("./pos").PosState;
|
|
86
86
|
punches: import("./punches").PunchesState;
|
|
87
87
|
refund: import("./refund").RefundState;
|
|
88
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
88
89
|
settings: import("./settings").SettingsState;
|
|
89
90
|
sidebar: import("./sidebar").SidebarState;
|
|
90
91
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -132,6 +133,7 @@ export declare const selectCartQuantity: ((state: {
|
|
|
132
133
|
pos: import("./pos").PosState;
|
|
133
134
|
punches: import("./punches").PunchesState;
|
|
134
135
|
refund: import("./refund").RefundState;
|
|
136
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
135
137
|
settings: import("./settings").SettingsState;
|
|
136
138
|
sidebar: import("./sidebar").SidebarState;
|
|
137
139
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -179,6 +181,7 @@ export declare const selectCartTotal: ((state: {
|
|
|
179
181
|
pos: import("./pos").PosState;
|
|
180
182
|
punches: import("./punches").PunchesState;
|
|
181
183
|
refund: import("./refund").RefundState;
|
|
184
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
182
185
|
settings: import("./settings").SettingsState;
|
|
183
186
|
sidebar: import("./sidebar").SidebarState;
|
|
184
187
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -226,6 +229,7 @@ export declare const selectCartTotals: ((state: {
|
|
|
226
229
|
pos: import("./pos").PosState;
|
|
227
230
|
punches: import("./punches").PunchesState;
|
|
228
231
|
refund: import("./refund").RefundState;
|
|
232
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
229
233
|
settings: import("./settings").SettingsState;
|
|
230
234
|
sidebar: import("./sidebar").SidebarState;
|
|
231
235
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OrderCreateSendReceipt, RequestError, RequestStatus } from '@open-tender/types';
|
|
2
|
+
import { AppState } from '../app';
|
|
3
|
+
export interface SendReceiptState {
|
|
4
|
+
loading: RequestStatus;
|
|
5
|
+
error: RequestError;
|
|
6
|
+
}
|
|
7
|
+
export declare enum SendReceiptActionType {
|
|
8
|
+
SendReceipt = "SendReceipt/sendReceipt"
|
|
9
|
+
}
|
|
10
|
+
export declare const sendReceipt: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
11
|
+
orderUuid: string;
|
|
12
|
+
data: OrderCreateSendReceipt;
|
|
13
|
+
}, {
|
|
14
|
+
state: AppState;
|
|
15
|
+
rejectValue: RequestError;
|
|
16
|
+
dispatch?: import("redux").Dispatch<import("redux").UnknownAction> | undefined;
|
|
17
|
+
extra?: unknown;
|
|
18
|
+
serializedErrorType?: unknown;
|
|
19
|
+
pendingMeta?: unknown;
|
|
20
|
+
fulfilledMeta?: unknown;
|
|
21
|
+
rejectedMeta?: unknown;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const resetSendReceipt: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"sendReceipt/resetSendReceipt">;
|
|
24
|
+
export declare const selectSendReceipt: (state: AppState) => SendReceiptState;
|
|
25
|
+
export declare const sendReceiptReducer: import("redux").Reducer<SendReceiptState>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendReceiptReducer = exports.selectSendReceipt = exports.resetSendReceipt = exports.sendReceipt = exports.SendReceiptActionType = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
var types_1 = require("./types");
|
|
7
|
+
var initialState = {
|
|
8
|
+
loading: 'idle',
|
|
9
|
+
error: null
|
|
10
|
+
};
|
|
11
|
+
var SendReceiptActionType;
|
|
12
|
+
(function (SendReceiptActionType) {
|
|
13
|
+
SendReceiptActionType["SendReceipt"] = "SendReceipt/sendReceipt";
|
|
14
|
+
})(SendReceiptActionType || (exports.SendReceiptActionType = SendReceiptActionType = {}));
|
|
15
|
+
exports.sendReceipt = (0, toolkit_1.createAsyncThunk)(SendReceiptActionType.SendReceipt, function (_a, _b) { return tslib_1.__awaiter(void 0, [_a, _b], void 0, function (_c, _d) {
|
|
16
|
+
var api, err_1;
|
|
17
|
+
var orderUuid = _c.orderUuid, data = _c.data;
|
|
18
|
+
var getState = _d.getState, rejectWithValue = _d.rejectWithValue;
|
|
19
|
+
return tslib_1.__generator(this, function (_e) {
|
|
20
|
+
switch (_e.label) {
|
|
21
|
+
case 0:
|
|
22
|
+
_e.trys.push([0, 2, , 3]);
|
|
23
|
+
api = getState().config.api;
|
|
24
|
+
return [4 /*yield*/, api.postSendReceipt(orderUuid, data)];
|
|
25
|
+
case 1: return [2 /*return*/, _e.sent()];
|
|
26
|
+
case 2:
|
|
27
|
+
err_1 = _e.sent();
|
|
28
|
+
return [2 /*return*/, rejectWithValue(err_1)];
|
|
29
|
+
case 3: return [2 /*return*/];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}); });
|
|
33
|
+
var sendReceiptSlice = (0, toolkit_1.createSlice)({
|
|
34
|
+
name: types_1.ReducerType.SendReceipt,
|
|
35
|
+
initialState: initialState,
|
|
36
|
+
reducers: {
|
|
37
|
+
resetSendReceipt: function () { return initialState; }
|
|
38
|
+
},
|
|
39
|
+
extraReducers: function (builder) {
|
|
40
|
+
builder
|
|
41
|
+
.addCase(exports.sendReceipt.fulfilled, function (state) {
|
|
42
|
+
state.loading = 'idle';
|
|
43
|
+
state.error = null;
|
|
44
|
+
})
|
|
45
|
+
.addCase(exports.sendReceipt.pending, function (state) {
|
|
46
|
+
state.loading = 'pending';
|
|
47
|
+
})
|
|
48
|
+
.addCase(exports.sendReceipt.rejected, function (state, action) {
|
|
49
|
+
state.error = action.payload;
|
|
50
|
+
state.loading = 'idle';
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
exports.resetSendReceipt = sendReceiptSlice.actions.resetSendReceipt;
|
|
55
|
+
var selectSendReceipt = function (state) { return state.sendReceipt; };
|
|
56
|
+
exports.selectSendReceipt = selectSendReceipt;
|
|
57
|
+
exports.sendReceiptReducer = sendReceiptSlice.reducer;
|
package/dist/cjs/slices/types.js
CHANGED
|
@@ -26,6 +26,7 @@ var ReducerType;
|
|
|
26
26
|
ReducerType["Pos"] = "pos";
|
|
27
27
|
ReducerType["Punches"] = "punches";
|
|
28
28
|
ReducerType["Refund"] = "refund";
|
|
29
|
+
ReducerType["SendReceipt"] = "sendReceipt";
|
|
29
30
|
ReducerType["Settings"] = "settings";
|
|
30
31
|
ReducerType["Sidebar"] = "sidebar";
|
|
31
32
|
ReducerType["Surcharges"] = "surcharges";
|
package/dist/esm/app/hooks.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
22
22
|
pos: import("..").PosState;
|
|
23
23
|
punches: import("..").PunchesState;
|
|
24
24
|
refund: import("..").RefundState;
|
|
25
|
+
sendReceipt: import("..").SendReceiptState;
|
|
25
26
|
settings: import("..").SettingsState;
|
|
26
27
|
sidebar: import("..").SidebarState;
|
|
27
28
|
surcharges: import("..").SurchargesState;
|
package/dist/esm/app/store.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const appReducer: import("redux").Reducer<{
|
|
|
21
21
|
pos: import("../slices").PosState;
|
|
22
22
|
punches: import("../slices").PunchesState;
|
|
23
23
|
refund: import("../slices").RefundState;
|
|
24
|
+
sendReceipt: import("../slices").SendReceiptState;
|
|
24
25
|
settings: import("../slices").SettingsState;
|
|
25
26
|
sidebar: import("../slices").SidebarState;
|
|
26
27
|
surcharges: import("../slices").SurchargesState;
|
|
@@ -47,6 +48,7 @@ export declare const appReducer: import("redux").Reducer<{
|
|
|
47
48
|
pos: import("../slices").PosState | undefined;
|
|
48
49
|
punches: import("../slices").PunchesState | undefined;
|
|
49
50
|
refund: import("../slices").RefundState | undefined;
|
|
51
|
+
sendReceipt: import("../slices").SendReceiptState | undefined;
|
|
50
52
|
settings: import("../slices").SettingsState | undefined;
|
|
51
53
|
sidebar: import("../slices").SidebarState | undefined;
|
|
52
54
|
surcharges: import("../slices").SurchargesState | undefined;
|
|
@@ -75,6 +77,7 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
75
77
|
pos: import("../slices").PosState;
|
|
76
78
|
punches: import("../slices").PunchesState;
|
|
77
79
|
refund: import("../slices").RefundState;
|
|
80
|
+
sendReceipt: import("../slices").SendReceiptState;
|
|
78
81
|
settings: import("../slices").SettingsState;
|
|
79
82
|
sidebar: import("../slices").SidebarState;
|
|
80
83
|
surcharges: import("../slices").SurchargesState;
|
|
@@ -102,6 +105,7 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
102
105
|
pos: import("../slices").PosState;
|
|
103
106
|
punches: import("../slices").PunchesState;
|
|
104
107
|
refund: import("../slices").RefundState;
|
|
108
|
+
sendReceipt: import("../slices").SendReceiptState;
|
|
105
109
|
settings: import("../slices").SettingsState;
|
|
106
110
|
sidebar: import("../slices").SidebarState;
|
|
107
111
|
surcharges: import("../slices").SurchargesState;
|
package/dist/esm/app/store.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
2
|
-
import { alertsReducer, arrivalsReducer, cartSummaryReducer, checkoutReducer, configReducer, customerReducer, customerIdentifyReducer, dealsReducer, discountsReducer, errorAlertsReducer, kdsReducer, kioskReducer, menuReducer, menuPagesReducer, modalReducer, notificationsReducer, offlineAuthsReducer, orderReducer, posReducer, punchesReducer, refundReducer, settingsReducer, sidebarReducer, surchargesReducer, taxesReducer } from '../slices';
|
|
2
|
+
import { alertsReducer, arrivalsReducer, cartSummaryReducer, checkoutReducer, configReducer, customerReducer, customerIdentifyReducer, dealsReducer, discountsReducer, errorAlertsReducer, kdsReducer, kioskReducer, menuReducer, menuPagesReducer, modalReducer, notificationsReducer, offlineAuthsReducer, orderReducer, posReducer, punchesReducer, refundReducer, sendReceiptReducer, settingsReducer, sidebarReducer, surchargesReducer, taxesReducer } from '../slices';
|
|
3
3
|
export var appReducer = combineReducers({
|
|
4
4
|
alerts: alertsReducer,
|
|
5
5
|
arrivals: arrivalsReducer,
|
|
@@ -22,6 +22,7 @@ export var appReducer = combineReducers({
|
|
|
22
22
|
pos: posReducer,
|
|
23
23
|
punches: punchesReducer,
|
|
24
24
|
refund: refundReducer,
|
|
25
|
+
sendReceipt: sendReceiptReducer,
|
|
25
26
|
settings: settingsReducer,
|
|
26
27
|
sidebar: sidebarReducer,
|
|
27
28
|
surcharges: surchargesReducer,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arrivals, CheckoutTender, CustomerEndpoints, CustomerIdentifier, CustomerIdentify, Discount, Discounts, ItemTypes, Menu, Order, Orders, OrderCreatePos, OrderTender, OrderUpdate, OrderType, RequestedAt, RevenueCenter, SelectOptions, ServiceType, TicketUpdate, TicketsUpdate, TicketStatusUpdate, EntityType, KioskConfig, Store, Settings, InternalSettings, GiftCardCredit, GiftCardBalance, Employee, Punch, Employees, CashEvent, CashSummary, ErrorAlerts, ErrorAlert, OfflineAuths, OfflineAuthsResult, MenuColors, MenuPages, Surcharges, Taxes, CheckoutTenderPos, Refund, DeviceRead } from '@open-tender/types';
|
|
1
|
+
import { Arrivals, CheckoutTender, CustomerEndpoints, CustomerIdentifier, CustomerIdentify, Discount, Discounts, ItemTypes, Menu, Order, Orders, OrderCreatePos, OrderTender, OrderUpdate, OrderType, RequestedAt, RevenueCenter, SelectOptions, ServiceType, TicketUpdate, TicketsUpdate, TicketStatusUpdate, EntityType, KioskConfig, Store, Settings, InternalSettings, GiftCardCredit, GiftCardBalance, Employee, Punch, Employees, CashEvent, CashSummary, ErrorAlerts, ErrorAlert, OfflineAuths, OfflineAuthsResult, MenuColors, MenuPages, Surcharges, Taxes, CheckoutTenderPos, Refund, DeviceRead, OrderCreateSendReceipt } from '@open-tender/types';
|
|
2
2
|
import { OrdersParams } from '../slices';
|
|
3
3
|
export interface InitAPI {
|
|
4
4
|
apiUrl: string;
|
|
@@ -60,6 +60,7 @@ declare class PosAPI {
|
|
|
60
60
|
postChipDNACancel(): Promise<null>;
|
|
61
61
|
postChipDNATmsUpdate(): Promise<null>;
|
|
62
62
|
postIdentifyCustomer(data: CustomerIdentifier): Promise<CustomerIdentify>;
|
|
63
|
+
postSendReceipt(orderUuid: string, data: OrderCreateSendReceipt): Promise<void>;
|
|
63
64
|
getCustomer(customerId: number, endpoints: CustomerEndpoints): Promise<any>;
|
|
64
65
|
postOrderValidate(order: OrderCreatePos): Promise<Order>;
|
|
65
66
|
postOrder(order: OrderCreatePos): Promise<Order>;
|
package/dist/esm/services/api.js
CHANGED
|
@@ -286,6 +286,9 @@ var PosAPI = /** @class */ (function () {
|
|
|
286
286
|
PosAPI.prototype.postIdentifyCustomer = function (data) {
|
|
287
287
|
return this.request("/identify-customer", 'POST', data);
|
|
288
288
|
};
|
|
289
|
+
PosAPI.prototype.postSendReceipt = function (orderUuid, data) {
|
|
290
|
+
return this.request("/orders/".concat(orderUuid, "/send-receipt"), 'POST', data);
|
|
291
|
+
};
|
|
289
292
|
PosAPI.prototype.getCustomer = function (customerId, endpoints) {
|
|
290
293
|
var query = "endpoints=".concat(endpoints.join(','));
|
|
291
294
|
return this.request("/customers/".concat(customerId, "?").concat(query));
|
package/dist/esm/slices/index.js
CHANGED
|
@@ -62,6 +62,7 @@ export declare const selectKioskTerminal: ((state: {
|
|
|
62
62
|
pos: import("./pos").PosState;
|
|
63
63
|
punches: import("./punches").PunchesState;
|
|
64
64
|
refund: import("./refund").RefundState;
|
|
65
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
65
66
|
settings: import("./settings").SettingsState;
|
|
66
67
|
sidebar: import("./sidebar").SidebarState;
|
|
67
68
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -118,6 +119,7 @@ export declare const selectKioskShowPrint: ((state: {
|
|
|
118
119
|
pos: import("./pos").PosState;
|
|
119
120
|
punches: import("./punches").PunchesState;
|
|
120
121
|
refund: import("./refund").RefundState;
|
|
122
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
121
123
|
settings: import("./settings").SettingsState;
|
|
122
124
|
sidebar: import("./sidebar").SidebarState;
|
|
123
125
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -174,6 +176,7 @@ export declare const selectKioskApi: ((state: {
|
|
|
174
176
|
pos: import("./pos").PosState;
|
|
175
177
|
punches: import("./punches").PunchesState;
|
|
176
178
|
refund: import("./refund").RefundState;
|
|
179
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
177
180
|
settings: import("./settings").SettingsState;
|
|
178
181
|
sidebar: import("./sidebar").SidebarState;
|
|
179
182
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -221,6 +224,7 @@ export declare const selectKioskConfig: ((state: {
|
|
|
221
224
|
pos: import("./pos").PosState;
|
|
222
225
|
punches: import("./punches").PunchesState;
|
|
223
226
|
refund: import("./refund").RefundState;
|
|
227
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
224
228
|
settings: import("./settings").SettingsState;
|
|
225
229
|
sidebar: import("./sidebar").SidebarState;
|
|
226
230
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -268,6 +272,7 @@ export declare const selectKioskConfigScreen: (screen: string) => ((state: {
|
|
|
268
272
|
pos: import("./pos").PosState;
|
|
269
273
|
punches: import("./punches").PunchesState;
|
|
270
274
|
refund: import("./refund").RefundState;
|
|
275
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
271
276
|
settings: import("./settings").SettingsState;
|
|
272
277
|
sidebar: import("./sidebar").SidebarState;
|
|
273
278
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -42,6 +42,7 @@ export declare const selectMenuPagesFiltered: ((state: {
|
|
|
42
42
|
pos: import("./pos").PosState;
|
|
43
43
|
punches: import("./punches").PunchesState;
|
|
44
44
|
refund: import("./refund").RefundState;
|
|
45
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
45
46
|
settings: import("./settings").SettingsState;
|
|
46
47
|
sidebar: import("./sidebar").SidebarState;
|
|
47
48
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -85,6 +85,7 @@ export declare const selectCartIds: ((state: {
|
|
|
85
85
|
pos: import("./pos").PosState;
|
|
86
86
|
punches: import("./punches").PunchesState;
|
|
87
87
|
refund: import("./refund").RefundState;
|
|
88
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
88
89
|
settings: import("./settings").SettingsState;
|
|
89
90
|
sidebar: import("./sidebar").SidebarState;
|
|
90
91
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -132,6 +133,7 @@ export declare const selectCartQuantity: ((state: {
|
|
|
132
133
|
pos: import("./pos").PosState;
|
|
133
134
|
punches: import("./punches").PunchesState;
|
|
134
135
|
refund: import("./refund").RefundState;
|
|
136
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
135
137
|
settings: import("./settings").SettingsState;
|
|
136
138
|
sidebar: import("./sidebar").SidebarState;
|
|
137
139
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -179,6 +181,7 @@ export declare const selectCartTotal: ((state: {
|
|
|
179
181
|
pos: import("./pos").PosState;
|
|
180
182
|
punches: import("./punches").PunchesState;
|
|
181
183
|
refund: import("./refund").RefundState;
|
|
184
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
182
185
|
settings: import("./settings").SettingsState;
|
|
183
186
|
sidebar: import("./sidebar").SidebarState;
|
|
184
187
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -226,6 +229,7 @@ export declare const selectCartTotals: ((state: {
|
|
|
226
229
|
pos: import("./pos").PosState;
|
|
227
230
|
punches: import("./punches").PunchesState;
|
|
228
231
|
refund: import("./refund").RefundState;
|
|
232
|
+
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
229
233
|
settings: import("./settings").SettingsState;
|
|
230
234
|
sidebar: import("./sidebar").SidebarState;
|
|
231
235
|
surcharges: import("./surcharges").SurchargesState;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OrderCreateSendReceipt, RequestError, RequestStatus } from '@open-tender/types';
|
|
2
|
+
import { AppState } from '../app';
|
|
3
|
+
export interface SendReceiptState {
|
|
4
|
+
loading: RequestStatus;
|
|
5
|
+
error: RequestError;
|
|
6
|
+
}
|
|
7
|
+
export declare enum SendReceiptActionType {
|
|
8
|
+
SendReceipt = "SendReceipt/sendReceipt"
|
|
9
|
+
}
|
|
10
|
+
export declare const sendReceipt: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
11
|
+
orderUuid: string;
|
|
12
|
+
data: OrderCreateSendReceipt;
|
|
13
|
+
}, {
|
|
14
|
+
state: AppState;
|
|
15
|
+
rejectValue: RequestError;
|
|
16
|
+
dispatch?: import("redux").Dispatch<import("redux").UnknownAction> | undefined;
|
|
17
|
+
extra?: unknown;
|
|
18
|
+
serializedErrorType?: unknown;
|
|
19
|
+
pendingMeta?: unknown;
|
|
20
|
+
fulfilledMeta?: unknown;
|
|
21
|
+
rejectedMeta?: unknown;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const resetSendReceipt: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"sendReceipt/resetSendReceipt">;
|
|
24
|
+
export declare const selectSendReceipt: (state: AppState) => SendReceiptState;
|
|
25
|
+
export declare const sendReceiptReducer: import("redux").Reducer<SendReceiptState>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
2
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
3
|
+
import { ReducerType } from './types';
|
|
4
|
+
var initialState = {
|
|
5
|
+
loading: 'idle',
|
|
6
|
+
error: null
|
|
7
|
+
};
|
|
8
|
+
export var SendReceiptActionType;
|
|
9
|
+
(function (SendReceiptActionType) {
|
|
10
|
+
SendReceiptActionType["SendReceipt"] = "SendReceipt/sendReceipt";
|
|
11
|
+
})(SendReceiptActionType || (SendReceiptActionType = {}));
|
|
12
|
+
export var sendReceipt = createAsyncThunk(SendReceiptActionType.SendReceipt, function (_a, _b) { return __awaiter(void 0, [_a, _b], void 0, function (_c, _d) {
|
|
13
|
+
var api, err_1;
|
|
14
|
+
var orderUuid = _c.orderUuid, data = _c.data;
|
|
15
|
+
var getState = _d.getState, rejectWithValue = _d.rejectWithValue;
|
|
16
|
+
return __generator(this, function (_e) {
|
|
17
|
+
switch (_e.label) {
|
|
18
|
+
case 0:
|
|
19
|
+
_e.trys.push([0, 2, , 3]);
|
|
20
|
+
api = getState().config.api;
|
|
21
|
+
return [4 /*yield*/, api.postSendReceipt(orderUuid, data)];
|
|
22
|
+
case 1: return [2 /*return*/, _e.sent()];
|
|
23
|
+
case 2:
|
|
24
|
+
err_1 = _e.sent();
|
|
25
|
+
return [2 /*return*/, rejectWithValue(err_1)];
|
|
26
|
+
case 3: return [2 /*return*/];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}); });
|
|
30
|
+
var sendReceiptSlice = createSlice({
|
|
31
|
+
name: ReducerType.SendReceipt,
|
|
32
|
+
initialState: initialState,
|
|
33
|
+
reducers: {
|
|
34
|
+
resetSendReceipt: function () { return initialState; }
|
|
35
|
+
},
|
|
36
|
+
extraReducers: function (builder) {
|
|
37
|
+
builder
|
|
38
|
+
.addCase(sendReceipt.fulfilled, function (state) {
|
|
39
|
+
state.loading = 'idle';
|
|
40
|
+
state.error = null;
|
|
41
|
+
})
|
|
42
|
+
.addCase(sendReceipt.pending, function (state) {
|
|
43
|
+
state.loading = 'pending';
|
|
44
|
+
})
|
|
45
|
+
.addCase(sendReceipt.rejected, function (state, action) {
|
|
46
|
+
state.error = action.payload;
|
|
47
|
+
state.loading = 'idle';
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export var resetSendReceipt = sendReceiptSlice.actions.resetSendReceipt;
|
|
52
|
+
export var selectSendReceipt = function (state) { return state.sendReceipt; };
|
|
53
|
+
export var sendReceiptReducer = sendReceiptSlice.reducer;
|
package/dist/esm/slices/types.js
CHANGED
|
@@ -23,6 +23,7 @@ export var ReducerType;
|
|
|
23
23
|
ReducerType["Pos"] = "pos";
|
|
24
24
|
ReducerType["Punches"] = "punches";
|
|
25
25
|
ReducerType["Refund"] = "refund";
|
|
26
|
+
ReducerType["SendReceipt"] = "sendReceipt";
|
|
26
27
|
ReducerType["Settings"] = "settings";
|
|
27
28
|
ReducerType["Sidebar"] = "sidebar";
|
|
28
29
|
ReducerType["Surcharges"] = "surcharges";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.49",
|
|
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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@emotion/react": "^11.11.1",
|
|
64
|
-
"@open-tender/types": "^0.4.
|
|
64
|
+
"@open-tender/types": "^0.4.58",
|
|
65
65
|
"@open-tender/ui": "^0.3.48",
|
|
66
66
|
"@open-tender/utils": "^0.4.31",
|
|
67
67
|
"@reduxjs/toolkit": "^2.0.1",
|