@open-tender/store 0.7.14 → 0.7.15

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.
@@ -36,9 +36,7 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
36
36
  var apiUrl = _a.apiUrl;
37
37
  var dispatch = _b.dispatch, getState = _b.getState, rejectWithValue = _b.rejectWithValue;
38
38
  return tslib_1.__awaiter(void 0, void 0, void 0, function () {
39
- var terminalId, app, api, _c, _d,
40
- // config,
41
- devicesList, _e, stores, _f, selectOptions, _g, itemTypes, _h, menuColors, store, devices, err, cashier, employee, tz, businessDate, err_1, err_2;
39
+ var terminalId, app, api, _c, _d, devicesList, _e, stores, _f, selectOptions, _g, itemTypes, _h, menuColors, store, devices, err, cashier, employee, tz, businessDate, err_1, err_2;
42
40
  return tslib_1.__generator(this, function (_j) {
43
41
  switch (_j.label) {
44
42
  case 0:
@@ -47,10 +45,11 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
47
45
  app = terminalId ? { apiUrl: apiUrl, terminalId: terminalId } : { apiUrl: apiUrl };
48
46
  api = new services_1.PosAPI(app);
49
47
  return [4 /*yield*/, Promise.all([
50
- // api.getConfig(),
51
48
  api.getSettings('DEVICES'),
52
49
  api.getSettings('STORE'),
53
- api.getSettings('SELECT_OPTION'),
50
+ // TODO: replace getSelectOptions when formatted correctly
51
+ // api.getSettings<SelectOptions>('SELECT_OPTION'),
52
+ api.getSelectOptions(),
54
53
  api.getSettings('ITEM_TYPE'),
55
54
  api.getSettings('ITEM_COLORS')
56
55
  ])];
@@ -27,6 +27,7 @@ export interface Config {
27
27
  }
28
28
  export interface ItemType {
29
29
  default_prep_status: PrepStatus;
30
+ display_order: number;
30
31
  is_default: boolean;
31
32
  is_grouped: boolean;
32
33
  is_hidden_assembly: boolean;
@@ -34,7 +35,6 @@ export interface ItemType {
34
35
  item_type_id: number;
35
36
  items: number[];
36
37
  name: string;
37
- position: number;
38
38
  prep_time: number;
39
39
  print_on_completed: boolean;
40
40
  }
@@ -206,13 +206,11 @@ export interface OrderGiftCard {
206
206
  export type OrderGiftCards = Array<OrderGiftCard>;
207
207
  export interface OrderTax {
208
208
  amount: Money;
209
- amount_total?: Money;
210
- id: number;
211
- is_active?: boolean;
212
- is_optional?: boolean;
209
+ display_order: 0;
210
+ is_optional: boolean;
213
211
  name: string;
214
- tax_id?: number;
215
- tax_type?: number;
212
+ tax_id: number;
213
+ tax_type: number;
216
214
  }
217
215
  export type OrderTaxes = Array<OrderTax>;
218
216
  export interface OrderTenderCash {
@@ -46,7 +46,7 @@ var makeDiscountsAmountsLookup = function (discounts) {
46
46
  var makeTaxesAmountsLookup = function (taxes) {
47
47
  return taxes.reduce(function (obj, i) {
48
48
  var _a;
49
- return (tslib_1.__assign(tslib_1.__assign({}, obj), (_a = {}, _a[i.id] = i.amount, _a)));
49
+ return (tslib_1.__assign(tslib_1.__assign({}, obj), (_a = {}, _a[i.tax_id] = i.amount, _a)));
50
50
  }, {});
51
51
  };
52
52
  var makeTendersAmountsLookup = function (tenders) {
@@ -149,7 +149,7 @@ var makeNetOrder = function (order, refunds) {
149
149
  i.amount = adjustAmount(i.amount, amount);
150
150
  });
151
151
  copy.taxes.forEach(function (i) {
152
- var amount = lookup.taxes[i.id];
152
+ var amount = lookup.taxes[i.tax_id];
153
153
  if (amount)
154
154
  i.amount = adjustAmount(i.amount, amount);
155
155
  });
@@ -33,9 +33,7 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
33
33
  var apiUrl = _a.apiUrl;
34
34
  var dispatch = _b.dispatch, getState = _b.getState, rejectWithValue = _b.rejectWithValue;
35
35
  return __awaiter(void 0, void 0, void 0, function () {
36
- var terminalId, app, api, _c, _d,
37
- // config,
38
- devicesList, _e, stores, _f, selectOptions, _g, itemTypes, _h, menuColors, store, devices, err, cashier, employee, tz, businessDate, err_1, err_2;
36
+ var terminalId, app, api, _c, _d, devicesList, _e, stores, _f, selectOptions, _g, itemTypes, _h, menuColors, store, devices, err, cashier, employee, tz, businessDate, err_1, err_2;
39
37
  return __generator(this, function (_j) {
40
38
  switch (_j.label) {
41
39
  case 0:
@@ -44,10 +42,11 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
44
42
  app = terminalId ? { apiUrl: apiUrl, terminalId: terminalId } : { apiUrl: apiUrl };
45
43
  api = new PosAPI(app);
46
44
  return [4 /*yield*/, Promise.all([
47
- // api.getConfig(),
48
45
  api.getSettings('DEVICES'),
49
46
  api.getSettings('STORE'),
50
- api.getSettings('SELECT_OPTION'),
47
+ // TODO: replace getSelectOptions when formatted correctly
48
+ // api.getSettings<SelectOptions>('SELECT_OPTION'),
49
+ api.getSelectOptions(),
51
50
  api.getSettings('ITEM_TYPE'),
52
51
  api.getSettings('ITEM_COLORS')
53
52
  ])];
@@ -27,6 +27,7 @@ export interface Config {
27
27
  }
28
28
  export interface ItemType {
29
29
  default_prep_status: PrepStatus;
30
+ display_order: number;
30
31
  is_default: boolean;
31
32
  is_grouped: boolean;
32
33
  is_hidden_assembly: boolean;
@@ -34,7 +35,6 @@ export interface ItemType {
34
35
  item_type_id: number;
35
36
  items: number[];
36
37
  name: string;
37
- position: number;
38
38
  prep_time: number;
39
39
  print_on_completed: boolean;
40
40
  }
@@ -206,13 +206,11 @@ export interface OrderGiftCard {
206
206
  export type OrderGiftCards = Array<OrderGiftCard>;
207
207
  export interface OrderTax {
208
208
  amount: Money;
209
- amount_total?: Money;
210
- id: number;
211
- is_active?: boolean;
212
- is_optional?: boolean;
209
+ display_order: 0;
210
+ is_optional: boolean;
213
211
  name: string;
214
- tax_id?: number;
215
- tax_type?: number;
212
+ tax_id: number;
213
+ tax_type: number;
216
214
  }
217
215
  export type OrderTaxes = Array<OrderTax>;
218
216
  export interface OrderTenderCash {
@@ -41,7 +41,7 @@ var makeDiscountsAmountsLookup = function (discounts) {
41
41
  var makeTaxesAmountsLookup = function (taxes) {
42
42
  return taxes.reduce(function (obj, i) {
43
43
  var _a;
44
- return (__assign(__assign({}, obj), (_a = {}, _a[i.id] = i.amount, _a)));
44
+ return (__assign(__assign({}, obj), (_a = {}, _a[i.tax_id] = i.amount, _a)));
45
45
  }, {});
46
46
  };
47
47
  var makeTendersAmountsLookup = function (tenders) {
@@ -143,7 +143,7 @@ export var makeNetOrder = function (order, refunds) {
143
143
  i.amount = adjustAmount(i.amount, amount);
144
144
  });
145
145
  copy.taxes.forEach(function (i) {
146
- var amount = lookup.taxes[i.id];
146
+ var amount = lookup.taxes[i.tax_id];
147
147
  if (amount)
148
148
  i.amount = adjustAmount(i.amount, amount);
149
149
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "0.7.14",
3
+ "version": "0.7.15",
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",