@open-tender/cloud 0.1.24 → 0.1.26
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.
- package/dist/cjs/slices/allergens.d.ts +3 -3
- package/dist/cjs/slices/customer/allergens.d.ts +4 -4
- package/dist/cjs/slices/groupOrder.js +2 -6
- package/dist/esm/slices/allergens.d.ts +3 -3
- package/dist/esm/slices/customer/allergens.d.ts +4 -4
- package/dist/esm/slices/groupOrder.js +2 -6
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AppState } from '../app';
|
|
2
|
-
import {
|
|
2
|
+
import { Allergens, RequestError, RequestStatus } from '@open-tender/types';
|
|
3
3
|
export interface AllergensState {
|
|
4
|
-
entities:
|
|
4
|
+
entities: Allergens;
|
|
5
5
|
error: RequestError;
|
|
6
6
|
loading: RequestStatus;
|
|
7
|
-
selectedAllergens:
|
|
7
|
+
selectedAllergens: Allergens | null;
|
|
8
8
|
}
|
|
9
9
|
export declare enum AllergensActionType {
|
|
10
10
|
FetchAllergens = "allergens/fetchAllergens"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppState } from '../../app';
|
|
2
|
-
import {
|
|
2
|
+
import { CustomerAllergens, RequestError, RequestStatus } from '@open-tender/types';
|
|
3
3
|
export interface CustomerAllergensState {
|
|
4
|
-
entities:
|
|
4
|
+
entities: CustomerAllergens;
|
|
5
5
|
error: RequestError;
|
|
6
6
|
loading: RequestStatus;
|
|
7
7
|
lookup: {
|
|
@@ -12,7 +12,7 @@ export declare enum CustomerAllergensActionType {
|
|
|
12
12
|
FetchCustomerAllergens = "customer/fetchCustomerAllergens",
|
|
13
13
|
UpdateCustomerAllergens = "customer/updateCustomerAllergens"
|
|
14
14
|
}
|
|
15
|
-
export declare const fetchCustomerAllergens: import("@reduxjs/toolkit").AsyncThunk<
|
|
15
|
+
export declare const fetchCustomerAllergens: import("@reduxjs/toolkit").AsyncThunk<CustomerAllergens, void, {
|
|
16
16
|
state: AppState;
|
|
17
17
|
rejectValue: RequestError;
|
|
18
18
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -22,7 +22,7 @@ export declare const fetchCustomerAllergens: import("@reduxjs/toolkit").AsyncThu
|
|
|
22
22
|
fulfilledMeta?: unknown;
|
|
23
23
|
rejectedMeta?: unknown;
|
|
24
24
|
}>;
|
|
25
|
-
export declare const updateCustomerAllergens: import("@reduxjs/toolkit").AsyncThunk<
|
|
25
|
+
export declare const updateCustomerAllergens: import("@reduxjs/toolkit").AsyncThunk<CustomerAllergens, CustomerAllergens, {
|
|
26
26
|
state: AppState;
|
|
27
27
|
rejectValue: RequestError;
|
|
28
28
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -227,9 +227,7 @@ exports.selectSpendingLimit = selectSpendingLimit;
|
|
|
227
227
|
const selectGroupOrderClosed = (state) => {
|
|
228
228
|
const { cartGuest, cutoffAt, closed } = state.groupOrder;
|
|
229
229
|
const tz = (0, order_1.selectTimezone)(state);
|
|
230
|
-
const cutoffDate = cutoffAt
|
|
231
|
-
? (0, utils_1.isoToDate)(cutoffAt, tz)
|
|
232
|
-
: null;
|
|
230
|
+
const cutoffDate = cutoffAt ? (0, utils_1.isoToDate)(cutoffAt, tz) : null;
|
|
233
231
|
const pastCutoff = cutoffDate ? new Date() > cutoffDate : false;
|
|
234
232
|
return cartGuest && (closed || pastCutoff);
|
|
235
233
|
};
|
|
@@ -237,9 +235,7 @@ exports.selectGroupOrderClosed = selectGroupOrderClosed;
|
|
|
237
235
|
const selectGroupOrderTests = (state) => {
|
|
238
236
|
const { closed, cutoffAt, guestLimit, guestCount } = state.groupOrder;
|
|
239
237
|
const tz = (0, order_1.selectTimezone)(state);
|
|
240
|
-
const cutoffDate = cutoffAt
|
|
241
|
-
? (0, utils_1.isoToDate)(cutoffAt, tz)
|
|
242
|
-
: null;
|
|
238
|
+
const cutoffDate = cutoffAt ? (0, utils_1.isoToDate)(cutoffAt, tz) : null;
|
|
243
239
|
const pastCutoff = cutoffDate ? new Date() > cutoffDate : false;
|
|
244
240
|
const spotsRemaining = guestLimit ? guestLimit - (guestCount !== null && guestCount !== void 0 ? guestCount : 0) : null;
|
|
245
241
|
const atCapacity = spotsRemaining !== null && spotsRemaining <= 0;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AppState } from '../app';
|
|
2
|
-
import {
|
|
2
|
+
import { Allergens, RequestError, RequestStatus } from '@open-tender/types';
|
|
3
3
|
export interface AllergensState {
|
|
4
|
-
entities:
|
|
4
|
+
entities: Allergens;
|
|
5
5
|
error: RequestError;
|
|
6
6
|
loading: RequestStatus;
|
|
7
|
-
selectedAllergens:
|
|
7
|
+
selectedAllergens: Allergens | null;
|
|
8
8
|
}
|
|
9
9
|
export declare enum AllergensActionType {
|
|
10
10
|
FetchAllergens = "allergens/fetchAllergens"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppState } from '../../app';
|
|
2
|
-
import {
|
|
2
|
+
import { CustomerAllergens, RequestError, RequestStatus } from '@open-tender/types';
|
|
3
3
|
export interface CustomerAllergensState {
|
|
4
|
-
entities:
|
|
4
|
+
entities: CustomerAllergens;
|
|
5
5
|
error: RequestError;
|
|
6
6
|
loading: RequestStatus;
|
|
7
7
|
lookup: {
|
|
@@ -12,7 +12,7 @@ export declare enum CustomerAllergensActionType {
|
|
|
12
12
|
FetchCustomerAllergens = "customer/fetchCustomerAllergens",
|
|
13
13
|
UpdateCustomerAllergens = "customer/updateCustomerAllergens"
|
|
14
14
|
}
|
|
15
|
-
export declare const fetchCustomerAllergens: import("@reduxjs/toolkit").AsyncThunk<
|
|
15
|
+
export declare const fetchCustomerAllergens: import("@reduxjs/toolkit").AsyncThunk<CustomerAllergens, void, {
|
|
16
16
|
state: AppState;
|
|
17
17
|
rejectValue: RequestError;
|
|
18
18
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -22,7 +22,7 @@ export declare const fetchCustomerAllergens: import("@reduxjs/toolkit").AsyncThu
|
|
|
22
22
|
fulfilledMeta?: unknown;
|
|
23
23
|
rejectedMeta?: unknown;
|
|
24
24
|
}>;
|
|
25
|
-
export declare const updateCustomerAllergens: import("@reduxjs/toolkit").AsyncThunk<
|
|
25
|
+
export declare const updateCustomerAllergens: import("@reduxjs/toolkit").AsyncThunk<CustomerAllergens, CustomerAllergens, {
|
|
26
26
|
state: AppState;
|
|
27
27
|
rejectValue: RequestError;
|
|
28
28
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -220,18 +220,14 @@ export const selectSpendingLimit = (state) => {
|
|
|
220
220
|
export const selectGroupOrderClosed = (state) => {
|
|
221
221
|
const { cartGuest, cutoffAt, closed } = state.groupOrder;
|
|
222
222
|
const tz = selectTimezone(state);
|
|
223
|
-
const cutoffDate = cutoffAt
|
|
224
|
-
? isoToDate(cutoffAt, tz)
|
|
225
|
-
: null;
|
|
223
|
+
const cutoffDate = cutoffAt ? isoToDate(cutoffAt, tz) : null;
|
|
226
224
|
const pastCutoff = cutoffDate ? new Date() > cutoffDate : false;
|
|
227
225
|
return cartGuest && (closed || pastCutoff);
|
|
228
226
|
};
|
|
229
227
|
export const selectGroupOrderTests = (state) => {
|
|
230
228
|
const { closed, cutoffAt, guestLimit, guestCount } = state.groupOrder;
|
|
231
229
|
const tz = selectTimezone(state);
|
|
232
|
-
const cutoffDate = cutoffAt
|
|
233
|
-
? isoToDate(cutoffAt, tz)
|
|
234
|
-
: null;
|
|
230
|
+
const cutoffDate = cutoffAt ? isoToDate(cutoffAt, tz) : null;
|
|
235
231
|
const pastCutoff = cutoffDate ? new Date() > cutoffDate : false;
|
|
236
232
|
const spotsRemaining = guestLimit ? guestLimit - (guestCount !== null && guestCount !== void 0 ? guestCount : 0) : null;
|
|
237
233
|
const atCapacity = spotsRemaining !== null && spotsRemaining <= 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"typescript": "^4.8.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@open-tender/types": "^0.2.
|
|
53
|
-
"@open-tender/utils": "^0.1.
|
|
52
|
+
"@open-tender/types": "^0.2.16",
|
|
53
|
+
"@open-tender/utils": "^0.1.76",
|
|
54
54
|
"@reduxjs/toolkit": "^1.8.5",
|
|
55
55
|
"react": "^18.2.0"
|
|
56
56
|
},
|