@open-tender/store 0.3.22 → 0.3.24

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.
@@ -59,7 +59,7 @@ declare class PosAPI {
59
59
  getOrders(args: FetchOrdersAPIArgs): Promise<Orders | null | undefined>;
60
60
  patchOrder(orderId: string, data: OrderUpdate): Promise<Order | null | undefined>;
61
61
  postReceipt(orderId: string): Promise<Order | null | undefined>;
62
- postTicketsPrint(orderId: string, data?: OrderUpdate): Promise<Order | null | undefined>;
62
+ postTicketsPrint(orderId: string, ticketNos?: number[], data?: TicketUpdate): Promise<Order | null | undefined>;
63
63
  postTicketsReset(orderId: string): Promise<Order | null | undefined>;
64
64
  postTicketPrint(orderId: string, ticketNo: number, data?: TicketUpdate): Promise<Order | null | undefined>;
65
65
  putTicketStatus(orderId: string, ticketNo: number, data: TicketUpdate): Promise<Order | null | undefined>;
@@ -290,10 +290,10 @@ var PosAPI = /** @class */ (function () {
290
290
  PosAPI.prototype.postReceipt = function (orderId) {
291
291
  return this.request("/orders/".concat(orderId, "/print"), 'POST', {});
292
292
  };
293
- PosAPI.prototype.postTicketsPrint = function (orderId, data) {
294
- if (data === void 0) { data = {}; }
293
+ PosAPI.prototype.postTicketsPrint = function (orderId, ticketNos, data) {
295
294
  var endpoint = "/orders/".concat(orderId, "/tickets/print");
296
- return this.request(endpoint, 'POST', data);
295
+ var body = ticketNos ? tslib_1.__assign(tslib_1.__assign({}, data), { ticketNos: ticketNos }) : tslib_1.__assign({}, data);
296
+ return this.request(endpoint, 'POST', body);
297
297
  };
298
298
  PosAPI.prototype.postTicketsReset = function (orderId) {
299
299
  var endpoint = "/orders/".concat(orderId, "/tickets/reset");
@@ -49,7 +49,8 @@ export declare const printKdsOrder: import("@reduxjs/toolkit").AsyncThunk<void,
49
49
  }>;
50
50
  export declare const printTickets: import("@reduxjs/toolkit").AsyncThunk<void, {
51
51
  orderId: string;
52
- data?: OrderUpdate | undefined;
52
+ ticketNos?: number[] | undefined;
53
+ status?: TicketStatus | undefined;
53
54
  }, {
54
55
  state: AppState;
55
56
  }>;
@@ -121,16 +121,17 @@ exports.printKdsOrder = (0, toolkit_1.createAsyncThunk)(KdsActionType.PrintKdsOr
121
121
  });
122
122
  });
123
123
  exports.printTickets = (0, toolkit_1.createAsyncThunk)(KdsActionType.PrintTickets, function (_a, _b) {
124
- var orderId = _a.orderId, data = _a.data;
124
+ var orderId = _a.orderId, ticketNos = _a.ticketNos, status = _a.status;
125
125
  var getState = _b.getState, dispatch = _b.dispatch;
126
126
  return tslib_1.__awaiter(void 0, void 0, void 0, function () {
127
- var api, order, err_4, detail;
127
+ var api, data, order, err_4, detail;
128
128
  return tslib_1.__generator(this, function (_c) {
129
129
  switch (_c.label) {
130
130
  case 0:
131
131
  _c.trys.push([0, 2, , 3]);
132
132
  api = getState().config.api;
133
- return [4 /*yield*/, api.postTicketsPrint(orderId, data)];
133
+ data = status ? { ticket_status: status } : {};
134
+ return [4 /*yield*/, api.postTicketsPrint(orderId, ticketNos, data)];
134
135
  case 1:
135
136
  order = _c.sent();
136
137
  dispatch((0, exports.replaceKdsOrder)(order));
@@ -15,9 +15,9 @@ export interface PrepStation {
15
15
  item_type_ids: number[] | null;
16
16
  prep_type: KdsPrepType;
17
17
  assembly_options: KdsAssemblyOptions;
18
- expo_show_print: boolean;
19
- expo_show_reset: boolean;
20
18
  expo_done_only: boolean;
19
+ expo_print: boolean;
20
+ expo_reset: boolean;
21
21
  expo_complete: boolean;
22
22
  expo_complete_all: boolean;
23
23
  }
@@ -59,7 +59,7 @@ declare class PosAPI {
59
59
  getOrders(args: FetchOrdersAPIArgs): Promise<Orders | null | undefined>;
60
60
  patchOrder(orderId: string, data: OrderUpdate): Promise<Order | null | undefined>;
61
61
  postReceipt(orderId: string): Promise<Order | null | undefined>;
62
- postTicketsPrint(orderId: string, data?: OrderUpdate): Promise<Order | null | undefined>;
62
+ postTicketsPrint(orderId: string, ticketNos?: number[], data?: TicketUpdate): Promise<Order | null | undefined>;
63
63
  postTicketsReset(orderId: string): Promise<Order | null | undefined>;
64
64
  postTicketPrint(orderId: string, ticketNo: number, data?: TicketUpdate): Promise<Order | null | undefined>;
65
65
  putTicketStatus(orderId: string, ticketNo: number, data: TicketUpdate): Promise<Order | null | undefined>;
@@ -1,4 +1,4 @@
1
- import { __awaiter, __generator } from "tslib";
1
+ import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { errorsApi } from './errors';
3
3
  var parseResponse = function (response, contentType) { return __awaiter(void 0, void 0, void 0, function () {
4
4
  return __generator(this, function (_a) {
@@ -288,10 +288,10 @@ var PosAPI = /** @class */ (function () {
288
288
  PosAPI.prototype.postReceipt = function (orderId) {
289
289
  return this.request("/orders/".concat(orderId, "/print"), 'POST', {});
290
290
  };
291
- PosAPI.prototype.postTicketsPrint = function (orderId, data) {
292
- if (data === void 0) { data = {}; }
291
+ PosAPI.prototype.postTicketsPrint = function (orderId, ticketNos, data) {
293
292
  var endpoint = "/orders/".concat(orderId, "/tickets/print");
294
- return this.request(endpoint, 'POST', data);
293
+ var body = ticketNos ? __assign(__assign({}, data), { ticketNos: ticketNos }) : __assign({}, data);
294
+ return this.request(endpoint, 'POST', body);
295
295
  };
296
296
  PosAPI.prototype.postTicketsReset = function (orderId) {
297
297
  var endpoint = "/orders/".concat(orderId, "/tickets/reset");
@@ -49,7 +49,8 @@ export declare const printKdsOrder: import("@reduxjs/toolkit").AsyncThunk<void,
49
49
  }>;
50
50
  export declare const printTickets: import("@reduxjs/toolkit").AsyncThunk<void, {
51
51
  orderId: string;
52
- data?: OrderUpdate | undefined;
52
+ ticketNos?: number[] | undefined;
53
+ status?: TicketStatus | undefined;
53
54
  }, {
54
55
  state: AppState;
55
56
  }>;
@@ -117,16 +117,17 @@ export var printKdsOrder = createAsyncThunk(KdsActionType.PrintKdsOrder, functio
117
117
  });
118
118
  });
119
119
  export var printTickets = createAsyncThunk(KdsActionType.PrintTickets, function (_a, _b) {
120
- var orderId = _a.orderId, data = _a.data;
120
+ var orderId = _a.orderId, ticketNos = _a.ticketNos, status = _a.status;
121
121
  var getState = _b.getState, dispatch = _b.dispatch;
122
122
  return __awaiter(void 0, void 0, void 0, function () {
123
- var api, order, err_4, detail;
123
+ var api, data, order, err_4, detail;
124
124
  return __generator(this, function (_c) {
125
125
  switch (_c.label) {
126
126
  case 0:
127
127
  _c.trys.push([0, 2, , 3]);
128
128
  api = getState().config.api;
129
- return [4 /*yield*/, api.postTicketsPrint(orderId, data)];
129
+ data = status ? { ticket_status: status } : {};
130
+ return [4 /*yield*/, api.postTicketsPrint(orderId, ticketNos, data)];
130
131
  case 1:
131
132
  order = _c.sent();
132
133
  dispatch(replaceKdsOrder(order));
@@ -15,9 +15,9 @@ export interface PrepStation {
15
15
  item_type_ids: number[] | null;
16
16
  prep_type: KdsPrepType;
17
17
  assembly_options: KdsAssemblyOptions;
18
- expo_show_print: boolean;
19
- expo_show_reset: boolean;
20
18
  expo_done_only: boolean;
19
+ expo_print: boolean;
20
+ expo_reset: boolean;
21
21
  expo_complete: boolean;
22
22
  expo_complete_all: boolean;
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
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",