@open-tender/store 1.0.17 → 1.0.19
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 { Arrivals, CustomerIdentifier, CustomerIdentify, Menu, Order, Orders,
|
|
1
|
+
import { Arrivals, CustomerIdentifier, CustomerIdentify, Menu, Order, Orders, OrderTender, OrderType, ServiceType, SelectOptions, ItemTypes, OrderUpdate, TicketsUpdate, TicketUpdate, TicketStatusUpdate, RequestedAt, RevenueCenter, CheckoutTender, OrderCreatePos } from '@open-tender/types';
|
|
2
2
|
import { CashEvent, CashSummary, DeviceRead, Discount, Discounts, Employee, Employees, PosSettingType, ErrorAlert, ErrorAlerts, GiftCardBalance, GiftCardCredit, InternalSettings, KioskConfig, LevelUp, MenuColors, MenuPages, OfflineAuths, OfflineAuthsResult, Punch, Refund, Settings, Store, Surcharges, Taxes, Tender } from '../types';
|
|
3
3
|
import { OrdersParams } from '../slices';
|
|
4
4
|
export interface InitAPI {
|
|
@@ -61,9 +61,9 @@ declare class PosAPI {
|
|
|
61
61
|
postChipDNACancel(): Promise<null>;
|
|
62
62
|
postChipDNATmsUpdate(): Promise<null>;
|
|
63
63
|
postIdentifyCustomer(data: CustomerIdentifier): Promise<CustomerIdentify>;
|
|
64
|
-
postOrderValidate(order:
|
|
65
|
-
postOrder(order:
|
|
66
|
-
deleteOrder(order:
|
|
64
|
+
postOrderValidate(order: OrderCreatePos): Promise<Order>;
|
|
65
|
+
postOrder(order: OrderCreatePos): Promise<Order>;
|
|
66
|
+
deleteOrder(order: OrderCreatePos): Promise<Order>;
|
|
67
67
|
getOrders(args: OrdersParams): Promise<Orders>;
|
|
68
68
|
patchOrder(orderId: string, data: OrderUpdate): Promise<Order>;
|
|
69
69
|
postReceipt(orderId: string): Promise<Order>;
|
|
@@ -25,7 +25,10 @@ export interface CheckoutState {
|
|
|
25
25
|
tip: Money | null;
|
|
26
26
|
validating: RequestStatus;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
interface OrderCreatePos extends Omit<OrderCreate, 'customer'> {
|
|
29
|
+
customer: CustomerIdentify | null;
|
|
30
|
+
}
|
|
31
|
+
export declare const prepareOrder: (order: OrderState, checkout: CheckoutState) => OrderCreatePos | null;
|
|
29
32
|
export declare enum CheckoutActionType {
|
|
30
33
|
AddTender = "checkout/addTender",
|
|
31
34
|
RemoveTender = "checkout/removeTender",
|
|
@@ -155,3 +158,4 @@ export declare const selectPosCheckSubtotal: (state: AppState) => `${number}.${n
|
|
|
155
158
|
export declare const selectPosCheckTotal: (state: AppState) => `${number}.${number}`;
|
|
156
159
|
export declare const selectPosCheckTenders: (state: AppState) => import("@open-tender/types").OrderTenders;
|
|
157
160
|
export declare const checkoutReducer: import("redux").Reducer<CheckoutState>;
|
|
161
|
+
export {};
|
|
@@ -53,17 +53,19 @@ var prepareOrder = function (order, checkout) {
|
|
|
53
53
|
// isTaxExempt,
|
|
54
54
|
points = checkout.points;
|
|
55
55
|
// const is_tax_exempt = isTaxExempt ? true : false
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
// const { customer_id, first_name, last_name, email, phone } =
|
|
57
|
+
// customer?.customer || {}
|
|
58
|
+
// const customerCreate = customer
|
|
59
|
+
// ? { customer_id, first_name, last_name, email, phone }
|
|
60
|
+
// : null
|
|
60
61
|
return {
|
|
61
62
|
order_uuid: order_uuid,
|
|
62
63
|
revenue_center_id: revenue_center_id,
|
|
63
64
|
// order_type,
|
|
64
65
|
service_type: service_type,
|
|
65
66
|
requested_at: requested_at,
|
|
66
|
-
customer: customerCreate,
|
|
67
|
+
// customer: customerCreate,
|
|
68
|
+
customer: customer,
|
|
67
69
|
cart: cart,
|
|
68
70
|
// gift_cards,
|
|
69
71
|
surcharges: surcharges,
|
|
@@ -255,7 +257,7 @@ exports.identifyCustomer = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.Id
|
|
|
255
257
|
var msg = "".concat(i.name, " discount applied!");
|
|
256
258
|
dispatch((0, notifications_1.showNotification)(msg));
|
|
257
259
|
});
|
|
258
|
-
if (!(points && points > 0)) return [3 /*break*/, 3];
|
|
260
|
+
if (!(points && parseInt(points) > 0)) return [3 /*break*/, 3];
|
|
259
261
|
dispatch((0, exports.setPendingDiscounts)(true));
|
|
260
262
|
return [4 /*yield*/, dispatch((0, exports.validatePosOrder)())];
|
|
261
263
|
case 2:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arrivals, CustomerIdentifier, CustomerIdentify, Menu, Order, Orders,
|
|
1
|
+
import { Arrivals, CustomerIdentifier, CustomerIdentify, Menu, Order, Orders, OrderTender, OrderType, ServiceType, SelectOptions, ItemTypes, OrderUpdate, TicketsUpdate, TicketUpdate, TicketStatusUpdate, RequestedAt, RevenueCenter, CheckoutTender, OrderCreatePos } from '@open-tender/types';
|
|
2
2
|
import { CashEvent, CashSummary, DeviceRead, Discount, Discounts, Employee, Employees, PosSettingType, ErrorAlert, ErrorAlerts, GiftCardBalance, GiftCardCredit, InternalSettings, KioskConfig, LevelUp, MenuColors, MenuPages, OfflineAuths, OfflineAuthsResult, Punch, Refund, Settings, Store, Surcharges, Taxes, Tender } from '../types';
|
|
3
3
|
import { OrdersParams } from '../slices';
|
|
4
4
|
export interface InitAPI {
|
|
@@ -61,9 +61,9 @@ declare class PosAPI {
|
|
|
61
61
|
postChipDNACancel(): Promise<null>;
|
|
62
62
|
postChipDNATmsUpdate(): Promise<null>;
|
|
63
63
|
postIdentifyCustomer(data: CustomerIdentifier): Promise<CustomerIdentify>;
|
|
64
|
-
postOrderValidate(order:
|
|
65
|
-
postOrder(order:
|
|
66
|
-
deleteOrder(order:
|
|
64
|
+
postOrderValidate(order: OrderCreatePos): Promise<Order>;
|
|
65
|
+
postOrder(order: OrderCreatePos): Promise<Order>;
|
|
66
|
+
deleteOrder(order: OrderCreatePos): Promise<Order>;
|
|
67
67
|
getOrders(args: OrdersParams): Promise<Orders>;
|
|
68
68
|
patchOrder(orderId: string, data: OrderUpdate): Promise<Order>;
|
|
69
69
|
postReceipt(orderId: string): Promise<Order>;
|
|
@@ -25,7 +25,10 @@ export interface CheckoutState {
|
|
|
25
25
|
tip: Money | null;
|
|
26
26
|
validating: RequestStatus;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
interface OrderCreatePos extends Omit<OrderCreate, 'customer'> {
|
|
29
|
+
customer: CustomerIdentify | null;
|
|
30
|
+
}
|
|
31
|
+
export declare const prepareOrder: (order: OrderState, checkout: CheckoutState) => OrderCreatePos | null;
|
|
29
32
|
export declare enum CheckoutActionType {
|
|
30
33
|
AddTender = "checkout/addTender",
|
|
31
34
|
RemoveTender = "checkout/removeTender",
|
|
@@ -155,3 +158,4 @@ export declare const selectPosCheckSubtotal: (state: AppState) => `${number}.${n
|
|
|
155
158
|
export declare const selectPosCheckTotal: (state: AppState) => `${number}.${number}`;
|
|
156
159
|
export declare const selectPosCheckTenders: (state: AppState) => import("@open-tender/types").OrderTenders;
|
|
157
160
|
export declare const checkoutReducer: import("redux").Reducer<CheckoutState>;
|
|
161
|
+
export {};
|
|
@@ -50,17 +50,19 @@ export var prepareOrder = function (order, checkout) {
|
|
|
50
50
|
// isTaxExempt,
|
|
51
51
|
points = checkout.points;
|
|
52
52
|
// const is_tax_exempt = isTaxExempt ? true : false
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
// const { customer_id, first_name, last_name, email, phone } =
|
|
54
|
+
// customer?.customer || {}
|
|
55
|
+
// const customerCreate = customer
|
|
56
|
+
// ? { customer_id, first_name, last_name, email, phone }
|
|
57
|
+
// : null
|
|
57
58
|
return {
|
|
58
59
|
order_uuid: order_uuid,
|
|
59
60
|
revenue_center_id: revenue_center_id,
|
|
60
61
|
// order_type,
|
|
61
62
|
service_type: service_type,
|
|
62
63
|
requested_at: requested_at,
|
|
63
|
-
customer: customerCreate,
|
|
64
|
+
// customer: customerCreate,
|
|
65
|
+
customer: customer,
|
|
64
66
|
cart: cart,
|
|
65
67
|
// gift_cards,
|
|
66
68
|
surcharges: surcharges,
|
|
@@ -251,7 +253,7 @@ export var identifyCustomer = createAsyncThunk(CheckoutActionType.IdentifyCustom
|
|
|
251
253
|
var msg = "".concat(i.name, " discount applied!");
|
|
252
254
|
dispatch(showNotification(msg));
|
|
253
255
|
});
|
|
254
|
-
if (!(points && points > 0)) return [3 /*break*/, 3];
|
|
256
|
+
if (!(points && parseInt(points) > 0)) return [3 /*break*/, 3];
|
|
255
257
|
dispatch(setPendingDiscounts(true));
|
|
256
258
|
return [4 /*yield*/, dispatch(validatePosOrder())];
|
|
257
259
|
case 2:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
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",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@emotion/react": "^11.11.1",
|
|
61
|
-
"@open-tender/types": "^0.4.
|
|
62
|
-
"@open-tender/ui": "^0.1.
|
|
61
|
+
"@open-tender/types": "^0.4.29",
|
|
62
|
+
"@open-tender/ui": "^0.1.22",
|
|
63
63
|
"@open-tender/utils": "^0.4.9",
|
|
64
64
|
"@reduxjs/toolkit": "^2.0.1",
|
|
65
65
|
"date-fns": "2.30.0",
|