@open-tender/store 1.1.132 → 1.1.133

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.
@@ -1,4 +1,4 @@
1
- import { CheckoutTenderPos, CustomerIdentifier, CustomerIdentify, Discount, Money, Order, OrderCreate, OrderCreateDiscount, OrderCreateDiscounts, OrderCreateGiftCards, OrderCreatePoints, OrderCreateSurcharge, OrderCreateSurcharges, OrderTender, RequestError, RequestStatus, Taxes } from '@open-tender/types';
1
+ import { CheckoutTenderPos, CustomerIdentifier, CustomerIdentify, Discount, Money, Order, OrderCreateDiscount, OrderCreateDiscounts, OrderCreateGiftCards, OrderCreatePoints, OrderCreatePos, OrderCreateSurcharge, OrderCreateSurcharges, OrderTender, RequestError, RequestStatus, Taxes } from '@open-tender/types';
2
2
  import { AppState } from '../app';
3
3
  import { OrderState } from './order';
4
4
  export interface CheckoutState {
@@ -24,9 +24,6 @@ export interface CheckoutState {
24
24
  tip: Money | null;
25
25
  validating: RequestStatus;
26
26
  }
27
- interface OrderCreatePos extends Omit<OrderCreate, 'customer'> {
28
- customer: CustomerIdentify | null;
29
- }
30
27
  export declare const prepareOrder: (order: OrderState, checkout: CheckoutState) => OrderCreatePos | null;
31
28
  export declare enum CheckoutActionType {
32
29
  AddPromoCode = "checkout/addPromoCode",
@@ -168,4 +165,3 @@ export declare const selectPosCheckSubtotal: (state: AppState) => `${number}.${n
168
165
  export declare const selectPosCheckTotal: (state: AppState) => `${number}.${number}`;
169
166
  export declare const selectPosCheckTenders: (state: AppState) => import("@open-tender/types").OrderTenders;
170
167
  export declare const checkoutReducer: import("redux").Reducer<CheckoutState>;
171
- export {};
@@ -38,7 +38,7 @@ var getAmountDue = function (check) {
38
38
  return check && check.totals ? check.totals.amount_due : null;
39
39
  };
40
40
  var prepareOrder = function (order, checkout) {
41
- var order_uuid = order.orderId, requested_at = order.requestedAt, service_type = order.serviceType, order_type = order.orderType, revenue_center_id = order.revenueCenterId;
41
+ var order_uuid = order.orderId, requested_at = order.requestedAt, service_type = order.serviceType, order_type = order.orderType, revenue_center_id = order.revenueCenterId, prep_type = order.prepType;
42
42
  if (!order_uuid)
43
43
  return null;
44
44
  var simpleCart = (0, utils_1.makeSimpleCart)(order.cart);
@@ -46,33 +46,22 @@ var prepareOrder = function (order, checkout) {
46
46
  if (!revenue_center_id || !order_type || !service_type) {
47
47
  return null;
48
48
  }
49
- var customer = checkout.customer,
50
- // giftCards: gift_cards,
51
- surcharges = checkout.surcharges, discounts = checkout.discounts, taxes = checkout.taxes, tip = checkout.tip,
52
- // isTaxExempt,
53
- points = checkout.points;
54
- // const is_tax_exempt = isTaxExempt ? true : false
55
- // const { customer_id, first_name, last_name, email, phone } =
56
- // customer?.customer || {}
57
- // const customerCreate = customer
58
- // ? { customer_id, first_name, last_name, email, phone }
59
- // : null
49
+ var customer = checkout.customer, surcharges = checkout.surcharges, discounts = checkout.discounts, taxes = checkout.taxes, tip = checkout.tip, points = checkout.points, made_for = checkout.madeFor, phone = checkout.phone;
60
50
  return {
61
51
  order_uuid: order_uuid,
62
52
  revenue_center_id: revenue_center_id,
63
- // order_type,
64
53
  service_type: service_type,
65
54
  requested_at: requested_at,
66
- // customer: customerCreate,
67
55
  customer: customer,
68
56
  cart: cart,
69
- // gift_cards,
70
57
  surcharges: surcharges,
71
58
  discounts: discounts,
72
59
  taxes: taxes,
73
- // is_tax_exempt,
74
60
  tip: tip || '0.00',
75
- points: points
61
+ points: points,
62
+ made_for: made_for,
63
+ phone: phone,
64
+ prep_type: prep_type
76
65
  };
77
66
  };
78
67
  exports.prepareOrder = prepareOrder;
@@ -1,4 +1,4 @@
1
- import { CheckoutTenderPos, CustomerIdentifier, CustomerIdentify, Discount, Money, Order, OrderCreate, OrderCreateDiscount, OrderCreateDiscounts, OrderCreateGiftCards, OrderCreatePoints, OrderCreateSurcharge, OrderCreateSurcharges, OrderTender, RequestError, RequestStatus, Taxes } from '@open-tender/types';
1
+ import { CheckoutTenderPos, CustomerIdentifier, CustomerIdentify, Discount, Money, Order, OrderCreateDiscount, OrderCreateDiscounts, OrderCreateGiftCards, OrderCreatePoints, OrderCreatePos, OrderCreateSurcharge, OrderCreateSurcharges, OrderTender, RequestError, RequestStatus, Taxes } from '@open-tender/types';
2
2
  import { AppState } from '../app';
3
3
  import { OrderState } from './order';
4
4
  export interface CheckoutState {
@@ -24,9 +24,6 @@ export interface CheckoutState {
24
24
  tip: Money | null;
25
25
  validating: RequestStatus;
26
26
  }
27
- interface OrderCreatePos extends Omit<OrderCreate, 'customer'> {
28
- customer: CustomerIdentify | null;
29
- }
30
27
  export declare const prepareOrder: (order: OrderState, checkout: CheckoutState) => OrderCreatePos | null;
31
28
  export declare enum CheckoutActionType {
32
29
  AddPromoCode = "checkout/addPromoCode",
@@ -168,4 +165,3 @@ export declare const selectPosCheckSubtotal: (state: AppState) => `${number}.${n
168
165
  export declare const selectPosCheckTotal: (state: AppState) => `${number}.${number}`;
169
166
  export declare const selectPosCheckTenders: (state: AppState) => import("@open-tender/types").OrderTenders;
170
167
  export declare const checkoutReducer: import("redux").Reducer<CheckoutState>;
171
- export {};
@@ -35,7 +35,7 @@ var getAmountDue = function (check) {
35
35
  return check && check.totals ? check.totals.amount_due : null;
36
36
  };
37
37
  export var prepareOrder = function (order, checkout) {
38
- var order_uuid = order.orderId, requested_at = order.requestedAt, service_type = order.serviceType, order_type = order.orderType, revenue_center_id = order.revenueCenterId;
38
+ var order_uuid = order.orderId, requested_at = order.requestedAt, service_type = order.serviceType, order_type = order.orderType, revenue_center_id = order.revenueCenterId, prep_type = order.prepType;
39
39
  if (!order_uuid)
40
40
  return null;
41
41
  var simpleCart = makeSimpleCart(order.cart);
@@ -43,33 +43,22 @@ export var prepareOrder = function (order, checkout) {
43
43
  if (!revenue_center_id || !order_type || !service_type) {
44
44
  return null;
45
45
  }
46
- var customer = checkout.customer,
47
- // giftCards: gift_cards,
48
- surcharges = checkout.surcharges, discounts = checkout.discounts, taxes = checkout.taxes, tip = checkout.tip,
49
- // isTaxExempt,
50
- points = checkout.points;
51
- // const is_tax_exempt = isTaxExempt ? true : false
52
- // const { customer_id, first_name, last_name, email, phone } =
53
- // customer?.customer || {}
54
- // const customerCreate = customer
55
- // ? { customer_id, first_name, last_name, email, phone }
56
- // : null
46
+ var customer = checkout.customer, surcharges = checkout.surcharges, discounts = checkout.discounts, taxes = checkout.taxes, tip = checkout.tip, points = checkout.points, made_for = checkout.madeFor, phone = checkout.phone;
57
47
  return {
58
48
  order_uuid: order_uuid,
59
49
  revenue_center_id: revenue_center_id,
60
- // order_type,
61
50
  service_type: service_type,
62
51
  requested_at: requested_at,
63
- // customer: customerCreate,
64
52
  customer: customer,
65
53
  cart: cart,
66
- // gift_cards,
67
54
  surcharges: surcharges,
68
55
  discounts: discounts,
69
56
  taxes: taxes,
70
- // is_tax_exempt,
71
57
  tip: tip || '0.00',
72
- points: points
58
+ points: points,
59
+ made_for: made_for,
60
+ phone: phone,
61
+ prep_type: prep_type
73
62
  };
74
63
  };
75
64
  export var CheckoutActionType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "1.1.132",
3
+ "version": "1.1.133",
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.63",
64
+ "@open-tender/types": "^0.4.65",
65
65
  "@open-tender/ui": "^0.3.96",
66
66
  "@open-tender/utils": "^0.4.39",
67
67
  "@reduxjs/toolkit": "^2.0.1",