@open-tender/store 0.3.75 → 0.3.76

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.
@@ -77,7 +77,8 @@ 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
79
  export declare const selectPosCustomerProfile: (state: AppState) => import("../types").Customer | null;
80
- export declare const selectPosCustomerName: (state: AppState, isShort?: boolean) => string | null;
80
+ export declare const selectPosCustomerName: (state: AppState) => string | null;
81
+ export declare const selectPosCustomerNameShort: (state: AppState) => string | null;
81
82
  export declare const selectPosPendingDiscounts: (state: AppState) => boolean;
82
83
  export declare const selectPosAmountDue: (state: AppState) => `${number}.${number}` | null | undefined;
83
84
  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.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;
5
5
  var tslib_1 = require("tslib");
6
6
  var toolkit_1 = require("@reduxjs/toolkit");
7
7
  var uuid_1 = require("uuid");
@@ -650,16 +650,23 @@ var selectPosCustomerProfile = function (state) {
650
650
  return customer;
651
651
  };
652
652
  exports.selectPosCustomerProfile = selectPosCustomerProfile;
653
- var selectPosCustomerName = function (state, isShort) {
654
- if (isShort === void 0) { isShort = false; }
653
+ var selectPosCustomerName = function (state) {
655
654
  if (!state.checkout.customer)
656
655
  return null;
657
656
  var customer = state.checkout.customer.customer;
658
657
  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;
660
- return "".concat(first_name, " ").concat(lastName);
658
+ return "".concat(first_name, " ").concat(last_name);
661
659
  };
662
660
  exports.selectPosCustomerName = selectPosCustomerName;
661
+ var selectPosCustomerNameShort = function (state) {
662
+ if (!state.checkout.customer)
663
+ return null;
664
+ var customer = state.checkout.customer.customer;
665
+ var first_name = customer.first_name, last_name = customer.last_name;
666
+ var lastName = (last_name === null || last_name === void 0 ? void 0 : last_name.charAt(0)) || '';
667
+ return "".concat(first_name, " ").concat(lastName);
668
+ };
669
+ exports.selectPosCustomerNameShort = selectPosCustomerNameShort;
663
670
  var selectPosPendingDiscounts = function (state) {
664
671
  return state.checkout.pendingDiscounts;
665
672
  };
@@ -77,7 +77,8 @@ 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
79
  export declare const selectPosCustomerProfile: (state: AppState) => import("../types").Customer | null;
80
- export declare const selectPosCustomerName: (state: AppState, isShort?: boolean) => string | null;
80
+ export declare const selectPosCustomerName: (state: AppState) => string | null;
81
+ export declare const selectPosCustomerNameShort: (state: AppState) => string | null;
81
82
  export declare const selectPosPendingDiscounts: (state: AppState) => boolean;
82
83
  export declare const selectPosAmountDue: (state: AppState) => `${number}.${number}` | null | undefined;
83
84
  export declare const selectPosCheckTotal: (state: AppState) => `${number}.${number}`;
@@ -643,13 +643,19 @@ export var selectPosCustomerProfile = function (state) {
643
643
  var customer = state.checkout.customer.customer;
644
644
  return customer;
645
645
  };
646
- export var selectPosCustomerName = function (state, isShort) {
647
- if (isShort === void 0) { isShort = false; }
646
+ export var selectPosCustomerName = function (state) {
648
647
  if (!state.checkout.customer)
649
648
  return null;
650
649
  var customer = state.checkout.customer.customer;
651
650
  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;
651
+ return "".concat(first_name, " ").concat(last_name);
652
+ };
653
+ export var selectPosCustomerNameShort = function (state) {
654
+ if (!state.checkout.customer)
655
+ return null;
656
+ var customer = state.checkout.customer.customer;
657
+ var first_name = customer.first_name, last_name = customer.last_name;
658
+ var lastName = (last_name === null || last_name === void 0 ? void 0 : last_name.charAt(0)) || '';
653
659
  return "".concat(first_name, " ").concat(lastName);
654
660
  };
655
661
  export var selectPosPendingDiscounts = function (state) {
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.76",
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",