@open-tender/store 0.3.42 → 0.3.44

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.
@@ -6,6 +6,7 @@ export declare type IpAddress = `${number}.${number}.${number}.${number}`;
6
6
  export declare type Url = `https://${string}`;
7
7
  export declare type Weekday = 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY';
8
8
  export declare type OrderType = 'OLO' | 'CATERING' | 'MERCH';
9
+ export declare type FullOrderType = OrderType | 'MAIN_MENU' | 'ECOMMERCE';
9
10
  export declare type OrderTypeMap = {
10
11
  [Property in OrderType]: string;
11
12
  };
@@ -77,13 +77,11 @@ export declare type ButtonSize = {
77
77
  height: string;
78
78
  };
79
79
  export declare type ButtonSizes = {
80
- link: ButtonSize;
81
80
  xsmall: ButtonSize;
82
81
  small: ButtonSize;
83
82
  medium: ButtonSize;
84
83
  large: ButtonSize;
85
84
  xlarge: ButtonSize;
86
- tall: ButtonSize;
87
85
  };
88
86
  export interface NavButtonProps {
89
87
  text: string;
@@ -1,5 +1,6 @@
1
- import { Cart, CartItem, CartItemOption, GuestItem, MenuItem, NutritionalInfo, OrderChannel, OrderTypeMap, ServiceTypeMap, SimpleCart, TenderType, TenderTypeMap } from '../types';
1
+ import { Cart, CartItem, CartItemOption, FullOrderType, GuestItem, MenuItem, NutritionalInfo, OrderChannel, OrderType, OrderTypeMap, ServiceTypeMap, SimpleCart, TenderType, TenderTypeMap } from '../types';
2
2
  export declare const orderTypeNamesMap: OrderTypeMap;
3
+ export declare const normalizeOrderType: (orderType: FullOrderType) => OrderType;
3
4
  export declare const serviceTypeNamesMap: ServiceTypeMap;
4
5
  export declare const tenderTypeNamesMap: TenderTypeMap;
5
6
  export declare const makeTenderTypeName: (tenderType: TenderType) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getItemOptions = exports.calcCartCounts = exports.makeSimpleCart = exports.decrementItem = exports.incrementItem = exports.removeItem = exports.addItem = exports.makeCartItemSignature = exports.makeCartItem = exports.calcNutrition = exports.calcPrices = exports.makeChannelName = exports.makeTenderTypeName = exports.tenderTypeNamesMap = exports.serviceTypeNamesMap = exports.orderTypeNamesMap = void 0;
3
+ exports.getItemOptions = exports.calcCartCounts = exports.makeSimpleCart = exports.decrementItem = exports.incrementItem = exports.removeItem = exports.addItem = exports.makeCartItemSignature = exports.makeCartItem = exports.calcNutrition = exports.calcPrices = exports.makeChannelName = exports.makeTenderTypeName = exports.tenderTypeNamesMap = exports.serviceTypeNamesMap = exports.normalizeOrderType = exports.orderTypeNamesMap = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var helpers_1 = require("./helpers");
6
6
  exports.orderTypeNamesMap = {
@@ -8,6 +8,17 @@ exports.orderTypeNamesMap = {
8
8
  CATERING: 'Catering',
9
9
  MERCH: 'Merch'
10
10
  };
11
+ var normalizeOrderType = function (orderType) {
12
+ switch (orderType) {
13
+ case 'MAIN_MENU':
14
+ return 'OLO';
15
+ case 'ECOMMERCE':
16
+ return 'MERCH';
17
+ default:
18
+ return orderType;
19
+ }
20
+ };
21
+ exports.normalizeOrderType = normalizeOrderType;
11
22
  exports.serviceTypeNamesMap = {
12
23
  WALKIN: 'Dine-In',
13
24
  PICKUP: 'Pickup',
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeOrderTimes = exports.makeBucketColor = exports.displayCounts = exports.makeDisplayCounts = exports.makeTicketGroups = exports.makeModifiersMetadataLookup = exports.makeCartLookup = exports.makeItemTypesMap = exports.makeItemTypeSettings = exports.makeTicketCounts = exports.makeOrderBucketsCounts = exports.makeOrderBuckets = exports.makeKdsStationCounts = exports.makeKdsStationCount = exports.makeCurrentAndFutureOrders = exports.makeKdsCounts = exports.makeItemCounts = exports.makeOrderItemSignature = exports.makeOrdersForPrepStation = exports.filterOrdersToday = exports.filterOrdersByItemType = exports.makeOrdersOfType = exports.makeCompletedOrders = exports.makeIncompleteOrders = exports.makeFutureOrders = exports.makeCurrentOrders = exports.makeKdsOrders = exports.isFutureOrder = exports.isCompleted = exports.notCompleted = exports.isDone = exports.notDone = exports.makeFetchOrdersArgs = exports.prepStatus = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var datetimes_1 = require("./datetimes");
6
+ var order_1 = require("./order");
6
7
  exports.prepStatus = {
7
8
  TODO: 'TODO',
8
9
  IN_PROGRESS: 'IN_PROGRESS',
@@ -77,7 +78,8 @@ var isFutureOrder = function (order) {
77
78
  };
78
79
  exports.isFutureOrder = isFutureOrder;
79
80
  var makeKdsOrders = function (orders) {
80
- return orders.filter(function (i) { return i.expected_at && i.fire_at && i.tickets; });
81
+ var filtered = orders.filter(function (i) { return i.expected_at && i.fire_at && i.tickets; });
82
+ return filtered.map(function (i) { return (tslib_1.__assign(tslib_1.__assign({}, i), { order_type: (0, order_1.normalizeOrderType)(i.order_type) })); });
81
83
  };
82
84
  exports.makeKdsOrders = makeKdsOrders;
83
85
  var makeCurrentOrders = function (orders) {
@@ -6,6 +6,7 @@ export declare type IpAddress = `${number}.${number}.${number}.${number}`;
6
6
  export declare type Url = `https://${string}`;
7
7
  export declare type Weekday = 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY';
8
8
  export declare type OrderType = 'OLO' | 'CATERING' | 'MERCH';
9
+ export declare type FullOrderType = OrderType | 'MAIN_MENU' | 'ECOMMERCE';
9
10
  export declare type OrderTypeMap = {
10
11
  [Property in OrderType]: string;
11
12
  };
@@ -77,13 +77,11 @@ export declare type ButtonSize = {
77
77
  height: string;
78
78
  };
79
79
  export declare type ButtonSizes = {
80
- link: ButtonSize;
81
80
  xsmall: ButtonSize;
82
81
  small: ButtonSize;
83
82
  medium: ButtonSize;
84
83
  large: ButtonSize;
85
84
  xlarge: ButtonSize;
86
- tall: ButtonSize;
87
85
  };
88
86
  export interface NavButtonProps {
89
87
  text: string;
@@ -1,5 +1,6 @@
1
- import { Cart, CartItem, CartItemOption, GuestItem, MenuItem, NutritionalInfo, OrderChannel, OrderTypeMap, ServiceTypeMap, SimpleCart, TenderType, TenderTypeMap } from '../types';
1
+ import { Cart, CartItem, CartItemOption, FullOrderType, GuestItem, MenuItem, NutritionalInfo, OrderChannel, OrderType, OrderTypeMap, ServiceTypeMap, SimpleCart, TenderType, TenderTypeMap } from '../types';
2
2
  export declare const orderTypeNamesMap: OrderTypeMap;
3
+ export declare const normalizeOrderType: (orderType: FullOrderType) => OrderType;
3
4
  export declare const serviceTypeNamesMap: ServiceTypeMap;
4
5
  export declare const tenderTypeNamesMap: TenderTypeMap;
5
6
  export declare const makeTenderTypeName: (tenderType: TenderType) => string;
@@ -5,6 +5,16 @@ export var orderTypeNamesMap = {
5
5
  CATERING: 'Catering',
6
6
  MERCH: 'Merch'
7
7
  };
8
+ export var normalizeOrderType = function (orderType) {
9
+ switch (orderType) {
10
+ case 'MAIN_MENU':
11
+ return 'OLO';
12
+ case 'ECOMMERCE':
13
+ return 'MERCH';
14
+ default:
15
+ return orderType;
16
+ }
17
+ };
8
18
  export var serviceTypeNamesMap = {
9
19
  WALKIN: 'Dine-In',
10
20
  PICKUP: 'Pickup',
@@ -1,5 +1,6 @@
1
1
  import { __assign, __spreadArray } from "tslib";
2
2
  import { currentLocalDate, currentLocalDateStr, DATE, formatDate, isoToDate, isoToDateStr, makeIntervals, minutesLeft, timezoneMap } from './datetimes';
3
+ import { normalizeOrderType } from './order';
3
4
  export var prepStatus = {
4
5
  TODO: 'TODO',
5
6
  IN_PROGRESS: 'IN_PROGRESS',
@@ -68,7 +69,8 @@ export var isFutureOrder = function (order) {
68
69
  return notDone(prep_status) && fireDate && fireDate > currentDate;
69
70
  };
70
71
  export var makeKdsOrders = function (orders) {
71
- return orders.filter(function (i) { return i.expected_at && i.fire_at && i.tickets; });
72
+ var filtered = orders.filter(function (i) { return i.expected_at && i.fire_at && i.tickets; });
73
+ return filtered.map(function (i) { return (__assign(__assign({}, i), { order_type: normalizeOrderType(i.order_type) })); });
72
74
  };
73
75
  export var makeCurrentOrders = function (orders) {
74
76
  return orders.filter(function (i) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "0.3.42",
3
+ "version": "0.3.44",
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",