@open-tender/types 0.1.4 → 0.1.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 +195 -119
- package/dist/cjs/types/api/config.d.ts +22 -36
- package/dist/cjs/types/api/creditCards.d.ts +6 -6
- package/dist/cjs/types/api/customer/addresses.d.ts +10 -6
- package/dist/cjs/types/api/kds.d.ts +1 -1
- package/dist/cjs/types/api/menu.d.ts +16 -3
- package/dist/cjs/types/api/messages.d.ts +1 -1
- package/dist/cjs/types/api/order.d.ts +207 -446
- package/dist/cjs/types/api/order.js +17 -0
- package/dist/cjs/types/api/pos.d.ts +163 -0
- package/dist/cjs/types/api/pos.js +2 -0
- package/dist/cjs/types/global.d.ts +9 -2
- package/dist/cjs/types/request.d.ts +7 -4
- package/dist/esm/types/api/checkout.d.ts +195 -119
- package/dist/esm/types/api/config.d.ts +22 -36
- package/dist/esm/types/api/creditCards.d.ts +6 -6
- package/dist/esm/types/api/customer/addresses.d.ts +10 -6
- package/dist/esm/types/api/kds.d.ts +1 -1
- package/dist/esm/types/api/menu.d.ts +16 -3
- package/dist/esm/types/api/messages.d.ts +1 -1
- package/dist/esm/types/api/order.d.ts +207 -446
- package/dist/esm/types/api/order.js +12 -1
- package/dist/esm/types/api/pos.d.ts +163 -0
- package/dist/esm/types/api/pos.js +1 -0
- package/dist/esm/types/global.d.ts +9 -2
- package/dist/esm/types/request.d.ts +7 -4
- package/package.json +1 -1
|
@@ -1,2 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isHouseAccountTender = exports.isGiftCardTender = exports.isCreditTender = exports.isOrderCustomer = void 0;
|
|
4
|
+
const isOrderCustomer = (customer) => {
|
|
5
|
+
return customer.customer_id !== undefined;
|
|
6
|
+
};
|
|
7
|
+
exports.isOrderCustomer = isOrderCustomer;
|
|
8
|
+
const isCreditTender = (tender) => {
|
|
9
|
+
return tender.tender_type === 'CREDIT';
|
|
10
|
+
};
|
|
11
|
+
exports.isCreditTender = isCreditTender;
|
|
12
|
+
const isGiftCardTender = (tender) => {
|
|
13
|
+
return tender.tender_type === 'GIFT_CARD';
|
|
14
|
+
};
|
|
15
|
+
exports.isGiftCardTender = isGiftCardTender;
|
|
16
|
+
const isHouseAccountTender = (tender) => {
|
|
17
|
+
return tender.tender_type === 'HOUSE_ACCOUNT';
|
|
18
|
+
};
|
|
19
|
+
exports.isHouseAccountTender = isHouseAccountTender;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { DateString, ISOStringOffset } from '../datetimes';
|
|
2
|
+
import { ChannelType, Decimal, Money, NegativeMoney, ReceiptType, SurchargeType } from '../global';
|
|
3
|
+
import { PrepStatus, TicketStatus } from './kds';
|
|
4
|
+
import { Order, OrderCart, OrderItem } from './order';
|
|
5
|
+
export interface PosOrderItemGroup {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
options: PosOrderItemOptions;
|
|
9
|
+
short_name: string;
|
|
10
|
+
}
|
|
11
|
+
export declare type PosOrderItemGroups = PosOrderItemGroup[];
|
|
12
|
+
export interface PosOrderItem extends Omit<OrderItem, 'groups'> {
|
|
13
|
+
item_no: number;
|
|
14
|
+
line_no: number;
|
|
15
|
+
groups: PosOrderItemGroups;
|
|
16
|
+
}
|
|
17
|
+
export declare type PosOrderItemOptions = PosOrderItem[];
|
|
18
|
+
export declare type PosOrderCart = PosOrderItem[];
|
|
19
|
+
export interface OrderTicket {
|
|
20
|
+
display_order?: number;
|
|
21
|
+
item_nos: number[];
|
|
22
|
+
item_type_id: number;
|
|
23
|
+
item_type_name: string;
|
|
24
|
+
ticket_no?: number;
|
|
25
|
+
ticket_status: PrepStatus;
|
|
26
|
+
}
|
|
27
|
+
export declare type OrderTickets = Array<OrderTicket>;
|
|
28
|
+
export interface OrderPos extends Omit<Order, 'cart'> {
|
|
29
|
+
cart: PosOrderCart;
|
|
30
|
+
}
|
|
31
|
+
export interface OrderKds extends Omit<Order, 'fire_at' | 'tickets' | 'expected_at'> {
|
|
32
|
+
expected_at: ISOStringOffset;
|
|
33
|
+
fire_at: ISOStringOffset;
|
|
34
|
+
tickets: OrderTickets;
|
|
35
|
+
}
|
|
36
|
+
export declare type OrdersKds = Array<OrderKds>;
|
|
37
|
+
export interface FetchOrdersArgs {
|
|
38
|
+
businessDate?: DateString | null;
|
|
39
|
+
receiptType?: ReceiptType | 'BOTH';
|
|
40
|
+
channelType?: Array<ChannelType> | null;
|
|
41
|
+
prepStatus?: Array<PrepStatus> | null;
|
|
42
|
+
search?: string | null;
|
|
43
|
+
sortBy?: 'requested_at' | 'expected_at' | 'fire_at';
|
|
44
|
+
sortDirection?: 'ASC' | 'DESC';
|
|
45
|
+
parentOrderId?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface FetchOrdersAPIArgs {
|
|
48
|
+
business_date?: DateString;
|
|
49
|
+
receipt_type?: ReceiptType | 'BOTH';
|
|
50
|
+
channel_type?: string;
|
|
51
|
+
prep_status?: string;
|
|
52
|
+
search?: string;
|
|
53
|
+
sort_by?: 'requested_at' | 'expected_at' | 'fire_at';
|
|
54
|
+
sort_direction?: 'ASC' | 'DESC';
|
|
55
|
+
parent_receipt_uuid?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface OrderCounts {
|
|
58
|
+
current: Record<string, number> | null;
|
|
59
|
+
future: Record<string, number> | null;
|
|
60
|
+
qa: Record<string, number> | null;
|
|
61
|
+
Orders: number;
|
|
62
|
+
}
|
|
63
|
+
export interface OrdersAndCounts {
|
|
64
|
+
orders: OrdersKds;
|
|
65
|
+
counts: OrderCounts;
|
|
66
|
+
}
|
|
67
|
+
export interface OrderUpdate {
|
|
68
|
+
expected_at?: string;
|
|
69
|
+
prep_status?: PrepStatus;
|
|
70
|
+
}
|
|
71
|
+
export interface OrderBucket {
|
|
72
|
+
orders: OrdersKds;
|
|
73
|
+
start: Date;
|
|
74
|
+
end: Date;
|
|
75
|
+
}
|
|
76
|
+
export declare type OrderBuckets = Array<OrderBucket>;
|
|
77
|
+
export interface OrderTimes {
|
|
78
|
+
delayed: number;
|
|
79
|
+
requested: Date;
|
|
80
|
+
requestedTime: string;
|
|
81
|
+
expected: Date;
|
|
82
|
+
expectedDate: string;
|
|
83
|
+
expectedTime: string;
|
|
84
|
+
readyBy: Date;
|
|
85
|
+
readyTime: string;
|
|
86
|
+
dateStr: string;
|
|
87
|
+
status: string;
|
|
88
|
+
}
|
|
89
|
+
export interface TicketUpdate {
|
|
90
|
+
ticket_status: TicketStatus;
|
|
91
|
+
}
|
|
92
|
+
export interface TicketsUpdate {
|
|
93
|
+
ticket_status?: TicketStatus;
|
|
94
|
+
ticket_nos?: number[];
|
|
95
|
+
}
|
|
96
|
+
export declare type TicketStatusUpdate = 'done' | 'completed' | 'reset';
|
|
97
|
+
export interface Ticket {
|
|
98
|
+
item_nos: number[];
|
|
99
|
+
item_type_id: number;
|
|
100
|
+
item_type_name: string;
|
|
101
|
+
ticket_no: number;
|
|
102
|
+
ticket_status: TicketStatus;
|
|
103
|
+
items: OrderCart;
|
|
104
|
+
is_default: boolean;
|
|
105
|
+
is_grouped: boolean;
|
|
106
|
+
is_hidden_assembly: boolean;
|
|
107
|
+
is_hidden_qa: boolean;
|
|
108
|
+
print_on_completed: boolean;
|
|
109
|
+
}
|
|
110
|
+
export declare type Tickets = Ticket[];
|
|
111
|
+
export declare type TicketGroup = Ticket[];
|
|
112
|
+
export declare type TicketGroups = TicketGroup[];
|
|
113
|
+
export interface OrderKdsStatus {
|
|
114
|
+
NOT_DONE: boolean;
|
|
115
|
+
DONE: boolean;
|
|
116
|
+
COMPLETED: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface OrderItemCount {
|
|
119
|
+
item: OrderItem;
|
|
120
|
+
count: number;
|
|
121
|
+
}
|
|
122
|
+
export interface OrderItemDiscount {
|
|
123
|
+
discount_id: number;
|
|
124
|
+
amount: NegativeMoney;
|
|
125
|
+
amount_total: NegativeMoney;
|
|
126
|
+
}
|
|
127
|
+
export declare type OrderItemDiscounts = Array<OrderItemDiscount>;
|
|
128
|
+
export interface OrderItemTax {
|
|
129
|
+
tax_id: number;
|
|
130
|
+
name: string;
|
|
131
|
+
amount: NegativeMoney;
|
|
132
|
+
amount_total: NegativeMoney;
|
|
133
|
+
}
|
|
134
|
+
export declare type OrderItemTaxes = Array<OrderItemTax>;
|
|
135
|
+
export interface OrderSurchargeDiscount {
|
|
136
|
+
amount: NegativeMoney;
|
|
137
|
+
discount_id: number;
|
|
138
|
+
employee_id: number | null;
|
|
139
|
+
}
|
|
140
|
+
export interface OrderSurchargeTax {
|
|
141
|
+
tax_id: number;
|
|
142
|
+
name: string;
|
|
143
|
+
amount: NegativeMoney;
|
|
144
|
+
amount_total: NegativeMoney;
|
|
145
|
+
}
|
|
146
|
+
export interface PosOrderSurcharge {
|
|
147
|
+
amount: Money;
|
|
148
|
+
discount: NegativeMoney;
|
|
149
|
+
discounts: Array<OrderSurchargeDiscount>;
|
|
150
|
+
description?: string;
|
|
151
|
+
employee_id: number | null;
|
|
152
|
+
id: number;
|
|
153
|
+
surcharge_id?: number;
|
|
154
|
+
is_optional?: boolean;
|
|
155
|
+
is_taxed: boolean;
|
|
156
|
+
label?: string;
|
|
157
|
+
name: string;
|
|
158
|
+
percentage: Decimal | null;
|
|
159
|
+
surcharge_type: SurchargeType;
|
|
160
|
+
tax: Money;
|
|
161
|
+
taxes: Array<OrderSurchargeTax>;
|
|
162
|
+
}
|
|
163
|
+
export declare type PosOrderSurcharges = Array<PosOrderSurcharge>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export interface Modal {
|
|
2
|
+
args: Record<string, unknown> | null;
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
type: string | null;
|
|
5
|
+
}
|
|
1
6
|
export declare type Decimal = `${number}.${number}`;
|
|
2
7
|
export declare type Money = `${number}.${number}`;
|
|
3
8
|
export declare type NegativeMoney = `-${number}.${number}`;
|
|
@@ -14,13 +19,13 @@ export declare type ServiceType = 'WALKIN' | 'PICKUP' | 'DELIVERY' | 'PORTAL' |
|
|
|
14
19
|
export declare type ServiceTypeMap = {
|
|
15
20
|
[Property in ServiceType]: string;
|
|
16
21
|
};
|
|
17
|
-
export declare type GratuityType = 'amount' | 'percent';
|
|
18
22
|
export declare type TenderType = 'CASH' | 'CREDIT' | 'HOUSE_ACCOUNT' | 'GIFT_CARD' | 'COMP' | 'LEVELUP' | 'GOOGLE_PAY' | 'APPLE_PAY';
|
|
19
23
|
export declare type TenderTypeMap = {
|
|
20
24
|
[Property in TenderType]: string;
|
|
21
25
|
};
|
|
22
26
|
export declare type CardType = 'VISA' | 'MC' | 'DISC' | 'AMEX' | 'OTHER';
|
|
23
|
-
export declare type
|
|
27
|
+
export declare type CardTypeName = 'Visa' | 'Mastercard' | 'Discover' | 'Amex' | 'Other';
|
|
28
|
+
export declare type DiscountType = 'DOLLAR' | 'PERCENTAGE' | 'LOYALTY';
|
|
24
29
|
export declare type DiscountAuthType = 'ACCOUNT' | 'VERIFIED' | null;
|
|
25
30
|
export declare type SurchargeType = 'DOLLAR' | 'PERCENTAGE' | 'DISTANCE' | 'TRAVEL_TIME';
|
|
26
31
|
export declare type TaxType = 'DOLLAR' | 'PERCENTAGE';
|
|
@@ -37,3 +42,5 @@ export interface PicklistOption {
|
|
|
37
42
|
disabled?: boolean;
|
|
38
43
|
}
|
|
39
44
|
export declare type PicklistOptions = PicklistOption[];
|
|
45
|
+
export declare type DeviceType = 'DESKTOP' | 'KIOSK' | 'MOBILE' | 'NONE' | 'TABLET';
|
|
46
|
+
export declare type PrepType = 'EAT_HERE' | 'TAKE_OUT';
|
|
@@ -2,13 +2,16 @@ export interface IndexedError {
|
|
|
2
2
|
index: any;
|
|
3
3
|
[x: string]: string;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface RequestErrorMessage {
|
|
6
6
|
code: string;
|
|
7
|
-
title: string;
|
|
8
7
|
detail: string;
|
|
8
|
+
message: string;
|
|
9
|
+
title: string;
|
|
10
|
+
}
|
|
11
|
+
export declare type RequestErrorParams = Record<string, RequestErrorMessage>;
|
|
12
|
+
export interface RequestErrorAPI extends RequestErrorMessage {
|
|
9
13
|
status: number;
|
|
10
|
-
params?:
|
|
11
|
-
message?: string;
|
|
14
|
+
params?: RequestErrorParams;
|
|
12
15
|
}
|
|
13
16
|
export declare type RequestError = RequestErrorAPI | null | undefined;
|
|
14
17
|
export declare type RequestStatus = 'idle' | 'pending';
|
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
phone?: string;
|
|
8
|
-
qr_code?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface IdentifyCustomer {
|
|
11
|
-
data: CustomerIdentifier;
|
|
12
|
-
callback?: () => void;
|
|
13
|
-
showError?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface CustomerDiscount {
|
|
16
|
-
customer_loyalty_id: number;
|
|
17
|
-
loyalty_program_id: number;
|
|
18
|
-
order_type: OrderType;
|
|
19
|
-
amount: Money;
|
|
20
|
-
name: string;
|
|
21
|
-
discount_id: number;
|
|
22
|
-
discount_type: DiscountType;
|
|
23
|
-
description: string;
|
|
24
|
-
before_surcharge: boolean;
|
|
25
|
-
is_taxed: boolean;
|
|
26
|
-
is_promo_code: boolean;
|
|
27
|
-
is_auto: boolean;
|
|
28
|
-
is_loyalty: boolean;
|
|
29
|
-
}
|
|
30
|
-
export declare type CustomerDiscounts = Array<CustomerDiscount>;
|
|
31
|
-
export interface CustomerCheckout {
|
|
32
|
-
customer: Customer;
|
|
33
|
-
discounts: CustomerDiscounts;
|
|
34
|
-
points: any;
|
|
35
|
-
discount: any;
|
|
36
|
-
}
|
|
1
|
+
import { RequestedAt } from '../datetimes';
|
|
2
|
+
import { CardType, CardTypeName, DeviceType, DiscountType, Money, OrderType, PrepType, ServiceType, TenderType } from '../global';
|
|
3
|
+
import { RequestErrorParams } from '../request';
|
|
4
|
+
import { Cart } from './cart';
|
|
5
|
+
import { Address, Customer } from './customer';
|
|
6
|
+
import { Order, OrderDiscounts, OrderFulfillment, OrderSurcharge } from './order';
|
|
37
7
|
export interface SimpleCartOption {
|
|
38
8
|
id: number;
|
|
39
9
|
quantity: number;
|
|
@@ -61,13 +31,70 @@ export interface SimpleCartLookupOption {
|
|
|
61
31
|
export interface SimpleCartLookupGroup {
|
|
62
32
|
options: Record<string, SimpleCartLookupOption>;
|
|
63
33
|
}
|
|
34
|
+
export declare type CheckoutConfigFieldAddress = 'company' | 'contact' | 'phone' | 'unit';
|
|
35
|
+
export declare type CheckoutConfigFieldCustomer = 'company';
|
|
36
|
+
export declare type CheckoutConfigFieldDetails = 'count' | 'eatingUtensils' | 'notes' | 'servingUtensils';
|
|
37
|
+
export interface CheckoutConfigFields {
|
|
38
|
+
address: CheckoutConfigFieldAddress[];
|
|
39
|
+
customer: CheckoutConfigFieldCustomer[];
|
|
40
|
+
details: CheckoutConfigFieldDetails[];
|
|
41
|
+
}
|
|
42
|
+
export interface CheckoutConfigGratuityAmount {
|
|
43
|
+
amount: Money;
|
|
44
|
+
percent: Money;
|
|
45
|
+
}
|
|
46
|
+
export interface CheckoutConfigGratuity {
|
|
47
|
+
default: CheckoutConfigGratuityAmount | null;
|
|
48
|
+
has_tip: boolean;
|
|
49
|
+
max_gratuity: CheckoutConfigGratuityAmount | null;
|
|
50
|
+
options: CheckoutConfigGratuityAmount[];
|
|
51
|
+
}
|
|
52
|
+
export interface CheckoutConfigCurbsideField {
|
|
53
|
+
label: string;
|
|
54
|
+
name: keyof OrderFulfillment;
|
|
55
|
+
placeholder: string;
|
|
56
|
+
}
|
|
57
|
+
export declare type CheckoutConfigCurbsideFields = CheckoutConfigCurbsideField[];
|
|
58
|
+
export interface CheckoutConfigCurbside {
|
|
59
|
+
description: string;
|
|
60
|
+
fields: CheckoutConfigCurbsideFields;
|
|
61
|
+
title: string;
|
|
62
|
+
}
|
|
63
|
+
export interface CheckoutConfigLoyalty {
|
|
64
|
+
balance: number;
|
|
65
|
+
name: string;
|
|
66
|
+
per: 5;
|
|
67
|
+
remaining: number;
|
|
68
|
+
}
|
|
69
|
+
export interface CheckoutConfigSurcharge extends OrderSurcharge {
|
|
70
|
+
label: string;
|
|
71
|
+
}
|
|
72
|
+
export declare type CheckoutConfigSurcharges = CheckoutConfigSurcharge[];
|
|
73
|
+
export interface CheckoutConfig {
|
|
74
|
+
allow_tax_exempt: boolean;
|
|
75
|
+
discounts: OrderDiscounts;
|
|
76
|
+
displayed: CheckoutConfigFields;
|
|
77
|
+
gratuity: CheckoutConfigGratuity;
|
|
78
|
+
order_fulfillment: CheckoutConfigCurbside | null;
|
|
79
|
+
points: CheckoutConfigLoyalty | null;
|
|
80
|
+
promo_code_limit: number;
|
|
81
|
+
required: CheckoutConfigFields;
|
|
82
|
+
surcharges: CheckoutConfigSurcharges;
|
|
83
|
+
tender_types: TenderType[];
|
|
84
|
+
}
|
|
85
|
+
export interface CheckoutCheck extends Order {
|
|
86
|
+
config: CheckoutConfig;
|
|
87
|
+
errors: RequestErrorParams;
|
|
88
|
+
}
|
|
64
89
|
export interface OrderCreateDetails {
|
|
90
|
+
cart_id?: number | null;
|
|
91
|
+
device_type?: DeviceType | null;
|
|
65
92
|
eating_utensils?: boolean;
|
|
66
|
-
serving_utensils?: boolean;
|
|
67
|
-
person_count?: number | null;
|
|
68
93
|
notes?: string | null;
|
|
94
|
+
notes_internal?: string | null;
|
|
95
|
+
person_count?: number | null;
|
|
96
|
+
serving_utensils?: boolean;
|
|
69
97
|
tax_exempt_id?: string | null;
|
|
70
|
-
cart_id?: number | null;
|
|
71
98
|
}
|
|
72
99
|
export interface OrderCreateGiftCard {
|
|
73
100
|
id: number;
|
|
@@ -80,108 +107,157 @@ export interface OrderCreateGiftCard {
|
|
|
80
107
|
export interface OrderCreateSurcharge {
|
|
81
108
|
id: number;
|
|
82
109
|
}
|
|
110
|
+
export declare type OrderCreateSurcharges = OrderCreateSurcharge[];
|
|
83
111
|
export interface OrderCreateDiscount {
|
|
84
112
|
id: number;
|
|
85
113
|
ext_id?: string | null;
|
|
86
114
|
}
|
|
115
|
+
export declare type OrderCreateDiscounts = OrderCreateDiscount[];
|
|
87
116
|
export interface OrderCreateTax {
|
|
88
117
|
id: number;
|
|
89
118
|
}
|
|
90
|
-
export
|
|
119
|
+
export declare type OrderCreateTaxes = OrderCreateTax[];
|
|
120
|
+
export interface OrderCreatePointsItem {
|
|
91
121
|
index: number;
|
|
92
122
|
points: number;
|
|
93
123
|
}
|
|
94
|
-
export
|
|
124
|
+
export declare type OrderCreatePoints = OrderCreatePointsItem[];
|
|
125
|
+
export interface CheckoutFormAddress {
|
|
126
|
+
company?: string;
|
|
127
|
+
contact?: string;
|
|
128
|
+
phone?: string;
|
|
129
|
+
unit?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface CheckoutFormCustomer {
|
|
132
|
+
company?: string;
|
|
133
|
+
customer_id?: number;
|
|
134
|
+
email?: string;
|
|
135
|
+
first_name?: string;
|
|
136
|
+
phone?: string;
|
|
137
|
+
last_name?: string;
|
|
138
|
+
}
|
|
139
|
+
export interface CheckoutTenderCreditGuest {
|
|
140
|
+
acct: string;
|
|
141
|
+
cvv: string;
|
|
142
|
+
amount: Money;
|
|
143
|
+
card_type_name: CardTypeName;
|
|
144
|
+
exp: string;
|
|
145
|
+
is_default: false;
|
|
146
|
+
last4: string;
|
|
147
|
+
masked: string;
|
|
148
|
+
tender_type: TenderType;
|
|
149
|
+
zip: string;
|
|
150
|
+
}
|
|
151
|
+
export interface CheckoutTenderCreditCustomer {
|
|
152
|
+
tender_type: TenderType;
|
|
153
|
+
amount: Money;
|
|
154
|
+
card_type: CardType;
|
|
155
|
+
card_type_name: CardTypeName;
|
|
156
|
+
customer_card_id: number;
|
|
157
|
+
last4: string;
|
|
158
|
+
masked: string;
|
|
159
|
+
is_default: false;
|
|
160
|
+
}
|
|
161
|
+
export interface CheckoutTenderGiftCard {
|
|
162
|
+
amount: Money;
|
|
163
|
+
balance?: Money;
|
|
164
|
+
card_number: string;
|
|
165
|
+
tender_type: TenderType;
|
|
166
|
+
}
|
|
167
|
+
export interface CheckoutTenderHouseAccount {
|
|
168
|
+
amount: Money;
|
|
169
|
+
approved_contact: boolean;
|
|
170
|
+
domain: string | null;
|
|
171
|
+
house_account_id: number;
|
|
172
|
+
name: string;
|
|
173
|
+
order_type: OrderType | null;
|
|
174
|
+
pin: string;
|
|
175
|
+
revenue_centers: number[];
|
|
176
|
+
service_type: ServiceType | null;
|
|
95
177
|
tender_type: TenderType;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
178
|
+
}
|
|
179
|
+
export declare type CheckoutTender = CheckoutTenderCreditGuest | CheckoutTenderCreditCustomer | CheckoutTenderGiftCard | CheckoutTenderHouseAccount;
|
|
180
|
+
export declare type CheckoutTenders = CheckoutTender[];
|
|
181
|
+
export declare type CheckoutPromoCodes = string[];
|
|
182
|
+
export interface CheckoutForm {
|
|
183
|
+
address: CheckoutFormAddress;
|
|
184
|
+
customer: CheckoutFormCustomer;
|
|
185
|
+
details: OrderCreateDetails;
|
|
186
|
+
discounts: OrderCreateDiscounts;
|
|
187
|
+
points: OrderCreatePoints;
|
|
188
|
+
promoCodes: CheckoutPromoCodes;
|
|
189
|
+
surcharges: OrderCreateSurcharges;
|
|
190
|
+
tenders: CheckoutTenders;
|
|
191
|
+
tip: Money | null;
|
|
192
|
+
}
|
|
193
|
+
export interface OrderData {
|
|
194
|
+
address: Address | null;
|
|
195
|
+
cart: Cart;
|
|
196
|
+
cartId: number | null;
|
|
197
|
+
customer: CheckoutFormCustomer;
|
|
198
|
+
details: OrderCreateDetails | null;
|
|
199
|
+
deviceType: DeviceType | null;
|
|
200
|
+
discounts: OrderCreateDiscounts | null;
|
|
201
|
+
orderId: number | null;
|
|
202
|
+
points: OrderCreatePoints | null;
|
|
203
|
+
prepType: PrepType | null;
|
|
204
|
+
promoCodes: CheckoutPromoCodes | null;
|
|
205
|
+
requestedAt: RequestedAt;
|
|
206
|
+
revenueCenterId: number;
|
|
207
|
+
serviceType: ServiceType;
|
|
208
|
+
surcharges: OrderCreateSurcharges | null;
|
|
209
|
+
table: string | null;
|
|
210
|
+
tenders: CheckoutTenders | null;
|
|
211
|
+
tip: Money | null;
|
|
104
212
|
}
|
|
105
213
|
export interface OrderCreate {
|
|
106
214
|
address?: Address | null;
|
|
107
215
|
cart: SimpleCart;
|
|
108
|
-
|
|
216
|
+
cart_id?: number;
|
|
217
|
+
customer?: CheckoutFormCustomer | null;
|
|
109
218
|
details?: OrderCreateDetails | null;
|
|
110
|
-
discounts?:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
points?: Array<OrderCreatePoints>;
|
|
117
|
-
promo_codes?: string[];
|
|
118
|
-
requested_at: ISOString | 'asap';
|
|
119
|
-
revenue_center_id?: number;
|
|
219
|
+
discounts?: OrderCreateDiscounts;
|
|
220
|
+
order_id?: number;
|
|
221
|
+
points?: OrderCreatePoints;
|
|
222
|
+
promo_codes?: CheckoutPromoCodes;
|
|
223
|
+
requested_at: RequestedAt;
|
|
224
|
+
revenue_center_id: number;
|
|
120
225
|
service_type: ServiceType;
|
|
121
226
|
shipment_id?: string;
|
|
122
|
-
surcharges?:
|
|
123
|
-
taxes?:
|
|
124
|
-
tenders?:
|
|
227
|
+
surcharges?: OrderCreateSurcharges;
|
|
228
|
+
taxes?: OrderCreateTaxes;
|
|
229
|
+
tenders?: CheckoutTenders;
|
|
125
230
|
tip?: Money;
|
|
126
231
|
}
|
|
127
|
-
export interface
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
export interface CheckoutConfigGratuity {
|
|
133
|
-
default: {
|
|
134
|
-
[key in GratuityType]: string;
|
|
135
|
-
} | null;
|
|
136
|
-
has_tip: boolean;
|
|
137
|
-
max_gratuity: {
|
|
138
|
-
[key in GratuityType]: string;
|
|
139
|
-
} | null;
|
|
140
|
-
options: {
|
|
141
|
-
[key in GratuityType]: string;
|
|
142
|
-
}[];
|
|
232
|
+
export interface CustomerIdentifier {
|
|
233
|
+
card_token?: string;
|
|
234
|
+
phone?: string;
|
|
235
|
+
qr_code?: string;
|
|
143
236
|
}
|
|
144
|
-
export interface
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
gratuity: CheckoutConfigGratuity;
|
|
149
|
-
order_fulfillment: OrderFulfillment;
|
|
150
|
-
points: LoyaltyPoints | null;
|
|
151
|
-
promo_code_limit: number;
|
|
152
|
-
required: CheckoutConfigDisplayed;
|
|
153
|
-
surcharges: OrderSurcharges;
|
|
154
|
-
tender_types: Array<TenderType>;
|
|
237
|
+
export interface IdentifyCustomer {
|
|
238
|
+
data: CustomerIdentifier;
|
|
239
|
+
callback?: () => void;
|
|
240
|
+
showError?: boolean;
|
|
155
241
|
}
|
|
156
|
-
export interface
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
242
|
+
export interface CustomerDiscount {
|
|
243
|
+
customer_loyalty_id: number;
|
|
244
|
+
loyalty_program_id: number;
|
|
245
|
+
order_type: OrderType;
|
|
246
|
+
amount: Money;
|
|
247
|
+
name: string;
|
|
248
|
+
discount_id: number;
|
|
249
|
+
discount_type: DiscountType;
|
|
250
|
+
description: string;
|
|
251
|
+
before_surcharge: boolean;
|
|
252
|
+
is_taxed: boolean;
|
|
253
|
+
is_promo_code: boolean;
|
|
254
|
+
is_auto: boolean;
|
|
255
|
+
is_loyalty: boolean;
|
|
166
256
|
}
|
|
167
|
-
export
|
|
168
|
-
|
|
169
|
-
order_id?: string | number;
|
|
170
|
-
cart: Array<OrderItem>;
|
|
171
|
-
config: CheckoutConfig;
|
|
257
|
+
export declare type CustomerDiscounts = Array<CustomerDiscount>;
|
|
258
|
+
export interface CustomerCheckout {
|
|
172
259
|
customer: Customer;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
requested_at: ISOString;
|
|
177
|
-
revenue_center: OrderRevenueCenter;
|
|
178
|
-
service_type: ServiceType;
|
|
179
|
-
shipment: OrderShipment | null;
|
|
180
|
-
surcharges: OrderSurcharges;
|
|
181
|
-
taxes: OrderTaxes;
|
|
182
|
-
tenders: OrderTenders;
|
|
183
|
-
timezone: TimezonePython;
|
|
184
|
-
totals: OrderTotals;
|
|
185
|
-
gift_cards: Array<Partial<CustomerGiftCard>>;
|
|
186
|
-
errors: any;
|
|
260
|
+
discounts: CustomerDiscounts;
|
|
261
|
+
points: any;
|
|
262
|
+
discount: any;
|
|
187
263
|
}
|
|
@@ -528,6 +528,9 @@ export interface ConfigCountColors {
|
|
|
528
528
|
weight: string;
|
|
529
529
|
}
|
|
530
530
|
export declare type ConfigFontSizes = 'big' | 'giga' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'main' | 'mega' | 'small' | 'tera' | 'xBig' | 'xSmall' | 'xxBig' | 'xxSmall';
|
|
531
|
+
export declare type ConfigThemeFontSizes = Record<string, string> & {
|
|
532
|
+
[keys in ConfigFontSizes]: string;
|
|
533
|
+
};
|
|
531
534
|
export interface ConfigFont {
|
|
532
535
|
color: string;
|
|
533
536
|
family: string;
|
|
@@ -535,9 +538,7 @@ export interface ConfigFont {
|
|
|
535
538
|
fontSmoothing: string;
|
|
536
539
|
letterSpacing: string;
|
|
537
540
|
lineHeight: number;
|
|
538
|
-
lineHeights:
|
|
539
|
-
[keys in ConfigFontSizes]: string;
|
|
540
|
-
};
|
|
541
|
+
lineHeights: ConfigThemeFontSizes;
|
|
541
542
|
textTransform: string;
|
|
542
543
|
url: string;
|
|
543
544
|
weight: string;
|
|
@@ -559,13 +560,10 @@ export interface ConfigThemeFont {
|
|
|
559
560
|
body: ConfigFont;
|
|
560
561
|
headings: ConfigFont;
|
|
561
562
|
headline: ConfigFont;
|
|
562
|
-
lineHeights:
|
|
563
|
-
[keys in ConfigFontSizes]: string;
|
|
564
|
-
};
|
|
563
|
+
lineHeights: ConfigThemeFontSizes;
|
|
565
564
|
preface: ConfigFont;
|
|
566
|
-
sizes:
|
|
567
|
-
|
|
568
|
-
};
|
|
565
|
+
sizes: ConfigThemeFontSizes;
|
|
566
|
+
sizesMobile: ConfigThemeFontSizes;
|
|
569
567
|
}
|
|
570
568
|
export interface ConfigThemeInputLabel {
|
|
571
569
|
fontSize: string;
|
|
@@ -705,24 +703,25 @@ export interface ConfigThemeWelcome {
|
|
|
705
703
|
titleSize: string;
|
|
706
704
|
mobile?: ConfigThemeWelcome;
|
|
707
705
|
}
|
|
706
|
+
export interface ConfigThemeColors extends Record<string, string> {
|
|
707
|
+
alert: string;
|
|
708
|
+
allergens: string;
|
|
709
|
+
dark: string;
|
|
710
|
+
error: string;
|
|
711
|
+
highlight: string;
|
|
712
|
+
light: string;
|
|
713
|
+
primary: string;
|
|
714
|
+
secondary: string;
|
|
715
|
+
success: string;
|
|
716
|
+
tertiary: string;
|
|
717
|
+
toast: string;
|
|
718
|
+
}
|
|
708
719
|
export interface ConfigTheme {
|
|
709
720
|
alert: {
|
|
710
721
|
bgColor: string;
|
|
711
722
|
color: string;
|
|
712
723
|
};
|
|
713
|
-
bgColors:
|
|
714
|
-
alert: string;
|
|
715
|
-
allergens: string;
|
|
716
|
-
dark: string;
|
|
717
|
-
error: string;
|
|
718
|
-
highlight: string;
|
|
719
|
-
light: string;
|
|
720
|
-
primary: string;
|
|
721
|
-
secondary: string;
|
|
722
|
-
success: string;
|
|
723
|
-
tertiary: string;
|
|
724
|
-
toast: string;
|
|
725
|
-
};
|
|
724
|
+
bgColors: ConfigThemeColors;
|
|
726
725
|
boldWeight: string;
|
|
727
726
|
border: ConfigThemeBorder;
|
|
728
727
|
boxShadow: {
|
|
@@ -739,20 +738,7 @@ export interface ConfigTheme {
|
|
|
739
738
|
};
|
|
740
739
|
buttons: ConfigThemeButtons;
|
|
741
740
|
cards: ConfigThemeCards;
|
|
742
|
-
colors:
|
|
743
|
-
alert: string;
|
|
744
|
-
allergens: string;
|
|
745
|
-
dark: string;
|
|
746
|
-
error: string;
|
|
747
|
-
light: string;
|
|
748
|
-
primary: string;
|
|
749
|
-
secondary: string;
|
|
750
|
-
success: string;
|
|
751
|
-
tags: string;
|
|
752
|
-
tertiary: string;
|
|
753
|
-
title: string;
|
|
754
|
-
toast: string;
|
|
755
|
-
};
|
|
741
|
+
colors: ConfigThemeColors;
|
|
756
742
|
counts: ConfigThemeCounts;
|
|
757
743
|
error: {
|
|
758
744
|
bgColor: string;
|