@open-tender/store 0.3.75 → 0.3.77

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.
@@ -76,8 +76,8 @@ export declare const resetPosCheckout: import("@reduxjs/toolkit").ActionCreatorW
76
76
  export declare const selectPosCheckout: (state: AppState) => CheckoutState;
77
77
  export declare const selectPosCheck: (state: AppState) => Order | null;
78
78
  export declare const selectPosCustomer: (state: AppState) => CustomerCheckout | null;
79
- export declare const selectPosCustomerProfile: (state: AppState) => import("../types").Customer | null;
80
- export declare const selectPosCustomerName: (state: AppState, isShort?: boolean) => string | null;
79
+ export declare const selectPosCustomerName: (state: AppState) => string | null;
80
+ export declare const selectPosCustomerNameShort: (state: AppState) => string | null;
81
81
  export declare const selectPosPendingDiscounts: (state: AppState) => boolean;
82
82
  export declare const selectPosAmountDue: (state: AppState) => `${number}.${number}` | null | undefined;
83
83
  export declare const selectPosCheckTotal: (state: AppState) => `${number}.${number}`;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.checkoutReducer = exports.selectPosCheckGiftCardCodes = exports.selectPosCheckTenders = exports.selectPosCheckTotal = exports.selectPosAmountDue = exports.selectPosPendingDiscounts = exports.selectPosCustomerName = exports.selectPosCustomerProfile = exports.selectPosCustomer = exports.selectPosCheck = exports.selectPosCheckout = exports.setPoints = exports.setPendingDiscounts = exports.removeCustomer = exports.addCustomer = exports.setTaxExempt = exports.removeTip = exports.addTip = exports.removeTax = exports.addTax = exports.removeDiscount = exports.addDiscount = exports.removeSurcharge = exports.addSurcharge = exports.removeGiftCard = exports.addGiftCard = exports.handleCheckoutError = exports.resetPosCheck = exports.resetPosCheckout = exports.activateGiftCards = exports.voidPosOrder = exports.submitPosOrder = exports.validatePosOrder = exports.completeChipDNA = exports.identifyCustomer = exports.updateCart = exports.updateTender = exports.removeTender = exports.addTender = exports.CheckoutActionType = void 0;
4
+ exports.checkoutReducer = exports.selectPosCheckGiftCardCodes = exports.selectPosCheckTenders = exports.selectPosCheckTotal = exports.selectPosAmountDue = exports.selectPosPendingDiscounts = exports.selectPosCustomerNameShort = exports.selectPosCustomerName = exports.selectPosCustomer = exports.selectPosCheck = exports.selectPosCheckout = exports.setPoints = exports.setPendingDiscounts = exports.removeCustomer = exports.addCustomer = exports.setTaxExempt = exports.removeTip = exports.addTip = exports.removeTax = exports.addTax = exports.removeDiscount = exports.addDiscount = exports.removeSurcharge = exports.addSurcharge = exports.removeGiftCard = exports.addGiftCard = exports.handleCheckoutError = exports.resetPosCheck = exports.resetPosCheckout = exports.activateGiftCards = exports.voidPosOrder = exports.submitPosOrder = exports.validatePosOrder = exports.completeChipDNA = exports.identifyCustomer = exports.updateCart = exports.updateTender = exports.removeTender = exports.addTender = exports.CheckoutActionType = void 0;
5
5
  var tslib_1 = require("tslib");
6
6
  var toolkit_1 = require("@reduxjs/toolkit");
7
7
  var uuid_1 = require("uuid");
@@ -643,23 +643,21 @@ var selectPosCheck = function (state) { return state.checkout.check; };
643
643
  exports.selectPosCheck = selectPosCheck;
644
644
  var selectPosCustomer = function (state) { return state.checkout.customer; };
645
645
  exports.selectPosCustomer = selectPosCustomer;
