@open-tender/types 0.2.4 → 0.2.6
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/types/api/checkout.d.ts +7 -2
- package/dist/cjs/types/api/checkout.js +19 -0
- package/dist/cjs/types/api/customer/account.d.ts +0 -12
- package/dist/cjs/types/api/customer/account.js +3 -0
- package/dist/cjs/types/api/customer/communicationPreferences.d.ts +3 -1
- package/dist/cjs/types/api/customer/customer.d.ts +23 -23
- package/dist/cjs/types/api/customer/customer.js +5 -0
- package/dist/cjs/types/api/customer/giftCards.d.ts +6 -4
- package/dist/cjs/types/api/customer/houseAccounts.d.ts +12 -8
- package/dist/cjs/types/api/order.d.ts +13 -24
- package/dist/cjs/types/global.d.ts +1 -1
- package/dist/cjs/types/inputs.d.ts +1 -0
- package/dist/esm/types/api/checkout.d.ts +7 -2
- package/dist/esm/types/api/checkout.js +14 -1
- package/dist/esm/types/api/customer/account.d.ts +0 -12
- package/dist/esm/types/api/customer/account.js +3 -0
- package/dist/esm/types/api/customer/communicationPreferences.d.ts +3 -1
- package/dist/esm/types/api/customer/customer.d.ts +23 -23
- package/dist/esm/types/api/customer/customer.js +5 -0
- package/dist/esm/types/api/customer/giftCards.d.ts +6 -4
- package/dist/esm/types/api/customer/houseAccounts.d.ts +12 -8
- package/dist/esm/types/api/order.d.ts +13 -24
- package/dist/esm/types/global.d.ts +1 -1
- package/dist/esm/types/inputs.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { CardType, CardTypeName, DeviceType, DiscountType, Money, OrderType, Pre
|
|
|
3
3
|
import { RequestErrorParams } from '../request';
|
|
4
4
|
import { Cart } from './cart';
|
|
5
5
|
import { Address, Customer } from './customer';
|
|
6
|
-
import { Order, OrderDiscounts, OrderFulfillment, OrderSurcharge } from './order';
|
|
6
|
+
import { Order, OrderCustomer, OrderDiscounts, OrderFulfillment, OrderSurcharge } from './order';
|
|
7
7
|
export interface SimpleCartOption {
|
|
8
8
|
id: number;
|
|
9
9
|
quantity: number;
|
|
@@ -82,8 +82,9 @@ export interface CheckoutConfig {
|
|
|
82
82
|
surcharges: CheckoutConfigSurcharges;
|
|
83
83
|
tender_types: TenderType[];
|
|
84
84
|
}
|
|
85
|
-
export interface CheckoutCheck extends Order {
|
|
85
|
+
export interface CheckoutCheck extends Omit<Order, 'customer'> {
|
|
86
86
|
config: CheckoutConfig;
|
|
87
|
+
customer: OrderCustomer | null;
|
|
87
88
|
errors: RequestErrorParams;
|
|
88
89
|
}
|
|
89
90
|
export interface OrderCreateDetails {
|
|
@@ -179,6 +180,10 @@ export interface CheckoutTenderHouseAccount {
|
|
|
179
180
|
}
|
|
180
181
|
export declare type CheckoutTender = CheckoutTenderCreditGuest | CheckoutTenderCreditCustomer | CheckoutTenderGiftCard | CheckoutTenderHouseAccount;
|
|
181
182
|
export declare type CheckoutTenders = CheckoutTender[];
|
|
183
|
+
export declare const isCreditCustomerCheckoutTender: (tender: CheckoutTender) => tender is CheckoutTenderCreditGuest;
|
|
184
|
+
export declare const isCreditGuestCheckoutTender: (tender: CheckoutTender) => tender is CheckoutTenderCreditGuest;
|
|
185
|
+
export declare const isGiftCardCheckoutTender: (tender: CheckoutTender) => tender is CheckoutTenderGiftCard;
|
|
186
|
+
export declare const isHouseAccountCheckoutTender: (tender: CheckoutTender) => tender is CheckoutTenderHouseAccount;
|
|
182
187
|
export declare type CheckoutPromoCodes = string[];
|
|
183
188
|
export interface CheckoutForm {
|
|
184
189
|
address: CheckoutFormAddress;
|
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isHouseAccountCheckoutTender = exports.isGiftCardCheckoutTender = exports.isCreditGuestCheckoutTender = exports.isCreditCustomerCheckoutTender = void 0;
|
|
4
|
+
const isCreditCustomerCheckoutTender = (tender) => {
|
|
5
|
+
return (tender.tender_type === 'CREDIT' &&
|
|
6
|
+
tender.customer_card_id !== undefined);
|
|
7
|
+
};
|
|
8
|
+
exports.isCreditCustomerCheckoutTender = isCreditCustomerCheckoutTender;
|
|
9
|
+
const isCreditGuestCheckoutTender = (tender) => {
|
|
10
|
+
return (tender.tender_type === 'CREDIT' &&
|
|
11
|
+
tender.acct !== undefined);
|
|
12
|
+
};
|
|
13
|
+
exports.isCreditGuestCheckoutTender = isCreditGuestCheckoutTender;
|
|
14
|
+
const isGiftCardCheckoutTender = (tender) => {
|
|
15
|
+
return tender.tender_type === 'GIFT_CARD';
|
|
16
|
+
};
|
|
17
|
+
exports.isGiftCardCheckoutTender = isGiftCardCheckoutTender;
|
|
18
|
+
const isHouseAccountCheckoutTender = (tender) => {
|
|
19
|
+
return tender.tender_type === 'HOUSE_ACCOUNT';
|
|
20
|
+
};
|
|
21
|
+
exports.isHouseAccountCheckoutTender = isHouseAccountCheckoutTender;
|
|
@@ -4,18 +4,6 @@ export interface Auth {
|
|
|
4
4
|
refresh_token: string;
|
|
5
5
|
token_type: string;
|
|
6
6
|
}
|
|
7
|
-
export interface Profile {
|
|
8
|
-
birth_date: string | null;
|
|
9
|
-
company: string;
|
|
10
|
-
customer_id: number;
|
|
11
|
-
email: string;
|
|
12
|
-
first_name: string;
|
|
13
|
-
gender: string | null;
|
|
14
|
-
is_notification_set: boolean;
|
|
15
|
-
is_verified: boolean;
|
|
16
|
-
last_name: string;
|
|
17
|
-
phone: string;
|
|
18
|
-
}
|
|
19
7
|
export interface LoginData {
|
|
20
8
|
email: string;
|
|
21
9
|
password: string;
|
|
@@ -7,4 +7,6 @@ export interface CustomerNotificationPref {
|
|
|
7
7
|
notification_area: NotificationArea;
|
|
8
8
|
notification_channel: NotificationChannel;
|
|
9
9
|
}
|
|
10
|
-
export declare type CustomerNotificationPrefs =
|
|
10
|
+
export declare type CustomerNotificationPrefs = CustomerNotificationPref[];
|
|
11
|
+
export declare type CustomerNotificationPrefCreate = Omit<CustomerNotificationPref, 'created_at' | 'customer_notification_preference_id'>;
|
|
12
|
+
export declare type CustomerNotificationPrefsCreate = CustomerNotificationPrefCreate[];
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { DateString } from '../../datetimes';
|
|
2
2
|
import { Gender, OrderNotifications } from '../../global';
|
|
3
3
|
import { Allergens } from '../allergens';
|
|
4
|
-
import { CreditCards } from '../creditCards';
|
|
5
4
|
import { Favorites } from '../favorite';
|
|
6
5
|
import { CustomerNotificationPrefs } from './communicationPreferences';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export interface Customer {
|
|
10
|
-
accepts_marketing?: boolean;
|
|
6
|
+
import { GiftCards } from './giftCards';
|
|
7
|
+
export interface CustomerCreate {
|
|
11
8
|
birth_date?: DateString | null;
|
|
12
|
-
company?:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
is_guest?: boolean;
|
|
18
|
-
is_notification_set?: boolean;
|
|
19
|
-
is_verified?: boolean;
|
|
20
|
-
last_name?: string;
|
|
21
|
-
order_notifications?: OrderNotifications;
|
|
22
|
-
phone?: string | null;
|
|
9
|
+
company?: string;
|
|
10
|
+
email: string;
|
|
11
|
+
first_name: string;
|
|
12
|
+
gender?: string | null;
|
|
13
|
+
last_name: string;
|
|
23
14
|
password?: string;
|
|
24
|
-
|
|
25
|
-
gift_cards?: Array<Partial<CustomerGiftCard>>;
|
|
26
|
-
house_accounts?: HouseAccounts;
|
|
15
|
+
phone: string;
|
|
27
16
|
}
|
|
28
|
-
export interface
|
|
17
|
+
export interface Customer {
|
|
18
|
+
accepts_marketing: boolean;
|
|
29
19
|
allergens?: Allergens;
|
|
30
|
-
|
|
20
|
+
birth_date: DateString | null;
|
|
21
|
+
company: string;
|
|
22
|
+
customer_id: number;
|
|
23
|
+
customer_notification_preferences: CustomerNotificationPrefs;
|
|
24
|
+
email: string;
|
|
31
25
|
favorites?: Favorites;
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
first_name: string;
|
|
27
|
+
gender: Gender | null;
|
|
28
|
+
gift_cards?: GiftCards;
|
|
29
|
+
is_notification_set: boolean;
|
|
30
|
+
is_verified: boolean;
|
|
31
|
+
last_name: string;
|
|
32
|
+
order_notifications: OrderNotifications;
|
|
33
|
+
phone: string;
|
|
34
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateString, ISOStringOffset } from '../../datetimes';
|
|
2
2
|
import { Money } from '../../global';
|
|
3
3
|
import { CreditCardData, CreditCardSaved } from '../creditCards';
|
|
4
|
-
export interface
|
|
4
|
+
export interface GiftCard {
|
|
5
5
|
balance: Money;
|
|
6
6
|
card_number: string;
|
|
7
7
|
expiration: DateString | null;
|
|
@@ -9,10 +9,8 @@ export interface CustomerGiftCard {
|
|
|
9
9
|
orders: number;
|
|
10
10
|
qr_code_url: string;
|
|
11
11
|
updated_at: ISOStringOffset;
|
|
12
|
-
amount?: number;
|
|
13
|
-
customer_card_id?: string | number;
|
|
14
12
|
}
|
|
15
|
-
export declare type
|
|
13
|
+
export declare type GiftCards = GiftCard[];
|
|
16
14
|
export interface GiftCardPurchased {
|
|
17
15
|
email: string;
|
|
18
16
|
balance: string;
|
|
@@ -31,3 +29,7 @@ export interface GiftCardsPurchase {
|
|
|
31
29
|
url: string;
|
|
32
30
|
token?: string;
|
|
33
31
|
}
|
|
32
|
+
export interface GiftCardPurchase {
|
|
33
|
+
amount: string;
|
|
34
|
+
customer_card_id: number;
|
|
35
|
+
}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { OrderType, ServiceType } from '../../global';
|
|
2
|
-
import {
|
|
2
|
+
import { RevenueCenterType } from '../revenueCenter';
|
|
3
|
+
export interface HouseAccountRevenueCenter {
|
|
4
|
+
name: string;
|
|
5
|
+
revenue_center_id: number;
|
|
6
|
+
revenue_center_type: RevenueCenterType;
|
|
7
|
+
}
|
|
8
|
+
export declare type HouseAccountRevenueCenters = HouseAccountRevenueCenter[];
|
|
3
9
|
export interface HouseAccount {
|
|
4
10
|
approved_contact: boolean;
|
|
5
|
-
domain: string;
|
|
11
|
+
domain: string | null;
|
|
6
12
|
house_account_id: number;
|
|
7
13
|
name: string;
|
|
8
|
-
order_type: OrderType;
|
|
14
|
+
order_type: OrderType | null;
|
|
9
15
|
pin: string;
|
|
10
|
-
revenue_centers:
|
|
11
|
-
service_type: ServiceType;
|
|
12
|
-
revenue_center_type?: RevenueCenterType;
|
|
13
|
-
qr_code_url?: string;
|
|
16
|
+
revenue_centers: HouseAccountRevenueCenters;
|
|
17
|
+
service_type: ServiceType | null;
|
|
14
18
|
}
|
|
15
|
-
export declare type HouseAccounts =
|
|
19
|
+
export declare type HouseAccounts = HouseAccount[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ISOStringOffset, RequestedAt, TimeHuman, TimezonePython } from '../datetimes';
|
|
2
|
-
import { CardType, CardTypeName, ChannelType, DiscountAuthType, DiscountType, Images, Money, NegativeMoney,
|
|
3
|
-
import { CreditCard } from './creditCards';
|
|
4
|
-
import { Address } from './customer';
|
|
1
|
+
import { DateString, ISOStringOffset, RequestedAt, TimeHuman, TimezonePython } from '../datetimes';
|
|
2
|
+
import { CardType, CardTypeName, ChannelType, DiscountAuthType, DiscountType, Gender, Images, Money, NegativeMoney, OrderStatus, OrderType, ServiceType, TenderType } from '../global';
|
|
3
|
+
import { CreditCard, CreditCards } from './creditCards';
|
|
4
|
+
import { Address, Customer, GiftCard, HouseAccounts } from './customer';
|
|
5
5
|
import { PrepStatus } from './kds';
|
|
6
6
|
import { NutritionalInfo } from './menu';
|
|
7
7
|
export interface OrderItemPoints {
|
|
@@ -48,32 +48,21 @@ export interface OrderCustomerCreditCard {
|
|
|
48
48
|
masked: string;
|
|
49
49
|
}
|
|
50
50
|
export declare type OrderCustomerCreditCards = OrderCustomerCreditCard[];
|
|
51
|
-
export
|
|
52
|
-
balance: Money;
|
|
53
|
-
card_number: string;
|
|
54
|
-
expiration: ISOStringOffset | null;
|
|
55
|
-
orders: number;
|
|
56
|
-
updated_at: ISOStringOffset;
|
|
57
|
-
}
|
|
51
|
+
export declare type OrderCustomerGiftCard = Omit<GiftCard, 'gift_card_id' | 'qr_code_url'>;
|
|
58
52
|
export declare type OrderCustomerGiftCards = OrderCustomerGiftCard[];
|
|
59
53
|
export interface OrderCustomerSso {
|
|
60
54
|
connected: boolean;
|
|
61
55
|
service: string;
|
|
62
56
|
}
|
|
63
|
-
export interface OrderCustomer {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
email: string;
|
|
69
|
-
first_name: string;
|
|
57
|
+
export interface OrderCustomer extends Omit<Customer, 'allergens' | 'birth_date' | 'customer_id' | 'customer_notification_preferences' | 'favorites' | 'gender' | 'gift_cards' | 'is_notification_set'> {
|
|
58
|
+
birth_date?: DateString | null;
|
|
59
|
+
credit_cards?: CreditCards;
|
|
60
|
+
customer_id?: number;
|
|
61
|
+
gender?: Gender | null;
|
|
70
62
|
gift_cards?: OrderCustomerGiftCards;
|
|
63
|
+
house_accounts?: HouseAccounts;
|
|
71
64
|
is_guest: boolean;
|
|
72
|
-
|
|
73
|
-
last_name: string;
|
|
74
|
-
order_notifications: OrderNotifications;
|
|
75
|
-
phone: string;
|
|
76
|
-
sso?: OrderCustomerSso;
|
|
65
|
+
sso: OrderCustomerSso;
|
|
77
66
|
}
|
|
78
67
|
export interface OrderDineInGuest {
|
|
79
68
|
company: string | null;
|
|
@@ -230,7 +219,7 @@ export interface Order {
|
|
|
230
219
|
address: Address | null;
|
|
231
220
|
cart: OrderCart;
|
|
232
221
|
created_at: ISOStringOffset;
|
|
233
|
-
customer: OrderCustomer
|
|
222
|
+
customer: OrderCustomer;
|
|
234
223
|
delivery: OrderDelivery | null;
|
|
235
224
|
details: OrderDetails | null;
|
|
236
225
|
discounts: OrderDiscounts;
|
|
@@ -51,4 +51,4 @@ export interface Image {
|
|
|
51
51
|
}
|
|
52
52
|
export declare type Images = Image[];
|
|
53
53
|
export declare type OrderNotifications = 'ALL' | 'EMAIL' | 'NEW' | 'NONE' | 'SMS';
|
|
54
|
-
export declare type Gender = 'MALE' | 'FEMALE' | 'DECLINED'
|
|
54
|
+
export declare type Gender = 'MALE' | 'FEMALE' | 'DECLINED';
|
|
@@ -78,3 +78,4 @@ export declare const isSelect: (field: FormFieldType) => field is Select;
|
|
|
78
78
|
export declare const isSwitch: (field: FormFieldType) => field is Switch;
|
|
79
79
|
export declare const isTextarea: (field: FormFieldType) => field is Textarea;
|
|
80
80
|
export declare const isInput: (field: FormFieldType) => field is Input;
|
|
81
|
+
export declare type FormFields = FormFieldType[];
|
|
@@ -3,7 +3,7 @@ import { CardType, CardTypeName, DeviceType, DiscountType, Money, OrderType, Pre
|
|
|
3
3
|
import { RequestErrorParams } from '../request';
|
|
4
4
|
import { Cart } from './cart';
|
|
5
5
|
import { Address, Customer } from './customer';
|
|
6
|
-
import { Order, OrderDiscounts, OrderFulfillment, OrderSurcharge } from './order';
|
|
6
|
+
import { Order, OrderCustomer, OrderDiscounts, OrderFulfillment, OrderSurcharge } from './order';
|
|
7
7
|
export interface SimpleCartOption {
|
|
8
8
|
id: number;
|
|
9
9
|
quantity: number;
|
|
@@ -82,8 +82,9 @@ export interface CheckoutConfig {
|
|
|
82
82
|
surcharges: CheckoutConfigSurcharges;
|
|
83
83
|
tender_types: TenderType[];
|
|
84
84
|
}
|
|
85
|
-
export interface CheckoutCheck extends Order {
|
|
85
|
+
export interface CheckoutCheck extends Omit<Order, 'customer'> {
|
|
86
86
|
config: CheckoutConfig;
|
|
87
|
+
customer: OrderCustomer | null;
|
|
87
88
|
errors: RequestErrorParams;
|
|
88
89
|
}
|
|
89
90
|
export interface OrderCreateDetails {
|
|
@@ -179,6 +180,10 @@ export interface CheckoutTenderHouseAccount {
|
|
|
179
180
|
}
|
|
180
181
|
export declare type CheckoutTender = CheckoutTenderCreditGuest | CheckoutTenderCreditCustomer | CheckoutTenderGiftCard | CheckoutTenderHouseAccount;
|
|
181
182
|
export declare type CheckoutTenders = CheckoutTender[];
|
|
183
|
+
export declare const isCreditCustomerCheckoutTender: (tender: CheckoutTender) => tender is CheckoutTenderCreditGuest;
|
|
184
|
+
export declare const isCreditGuestCheckoutTender: (tender: CheckoutTender) => tender is CheckoutTenderCreditGuest;
|
|
185
|
+
export declare const isGiftCardCheckoutTender: (tender: CheckoutTender) => tender is CheckoutTenderGiftCard;
|
|
186
|
+
export declare const isHouseAccountCheckoutTender: (tender: CheckoutTender) => tender is CheckoutTenderHouseAccount;
|
|
182
187
|
export declare type CheckoutPromoCodes = string[];
|
|
183
188
|
export interface CheckoutForm {
|
|
184
189
|
address: CheckoutFormAddress;
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export const isCreditCustomerCheckoutTender = (tender) => {
|
|
2
|
+
return (tender.tender_type === 'CREDIT' &&
|
|
3
|
+
tender.customer_card_id !== undefined);
|
|
4
|
+
};
|
|
5
|
+
export const isCreditGuestCheckoutTender = (tender) => {
|
|
6
|
+
return (tender.tender_type === 'CREDIT' &&
|
|
7
|
+
tender.acct !== undefined);
|
|
8
|
+
};
|
|
9
|
+
export const isGiftCardCheckoutTender = (tender) => {
|
|
10
|
+
return tender.tender_type === 'GIFT_CARD';
|
|
11
|
+
};
|
|
12
|
+
export const isHouseAccountCheckoutTender = (tender) => {
|
|
13
|
+
return tender.tender_type === 'HOUSE_ACCOUNT';
|
|
14
|
+
};
|
|
@@ -4,18 +4,6 @@ export interface Auth {
|
|
|
4
4
|
refresh_token: string;
|
|
5
5
|
token_type: string;
|
|
6
6
|
}
|
|
7
|
-
export interface Profile {
|
|
8
|
-
birth_date: string | null;
|
|
9
|
-
company: string;
|
|
10
|
-
customer_id: number;
|
|
11
|
-
email: string;
|
|
12
|
-
first_name: string;
|
|
13
|
-
gender: string | null;
|
|
14
|
-
is_notification_set: boolean;
|
|
15
|
-
is_verified: boolean;
|
|
16
|
-
last_name: string;
|
|
17
|
-
phone: string;
|
|
18
|
-
}
|
|
19
7
|
export interface LoginData {
|
|
20
8
|
email: string;
|
|
21
9
|
password: string;
|
|
@@ -7,4 +7,6 @@ export interface CustomerNotificationPref {
|
|
|
7
7
|
notification_area: NotificationArea;
|
|
8
8
|
notification_channel: NotificationChannel;
|
|
9
9
|
}
|
|
10
|
-
export declare type CustomerNotificationPrefs =
|
|
10
|
+
export declare type CustomerNotificationPrefs = CustomerNotificationPref[];
|
|
11
|
+
export declare type CustomerNotificationPrefCreate = Omit<CustomerNotificationPref, 'created_at' | 'customer_notification_preference_id'>;
|
|
12
|
+
export declare type CustomerNotificationPrefsCreate = CustomerNotificationPrefCreate[];
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { DateString } from '../../datetimes';
|
|
2
2
|
import { Gender, OrderNotifications } from '../../global';
|
|
3
3
|
import { Allergens } from '../allergens';
|
|
4
|
-
import { CreditCards } from '../creditCards';
|
|
5
4
|
import { Favorites } from '../favorite';
|
|
6
5
|
import { CustomerNotificationPrefs } from './communicationPreferences';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export interface Customer {
|
|
10
|
-
accepts_marketing?: boolean;
|
|
6
|
+
import { GiftCards } from './giftCards';
|
|
7
|
+
export interface CustomerCreate {
|
|
11
8
|
birth_date?: DateString | null;
|
|
12
|
-
company?:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
is_guest?: boolean;
|
|
18
|
-
is_notification_set?: boolean;
|
|
19
|
-
is_verified?: boolean;
|
|
20
|
-
last_name?: string;
|
|
21
|
-
order_notifications?: OrderNotifications;
|
|
22
|
-
phone?: string | null;
|
|
9
|
+
company?: string;
|
|
10
|
+
email: string;
|
|
11
|
+
first_name: string;
|
|
12
|
+
gender?: string | null;
|
|
13
|
+
last_name: string;
|
|
23
14
|
password?: string;
|
|
24
|
-
|
|
25
|
-
gift_cards?: Array<Partial<CustomerGiftCard>>;
|
|
26
|
-
house_accounts?: HouseAccounts;
|
|
15
|
+
phone: string;
|
|
27
16
|
}
|
|
28
|
-
export interface
|
|
17
|
+
export interface Customer {
|
|
18
|
+
accepts_marketing: boolean;
|
|
29
19
|
allergens?: Allergens;
|
|
30
|
-
|
|
20
|
+
birth_date: DateString | null;
|
|
21
|
+
company: string;
|
|
22
|
+
customer_id: number;
|
|
23
|
+
customer_notification_preferences: CustomerNotificationPrefs;
|
|
24
|
+
email: string;
|
|
31
25
|
favorites?: Favorites;
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
first_name: string;
|
|
27
|
+
gender: Gender | null;
|
|
28
|
+
gift_cards?: GiftCards;
|
|
29
|
+
is_notification_set: boolean;
|
|
30
|
+
is_verified: boolean;
|
|
31
|
+
last_name: string;
|
|
32
|
+
order_notifications: OrderNotifications;
|
|
33
|
+
phone: string;
|
|
34
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateString, ISOStringOffset } from '../../datetimes';
|
|
2
2
|
import { Money } from '../../global';
|
|
3
3
|
import { CreditCardData, CreditCardSaved } from '../creditCards';
|
|
4
|
-
export interface
|
|
4
|
+
export interface GiftCard {
|
|
5
5
|
balance: Money;
|
|
6
6
|
card_number: string;
|
|
7
7
|
expiration: DateString | null;
|
|
@@ -9,10 +9,8 @@ export interface CustomerGiftCard {
|
|
|
9
9
|
orders: number;
|
|
10
10
|
qr_code_url: string;
|
|
11
11
|
updated_at: ISOStringOffset;
|
|
12
|
-
amount?: number;
|
|
13
|
-
customer_card_id?: string | number;
|
|
14
12
|
}
|
|
15
|
-
export declare type
|
|
13
|
+
export declare type GiftCards = GiftCard[];
|
|
16
14
|
export interface GiftCardPurchased {
|
|
17
15
|
email: string;
|
|
18
16
|
balance: string;
|
|
@@ -31,3 +29,7 @@ export interface GiftCardsPurchase {
|
|
|
31
29
|
url: string;
|
|
32
30
|
token?: string;
|
|
33
31
|
}
|
|
32
|
+
export interface GiftCardPurchase {
|
|
33
|
+
amount: string;
|
|
34
|
+
customer_card_id: number;
|
|
35
|
+
}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { OrderType, ServiceType } from '../../global';
|
|
2
|
-
import {
|
|
2
|
+
import { RevenueCenterType } from '../revenueCenter';
|
|
3
|
+
export interface HouseAccountRevenueCenter {
|
|
4
|
+
name: string;
|
|
5
|
+
revenue_center_id: number;
|
|
6
|
+
revenue_center_type: RevenueCenterType;
|
|
7
|
+
}
|
|
8
|
+
export declare type HouseAccountRevenueCenters = HouseAccountRevenueCenter[];
|
|
3
9
|
export interface HouseAccount {
|
|
4
10
|
approved_contact: boolean;
|
|
5
|
-
domain: string;
|
|
11
|
+
domain: string | null;
|
|
6
12
|
house_account_id: number;
|
|
7
13
|
name: string;
|
|
8
|
-
order_type: OrderType;
|
|
14
|
+
order_type: OrderType | null;
|
|
9
15
|
pin: string;
|
|
10
|
-
revenue_centers:
|
|
11
|
-
service_type: ServiceType;
|
|
12
|
-
revenue_center_type?: RevenueCenterType;
|
|
13
|
-
qr_code_url?: string;
|
|
16
|
+
revenue_centers: HouseAccountRevenueCenters;
|
|
17
|
+
service_type: ServiceType | null;
|
|
14
18
|
}
|
|
15
|
-
export declare type HouseAccounts =
|
|
19
|
+
export declare type HouseAccounts = HouseAccount[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ISOStringOffset, RequestedAt, TimeHuman, TimezonePython } from '../datetimes';
|
|
2
|
-
import { CardType, CardTypeName, ChannelType, DiscountAuthType, DiscountType, Images, Money, NegativeMoney,
|
|
3
|
-
import { CreditCard } from './creditCards';
|
|
4
|
-
import { Address } from './customer';
|
|
1
|
+
import { DateString, ISOStringOffset, RequestedAt, TimeHuman, TimezonePython } from '../datetimes';
|
|
2
|
+
import { CardType, CardTypeName, ChannelType, DiscountAuthType, DiscountType, Gender, Images, Money, NegativeMoney, OrderStatus, OrderType, ServiceType, TenderType } from '../global';
|
|
3
|
+
import { CreditCard, CreditCards } from './creditCards';
|
|
4
|
+
import { Address, Customer, GiftCard, HouseAccounts } from './customer';
|
|
5
5
|
import { PrepStatus } from './kds';
|
|
6
6
|
import { NutritionalInfo } from './menu';
|
|
7
7
|
export interface OrderItemPoints {
|
|
@@ -48,32 +48,21 @@ export interface OrderCustomerCreditCard {
|
|
|
48
48
|
masked: string;
|
|
49
49
|
}
|
|
50
50
|
export declare type OrderCustomerCreditCards = OrderCustomerCreditCard[];
|
|
51
|
-
export
|
|
52
|
-
balance: Money;
|
|
53
|
-
card_number: string;
|
|
54
|
-
expiration: ISOStringOffset | null;
|
|
55
|
-
orders: number;
|
|
56
|
-
updated_at: ISOStringOffset;
|
|
57
|
-
}
|
|
51
|
+
export declare type OrderCustomerGiftCard = Omit<GiftCard, 'gift_card_id' | 'qr_code_url'>;
|
|
58
52
|
export declare type OrderCustomerGiftCards = OrderCustomerGiftCard[];
|
|
59
53
|
export interface OrderCustomerSso {
|
|
60
54
|
connected: boolean;
|
|
61
55
|
service: string;
|
|
62
56
|
}
|
|
63
|
-
export interface OrderCustomer {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
email: string;
|
|
69
|
-
first_name: string;
|
|
57
|
+
export interface OrderCustomer extends Omit<Customer, 'allergens' | 'birth_date' | 'customer_id' | 'customer_notification_preferences' | 'favorites' | 'gender' | 'gift_cards' | 'is_notification_set'> {
|
|
58
|
+
birth_date?: DateString | null;
|
|
59
|
+
credit_cards?: CreditCards;
|
|
60
|
+
customer_id?: number;
|
|
61
|
+
gender?: Gender | null;
|
|
70
62
|
gift_cards?: OrderCustomerGiftCards;
|
|
63
|
+
house_accounts?: HouseAccounts;
|
|
71
64
|
is_guest: boolean;
|
|
72
|
-
|
|
73
|
-
last_name: string;
|
|
74
|
-
order_notifications: OrderNotifications;
|
|
75
|
-
phone: string;
|
|
76
|
-
sso?: OrderCustomerSso;
|
|
65
|
+
sso: OrderCustomerSso;
|
|
77
66
|
}
|
|
78
67
|
export interface OrderDineInGuest {
|
|
79
68
|
company: string | null;
|
|
@@ -230,7 +219,7 @@ export interface Order {
|
|
|
230
219
|
address: Address | null;
|
|
231
220
|
cart: OrderCart;
|
|
232
221
|
created_at: ISOStringOffset;
|
|
233
|
-
customer: OrderCustomer
|
|
222
|
+
customer: OrderCustomer;
|
|
234
223
|
delivery: OrderDelivery | null;
|
|
235
224
|
details: OrderDetails | null;
|
|
236
225
|
discounts: OrderDiscounts;
|
|
@@ -51,4 +51,4 @@ export interface Image {
|
|
|
51
51
|
}
|
|
52
52
|
export declare type Images = Image[];
|
|
53
53
|
export declare type OrderNotifications = 'ALL' | 'EMAIL' | 'NEW' | 'NONE' | 'SMS';
|
|
54
|
-
export declare type Gender = 'MALE' | 'FEMALE' | 'DECLINED'
|
|
54
|
+
export declare type Gender = 'MALE' | 'FEMALE' | 'DECLINED';
|
|
@@ -78,3 +78,4 @@ export declare const isSelect: (field: FormFieldType) => field is Select;
|
|
|
78
78
|
export declare const isSwitch: (field: FormFieldType) => field is Switch;
|
|
79
79
|
export declare const isTextarea: (field: FormFieldType) => field is Textarea;
|
|
80
80
|
export declare const isInput: (field: FormFieldType) => field is Input;
|
|
81
|
+
export declare type FormFields = FormFieldType[];
|
package/package.json
CHANGED