@compassdigital/sdk.typescript 4.207.0 → 4.209.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.
package/src/index.ts CHANGED
@@ -41,6 +41,9 @@ import {
41
41
  PostOrderQuery,
42
42
  PostOrderBody,
43
43
  PostOrderResponse,
44
+ PostPosOrderQuery,
45
+ PostPosOrderBody,
46
+ PostPosOrderResponse,
44
47
  GetOrderQuery,
45
48
  GetOrderResponse,
46
49
  PutOrderResponse,
@@ -1283,6 +1286,8 @@ import {
1283
1286
  GetSearchLocationResponse,
1284
1287
  GetSearchUserQuery,
1285
1288
  GetSearchUserResponse,
1289
+ GetSearchDiscountsQuery,
1290
+ GetSearchDiscountsResponse,
1286
1291
  } from './interface/search';
1287
1292
 
1288
1293
  import {
@@ -1345,6 +1350,23 @@ import {
1345
1350
  PostTimeslotsBrandIncrementResponse,
1346
1351
  } from './interface/timeslots';
1347
1352
 
1353
+ import {
1354
+ ProductionSheetControllerCreateSheetBody,
1355
+ ProductionSheetControllerCreateSheetResponse,
1356
+ ProductionSheetControllerGetScheduledMenuDataQuery,
1357
+ ProductionSheetControllerGetScheduledMenuDataResponse,
1358
+ ProductionSheetControllerSaveItemForecastDifferentialBody,
1359
+ ProductionSheetControllerSaveItemForecastDifferentialResponse,
1360
+ ProductionSheetControllerSendChatMessageBody,
1361
+ ProductionSheetControllerSendChatMessageResponse,
1362
+ ProductionSheetControllerSendChatFeedbackBody,
1363
+ ProductionSheetControllerSendChatFeedbackResponse,
1364
+ ProductionSheetControllerGetForecastMetaDataQuery,
1365
+ ProductionSheetControllerGetForecastMetaDataResponse,
1366
+ ProductionSheetControllerServiceStatusQuery,
1367
+ ProductionSheetControllerServiceStatusResponse,
1368
+ } from './interface/forecasting';
1369
+
1348
1370
  import { BaseServiceClient, RequestOptions, ResponsePromise } from './base';
1349
1371
  export * from './base';
1350
1372
 
@@ -1664,6 +1686,21 @@ export class ServiceClient extends BaseServiceClient {
1664
1686
  return this.request('order', '/order', 'POST', `/order`, body, options);
1665
1687
  }
1666
1688
 
1689
+ /**
1690
+ * POST /pos-order - Place a POS order
1691
+ *
1692
+ * @param body - Order object that needs to be created
1693
+ * @param options - additional request options
1694
+ */
1695
+ post_pos_order(
1696
+ body: PostPosOrderBody,
1697
+ options?: {
1698
+ query?: PostPosOrderQuery;
1699
+ } & RequestOptions,
1700
+ ): ResponsePromise<PostPosOrderResponse> {
1701
+ return this.request('order', '/pos-order', 'POST', `/pos-order`, body, options);
1702
+ }
1703
+
1667
1704
  /**
1668
1705
  * GET /order/{id} - Get an individual order
1669
1706
  *
@@ -13631,6 +13668,28 @@ export class ServiceClient extends BaseServiceClient {
13631
13668
  return this.request('search', '/search/user', 'GET', `/search/user`, null, options);
13632
13669
  }
13633
13670
 
13671
+ /**
13672
+ * GET /search/discounts/{id} - Get discounts from search
13673
+ *
13674
+ * @param id
13675
+ * @param options - additional request options
13676
+ */
13677
+ get_search_discounts(
13678
+ id: string,
13679
+ options?: {
13680
+ query?: GetSearchDiscountsQuery;
13681
+ } & RequestOptions,
13682
+ ): ResponsePromise<GetSearchDiscountsResponse> {
13683
+ return this.request(
13684
+ 'search',
13685
+ '/search/discounts/{id}',
13686
+ 'GET',
13687
+ `/search/discounts/${id}`,
13688
+ null,
13689
+ options,
13690
+ );
13691
+ }
13692
+
13634
13693
  /**
13635
13694
  * POST /auth/flow - Determines the authentication flow for a user based on their email address
13636
13695
  *
@@ -14022,4 +14081,144 @@ export class ServiceClient extends BaseServiceClient {
14022
14081
  options,
14023
14082
  );
14024
14083
  }
14084
+
14085
+ /**
14086
+ * POST /forecasting/production-sheet - Create a new Production Sheet
14087
+ *
14088
+ * @param body
14089
+ * @param options - additional request options
14090
+ */
14091
+ ProductionSheetController_createSheet(
14092
+ body: ProductionSheetControllerCreateSheetBody,
14093
+ options?: RequestOptions,
14094
+ ): ResponsePromise<ProductionSheetControllerCreateSheetResponse> {
14095
+ return this.request(
14096
+ 'forecasting',
14097
+ '/forecasting/production-sheet',
14098
+ 'POST',
14099
+ `/forecasting/production-sheet`,
14100
+ body,
14101
+ options,
14102
+ );
14103
+ }
14104
+
14105
+ /**
14106
+ * GET /forecasting/scheduled-menu-data - Get scheduled menu data for a site for a given date
14107
+ *
14108
+ * @param options - additional request options
14109
+ */
14110
+ ProductionSheetController_getScheduledMenuData(
14111
+ options: {
14112
+ query: ProductionSheetControllerGetScheduledMenuDataQuery;
14113
+ } & RequestOptions,
14114
+ ): ResponsePromise<ProductionSheetControllerGetScheduledMenuDataResponse> {
14115
+ return this.request(
14116
+ 'forecasting',
14117
+ '/forecasting/scheduled-menu-data',
14118
+ 'GET',
14119
+ `/forecasting/scheduled-menu-data`,
14120
+ null,
14121
+ options,
14122
+ );
14123
+ }
14124
+
14125
+ /**
14126
+ * POST /forecasting/item-forecast-diff - Send initial and updated forecast values for any items that had their forecast values manually updated in the centric UI prior to hitting 'Print and Save'
14127
+ *
14128
+ * @param body
14129
+ * @param options - additional request options
14130
+ */
14131
+ ProductionSheetController_saveItemForecastDifferential(
14132
+ body: ProductionSheetControllerSaveItemForecastDifferentialBody,
14133
+ options?: RequestOptions,
14134
+ ): ResponsePromise<ProductionSheetControllerSaveItemForecastDifferentialResponse> {
14135
+ return this.request(
14136
+ 'forecasting',
14137
+ '/forecasting/item-forecast-diff',
14138
+ 'POST',
14139
+ `/forecasting/item-forecast-diff`,
14140
+ body,
14141
+ options,
14142
+ );
14143
+ }
14144
+
14145
+ /**
14146
+ * POST /forecasting/chat - Relay a user chat message to Luna
14147
+ *
14148
+ * @param body
14149
+ * @param options - additional request options
14150
+ */
14151
+ ProductionSheetController_sendChatMessage(
14152
+ body: ProductionSheetControllerSendChatMessageBody,
14153
+ options?: RequestOptions,
14154
+ ): ResponsePromise<ProductionSheetControllerSendChatMessageResponse> {
14155
+ return this.request(
14156
+ 'forecasting',
14157
+ '/forecasting/chat',
14158
+ 'POST',
14159
+ `/forecasting/chat`,
14160
+ body,
14161
+ options,
14162
+ );
14163
+ }
14164
+
14165
+ /**
14166
+ * POST /forecasting/chat-feedback - Send user feedback for Luna chat messages
14167
+ *
14168
+ * @param body
14169
+ * @param options - additional request options
14170
+ */
14171
+ ProductionSheetController_sendChatFeedback(
14172
+ body: ProductionSheetControllerSendChatFeedbackBody,
14173
+ options?: RequestOptions,
14174
+ ): ResponsePromise<ProductionSheetControllerSendChatFeedbackResponse> {
14175
+ return this.request(
14176
+ 'forecasting',
14177
+ '/forecasting/chat-feedback',
14178
+ 'POST',
14179
+ `/forecasting/chat-feedback`,
14180
+ body,
14181
+ options,
14182
+ );
14183
+ }
14184
+
14185
+ /**
14186
+ * GET /forecasting/forecast-metadata - Get forecast meta data from Luna
14187
+ *
14188
+ * @param options - additional request options
14189
+ */
14190
+ ProductionSheetController_getForecastMetaData(
14191
+ options: {
14192
+ query: ProductionSheetControllerGetForecastMetaDataQuery;
14193
+ } & RequestOptions,
14194
+ ): ResponsePromise<ProductionSheetControllerGetForecastMetaDataResponse> {
14195
+ return this.request(
14196
+ 'forecasting',
14197
+ '/forecasting/forecast-metadata',
14198
+ 'GET',
14199
+ `/forecasting/forecast-metadata`,
14200
+ null,
14201
+ options,
14202
+ );
14203
+ }
14204
+
14205
+ /**
14206
+ * GET /forecasting/status
14207
+ *
14208
+ * @param options - additional request options
14209
+ */
14210
+ ProductionSheetController_serviceStatus(
14211
+ options?: {
14212
+ query?: ProductionSheetControllerServiceStatusQuery;
14213
+ } & RequestOptions,
14214
+ ): ResponsePromise<ProductionSheetControllerServiceStatusResponse> {
14215
+ return this.request(
14216
+ 'forecasting',
14217
+ '/forecasting/status',
14218
+ 'GET',
14219
+ `/forecasting/status`,
14220
+ null,
14221
+ options,
14222
+ );
14223
+ }
14025
14224
  }
@@ -1892,6 +1892,7 @@ export interface ConsumerTimeslot {
1892
1892
  duration?: string;
1893
1893
  is_available?: boolean;
1894
1894
  number_orders?: number;
1895
+ delivery_destinations?: string[];
1895
1896
  }
1896
1897
 
1897
1898
  export interface PostConsumerLocationMarketplaceTimeslotsResponse {
@@ -0,0 +1,148 @@
1
+ /* eslint-disable */
2
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
3
+
4
+ import { RequestQuery, BaseRequest } from './util';
5
+
6
+ export interface CreateProductionSheetDto {
7
+ // Site ID the production sheet is for
8
+ siteId: string;
9
+ // Start date of which scheduled menu items are being forecasted for
10
+ fromDate: string;
11
+ // End date of which scheduled menu items are being forecasted for
12
+ toDate: string;
13
+ // Response ID provided by Luna for session continuity
14
+ responseId?: string;
15
+ }
16
+
17
+ export interface ProductionSheetItemForecastDiffDto {
18
+ // Item name
19
+ item_name: string;
20
+ // Item posid
21
+ pos_id: string;
22
+ // Name of menu item belongs to
23
+ menu_name: string;
24
+ // ID of menu item belongs to
25
+ menu_id: string;
26
+ // Name of brand item belongs to
27
+ brand_name: string;
28
+ // ID of brand item belongs to
29
+ brand_id: string;
30
+ // Original forecasted amount from Luna
31
+ forecasted_amount: number;
32
+ // Manually updated forecast amount
33
+ updated_forecast_amount: number;
34
+ // Previous week's actual sale amount
35
+ last_week_amount: number;
36
+ // Manually updated 'on-hand' amount of the item
37
+ on_hand: number;
38
+ }
39
+
40
+ export interface ItemDiffOnSaveRequestDto {
41
+ // Site ID
42
+ siteId: string;
43
+ // Date of the request
44
+ date: string;
45
+ // Date of the production sheet
46
+ production_sheet_date: string;
47
+ // Username of user who saved production sheet
48
+ username: string;
49
+ // Array of items with forecast diffs
50
+ items: ProductionSheetItemForecastDiffDto[];
51
+ }
52
+
53
+ export interface ItemForecastDiffResponse {
54
+ // Success message from Luna API
55
+ data: string;
56
+ }
57
+
58
+ export interface ChatItemDto {
59
+ // Item's display name
60
+ name: string;
61
+ // Item's POSID
62
+ posid: string;
63
+ }
64
+
65
+ export interface ChatMessageDto {
66
+ // Timestamp of chat request
67
+ created_at: string;
68
+ // User message for chat endpoint
69
+ message: string;
70
+ // Site ID associated with chat request
71
+ site_id: string;
72
+ // Username of the user sending the message
73
+ username: string;
74
+ // Production sheet date for context
75
+ production_sheet_date?: string;
76
+ // Feedback rating for Luna messages
77
+ feedback?: 'positive' | 'negative';
78
+ // Item the user wants context on
79
+ item: ChatItemDto;
80
+ }
81
+
82
+ export interface ChatFeedbackDto {
83
+ // Site ID associated with chat request
84
+ site_id: string;
85
+ // Username of the user sending the message
86
+ username: string;
87
+ // Feedback rating for Luna messages
88
+ feedback: 'positive' | 'negative';
89
+ // User message for chat endpoint
90
+ message: string;
91
+ // Timestamp of chat request
92
+ created_at: string;
93
+ }
94
+
95
+ // POST /forecasting/production-sheet - Create a new Production Sheet
96
+
97
+ export type ProductionSheetControllerCreateSheetBody = CreateProductionSheetDto;
98
+
99
+ export type ProductionSheetControllerCreateSheetResponse = {};
100
+
101
+ // GET /forecasting/scheduled-menu-data - Get scheduled menu data for a site for a given date
102
+
103
+ export interface ProductionSheetControllerGetScheduledMenuDataQuery {
104
+ siteId: string;
105
+ date: string;
106
+ // Graphql query string
107
+ _query?: string;
108
+ }
109
+
110
+ export type ProductionSheetControllerGetScheduledMenuDataResponse = {};
111
+
112
+ // POST /forecasting/item-forecast-diff - Send initial and updated forecast values for any items that had their forecast values manually updated in the centric UI prior to hitting 'Print and Save'
113
+
114
+ export type ProductionSheetControllerSaveItemForecastDifferentialBody = ItemDiffOnSaveRequestDto;
115
+
116
+ export type ProductionSheetControllerSaveItemForecastDifferentialResponse =
117
+ ItemForecastDiffResponse;
118
+
119
+ // POST /forecasting/chat - Relay a user chat message to Luna
120
+
121
+ export type ProductionSheetControllerSendChatMessageBody = ChatMessageDto;
122
+
123
+ export type ProductionSheetControllerSendChatMessageResponse = {};
124
+
125
+ // POST /forecasting/chat-feedback - Send user feedback for Luna chat messages
126
+
127
+ export type ProductionSheetControllerSendChatFeedbackBody = ChatFeedbackDto;
128
+
129
+ export type ProductionSheetControllerSendChatFeedbackResponse = {};
130
+
131
+ // GET /forecasting/forecast-metadata - Get forecast meta data from Luna
132
+
133
+ export interface ProductionSheetControllerGetForecastMetaDataQuery {
134
+ site_id: string;
135
+ // Graphql query string
136
+ _query?: string;
137
+ }
138
+
139
+ export type ProductionSheetControllerGetForecastMetaDataResponse = {};
140
+
141
+ // GET /forecasting/status
142
+
143
+ export interface ProductionSheetControllerServiceStatusQuery {
144
+ // Graphql query string
145
+ _query?: string;
146
+ }
147
+
148
+ export type ProductionSheetControllerServiceStatusResponse = {};
@@ -4,6 +4,8 @@
4
4
  import { RequestQuery, BaseRequest } from './util';
5
5
 
6
6
  export interface CreateOrder {
7
+ // For mealplan orders, the ID of the mealplan
8
+ id?: string;
7
9
  location_brand?: string;
8
10
  location?: string;
9
11
  shoppingcart?: string;
@@ -45,6 +47,32 @@ export interface CreateOrder {
45
47
  };
46
48
  }
47
49
 
50
+ export interface CreatePOSOrder {
51
+ location_brand?: string;
52
+ location?: string;
53
+ shoppingcart?: string;
54
+ payment?: {
55
+ pos?: POSPayment;
56
+ };
57
+ customer?: string;
58
+ is?: {
59
+ in_progress?: boolean;
60
+ ready?: boolean;
61
+ };
62
+ meta?: {
63
+ // which ui the order was placed on
64
+ source?: 'pos';
65
+ // Override for meta.active for testing purposes
66
+ active_override?: boolean;
67
+ [index: string]: any;
68
+ };
69
+ requested_date?: string;
70
+ details?: {
71
+ name?: string;
72
+ order_type?: string;
73
+ };
74
+ }
75
+
48
76
  export interface Error {
49
77
  error?: string;
50
78
  code?: number;
@@ -79,6 +107,7 @@ export interface Order {
79
107
  stipend?: CashlessPayment;
80
108
  voucher?: CashlessPayment;
81
109
  coupon_voucher?: CashlessPayment;
110
+ pos?: POSPayment;
82
111
  };
83
112
  mealplan?: {
84
113
  id?: string;
@@ -157,7 +186,7 @@ export interface Order {
157
186
  checkin_uuid?: string;
158
187
  refunds?: RefundTransaction[];
159
188
  // which ui the order was placed on
160
- source?: 'web' | 'mobile';
189
+ source?: 'web' | 'mobile' | 'pos';
161
190
  // details pertaining to the amount charged on the order
162
191
  transaction?: {
163
192
  // used in mx orders - cart totals in dollars and meal exchange value (meals)
@@ -325,6 +354,12 @@ export interface MealPlan {
325
354
  name?: string;
326
355
  }
327
356
 
357
+ export interface POSPayment {
358
+ type?: string;
359
+ // FreedomPay Transaction details
360
+ transaction?: Record<string, any>;
361
+ }
362
+
328
363
  export interface OrderIssue {
329
364
  // Type of issue
330
365
  type?: string;
@@ -461,6 +496,21 @@ export interface PostOrderRequest extends BaseRequest, RequestQuery<PostOrderQue
461
496
  body: PostOrderBody;
462
497
  }
463
498
 
499
+ // POST /pos-order - Place a POS order
500
+
501
+ export interface PostPosOrderQuery {
502
+ // The language of the user ex en, fr
503
+ lang?: string;
504
+ }
505
+
506
+ export type PostPosOrderBody = CreatePOSOrder;
507
+
508
+ export type PostPosOrderResponse = Order;
509
+
510
+ export interface PostPosOrderRequest extends BaseRequest, RequestQuery<PostPosOrderQuery> {
511
+ body: PostPosOrderBody;
512
+ }
513
+
464
514
  // GET /order/{id} - Get an individual order
465
515
 
466
516
  export interface GetOrderPath {
@@ -138,6 +138,53 @@ export interface GetUserPaginatedResult {
138
138
  results: GetUserDto[];
139
139
  }
140
140
 
141
+ export interface DiscountStatus {
142
+ live?: boolean;
143
+ publishedTo3rdParty?: boolean;
144
+ readyToPublish?: boolean;
145
+ active?: boolean;
146
+ syncedWith3rdParty?: boolean;
147
+ }
148
+
149
+ export interface DiscountIs {
150
+ badgepayPromo?: boolean;
151
+ mealplanPromo?: boolean;
152
+ }
153
+
154
+ export interface VoucherifyMetaDataDiscount {
155
+ type: string;
156
+ amountOff?: number;
157
+ percentOff?: number;
158
+ }
159
+
160
+ export interface VoucherifyMetaData {
161
+ id?: string;
162
+ code?: string;
163
+ discount?: VoucherifyMetaDataDiscount;
164
+ }
165
+
166
+ export interface MetaProvider {
167
+ voucherify?: VoucherifyMetaData;
168
+ }
169
+
170
+ export interface DiscountMeta {
171
+ provider: MetaProvider;
172
+ }
173
+
174
+ export interface GetSearchDiscountResponseDTO {
175
+ id: string;
176
+ createdBy: string;
177
+ updatedBy?: string;
178
+ createdAt: string;
179
+ updatedAt: string;
180
+ name: string;
181
+ status?: DiscountStatus;
182
+ is?: DiscountIs;
183
+ meta?: DiscountMeta;
184
+ sites: string[];
185
+ brands: string[];
186
+ }
187
+
141
188
  // GET /search/order
142
189
 
143
190
  export interface GetSearchOrderQuery {
@@ -239,3 +286,16 @@ export interface GetSearchUserQuery {
239
286
  }
240
287
 
241
288
  export type GetSearchUserResponse = GetUserPaginatedResult;
289
+
290
+ // GET /search/discounts/{id} - Get discounts from search
291
+
292
+ export interface GetSearchDiscountsPath {
293
+ id: string;
294
+ }
295
+
296
+ export interface GetSearchDiscountsQuery {
297
+ // Graphql query string
298
+ _query?: string;
299
+ }
300
+
301
+ export type GetSearchDiscountsResponse = GetSearchDiscountResponseDTO;