646
- var selectPosCustomerProfile = function (state) {
646
+ var selectPosCustomerName = function (state) {
647
647
  if (!state.checkout.customer)
648
648
  return null;
649
- var customer = state.checkout.customer.customer;
650
- return customer;
649
+ var _a = state.checkout.customer, first_name = _a.first_name, last_name = _a.last_name;
650
+ return "".concat(first_name, " ").concat(last_name);
651
651
  };
652
- exports.selectPosCustomerProfile = selectPosCustomerProfile;
653
- var selectPosCustomerName = function (state, isShort) {
654
- if (isShort === void 0) { isShort = false; }
652
+ exports.selectPosCustomerName = selectPosCustomerName;
653
+ var selectPosCustomerNameShort = function (state) {
655
654
  if (!state.checkout.customer)
656
655
  return null;
657
- var customer = state.checkout.customer.customer;
658
- var first_name = customer.first_name, last_name = customer.last_name;
659
- var lastName = isShort ? (last_name === null || last_name === void 0 ? void 0 : last_name.charAt(0)) || '' : last_name;
656
+ var _a = state.checkout.customer, first_name = _a.first_name, last_name = _a.last_name;
657
+ var lastName = (last_name === null || last_name === void 0 ? void 0 : last_name.charAt(0)) || '';
660
658
  return "".concat(first_name, " ").concat(lastName);
661
659
  };
662
- exports.selectPosCustomerName = selectPosCustomerName;
660
+ exports.selectPosCustomerNameShort = selectPosCustomerNameShort;
663
661
  var selectPosPendingDiscounts = function (state) {
664
662
  return state.checkout.pendingDiscounts;
665
663
  };
@@ -28,7 +28,11 @@ export interface CustomerDiscount {
28
28
  }
29
29
  export declare type CustomerDiscounts = Array<CustomerDiscount>;
30
30
  export interface CustomerCheckout {
31
- customer: Customer;
31
+ customer_id: number;
32
+ first_name: string;
33
+ last_name: string;
34
+ email: string;
35
+ phone: string;
32
36
  discounts: CustomerDiscounts;
33
37
  points: any;
34
38
  discount: any;
@@ -76,8 +76,8 @@ export declare const resetPosCheckout: import("@reduxjs/toolkit").ActionCreatorW
76
76
  export declare const selectPosCheckout: (state: AppState) => CheckoutState;
77
77
  export declare const selectPosCheck: (state: AppState) => Order | null;
78
78
  export declare const selectPosCustomer: (state: AppState) => CustomerCheckout | null;
79
- export declare const selectPosCustomerProfile: (state: AppState) => import("../types").Customer | null;
80
- export declare const selectPosCustomerName: (state: AppState, isShort?: boolean) => string | null;
79
+ export declare const selectPosCustomerName: (state: AppState) => string | null;
80
+ export declare const selectPosCustomerNameShort: (state: AppState) => string | null;
81
81
  export declare const selectPosPendingDiscounts: (state: AppState) => boolean;
82
82
  export declare const selectPosAmountDue: (state: AppState) => `${number}.${number}` | null | undefined;
83
83
  export declare const selectPosCheckTotal: (state: AppState) => `${number}.${number}`;
@@ -637,19 +637,17 @@ export var resetPosCheckout = (_a = checkoutSlice.actions, _a.resetPosCheckout),
637
637
  export var selectPosCheckout = function (state) { return state.checkout; };
638
638
  export var selectPosCheck = function (state) { return state.checkout.check; };
639
639
  export var selectPosCustomer = function (state) { return state.checkout.customer; };
640
- export var selectPosCustomerProfile = function (state) {
640
+ export var selectPosCustomerName = function (state) {
641
641
  if (!state.checkout.customer)
642
642
  return null;
643
- var customer = state.checkout.customer.customer;
644
- return customer;
643
+ var _a = state.checkout.customer, first_name = _a.first_name, last_name = _a.last_name;
644
+ return "".concat(first_name, " ").concat(last_name);
645
645
  };
646
- export var selectPosCustomerName = function (state, isShort) {
647
- if (isShort === void 0) { isShort = false; }
646
+ export var selectPosCustomerNameShort = function (state) {
648
647
  if (!state.checkout.customer)
649
648
  return null;
650
- var customer = state.checkout.customer.customer;
651
- var first_name = customer.first_name, last_name = customer.last_name;
652
- var lastName = isShort ? (last_name === null || last_name === void 0 ? void 0 : last_name.charAt(0)) || '' : last_name;
649
+ var _a = state.checkout.customer, first_name = _a.first_name, last_name = _a.last_name;
650
+ var lastName = (last_name === null || last_name === void 0 ? void 0 : last_name.charAt(0)) || '';
653
651
  return "".concat(first_name, " ").concat(lastName);
654
652
  };
655
653
  export var selectPosPendingDiscounts = function (state) {
@@ -28,7 +28,11 @@ export interface CustomerDiscount {
28
28
  }
29
29
  export declare type CustomerDiscounts = Array<CustomerDiscount>;
30
30
  export interface CustomerCheckout {
31
- customer: Customer;
31
+ customer_id: number;
32
+ first_name: string;
33
+ last_name: string;
34
+ email: string;
35
+ phone: string;
32
36
  discounts: CustomerDiscounts;
33
37
  points: any;
34
38
  discount: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "0.3.75",
3
+ "version": "0.3.77",
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",