@open-tender/types 0.0.135 → 0.1.0

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,8 +1,10 @@
1
1
  import { DateString, ISOString, ISOStringOffset, RequestedAt, TimeHuman, TimezonePython } from '../datetimes';
2
- import { CardType, ChannelType, Decimal, Money, NegativeMoney, OrderStatus, OrderType, ReceiptType, ServiceType, SurchargeType, Temperature, TenderStatus, TenderType, Weekday } from '../global';
3
- import { Address, Customer, CustomerAllergens, CustomerGiftCards, CustomerRevenueCenterHours, CustomerRevenueCenterSettings, DeliveryZone, ExcludedTimes, FirstTime, HolidayItem, LoyaltyPoints, RevenueCenterGroupOrdering, RevenueCenterOrderTimes, ValidTimes } from './customer';
2
+ import { CardType, ChannelType, Decimal, Money, NegativeMoney, OrderStatus, OrderType, ReceiptType, ServiceType, SurchargeType, TenderStatus, TenderType, Weekday } from '../global';
3
+ import { Address, Customer, CustomerGiftCards, CustomerRevenueCenterHours, CustomerRevenueCenterSettings, DeliveryZone, ExcludedTimes, FirstTime, HolidayItem, LoyaltyPoints, RevenueCenterGroupOrdering, RevenueCenterOrderTimes, ValidTimes } from './customer';
4
4
  import { PrepStatus, TicketStatus } from './kds';
5
5
  import { ConfigFulfillmentField } from './config';
