@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.
@@ -1,39 +1,9 @@
1
- import { ISOString, TimezonePython } from '../datetimes';
2
- import { DiscountType, GratuityType, Money, OrderType, ServiceType, TenderType } from '../global';
3
- import { Address, Customer, CustomerGiftCard, LoyaltyPoints } from './customer';
4
- import { OrderDetails, OrderDiscounts, OrderFulfillment, OrderItem, OrderRevenueCenter, OrderShipment, OrderSurcharges, OrderTaxes, OrderTenders, OrderTotals } from './order';
5
- export interface CustomerIdentifier {
6
- card_token?: string;
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 interface OrderCreatePoints {
119
+ export declare type OrderCreateTaxes = OrderCreateTax[];
120
+ export interface OrderCreatePointsItem {
91
121
  index: number;
92
122
  points: number;
93
123
  }
94
- export interface Tender {
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
- amount?: Money;
97
- cash_back?: Money;
98
- customer_card_id?: string;
99
- acct?: string;
100
- cvv?: string;
101
- exp?: string;
102
- zip?: string;
103
- save?: boolean;
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
- customer?: Customer | null;
216
+ cart_id?: number;
217
+ customer?: CheckoutFormCustomer | null;
109
218
  details?: OrderCreateDetails | null;
110
- discounts?: Array<OrderCreateDiscount>;
111
- gift_cards?: Array<OrderCreateGiftCard>;
112
- is_tax_exempt?: boolean;
113
- made_for?: string;
114
- order_type?: OrderType;
115
- order_uuid?: string;
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?: Array<OrderCreateSurcharge>;
123
- taxes?: Array<OrderCreateTax>;
124
- tenders?: Array<Tender>;
227
+ surcharges?: OrderCreateSurcharges;
228
+ taxes?: OrderCreateTaxes;
229
+ tenders?: CheckoutTenders;
125
230
  tip?: Money;
126
231
  }
127
- export interface CheckoutConfigDisplayed {
128
- address: string[];
129
- customer: string[];
130
- details: string[];
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 CheckoutConfig {
145
- allow_tax_exempt: boolean;
146
- discounts: OrderDiscounts;
147
- displayed: CheckoutConfigDisplayed;
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 CheckoutForm {
157
- address: Partial<Address> | null;
158
- customer: Customer;
159
- details: Partial<OrderDetails>;
160
- discounts: OrderDiscounts;
161
- points: Array<LoyaltyPoints>;
162
- promoCodes: any;
163
- surcharges: OrderSurcharges;
164
- tenders: OrderTenders;
165
- tip: any;
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 interface CheckoutCheck {
168
- address: Address | null;
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
- details: OrderDetails;
174
- discounts: OrderDiscounts;
175
- order_type: OrderType;
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
- [keys in ConfigFontSizes]: string;
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;
@@ -1,12 +1,12 @@
1
- import { CardType } from '../global';
1
+ import { CardType, CardTypeName } from '../global';
2
2
  export interface CreditCard {
3
- card_type?: CardType;
4
- card_type_name?: string;
5
- customer_card_id?: number;
3
+ card_type: CardType;
4
+ card_type_name: CardTypeName;
5
+ customer_card_id: number;
6
6
  has_profile?: boolean;
7
7
  is_default?: boolean;
8
- last4?: string;
9
- masked?: string;
8
+ last4: string;
9
+ masked: string;
10
10
  }
11
11
  export declare type CreditCards = Array<CreditCard>;
12
12
  export interface CreditCardData {
@@ -1,15 +1,19 @@
1
+ import { ISOStringOffset } from '../../datetimes';
1
2
  export interface Address {
2
- city?: string;
3
+ city: string;
3
4
  company?: string;
4
5
  contact?: string;
5
- created_at?: string;
6
+ country?: string;
7
+ created_at?: ISOStringOffset;
6
8
  customer_address_id?: number;
9
+ customer_id?: number;
7
10
  description?: string;
8
11
  formatted_address?: string;
12
+ is_active?: boolean;
9
13
  is_default?: boolean;
10
- last_used_at?: string;
11
- lat: number | null;
12
- lng: number | null;
14
+ last_used_at?: ISOStringOffset;
15
+ lat: number;
16
+ lng: number;
13
17
  notes?: string;
14
18
  phone?: string;
15
19
  postal_code: string;
@@ -17,4 +21,4 @@ export interface Address {
17
21
  street: string;
18
22
  unit?: string;
19
23
  }
20
- export declare type Addresses = Array<Address>;
24
+ export declare type Addresses = Address[];
@@ -1,4 +1,4 @@
1
- import { OrdersKds } from './order';
1
+ import { OrdersKds } from './pos';
2
2
  export declare type PrepStatus = 'TODO' | 'IN_PROGRESS' | 'DONE' | 'COMPLETED' | 'FULFILLED' | 'TAKE_OUT';
3
3
  export declare type PrepStatusMap = {
4
4
  [Property in PrepStatus]: PrepStatus;
@@ -122,16 +122,29 @@ export interface MenuCategory {
122
122
  small_image_url: string | null;
123
123
  }
124
124
  export declare type MenuCategories = MenuCategory[];
125
+ export interface MenuRevenueCenter {
126
+ app_image_url: string;
127
+ description: string;
128
+ display_order: number;
129
+ hours_desc: string;
130
+ large_image_url: string;
131
+ name: string;
132
+ revenue_center_id: number;
133
+ short_name: string;
134
+ small_image_url: string;
135
+ }
136
+ export declare type MenuRevenueCenters = MenuRevenueCenter[];
137
+ export declare type SoldOut = number[];
125
138
  export interface Menu {
126
139
  menu: MenuCategories;
127
- service_type: ServiceType;
140
+ revenue_centers: MenuRevenueCenters | null;
141
+ sold_out_items: SoldOut;
128
142
  }
129
143
  export interface MenuVars {
130
144
  revenueCenterId: number;
131
145
  serviceType: ServiceType;
132
146
  requestedAt: RequestedAt;
133
147
  }
134
- export declare type SoldOut = number[];
135
148
  export interface DiscountedItem {
136
149
  id: number;
137
150
  category_id: number;
@@ -139,6 +152,6 @@ export interface DiscountedItem {
139
152
  short_name: string;
140
153
  }
141
154
  export interface DiscountedItems {
142
- items: Array<DiscountedItem>;
155
+ items: DiscountedItem[];
143
156
  quantity: number;
144
157
  }
@@ -2,4 +2,4 @@ export interface Message {
2
2
  message: string;
3
3
  id: string;
4
4
  }
5
- export declare type Messages = Array<Message>;
5
+ export declare type Messages = Message[];