@artisan-commerce/types 0.14.0-canary.5 → 0.14.0-canary.7

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/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.14.0-canary.7](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/types@0.14.0-canary.6...@artisan-commerce/types@0.14.0-canary.7) (2021-08-24)
7
+
8
+ **Note:** Version bump only for package @artisan-commerce/types
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.14.0-canary.6](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/types@0.14.0-canary.5...@artisan-commerce/types@0.14.0-canary.6) (2021-08-23)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **global:** add missing properties to order interfaces and types ([757157f](https://bitbucket.org/tradesystem/artisn_sdk/commit/757157fbb2dd25d04efc791cd9b9511e41685471))
20
+
21
+
22
+
6
23
  ## [0.14.0-canary.5](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/types@0.14.0-canary.4...@artisan-commerce/types@0.14.0-canary.5) (2021-08-23)
7
24
 
8
25
 
@@ -1,23 +1,43 @@
1
- import { BillTotalCategory } from "./shoppingCart.types";
1
+ import { BillTotalCategory, ShoppingCart } from "./shoppingCart.types";
2
2
  import { ShippingAddress } from "./shippingAddress.types";
3
3
  import { BillingData } from "./billingData.types";
4
+ import { StepCategory, StepCode } from "./fulfillment.types";
5
+ import { BaseUser } from "./user.types";
6
+ import { Store } from "./store.types";
7
+ import { CartProductQuestion } from "./product.types";
4
8
  /**
5
9
  * Representation of common properties of the order.
6
10
  *
7
11
  * @interface BaseOrder
8
- * @since 0.5.15
12
+ * @since 0.1.0
9
13
  */
10
14
  export interface BaseOrder {
11
15
  /** Order unique identifier */
12
16
  id: number;
13
- /** Order additional info */
14
- additionalInfo: any[];
17
+ /** Account unique identifier */
18
+ accountId: number;
19
+ /** Order additional info, see {@link OrderAdditionalInfo} */
20
+ additionalInfo: OrderAdditionalInfo;
21
+ /** User's order billing data' unique identifier */
22
+ billingDataByUserId: string;
15
23
  /** Order additional messages */
16
24
  additionalMessage: string | null;
17
- /** Order allocation */
18
- allocation: string;
25
+ /** Order allocation, see {@link Allocation} */
26
+ allocation: Allocation;
19
27
  /** Channel unique identifier */
20
28
  channelId: number;
29
+ /** Order channel name */
30
+ channelName: string;
31
+ /** Order comment */
32
+ comment: string;
33
+ /** Order hash */
34
+ hash: string;
35
+ /** Order issue unique identifier */
36
+ issueId: string;
37
+ /** Order pickup cook time */
38
+ pickupCooktime: string | null;
39
+ /** User's order shipping address' unique identifier */
40
+ shippingAddressByUserId: string;
21
41
  /** Order date, e.g.: `02 Aug 2021` */
22
42
  orderDate: string;
23
43
  /** Order time, e.g.: `17:00 am` */
@@ -31,97 +51,346 @@ export interface BaseOrder {
31
51
  /** Shopping cart associated with the order, see {@link OrderShoppingCart} */
32
52
  shoppingCart: OrderShoppingCart;
33
53
  /** Order step, see {@link OrderStep} */
34
- step: OrderStep;
35
- /** Step category */
36
- stepCategory: string;
37
- /** Step code */
38
- stepCode: string;
54
+ step: number;
55
+ /** Step category, see {@link StepCategory} */
56
+ stepCategory: StepCategory;
57
+ /** Step code, see {@link StepCode} */
58
+ stepCode: StepCode;
39
59
  /** Step unique identifier */
40
60
  stepId: number;
41
61
  /** Step name */
42
62
  stepName: string;
63
+ /** User unique identifier */
64
+ uid: string;
65
+ /** Order user, see {@link OrderUser} */
66
+ user: OrderUser;
43
67
  /** Order transaction unique identifier */
44
68
  transactionId: number | null;
45
69
  /** Vendor unique identifier */
46
70
  vendorId: number;
71
+ /** Vendor name */
72
+ vendorName: string;
73
+ /** Order operator information, see {@link OperatorInformation} */
74
+ createdByOperator: OperatorInformation;
47
75
  }
48
76
  /**
49
77
  * The shopping cart associated with the order.
50
78
  *
51
79
  * @interface OrderShoppingCart
52
- * @since 0.5.15
80
+ * @since 0.1.0
81
+ * @extends {{@link ShoppingCart}
53
82
  */
54
- export interface OrderShoppingCart {
55
- /** Order bill total category, see {@link BillTotalCategory} */
56
- billTotal: BillTotalCategory;
83
+ export interface OrderShoppingCart extends Omit<ShoppingCart, "stores"> {
84
+ /** Order shopping cart comment */
85
+ comment: string | null;
86
+ /** Order instructions */
87
+ instructions: string | null;
88
+ /** Order status unique identifier */
89
+ statusId: number;
90
+ /** Order issue unique identifier */
91
+ issueId: string | null;
92
+ /** Order invoice number */
93
+ invoiceNumber: string | null;
94
+ /** Order status name */
95
+ statusName: string;
96
+ /** Status code, see {@link StepCode} */
97
+ statusCode: StepCode;
98
+ /** Order payment status, see {@link OrderStatus} */
99
+ paymentStatus: OrderStatus;
57
100
  /**
58
101
  * An array of the order paid payment methods,
59
- * see {@link OrderPaidPaymentMethod}
102
+ * see {@link OrderPaymentMethod}
60
103
  */
61
- paidPaymentMethods: OrderPaidPaymentMethod[];
62
- /** An array of order stores, see {@link OrderStore} */
104
+ paidPaymentMethods: OrderPaymentMethod[] | null;
105
+ /** An array of order retries, see {@link OrderRetry} */
106
+ allRetries: OrderRetry[];
107
+ /**
108
+ * An array of the order rejected payment methods,
109
+ * see {@link OrderPaymentMethod}
110
+ */
111
+ rejectedPaymentMethods: OrderPaymentMethod[] | null;
112
+ /** An array of OrderStore, see {@link OrderStore} */
63
113
  stores: OrderStore[];
64
114
  }
65
115
  /**
66
- * Store associated with the order.
116
+ * Order common fields.
117
+ *
118
+ * @interface OrderCommonFields
119
+ * @since 0.1.0
120
+ */
121
+ export interface OrderCommonFields {
122
+ /** Order amount **/
123
+ amount: string;
124
+ /** Order status **/
125
+ status: string;
126
+ /** Order created date **/
127
+ created_at: string;
128
+ /** Order update date **/
129
+ updated_at: string;
130
+ }
131
+ /**
132
+ * The stores associated with the order.
67
133
  *
68
134
  * @interface OrderStore
69
- * @since 0.5.15
135
+ * @since 0.1.0
136
+ * @extends {{@link Store}
70
137
  */
71
- export interface OrderStore {
72
- /**
73
- * An array of products associated with the order,
74
- * see {@link OrderProduct}
75
- */
138
+ export interface OrderStore extends Store {
139
+ /** Order store id */
140
+ id: number;
141
+ /** Order unique identifier */
142
+ orderId: number;
143
+ /** Order digital command sent */
144
+ digitalCommandSent: string;
145
+ /** Order store status unique identifier */
146
+ statusId: number;
147
+ /** Order store status name */
148
+ statusName: string;
149
+ /** Order store status code, see {@link StepCode} */
150
+ statusCode: StepCode;
151
+ /** Order store bill total, see {@link OrderBillTotal} */
152
+ billStoreTotal: OrderBillTotal;
153
+ /** An array of OrderProducts, see {@link OrderProduct} */
76
154
  products: OrderProduct[];
77
- /** Store name */
78
- storeName: string;
79
155
  }
80
156
  /**
81
- * Product associated with the order.
157
+ * The product associated with the order.
82
158
  *
83
159
  * @interface OrderProduct
84
- * @since 0.5.15
160
+ * @since 0.1.0
85
161
  */
86
162
  export interface OrderProduct {
87
- /** Product unique identifier */
163
+ /** Order product id */
164
+ id: number;
165
+ /** Order product unique identifier */
88
166
  productId: number;
89
- /** Product name */
167
+ /** Order product name */
90
168
  productName: string;
169
+ /** Order product comment */
170
+ comment: string;
171
+ /** Order bill product, see {@link OrderBillProduct} */
172
+ billProduct: OrderBillProduct;
173
+ /** Order bill product and answers, see {@link OrderBillTotal} */
174
+ billProductAndAnswers: OrderBillTotal;
175
+ /** Order product questions and answers, see {@link CartProductQuestion} */
176
+ questionsAndAnswers: CartProductQuestion[];
91
177
  }
92
178
  /**
93
- * Paid payment methods associated with the order.
179
+ * The total bill associated with a product of order.
94
180
  *
95
- * @interface OrderPaidPaymentMethod
96
- * @since 0.5.15
181
+ * @interface OrderBillTotal
182
+ * @since 0.1.0
183
+ * @extends {{@link BillTotalCategory}
97
184
  */
98
- export interface OrderPaidPaymentMethod {
99
- /** Order paid payment methods */
100
- payment_method_name: string;
101
- /** Order last retry, see {@link OrderLastRetry} */
102
- lastRetry: OrderLastRetry;
185
+ export interface OrderBillTotal extends BillTotalCategory {
186
+ /** Order bill discount total */
187
+ discountTotal: number;
103
188
  }
104
189
  /**
105
- * The last retry of the order.
190
+ * The bill associated with a product of order.
106
191
  *
107
- * @interface OrderLastRetry
108
- * @since 0.5.15
192
+ * @interface OrderBillProduct
193
+ * @since 0.1.0
194
+ * @extends {{@link OrderBillTotal}
195
+ */
196
+ export interface OrderBillProduct extends OrderBillTotal {
197
+ /** Order bill product amount */
198
+ amount: number;
199
+ }
200
+ /**
201
+ * The retry of the order.
202
+ *
203
+ * @interface OrderRetry
204
+ * @since 0.1.0
205
+ * @extends {{@link Status}, {@link OrderCommonFields}
109
206
  */
110
- export interface OrderLastRetry {
111
- /** Order last retry step */
207
+ export interface OrderRetry extends Status, OrderCommonFields {
208
+ /** Order retry unique identifier */
209
+ id: number;
210
+ /** Order payment method id **/
211
+ payment_method_by_order_id: number;
212
+ /** Order retry reference **/
213
+ reference: string;
214
+ /** Order retry platform **/
215
+ platform: string;
216
+ /** Order retry user agent **/
217
+ user_agent: string;
218
+ /** Order retry ip address **/
219
+ ip_address: string;
220
+ /** Order retry request id **/
221
+ request_id: string;
222
+ /** Order retry process url **/
223
+ process_url: string;
224
+ /** Order payment method, see {@link PaymentMethodByOrder} **/
225
+ payment_method_by_order: PaymentMethodByOrder;
226
+ /** Order step, see {@link OrderStep} */
112
227
  step: OrderStep;
113
228
  }
229
+ /**
230
+ * The retry of the order.
231
+ *
232
+ * @interface PaymentMethodByOrder
233
+ * @since 0.1.0
234
+ * @extends {{@link Status}, {@link OrderCommonFields}
235
+ */
236
+ export interface PaymentMethodByOrder extends Status, OrderCommonFields {
237
+ /** Payment method by order unique identifier **/
238
+ id: number;
239
+ /** Order unique identifier **/
240
+ order_id: number;
241
+ /** Payment method id **/
242
+ payment_method_id: number;
243
+ /** Internal revenue service payment method id **/
244
+ sri_payment_method_id: number;
245
+ /** Order payment method, see {@link OrderRetryPaymentMethod} */
246
+ order: OrderRetryPaymentMethod;
247
+ }
248
+ /**
249
+ * Order retry payment method.
250
+ *
251
+ * @interface OrderRetryPaymentMethod
252
+ * @since 0.1.0
253
+ */
254
+ export interface OrderRetryPaymentMethod extends Status {
255
+ /** Order retry payment method unique identifier **/
256
+ id: number;
257
+ /** User unique identifier associated with the order retry **/
258
+ uid: string;
259
+ /** Order retry billing data by user id **/
260
+ billing_data_by_user_id: string;
261
+ /** Order retry shopping cart id **/
262
+ shopping_cart_id: string;
263
+ /** Order retry latitude **/
264
+ latitude: string;
265
+ /** Order retry longitude **/
266
+ longitude: string;
267
+ /** Order payment status, {@link OrderStatus} **/
268
+ payment_status: OrderStatus;
269
+ /** Order retry step **/
270
+ step: number;
271
+ /** In soft order process */
272
+ insoft_order_process: string;
273
+ /** Order retry sent fulfillment **/
274
+ sent_fulfillment: string;
275
+ /** Order retry account id **/
276
+ account_id: number;
277
+ /** Order retry sequence value **/
278
+ seq_val: string;
279
+ /** Order retry vendor id **/
280
+ vendor_id: number;
281
+ /** Order retry channel id **/
282
+ channel_id: number;
283
+ /** Order retry created date **/
284
+ created_at: string;
285
+ /** Order retry update date **/
286
+ updated_at: string;
287
+ /** Order retry allocation, see {@link Allocation} **/
288
+ allocation: Allocation;
289
+ /** Order retry suborder, see {@link Suborder} **/
290
+ suborders: Suborder[];
291
+ }
292
+ /**
293
+ * Representation of a order status.
294
+ *
295
+ * @interface Status
296
+ * @since 0.1.0
297
+ */
298
+ export interface Status {
299
+ /** Status unique identifier **/
300
+ status_id: number;
301
+ /** Status name **/
302
+ status_name: string;
303
+ /** Status code **/
304
+ status_code: string;
305
+ /** Status category **/
306
+ status_category: string;
307
+ }
308
+ /**
309
+ * Representation of a suborder object.
310
+ *
311
+ * @interface Suborder
312
+ * @since 0.1.0
313
+ * @extends {{@link Status}
314
+ */
315
+ export interface Suborder extends Status {
316
+ /** Suborder unique identifier **/
317
+ id: number;
318
+ /** Suborder store unique identifier **/
319
+ store_id: number;
320
+ /** Suborder store unique identifier **/
321
+ store_name: string;
322
+ /** Suborder order id **/
323
+ order_id: number;
324
+ /** Suborder digital command sent **/
325
+ digital_command_sent: string;
326
+ /** Suborder vendor **/
327
+ vendor: string;
328
+ /** Suborder additional information **/
329
+ additional_info: string;
330
+ /** Suborder creation date**/
331
+ created_at: string;
332
+ /** Suborder update date **/
333
+ updated_at: string;
334
+ }
114
335
  /**
115
336
  * The step where the order is located.
116
337
  *
117
338
  * @interface OrderStep
118
- * @since 0.5.15
339
+ * @since 0.1.0
119
340
  */
120
341
  export interface OrderStep {
121
- /** Step title to use on front end */
342
+ /** Order step title to use on front end */
122
343
  title_frontend: string;
123
- /** Step description to use on front end */
344
+ /** Order step description to use on front end */
124
345
  description_frontend: string;
346
+ /** Order step unique identifier */
347
+ id: number;
348
+ /** Order step name */
349
+ name: string;
350
+ /** Order step code */
351
+ code: string;
352
+ /** Order step description */
353
+ description: string;
354
+ /** Order step category */
355
+ category: string;
356
+ /** Order step subtitle to use on front end */
357
+ subtitle_frontend: string;
358
+ /** Order step color */
359
+ color: string;
360
+ /** Order step additional information, see {@link OrderStepAdditionalInfo} */
361
+ additional_info: OrderStepAdditionalInfo;
362
+ }
363
+ /**
364
+ * Order step additional information.
365
+ *
366
+ * @interface OrderStepAdditionalInfo
367
+ * @since 0.1.0
368
+ */
369
+ export interface OrderStepAdditionalInfo {
370
+ /** Whether or not to use the client on front end */
371
+ client_frontend: boolean;
372
+ /** Whether or not to use the operators on front end */
373
+ operators_frontend: boolean;
374
+ /** Whether or not to use the client has an error on front end */
375
+ client_frontend_error: boolean;
376
+ /** Order additional information group, see {@link OrderStepAdditionalInfoGroup} */
377
+ group: OrderStepAdditionalInfoGroup;
378
+ }
379
+ /**
380
+ * Order step additional information group.
381
+ *
382
+ * @interface OrderStepAdditionalInfoGroup
383
+ * @since 0.1.0
384
+ */
385
+ export interface OrderStepAdditionalInfoGroup {
386
+ /** Order additional information group code */
387
+ code: string;
388
+ /** Order additional information group description */
389
+ description: string;
390
+ /** Order additional information group weight */
391
+ weight: string;
392
+ /** Order additional information group type */
393
+ type: string;
125
394
  }
126
395
  /**
127
396
  * The details of the order.
@@ -155,3 +424,179 @@ export interface OrderDetailShippingCost {
155
424
  * @since 0.5.15
156
425
  */
157
426
  export declare type Order = BaseOrder | OrderDetails;
427
+ /**
428
+ * Order shipping metadata base field.
429
+ *
430
+ * @interface BaseField
431
+ * @since 0.1.0
432
+ */
433
+ export interface BaseField {
434
+ /** Base field unique identifier */
435
+ id: number;
436
+ /** Base field name */
437
+ name: string;
438
+ }
439
+ /**
440
+ * Order shipping metadata zip code base field.
441
+ *
442
+ * @interface ZipCodeField
443
+ * @since 0.1.0
444
+ * @extends {{@link BaseField}
445
+ */
446
+ export interface ZipCodeField extends BaseField {
447
+ /** Base field zip code */
448
+ zipCode: string;
449
+ }
450
+ /**
451
+ * Order injection field.
452
+ *
453
+ * @interface Injection
454
+ * @since 0.1.0
455
+ * @property {InjectionDetail} [key: string] object with key as string
456
+ * and value as InjectionDetail
457
+ */
458
+ export interface Injection {
459
+ [key: string]: InjectionDetail;
460
+ }
461
+ /**
462
+ * Order injection detail field.
463
+ *
464
+ * @interface InjectionDetail
465
+ * @since 0.1.0
466
+ */
467
+ export interface InjectionDetail {
468
+ /**
469
+ * Order injection detail cause,
470
+ * property is purposefully named in spanish
471
+ */
472
+ causa: string;
473
+ /**
474
+ * Order injection detail code
475
+ * property is purposefully named in spanish
476
+ */
477
+ codigo: number;
478
+ /**
479
+ * Order injection detail message
480
+ * property is purposefully named in spanish
481
+ * */
482
+ mensaje: string;
483
+ }
484
+ /**
485
+ * Order integration message.
486
+ *
487
+ * @interface IntegrationMessage
488
+ * @since 0.1.0
489
+ */
490
+ export interface IntegrationMessage {
491
+ /** Order injection, see {@link Injection} */
492
+ kfcInjection: Injection;
493
+ }
494
+ /**
495
+ * Order shipping metadata.
496
+ *
497
+ * @interface MetadataShipping
498
+ * @since 0.1.0
499
+ */
500
+ export interface MetadataShipping {
501
+ /** Order shipping area, see {@link BaseField} */
502
+ area: BaseField;
503
+ /** Order shipping city, see {@link BaseField} */
504
+ city: BaseField;
505
+ /** Order shipping zone, see {@link ZipCodeField} */
506
+ zone: ZipCodeField;
507
+ /** Order shipping store, see {@link BaseField} */
508
+ store: BaseField;
509
+ /** Order shipping country, see {@link BaseField} */
510
+ country: BaseField;
511
+ }
512
+ /**
513
+ * Order additional info.
514
+ *
515
+ * @interface OrderAdditionalInfo
516
+ * @since 0.1.0
517
+ */
518
+ export interface OrderAdditionalInfo {
519
+ /** Order auth provider */
520
+ providerAuth: string | null;
521
+ /** Order metadata shipping, see {@link MetadataShipping} */
522
+ metadataShipping: MetadataShipping;
523
+ /** Order integration messages, see {@link IntegrationMessage} */
524
+ integrationMessages: IntegrationMessage;
525
+ /** Order parent shipping cart */
526
+ parentShoppingCart: boolean;
527
+ }
528
+ /**
529
+ * Order allocation options.
530
+ *
531
+ * @typedef Allocation
532
+ * @since 0.1.0
533
+ */
534
+ export declare type Allocation = "PICKUP_TO_GO" | "PICKUP_IN_PLACE" | "DELIVERY";
535
+ /**
536
+ * Order user.
537
+ *
538
+ * @interface OrderUser
539
+ * @since 0.1.0
540
+ * @extends {{@link BaseUser}
541
+ */
542
+ export interface OrderUser extends BaseUser {
543
+ /** Order user settings, see {@link NotificationSettings} */
544
+ settings: NotificationSettings;
545
+ }
546
+ /**
547
+ * Order user notification settings.
548
+ *
549
+ * @interface NotificationSettings
550
+ * @since 0.1.0
551
+ */
552
+ export interface NotificationSettings {
553
+ /** Whether or not the user has email notifications enabled */
554
+ emailNotifications: boolean;
555
+ /** Whether or not the user has push notifications enabled */
556
+ pushNotifications: boolean;
557
+ }
558
+ /**
559
+ * Order operator information.
560
+ *
561
+ * @interface OperatorInformation
562
+ * @since 0.1.0
563
+ */
564
+ export interface OperatorInformation {
565
+ /** Operator unique identifier */
566
+ id: string;
567
+ /** Operator name */
568
+ name: string;
569
+ /** Operator email */
570
+ email: string;
571
+ /** Operator skill */
572
+ skill: string;
573
+ /** Operator document */
574
+ document: string;
575
+ }
576
+ /**
577
+ * Order payment method.
578
+ *
579
+ * @interface OrderPaymentMethod
580
+ * @since 0.1.0
581
+ */
582
+ export interface OrderPaymentMethod {
583
+ /** Order payment method id */
584
+ payment_method_id: number;
585
+ /** Order payment method name */
586
+ payment_method_name: string;
587
+ /** Order total by payment method */
588
+ total: string;
589
+ /** Order status, see {@link OrderStatus} */
590
+ status: OrderStatus;
591
+ /** Order payment method last retry, see {@link OrderRetry} */
592
+ lastRetry: OrderRetry;
593
+ /** Order step, see {@link OrderStep} */
594
+ step: OrderStep;
595
+ }
596
+ /**
597
+ * Order status.
598
+ *
599
+ * @typedef OrderStatus
600
+ * @since 0.1.0
601
+ */
602
+ export declare type OrderStatus = "APPROVED" | "REJECTED" | "PENDING";
@@ -78,7 +78,7 @@ export interface Store {
78
78
  location: StoreLocation;
79
79
  /** Array of catalogues, see {@link Catalogue} */
80
80
  catalogues: Catalogue[];
81
- /** Array of store images, see {@link CDNImage}*/
81
+ /** Array of store images, see {@link CDNImage} */
82
82
  images: CDNImage[];
83
83
  /** The distance between the user and the store, roughly in metres */
84
84
  distance: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@artisan-commerce/types",
3
3
  "description": "Artisn's types and interfaces library",
4
- "version": "0.14.0-canary.5",
4
+ "version": "0.14.0-canary.7",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
7
7
  "files": [
@@ -42,5 +42,5 @@
42
42
  "prettier": "^2.1.2",
43
43
  "webpack-bundle-analyzer": "^3.9.0"
44
44
  },
45
- "gitHead": "ebd70d44622f2d80b388382e9035853beec9839a"
45
+ "gitHead": "75a9a60090216dd64b4b84cdba5122457e31857b"
46
46
  }