6
+ import { NutritionalInfo } from './menu';
7
+ import { Cart } from './cart';
6
8
  export interface OrderChannel {
7
9
  ext_id?: string | null;
8
10
  ext_name?: string | null;
@@ -118,10 +120,10 @@ export interface OrderItemDiscount {
118
120
  }
119
121
  export declare type OrderItemDiscounts = Array<OrderItemDiscount>;
120
122
  export interface OrderItemImage {
121
- type: 'LARGE_IMAGE' | 'SMALL_IMAGE' | 'APP_IMAGE' | 'IMAGE' | 'SECONDARY_IMAGE' | 'FEATURED_IMAGE';
123
+ type: 'LARGE_IMAGE' | 'SMALL_IMAGE' | 'APP_IMAGE';
122
124
  url: string | null;
123
125
  }
124
- export declare type OrderItemImages = Array<OrderItemImage>;
126
+ export declare type OrderItemImages = OrderItemImage[];
125
127
  export interface OrderItemTax {
126
128
  tax_id: number;
127
129
  name: string;
@@ -129,54 +131,74 @@ export interface OrderItemTax {
129
131
  amount_total: NegativeMoney;
130
132
  }
131
133
  export declare type OrderItemTaxes = Array<OrderItemTax>;
132
- export declare type OrderGroupOptions = Array<OrderItem>;
133
- export interface OrderGroup {
134
- id?: number;
135
- inc?: number;
136
- is_size?: boolean;
137
- max?: number;
138
- min?: number;
139
- name: string;
140
- options: OrderGroupOptions;
141
- short_name?: string;
142
- }
143
- export declare type OrderGroups = Array<OrderGroup>;
144
134
  export interface OrderItem {
145
- cart_guest_id?: number;
146
- allergens?: CustomerAllergens | string[];
147
- description?: string | null;
148
- discount?: Money;
149
- discount_total?: Money;
150
- discounts?: OrderItemDiscounts;
151
- groups?: OrderGroups;
135
+ allergens: string[];
136
+ description: string | null;
137
+ groups: OrderItemGroups;
152
138
  id: number;
153
139
  images: OrderItemImages;
154
140
  ingredients: string | null;
155
- item_no?: number;
156
- line_no?: number;
157
- made_for?: string;
141
+ made_for?: string | null;
158
142
  name: string;
159
- notes?: string;
160
- points?: any;
161
- points_total?: number;
162
- price?: Money;
163
- price_quantity?: number;
143
+ notes?: string | null;
144
+ nutritional_info: NutritionalInfo | null;
145
+ points?: number | null;
146
+ price: Money;
164
147
  price_total: Money;
165
- price_unit?: Money;
166
- quantity?: number;
167
- quantity_total?: number;
168
- sales_tax_override?: string | null;
169
- short_description: string;
148
+ quantity: number;
149
+ short_description: string | null;
150
+ tags: string[];
151
+ temperature: 'Hot' | 'Cold';
152
+ }
153
+ export declare type OrderItemOptions = OrderItem[];
154
+ export interface OrderItemGroup {
155
+ id: number;
156
+ name: string;
157
+ options: OrderItemOptions;
158
+ short_name: string;
159
+ }
160
+ export declare type OrderItemGroups = OrderItemGroup[];
161
+ export declare type OrderCart = OrderItem[];
162
+ export interface PosOrderItemGroup {
163
+ id: number;
164
+ name: string;
165
+ options: PosOrderItemOptions;
170
166
  short_name: string;
171
- tax?: Money;
172
- tax_total?: Money;
173
- taxes?: OrderItemTaxes;
174
- temperature: Temperature;
175
- cals?: number;
176
- madeFor?: string;
177
- customer_id?: number;
178
- }
179
- export declare type OrderCart = Array<OrderItem>;
167
+ }
168
+ export declare type PosOrderItemGroups = PosOrderItemGroup[];
169
+ export interface PosOrderItem extends Omit<OrderItem, 'groups'> {
170
+ item_no: number;
171
+ line_no: number;
172
+ groups: PosOrderItemGroups;
173
+ }
174
+ export declare type PosOrderItemOptions = PosOrderItem[];
175
+ export declare type PosOrderCart = PosOrderItem[];
176
+ export interface DisplayItem {
177
+ allergens: string[];
178
+ cals: number | null;
179
+ description: string | null;
180
+ groups: DisplayItemGroups;
181
+ imageUrl: string | null;
182
+ id: number;
183
+ madeFor?: string | null;
184
+ name: string;
185
+ notes?: string | null;
186
+ nutritionalInfo: NutritionalInfo | null;
187
+ quantity: number;
188
+ price: Money;
189
+ shortDescription: string | null;
190
+ signature?: string;
191
+ tags: string[];
192
+ totalPrice: Money;
193
+ }
194
+ export declare type DisplayItems = DisplayItem[];
195
+ export interface DisplayItemGroup {
196
+ id: number;
197
+ name: string;
198
+ options: DisplayItems;
199
+ short_name: string;
200
+ }
201
+ export declare type DisplayItemGroups = DisplayItemGroup[];
180
202
  export interface ModifiersMetadataOption {
181
203
  id: number;
182
204
  line_no: number;
@@ -410,7 +432,10 @@ export interface Order {
410
432
  revenueCenter?: OrderRevenueCenter;
411
433
  serviceType?: ServiceType;
412
434
  }
413
- export declare type Orders = Array<Order>;
435
+ export declare type Orders = Order[];
436
+ export interface OrderPos extends Omit<Order, 'cart'> {
437
+ cart: PosOrderCart;
438
+ }
414
439
  export interface OrderKds extends Omit<Order, 'fire_at' | 'tickets' | 'expected_at'> {
415
440
  expected_at: ISOStringOffset;
416
441
  fire_at: ISOStringOffset;
@@ -490,6 +515,7 @@ export interface Ticket {
490
515
  is_hidden_qa: boolean;
491
516
  print_on_completed: boolean;
492
517
  }
518
+ export declare type Tickets = Ticket[];
493
519
  export declare type TicketGroup = Ticket[];
494
520
  export declare type TicketGroups = TicketGroup[];
495
521
  export interface OrderKdsStatus {
@@ -506,7 +532,7 @@ export interface UnpreparedOrderData {
506
532
  revenueCenterId: number | null;
507
533
  serviceType: ServiceType | null;
508
534
  requestedAt: string | null;
509
- cart: OrderCart | null;
535
+ cart: Cart | null;
510
536
  customer: Customer;
511
537
  address: Address | null;
512
538
  details: OrderDetails | null;
@@ -1,15 +1,16 @@
1
1
  import { AuthType } from '../global';
2
- export interface AnnouncementImage {
3
- type: 'LARGE_IMAGE' | 'SMALL_IMAGE' | 'APP_IMAGE' | 'IMAGE' | 'SECONDARY_IMAGE' | 'FEATURED_IMAGE';
2
+ export interface ContentImage {
3
+ type: 'SECONDARY_IMAGE' | 'FEATURED_IMAGE';
4
4
  url: string | null;
5
5
  }
6
+ export declare type ContentImages = ContentImage[];
6
7
  export interface Announcement {
7
8
  announcement_id: number;
8
9
  display_order: number;
9
10
  hide_text: boolean;
10
11
  hide_text_mobile: boolean;
11
12
  horizontal: string;
12
- images: Array<AnnouncementImage>;
13
+ images: ContentImages;
13
14
  overlay_color: string;
14
15
  overlay_opacity: number;
15
16
  show_overlay: boolean;
@@ -1,87 +1,63 @@
1
- import { Favorite } from './favorite';
2
1
  import { NutritionalInfo } from './menu';
3
- export interface GuestItem {
4
- cart_guest_id?: number | null;
5
- customer_id?: number | null;
6
- made_for: string | null;
7
- notes: string | null;
8
- }
9
2
  export interface CartItemOption {
10
- id: number;
11
- name: string;
12
- shortName: string;
3
+ allergens: string[];
4
+ cals: number | null;
13
5
  description: string | null;
6
+ groups: CartItemGroups;
7
+ id: number;
14
8
  imageUrl: string | null;
15
- allergens: string[];
16
- tags: string[];
9
+ increment: number;
17
10
  ingredients: string | null;
11
+ isDefault: boolean;
12
+ isSoldOut: boolean;
13
+ max: number;
14
+ min: number;
15
+ name: string;
18
16
  nutritionalInfo: NutritionalInfo | null;
19
- cals: number | null;
17
+ points: number | null;
20
18
  price: number;
21
- price_total?: number;
22
19
  quantity: number;
23
- isDefault?: boolean | number;
24
- increment: number;
25
- max: number;
26
- min: number;
27
- isSoldOut: boolean;
28
- points: number;
29
- totalPrice?: number;
30
- totalPoints?: number | null;
31
- totalCals?: number | null;
32
- groups?: Array<Partial<CartItemGroup>>;
20
+ shortDescription: string | null;
21
+ shortName: string;
22
+ slug: string;
23
+ tags: string[];
24
+ totalCals: number | null;
25
+ totalPoints: number | null;
26
+ totalPrice: number | null;
27
+ }
28
+ export interface CartItemOptionWithIndex extends CartItemOption {
29
+ index: number;
30
+ }
31
+ export interface CartItem extends Omit<CartItemOption, 'isDefault'> {
32
+ cartGuestId: number | null;
33
+ customerId: number | null;
34
+ index?: number;
35
+ madeFor: string | null;
36
+ notes: string | null;
37
+ signature?: string;
38
+ similarItems: number[];
39
+ upsellItems: number[];
33
40
  }
34
- export declare type CartItemOptions = Array<Partial<CartItemOption>>;
41
+ export declare type CartItemOptions = CartItemOption[];
35
42
  export interface CartItemGroup {
36
- id: number;
37
- name: string;
38
43
  description: string | null;
44
+ id: number;
39
45
  imageUrl: string | null;
40
46
  included: number;
47
+ isPizza: boolean;
48
+ isSize: boolean;
41
49
  max: number;
42
50
  min: number;
43
- isSize: boolean;
51
+ name: string;
44
52
  options: CartItemOptions;
45
- inc?: number;
46
- is_size?: boolean;
47
- short_name: string;
48
53
  quantity?: number;
49
- isPizza?: boolean;
50
54
  }
51
- export declare type CartItemGroups = Array<Partial<CartItemGroup>>;
52
- export interface CartItem {
53
- index?: number;
54
- id: number;
55
- name: string;
56
- shortName: string;
57
- cart_guest_id?: number | null;
58
- category: string;
59
- customer_id?: number | null;
60
- description: string | null;
61
- imageUrl: string | null;
62
- slug: string;
63
- allergens: string[];
64
- tags: string[];
65
- ingredients: string | null;
66
- madeFor?: string | null;
67
- notes?: string | null;
68
- nutritionalInfo: NutritionalInfo | null;
69
- cals: number | null;
70
- groups: CartItemGroups;
71
- quantity: number;
72
- price: number;
73
- increment: number;
74
- max: number;
75
- min: number;
76
- points: number | null;
77
- upsellItems: number[];
78
- similarItems: number[];
79
- totalPrice: number;
80
- totalPoints: number | null;
81
- totalCals: number | null;
82
- favorite: Favorite;
83
- isSoldOut?: boolean;
84
- signature?: string;
85
- }
86
- export declare type Cart = Array<CartItem>;
55
+ export declare type CartItemGroups = CartItemGroup[];
56
+ export declare type Cart = CartItem[];
57
+ export declare type CartLevels = number[][];
87
58
  export declare type CartCounts = Record<string, number>;
59
+ export interface PosCartItem extends CartItem {
60
+ item_no: number;
61
+ line_no: number;
62
+ }
63
+ export declare type PosCart = PosCartItem[];
@@ -37,21 +37,30 @@ export interface CustomerCheckout {
37
37
  export interface SimpleCartOption {
38
38
  id: number;
39
39
  quantity: number;
40
+ groups: SimpleCartGroups;
40
41
  }
41
42
  export interface SimpleCartGroup {
42
43
  id: number;
43
- options: Array<SimpleCartOption>;
44
+ options: SimpleCartOption[];
44
45
  }
46
+ export declare type SimpleCartGroups = SimpleCartGroup[];
45
47
  export interface SimpleCartItem {
46
48
  id: number;
47
49
  quantity: number;
48
- groups?: Array<SimpleCartGroup>;
50
+ groups: SimpleCartGroups;
49
51
  made_for?: string;
50
52
  notes?: string;
51
53
  cart_guest_id?: number;
52
54
  customer_id?: number;
53
55
  }
54
- export declare type SimpleCart = Array<SimpleCartItem>;
56
+ export declare type SimpleCart = SimpleCartItem[];
57
+ export interface SimpleCartLookupOption {
58
+ quantity: number;
59
+ groupsLookup: Record<string, SimpleCartLookupGroup> | null;
60
+ }
61
+ export interface SimpleCartLookupGroup {
62
+ options: Record<string, SimpleCartLookupOption>;
63
+ }
55
64
  export interface OrderCreateDetails {
56
65
  eating_utensils?: boolean;
57
66
  serving_utensils?: boolean;
@@ -1,39 +1,36 @@
1
1
  import { ISOString } from '../../datetimes';
2
2
  import { ServiceType } from '../../global';
3
- import { RequestErrorAPI, RequestStatus } from '../../request';
4
- import { OrderItem, OrderRevenueCenter } from '../order';
3
+ import { SimpleCart } from '../checkout';
5
4
  import { Address } from './addresses';
6
5
  export interface CartOwner {
7
6
  customer_id: number;
8
7
  first_name: string;
9
8
  last_name: string;
10
9
  }
10
+ export interface GroupOrderGuest {
11
+ cart_guest_id: number;
12
+ cart_id: number;
13
+ first_name: string;
14
+ last_name: string;
15
+ }
16
+ export declare type GroupOrderGuests = GroupOrderGuest[];
11
17
  export interface GroupOrder {
12
- order_id?: string | null;
13
- address?: Address | null;
14
- cart: Array<OrderItem>;
15
- cartGuest?: any;
16
- cartGuests?: any;
17
- cart_guests: any;
18
+ address: Address | null;
19
+ cart: SimpleCart;
20
+ cart_guests?: GroupOrderGuests;
18
21
  cart_id: number;
19
- cartOwner?: CartOwner;
20
- customer?: CartOwner;
21
22
  closed: boolean;
22
- cutoff_at: string;
23
- error?: RequestErrorAPI;
23
+ customer?: CartOwner;
24
+ cutoff_at: string | null;
24
25
  guest_count: number;
25
- guest_limit: number;
26
- isCartOwner: boolean;
27
- loading?: RequestStatus;
28
- requested_at: ISOString;
29
- revenue_center?: OrderRevenueCenter;
26
+ guest_limit: number | null;
27
+ requested_at: ISOString | 'asap';
30
28
  revenue_center_id: number;
31
29
  service_type: ServiceType;
32
- spending_limit: string;
30
+ spending_limit: string | null;
33
31
  token: string;
34
- spendingLimit: string;
35
32
  }
36
- export declare type GroupOrders = Array<GroupOrder>;
33
+ export declare type GroupOrders = GroupOrder[];
37
34
  export interface GroupOrderTime {
38
35
  isAdjusted: boolean;
39
36
  firstIso: ISOString;
@@ -1,98 +1,12 @@
1
1
  import { ISOStringOffset } from '../datetimes';
2
- import { Decimal, Temperature } from '../global';
3
- import { NutritionalInfo } from './menu';
4
- export interface FavoriteCartOption {
5
- id: number;
6
- quantity: number;
7
- }
8
- export interface FavoriteCartGroup {
9
- id: number;
10
- options: Array<FavoriteCartOption>;
11
- }
12
- export interface FavoriteCartItem {
13
- id: number;
14
- made_for?: string;
15
- notes?: string;
16
- quantity?: string;
17
- }
18
- export declare type FavoriteCart = Array<FavoriteCartItem>;
19
- export interface FavoriteItemImage {
20
- type: 'LARGE_IMAGE' | 'SMALL_IMAGE' | 'APP_IMAGE';
21
- url: string | null;
22
- }
23
- export interface FavoriteItemNutritionalInfo {
24
- calories: Decimal;
25
- cholesterol: Decimal;
26
- dietary_fiber: Decimal;
27
- protein: Decimal;
28
- saturated_fat: Decimal;
29
- serving_size: Decimal;
30
- sodium: Decimal;
31
- sugars: Decimal;
32
- total_carbs: Decimal;
33
- total_fat: Decimal;
34
- trans_fat: Decimal;
35
- }
36
- export interface FavoriteItemGroup {
37
- id: number;
38
- inc?: number;
39
- is_size?: boolean;
40
- max?: number;
41
- min?: number;
42
- name?: string;
43
- options: Array<Partial<FavoriteItem>>;
44
- short_name?: string;
45
- }
46
- export interface FavoriteItem {
47
- allergens: Array<string>;
48
- description: string;
49
- groups?: Array<Partial<FavoriteItemGroup>>;
50
- id: number;
51
- images: Array<FavoriteItemImage>;
52
- ingredients: string | null;
53
- made_for?: string;
54
- name: string;
55
- notes?: string;
56
- nutritional_info?: FavoriteItemNutritionalInfo | null;
57
- points?: number | null;
58
- quantity?: number;
59
- short_description: string | null;
60
- tags: Array<string>;
61
- temperature: Temperature;
62
- index?: number;
63
- shortName?: string;
64
- cart_guest_id?: number | null;
65
- category: string | null;
66
- customer_id?: number | null;
67
- imageUrl: string | null;
68
- slug: string;
69
- madeFor?: string | null;
70
- nutritionalInfo: NutritionalInfo | null;
71
- cals: number | null;
72
- price: number;
73
- increment: number;
74
- max: number;
75
- min: number;
76
- upsellItems: number[];
77
- similarItems: number[];
78
- totalPrice: number;
79
- totalPoints: number | null;
80
- totalCals: number | null;
81
- item_no?: number;
82
- price_total?: number;
83
- favorite_id?: number;
84
- shortDescription?: string;
85
- signature?: string;
86
- isDefault?: boolean | number;
87
- isSoldOut?: boolean;
88
- favorite?: Favorite;
89
- }
2
+ import { SimpleCartItem } from './checkout';
3
+ import { OrderItem } from './order';
90
4
  export interface Favorite {
91
5
  added_at: ISOStringOffset;
92
- cart: FavoriteCart;
93
- favorite_id?: number;
94
- item: Partial<FavoriteItem>;
6
+ cart: SimpleCartItem;
7
+ favorite_id: number;
8
+ item: OrderItem;
95
9
  name: string | null;
96
10
  updated_at: ISOStringOffset;
97
11
  }
98
- export declare type Favorites = Array<Favorite>;
12
+ export declare type Favorites = Favorite[];